feat(dev-auto): make the implementation handoff deterministic

- customize.toml: add workflow.implementation_handoff — a literal
  subagent prompt with {spec_file} substituted at run time; the spec
  is the sole source of truth, its change-log entries are binding, and
  the report shape (files, verification, blockers, residual risks) is
  fixed
- step-03: resolve and follow the handoff verbatim; no parent-authored
  goal restatements, file lists, ownership boundaries, or acceptance
  criteria; HALT on handoff/spec conflict; the subagent loads the
  spec's context: files itself instead of the parent pasting them
This commit is contained in:
Alex Verkhovsky
2026-07-06 02:23:41 -07:00
parent 243a4b2ff6
commit 39bdfd185f
2 changed files with 21 additions and 2 deletions
@@ -33,6 +33,25 @@ persistent_facts = [
on_complete = ""
# Handoff for the implementation subagent in step 03. The whole execution
# recipe — a subagent by default, but an override may run anything (e.g. an
# external coding tool via bash). {spec_file} is substituted at run time.
implementation_handoff = """
Launch a subagent with no prior conversation context, with this prompt:
> Read {spec_file} fully and implement it. The spec is the sole source of truth for this change; its Spec Change Log entries are binding constraints, not history.
>
> Guardrails:
>
> - Work in the current project. Before starting, load every file listed in the spec frontmatter `context:`.
> - Do not edit the spec file itself.
> - Do not revert or overwrite changes unrelated to this spec.
> - Run the verification described in the spec, plus focused checks for the code you touched.
>
> When done, report: files changed with one line each, verification commands run and their outcomes, anything you could not complete and why, and residual risks.
"""
# Review layers for the review step. `instruction` is the layer's whole
# execution recipe — subagents by default, but an override may run anything
# (e.g. an external reviewer via bash). {diff_output} is substituted at run
@@ -23,9 +23,9 @@ Capture `baseline_revision` (current HEAD, or `NO_VCS` if version control is una
Change `{spec_file}` status to `in-progress` in the frontmatter before starting implementation.
If `{spec_file}` has a non-empty `context:` list in its frontmatter, load those files before implementation begins. When handing to a subagent, include them in the subagent prompt so it has access to the referenced context.
The implementation handoff is `{workflow.implementation_handoff}`, resolved during activation. Substitute the runtime placeholders (e.g. `{spec_file}`) into it, then follow it verbatim. Do not add parent-authored goal restatements, file lists, ownership boundaries, or acceptance criteria to the handoff — the spec is the subagent's sole source of truth. If the resolved handoff conflicts with the spec, HALT with status `blocked` and blocking condition `handoff conflicts with spec`, and include both conflicting passages.
Hand `{spec_file}` to an implementation subagent. Invoke it **synchronously** and wait for it to return in this same turn — do not background/detach it (`run_in_background`) or end your turn to await a notification (see SKILL.md → Subagents). Resume at "Verify" only after it returns.
Invoke the subagent **synchronously** and wait for it to return in this same turn — do not background/detach it (`run_in_background`) or end your turn to await a notification (see SKILL.md → Subagents). Resume at "Verify" only after it returns.
**Path formatting rule:** Any markdown links written into `{spec_file}` must use paths relative to `{spec_file}`'s directory so they are clickable in VS Code. Any file paths displayed in terminal/conversation output must use CWD-relative format with `:line` notation (e.g., `src/path/file.ts:42`) for terminal clickability. No leading `/` in either case.