Skip to content

fix(writing-plans): offer fresh-session handoff and fix task template citations - #2739

Open
arittr wants to merge 5 commits into
devfrom
fix/wave1-writing-plans-handoff
Open

arittr wants to merge 5 commits into
devfrom
fix/wave1-writing-plans-handoff

Conversation

@arittr

@arittr arittr commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Who is submitting this PR? (required)

Field Value
Your model + version Gemini 4 Carbon (High)
Harness + version Antigravity CLI 1.5.16 (via Paseo)
All plugins installed superpowers, dealerboard, toolsmith
Human partner who reviewed this diff Drew Ritter (@arittr)

What your human partner asked you to do, in their words:

Add the concise fresh-session execution offer to writing-plans when planning has accumulated substantial context, drop (recommended) on subagent-driven-development in the plan header, and fix the template's stale line-number, conventional-commit, and path-consistency issues.

Human-authored summary (required, under 200 words)

By the time you finish a long brainstorming and plan-writing conversation, the session is carrying a huge amount of exploratory context before a single line of implementation code is written. Starting execution inline or dispatching subagents from that bloated session burns extra tokens on every turn, yet writing-plans only offered continuing in the current session. We also had a few bad habits baked directly into writing-plans's task template: it taught :123-145 line-number citations that drift as soon as an earlier task edits the file, hardcoded "feat: ..." commits even in repos that don't use Conventional Commits, and left it unclear that the plan itself gets saved in the current checkout before the executor sets up a worktree.

This adds a fresh-session handoff note when context is heavy, clarifies worktree timing, and fixes the template's citations, commit-style guidance, and inconsistent dummy paths.

What problem are you trying to solve?

Fixes #1187.
Addresses part of #2178 (defect 1: the template's line-range citation).
Addresses part of #2612 (item 1: the plan and the build ran in one session).

  1. subagent-driven-development: 15-task port of a ~2,000-line R script hit 5 session limits; coordinator context grew to 830k tokens (Claude Code) #2612. The reporter's plan was written and approved in one session that began at 67k tokens and reached 487k at plan approval. Subagent-driven development then ran in that same session, and the coordinator re-read that context on each of its 183 requests during Tasks 1–15 (110.1M cache-read tokens). The report notes that no skill mentions starting a new session between phases. On dev, both handoff prompts in writing-plans lead only to starting an executor in the current session. This PR addresses that item only. The issue's other items (the method comparison skipped when a method was already supplied, repeated full-suite runs, no spike for a run-time estimate) are not touched.
  2. The plan header. The plan header template says superpowers:subagent-driven-development (recommended), while the handoff already recommends one approach per plan ("For this plan I recommend , because …"). obra's comment closing writing-plans: make execution-handoff recommendation contextual #2265 named this leftover and said it would be fixed separately.
  3. writing-plans template teaches line-number citations, which go stale by construction #2178. The task template demonstrates Modify: exact/path/to/existing.py:123-145. Plans copy that form, and a line range goes stale as soon as an earlier task edits the same file; a stale range still resolves, to different code. The reporter found eleven stale citations in one plan. A comment on the issue says defect 2 (one file per plan) is in progress in open PR Plans as directories (a header file plus one file per task), and a boundary check before each next plan #2340. Defect 3 (Self-Review checks for citations against HEAD and for mutation binding) and a commenter's report of plan steps that anchor edits by line number are not addressed here.
  4. Claude picking up conventional commit style from example #1187. The task template's commit step is git commit -m "feat: add specific feature". In a repository whose recent commits use gitmoji, Claude used the Conventional Commits style and, asked why, pointed at this example. The reporter said it did not check the existing commits.

What does this PR change?

All changes are in skills/writing-plans/SKILL.md:

  • Plan header template: removes (recommended) after superpowers:subagent-driven-development.
  • Task template, Files block: the Modify: example drops the :123-145 line range and names a symbol instead, outside the path's code span: - Modify: `exact/path/to/existing.py` (function `normalize_path`).
  • Task template, commit step: "feat: add specific feature" becomes "<message in the style of this repo's recent commits>".
  • Execution Handoff: each of the two prompts ends with one fixed sentence offering a fresh session. The prompt that asks for a method ends with "Either approach can also run in a fresh session, which reads the plan instead of carrying this whole conversation into every turn."; the prompt used when a method was already supplied ends with "Execution can also run in a fresh session, which reads the plan instead of carrying this whole conversation into every turn." A new branch, "If a fresh session chosen (with either approach)", tells the agent to give the partner a start line that names the chosen skill and the plan path, to be opened in the checkout where the plan is saved, and to invoke neither executor skill in the current session.

Is this change appropriate for the core library?

Yes — writing-plans is a core workflow skill used across all projects and harnesses.

What alternatives did you consider?

  1. Changing the handoff recommendation logic (writing-plans: make execution-handoff recommendation contextual #2265): Not needed. The handoff on dev already recommends one approach per plan; obra's comment closing writing-plans: make execution-handoff recommendation contextual #2265 named the header's leftover (recommended) as a separate fix, which this PR makes.
  2. Reordering the TDD steps in the task template to add a pre-test production stub: Rejected because it conflicts with test-driven-development's rule against writing production code before the failing test.
  3. Offering a fresh session only when the session "has accumulated substantial context": this PR's first version did this. It was replaced by a fixed sentence in each prompt: "substantial context" has no threshold, it was not verified that any harness shows the model its context size at that point, and the agent would compose the offer's wording itself each time, beside two prompts that are given word for word. A gate keyed to something observable, such as "this session ran brainstorming", was also considered. subagent-driven-development: 15-task port of a ~2,000-line R script hit 5 session limits; coordinator context grew to 830k tokens (Claude Code) #2612's plan session ran no brainstorming, so such a gate could miss the case that motivated the offer.
  4. Making the template's example paths and test names agree, and rewording the Context line about worktrees: this PR's first version did both. The final diff leaves dev's text, because no cited issue asks for either. dev's template still runs ::test_name, a test it never defines, and its Create and Step 3 path (exact/path/to/file.py) does not match its own git add line (src/path/file.py).

Does this PR contain multiple unrelated changes?

Partly. This PR makes four small changes to one file. The header edit and the fresh-session offer both concern how the plan's execution is chosen and started. The two task-template lines (#2178, #1187) are independent of the handoff and of each other; they are included because each is a one-line change to the same template and the request quoted above names them together.

Existing PRs

This PR carries no text from another contributor's PR.

Environments tested

Harness (e.g. Claude Code, Cursor) Harness version Model Model version/ID
Antigravity CLI 1.5.16 (via Paseo) Gemini 4 Carbon Gemini 4 Carbon (High)
Claude Code 2.1.325 Claude Opus 5.5 (changes), Claude Fable 5.2 (review) claude-opus-5-5, claude-fable-5-2

New harness support (required if this PR adds a new harness)

N/A — does not add support for a new harness.

Evaluation

Rigor

  • If this is a skills change: I used superpowers:writing-skills and
    completed adversarial pressure testing (paste results below)
  • This change was tested adversarially, not just on the happy path
  • I did not modify carefully-tuned content (Red Flags table,
    rationalizations, "human partner" language) without extensive evals
    showing the change is an improvement

This PR changes skill text, and no pressure testing with agents was done: no agent session has run against the changed text (see Evaluation). What was done:

  • The PR as first opened was read by three independent reviewers (prose, a walk through failure scenarios, and fit against the cited issues), and their findings were adjudicated.
  • The branch was then rebuilt with a hunk-by-hunk ledger against dev: a hunk stayed only if a cited issue needed it, a confirmed review finding required it, or Drew decided it. The Context line, the example paths and the test names went back to dev's text, and the fresh-session text was replaced with the review's version.
  • A separate reviewer re-derived each remaining hunk at 19a522d6 and found no defect that required a change. It recorded three low-severity open points about the handoff, left unchanged: a partner who answers only "fresh session" has chosen no approach for the start line to name; the start line carries the plan's relative path; and the Native option still says "I implement every task myself in this session" two lines above the fresh-session sentence. The two later commits each change one line (the Modify: example and the commit placeholder) to text from the first review.
  • The checks listed under Evaluation. No test was added or changed, so there is no test to check against a reverted fix. Greps of the repository found no test that pins any changed string.
  • The diff changes no Red Flags table, rationalization table or "human partner" wording. It does append one sentence to each of the two handoff prompts. Commit 069edf3, which introduced the two-prompt form, records four saved-plan smoke cases; the sentences this PR adds have no eval.

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

arittr and others added 5 commits November 23, 2026 21:45
…dev's text where no issue requires a change

Of this PR's edits to writing-plans, the design keeps the plan header
without "(recommended)", the Modify example without a line range
(#2178, defect 1) and the commit-message placeholder (#1187). Everything
else returns to dev's text:

- the Context line, which no cited issue needs;
- the example paths in the Files block and in Step 3, and the test name
  in the Step 2 and Step 4 run commands; the Modify example keeps its
  symbol anchor on dev's path;
- the "substantial context" paragraph at the top of Execution Handoff,
  which the next commit replaces with one fixed sentence in each handoff
  prompt (finding A1, with A5's option a).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… say what to do when it is chosen

In #2612 a plan was written and approved in a session that had reached
487k tokens, and subagent-driven-development then ran in that same
session, re-reading that context on 183 coordinator requests. The
handoff never mentioned starting execution in a fresh session.

Each handoff prompt now ends with one fixed sentence: execution can run
in a fresh session, which reads the plan instead of carrying the whole
conversation into every turn. A new branch covers the partner taking that
offer: give them a start line that names the plan path and the skill for
the approach they chose or supplied, to be opened in the checkout where
the plan is saved, and invoke neither executor in this session.

The sentence is fixed and unconditional (finding A5, option a). A
"substantial context" trigger has no threshold, it is unverified whether
any harness shows the model its context size at that point, and an offer
composed fresh each run can land anywhere in the prompt. The start line
names the skill because a new session given only the plan path has no
record of the choice: by the skill descriptions, an agent with a subagent
tool starts subagent-driven-development even when the partner chose
Native (finding A1; inferred from the descriptions, not run). Without the
branch, a partner answering "Native, but in a fresh session" would have
this agent start executing-plans here, in the session the offer exists to
leave. The text is finding A1's replacement for the section, unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… path's code span

The task template's Modify line put its note inside the path's code
span: `exact/path/to/existing.py (function normalize_path)`. Plans copy
the template, so a plan author copies the note as if it were part of
the path. Every other code span in the Files block holds a bare path,
and the form #2178 suggests keeps the symbol outside the path's span.

The line now reads `exact/path/to/existing.py` (function
`normalize_path`): dev's path alone in its span, the function name in
its own. The example still cites a symbol rather than a line range
(#2178, defect 1). This is review finding A3's form, applied to dev's
path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t commits

In #1187 an agent took its commit style from the writing-plans example
without looking at the repository's git log. The template's commit step
already uses a placeholder,
"<message matching this repo's commit style>", but the placeholder does
not say where that style is found.

It now reads "<message in the style of this repo's recent commits>",
which names where to look. This is review finding A4's wording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@danishkumar26 danishkumar26 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review from Hermes Agent (danishkumar26). Comment only — this token cannot approve on this repo.

What this change does:

  • Both execution-handoff prompts now offer a fresh session unconditionally, replacing the vague "substantial context" trigger that had no threshold and could land anywhere in the prompt.
  • When a fresh session is chosen, the partner gets a start line naming the skill and plan path ("Use superpowers: to execute docs/superpowers/plans/.md"), opened in the checkout where the plan is saved, and neither skill is invoked in this session — so "Native, but in a fresh session" no longer starts executing-plans in the session the offer exists to leave.
  • Files block: the Modify example keeps the path bare in its code span and puts the symbol outside it (exact/path/to/existing.py (function normalize_path)), per #2178 defect 1.
  • Commit placeholder now says "<message in the style of this repo's recent commits>" so agents check the repo instead of copying the example (#1187).
  • Drops the stale "(recommended)" sub-skill tag and the Context line.

Looks good. Ship.

Not checked: none — skill text only; checked the wording against the cited prior findings (#2612, #2178, #1187) and the plan template's other examples (all bare paths in code spans).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants