Skip to content

feat: session manifest と loop artifacts から next-agent prompt を生成する script を追加する #922

Open

Description

@squne121

Machine-Readable Contract

contract_schema_version: v1
issue_kind: implementation
parent_issue: "none"
goal_ref: "session manifest / preflight artifact / termination artifact から next-agent prompt draft を deterministic に生成し、重複調査・token 消費・判断ブレを削減する"
change_kind: code

Background

Claude Code / Codex CLI の作業ログを人間が貼り付けてから、次に何を指示するかを毎回 LLM が再構築している。これは重複調査、token 消費、判断ブレの原因になる。

Issue #907 の停止時も、次のアクション(anchor reframe / follow-up split)を人間が手動で整理してプロンプトを組み立てた。

参考: #907 anchor 決定コメント

Outcome

scripts/generate_next_agent_prompt.py が存在し、issue number / termination artifact / optional session manifest を入力として、next action / required URLs / must-read files / do-not-read-initial paths / safe command list / ready-to-copy prompt を出力する。

In Scope

  • scripts/generate_next_agent_prompt.py を追加する
    • 入力: issue number, latest termination artifact path, optional session manifest path, optional planner_input path
    • 出力: next action / required URLs / must-read files / do-not-read-initial paths / safe command list / ready-to-copy prompt
    • scope_signal_guard 停止時は anchor reframe / follow-up split の 2 案を出す
    • raw transcript 全文を出力しない
    • prompt 内に absolute local path や private artifact content を漏らさない
  • tests/test_generate_next_agent_prompt.py を追加する

Allowed Paths

  • scripts/generate_next_agent_prompt.py
  • tests/test_generate_next_agent_prompt.py

Acceptance Criteria

Verification Commands

# AC1 / AC2 / AC3 / AC4 / AC5
uv run pytest tests/test_generate_next_agent_prompt.py -v

# smoke test
uv run python3 scripts/generate_next_agent_prompt.py \
  --issue 907 \
  --termination-artifact <fixture-path>

pnpm typecheck
pnpm lint

Non-Goals

  • next-agent prompt の自動実行
  • session transcript の解析・要約(別責務)
  • LLM を使った prompt 生成(deterministic のみ)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions