/specdev-step — Waterfall Step Author + Review
Author mode: emits a fresh artifact. Review mode: uses the same review-fix loop as
/specdev-review. This skill composes both.
Source spec: K_agentification.md §5.2.
Arguments
/specdev-step <NN> [--extend "<intent>" [--seed <seed_path>]]
<NN>: step number, e.g. 04, 13a, 16. Must match a step in the toolkit pipeline.
--extend "<intent>": (optional) NL description of what to add to an EXISTING artifact.
When supplied and the artifact already exists, dispatches author-extend mode instead of
stopping. The subagent authors the full structured content from intent + prompt contract +
upstream context — do NOT supply a pre-built content object.
--seed <seed_path>: (optional, requires --extend) path to a seed/source doc the subagent
reads as source material when authoring the new content.
Protocol
Step 1 — Author the artifact
Pre-dispatch existence check: Before dispatching specdev-impl, probe for an existing artifact:
ls spec/<NN>_*.json 2>/dev/null
If a match is found, check whether --extend was supplied:
If --extend "<intent>" was supplied — the operator wants to add NL-authored content to the
existing artifact. Proceed to the author-extend dispatch below (do NOT print the stop message).
If --extend was NOT supplied — stop and print:
Artifact spec/<NN>_*.json already exists. /specdev-step only authors new artifacts.
Choose a path based on your intent:
Sub-case A — Propagate an upstream change to this step:
/specdev-review step-<NN> --with-replay
(Replays forward-validation; surfaces downstream breakage from the upstream edit.)
Sub-case B — Insert known content directly (you already have the JSON):
specdev json insert spec/<NN>_*.json '<path>' '<new-content-json>'
then /specdev-review step-<NN>
(Surgically adds a field you've already composed; /specdev-review then validates it.)
Sub-case C — Add new content from a natural-language description:
/specdev-step <NN> --extend "<what to add>" [--seed <seed_path>]
(Dispatches author-extend mode; the subagent authors the structured content from your
intent + the step prompt contract + upstream context, then inserts it and gates.)
If no existing artifact is found, proceed to the author dispatch below.
Author dispatch (new artifact)
Dispatch specdev-impl with mode: "author":
{
"mode": "author",
"step": "<NN>",
"repo_root": "./devspec_toolkit",
"spec_root": "./spec",
"git_root": "."
}
The agent:
- Reads
devspec_toolkit/docs/prompts/shared_expectations.md first.
- Reads
devspec_toolkit/prompts/prompt_<NN>_*.md.
- Probes upstream artifact shapes and reads needed upstream content via
specdev json read.
- Emits
spec/<NN>_*.json via Write (new file only).
- Runs the scoped gate:
specdev spec-check spec \
--repo-root ./devspec_toolkit --spec-root ./spec --git-root .
- Returns structured summary
{mode: "author", edits_applied: ..., gate_status: ..., errors_remaining: [...]}.
After Agent returns:
- Parse return JSON.
- If
status != "blocker": check gate_status. If gate_status: "errors" and errors cannot
be resolved within specdev-impl's budget, surface them to the user. Do not proceed to the
review step if the artifact is structurally invalid.
- If
status == "blocker" (see specdev-impl.md § "Blocker emission protocol"):
a. Validate shape: questions[] non-empty; each has {id, question, header, options[2..4]}.
If malformed → HALT and surface to user (do NOT re-dispatch on a malformed payload).
Malformed includes: questions[] empty, any entry missing required fields, artifact
written AND status: "blocker" simultaneously (timing-constraint violation).
b. Persist audit trail:mkdir -p .specdev/blockers/
Write .specdev/blockers/blocker_step-<NN>_author_<unix_ts>.json with the full payload.
c. Chunk questions into groups of ≤4. Call AskUserQuestion once per chunk, sequentially.
Collect all answers keyed by question.id.
If the user dismisses or does not answer an AskUserQuestion call (empty answer set
returned), HALT immediately. Surface: "Blocker unresolved: user did not answer
clarification questions. Re-invoke /specdev-step to retry." Write a HALT artifact
noting aborted_by_user to .specdev/blockers/blocker_step-<NN>_author_aborted_<unix_ts>.json.
Do not re-dispatch. Re-invoke the skill to retry from round 1.
d. Build re-dispatch prompt:
- Original dispatch input verbatim.
- PLUS a
## User answers (from blocker bridge) section listing each
{id, question, selected_label, selected_description, user_notes_if_any}.
- PLUS a
## Context from prior dispatch section quoting the agent's context field.
e. Increment author_blocker_round counter (per-dispatch-site, scoped to this author
dispatch chain, independent of fix-phase counter; starts at 0 on first dispatch; cap = 2
re-dispatches (counter values 0, 1, 2); does not persist across skill invocations).
f. If author_blocker_round > 2: HALT, surface to user (persistent blocking — no auto-retry).
g. Fresh Agent dispatch with the augmented prompt. Continue from step 1.
Note: lossy re-dispatch — accepted cost; the re-dispatched agent re-reads all context
from scratch; user answers are the ONLY persistence across the bridge.
SendMessage-based clean resumption is deferred.
If the author step returns with gate_status: "errors" and the errors cannot be resolved
within specdev-impl's budget, surface them to the user. Do not proceed to the review step
if the artifact is structurally invalid.
Author-extend dispatch (extend existing artifact)
When --extend "<intent>" was supplied and the artifact already exists, dispatch
specdev-impl with mode: "author-extend":
{
"mode": "author-extend",
"target": "spec/<NN>_*.json",
"intent": "<the --extend intent string verbatim>",
"seed_path": "<value of --seed if supplied, else omit field>"
}
Pass target and intent. Pass seed_path only if --seed was supplied. Do NOT pass
insert_pointer — the subagent derives the correct jq-path from the prompt contract.
Do NOT build a content payload — the subagent does the authoring from intent.
The agent:
- Reads
devspec_toolkit/docs/prompts/shared_expectations.md first.
- Probes the existing artifact structure via
specdev json structure / json keys.
- Reads
devspec_toolkit/prompts/prompt_<NN>_*.md.
- Authors the new structured content object from
intent + optional seed_path + contract + upstream.
- Applies via
specdev json insert / specdev json patch — NEVER Write.
- Runs the scoped gate:
specdev spec-check spec \
--repo-root ./devspec_toolkit --spec-root ./spec --git-root .
- Returns structured summary
{mode: "author-extend", edits_applied: ..., gate_status: ..., errors_remaining: [...], forward_replay_debt: "..."}.
After Agent returns:
- Parse return JSON.
- If
status != "blocker": check gate_status. If gate_status: "errors" and errors cannot
be resolved within specdev-impl's budget, surface them to the user. Do not proceed to the
review step if the artifact is structurally invalid.
- If
status == "blocker" (see specdev-impl.md § "Blocker emission protocol"):
a. Validate shape: questions[] non-empty; each has {id, question, header, options[2..4]}.
If malformed → HALT and surface to user (do NOT re-dispatch on a malformed payload).
Malformed includes: questions[] empty, any entry missing required fields, edits applied
AND status: "blocker" simultaneously (timing-constraint violation).
b. Persist audit trail:mkdir -p .specdev/blockers/
Write .specdev/blockers/blocker_step-<NN>_author-extend_<unix_ts>.json with the full payload.
c. Chunk questions into groups of ≤4. Call AskUserQuestion once per chunk, sequentially.
Collect all answers keyed by question.id.
If the user dismisses or does not answer an AskUserQuestion call (empty answer set returned),
HALT immediately. Surface: "Blocker unresolved: user did not answer clarification questions.
Re-invoke /specdev-step --extend ... to retry." Write a HALT artifact noting
aborted_by_user to .specdev/blockers/blocker_step-<NN>_author-extend_aborted_<unix_ts>.json.
Do not re-dispatch.
d. Build re-dispatch prompt:
- Original dispatch input verbatim.
- PLUS a
## User answers (from blocker bridge) section listing each
{id, question, selected_label, selected_description, user_notes_if_any}.
- PLUS a
## Context from prior dispatch section quoting the agent's context field.
e. Increment author_extend_blocker_round counter (per-dispatch-site, scoped to this
author-extend dispatch chain, independent of author-phase and fix-phase counters;
starts at 0 on first dispatch; cap = 2 re-dispatches (counter values 0, 1, 2); does not
persist across skill invocations).
f. If author_extend_blocker_round > 2: HALT, surface to user (persistent blocking — no auto-retry).
g. Fresh Agent dispatch with the augmented prompt. Continue from step 1.
Note: lossy re-dispatch — accepted cost; user answers are the ONLY persistence across the bridge.
- On clean gate: surface the
forward_replay_debt notice from the return JSON to the user.
W595 CONTENT_STALENESS will fire on the next spec-check or forward-replay run for downstream
steps that have not yet incorporated the newly inserted content. Operator must replay downstream
steps to clear the debt (e.g., /specdev-review step-<NN+1> --with-replay).
Step 2 — Review-fix loop
After the author step completes with a clean gate, run the review-fix loop inline using
the same protocol as /specdev-review:
Dispatch specdev-scope with { "scope": "step-<NN>", "change_set": "git_diff" }.
For each round up to max_rounds=5:
a. Dispatch all planned specdev-reviewer instances in parallel (single message,
multiple Agent tool calls).
b. Merge with the jq one-liner (paths per K_agentification.md §11.7;
ensure directory exists once: mkdir -p .specdev/findings):
jq -s '{round: .[0].round, scope: .[0].scope, generated_at: (now | floor), findings: (map(.findings) | add | unique_by({kind, location, signature}))}' \
.specdev/findings/findings_step-<NN>_<round>_r*.json > .specdev/findings/findings_step-<NN>_<round>.json
c. If findings[] is empty: CONVERGED.
d. Else dispatch specdev-impl with mode: "fix" and the merged findings path.
After Agent returns (blocker handling — see specdev-impl.md § "Blocker emission protocol"):
- Parse return JSON.
- If
status != "blocker": check gate_status and errors_remaining; carry forward.
- If
status == "blocker":
a. Validate shape: questions[] non-empty; each has {id, question, header, options[2..4]}.
If malformed → HALT and surface to user.
Malformed includes: questions[] empty, any entry missing required fields,
edits applied AND status: "blocker" simultaneously (timing-constraint violation —
blocker window is closed after the first edit).
b. Persist: mkdir -p .specdev/blockers/ then write
.specdev/blockers/blocker_step-<NN>_fix_r<round>_<unix_ts>.json.
c. Chunk questions ≤4. Call AskUserQuestion once per chunk, sequentially.
Collect answers keyed by question.id.
If the user dismisses or does not answer an AskUserQuestion call (empty answer set
returned), HALT immediately. Surface: "Blocker unresolved: user did not answer
clarification questions. Re-invoke /specdev-step to retry." Write a HALT
artifact noting aborted_by_user to .specdev/blockers/blocker_step-<NN>_fix_aborted_<unix_ts>.json.
Do not re-dispatch.
d. Build re-dispatch prompt: original fix dispatch input verbatim
## User answers (from blocker bridge) section listing each
{id, question, selected_label, selected_description, user_notes_if_any}
## Context from prior dispatch section (agent's context field).
e. Increment fix_blocker_round counter (per-dispatch-site, scoped to this fix
dispatch chain, independent of author-phase counter; starts at 0 on first dispatch;
cap = 2 re-dispatches (counter values 0, 1, 2); does not persist across skill
invocations; resets to 0 at the start of each new outer review-fix round (R1/R2/.../R5)).
f. If fix_blocker_round > 2: HALT, surface to user.
g. Fresh Agent dispatch with augmented prompt. Continue from step 1.
Note: lossy re-dispatch — accepted cost; SendMessage-based resumption deferred.
e. Increment round and continue.
If round 5 completes with findings remaining: HALT.
Write the HALT artifact:
.specdev/findings/findings_step-<NN>_5_<unix_timestamp>.json
This is a timestamped copy of the round-5 merged findings file. It is the audit trail.
Do not promote it to a canonical name. The timestamped file IS the record.
Print:
HALT: max_rounds=5 reached with unresolved findings.
Findings path: .specdev/findings/findings_step-<NN>_5_<unix_timestamp>.json
Finding count: <N> (<P0_count> P0, <P1_count> P1, <P2_count> P2)
Human action required: proceed-with-gaps | replay | hand-edit then re-invoke /specdev-step <NN>
Do not silently accept partial convergence. HALT is a first-class verdict.
The scope identifier for this step is step-<NN> (e.g. step-04, step-13a).
Hand-off
After the review loop completes, report the final verdict:
/specdev-step <NN> complete.
Author gate: <clean | errors>
Review verdict: CONVERGED at round <N> | HALT at round 5
Artifact: spec/<NN>_*.json
Findings path (on HALT): .specdev/findings/findings_step-<NN>_5_<unix_timestamp>.json
Flag discipline
Three-flag protocol for all validation/governance commands:
--repo-root ./devspec_toolkit --spec-root ./spec --git-root .
specdev json read/shape/edit subcommands: pass --repo-root only.
Exception: specdev json resolve-pointers accepts --git-root.
canon-accept: pass --git-root, NOT --spec-root.
Never read spec/*.json directly.
What this skill does NOT do
- Does not review existing artifacts without authoring. Use
/specdev-review for that.
- Does not manage trinity-plan gating. Use
/specdev-trinity --phase plan for that.
- Does not handle 16b/16c. Plan-phase and Discovery-phase steps only
(see K_agentification.md §9).
- Does not commit changes. User authorizes commits separately.
- Does not run reviewers sequentially within a round. Parallel dispatch is required.
- Does not skip AskUserQuestion on a blocker payload. Blocker questions must be presented
to the user via the harness before re-dispatching.
- Does not author a fresh artifact when
spec/<NN>_*.json already exists (Step 1
pre-dispatch check short-circuits). For upstream propagation use
/specdev-review step-<NN> --with-replay. For NL-intent-driven new content use
/specdev-step <NN> --extend "<intent>" (author-extend mode). For direct JSON insertion
of already-composed content use specdev json insert/patch then /specdev-review step-<NN>.
1---2name: specdev-step3description: Author, extend, and review a single waterfall step. Dispatches specdev-impl in author mode to emit a fresh spec/NN_*.json from the step's prompt contract, or in author-extend mode to additively insert new operator-intent content into an EXISTING artifact, then runs the full review-fix loop via the /specdev-review protocol. Returns CONVERGED or HALT. When spec/NN_*.json exists and operator intent is propagation → /specdev-review --with-replay. When spec/NN_*.json exists and operator intent is to extend with NL-authored content → /specdev-step <NN> --extend "<intent>" (dispatches author-extend mode). NOT for step 16 trinity phases (→ /specdev-trinity). NOT for context-only or read-only questions about a step (→ /specdev-context). Sibling skills: specdev-context (orientation/read), specdev-review (review existing artifact), specdev-trinity (trinity phases 16a/16b/16c). Trigger on: "author step NN", "implement step NN", "/specdev-step NN", "/specdev-step NN --extend", "add content to step NN", or any request to p4---56# /specdev-step — Waterfall Step Author + Review78Author mode: emits a fresh artifact. Review mode: uses the same review-fix loop as9`/specdev-review`. This skill composes both.1011**Source spec:** K_agentification.md §5.2.1213---1415## Arguments1617```18/specdev-step <NN> [--extend "<intent>" [--seed <seed_path>]]19```2021- `<NN>`: step number, e.g. `04`, `13a`, `16`. Must match a step in the toolkit pipeline.22- `--extend "<intent>"`: (optional) NL description of what to add to an EXISTING artifact.23 When supplied and the artifact already exists, dispatches author-extend mode instead of24 stopping. The subagent authors the full structured content from `intent` + prompt contract +25 upstream context — do NOT supply a pre-built content object.26- `--seed <seed_path>`: (optional, requires `--extend`) path to a seed/source doc the subagent27 reads as source material when authoring the new content.2829---3031## Protocol3233### Step 1 — Author the artifact3435**Pre-dispatch existence check:** Before dispatching `specdev-impl`, probe for an existing artifact:36```bash37ls spec/<NN>_*.json 2>/dev/null38```39If a match is found, check whether `--extend` was supplied:4041**If `--extend "<intent>"` was supplied** — the operator wants to add NL-authored content to the42existing artifact. Proceed to the **author-extend dispatch** below (do NOT print the stop message).4344**If `--extend` was NOT supplied** — stop and print:45```46Artifact spec/<NN>_*.json already exists. /specdev-step only authors new artifacts.4748Choose a path based on your intent:4950 Sub-case A — Propagate an upstream change to this step:51 /specdev-review step-<NN> --with-replay52 (Replays forward-validation; surfaces downstream breakage from the upstream edit.)5354 Sub-case B — Insert known content directly (you already have the JSON):55 specdev json insert spec/<NN>_*.json '<path>' '<new-content-json>'56 then /specdev-review step-<NN>57 (Surgically adds a field you've already composed; /specdev-review then validates it.)5859 Sub-case C — Add new content from a natural-language description:60 /specdev-step <NN> --extend "<what to add>" [--seed <seed_path>]61 (Dispatches author-extend mode; the subagent authors the structured content from your62 intent + the step prompt contract + upstream context, then inserts it and gates.)63```64If no existing artifact is found, proceed to the **author dispatch** below.6566#### Author dispatch (new artifact)6768Dispatch `specdev-impl` with `mode: "author"`:6970```json71{72 "mode": "author",73 "step": "<NN>",74 "repo_root": "./devspec_toolkit",75 "spec_root": "./spec",76 "git_root": "."77}78```7980The agent:811. Reads `devspec_toolkit/docs/prompts/shared_expectations.md` first.822. Reads `devspec_toolkit/prompts/prompt_<NN>_*.md`.833. Probes upstream artifact shapes and reads needed upstream content via `specdev json read`.844. Emits `spec/<NN>_*.json` via Write (new file only).855. Runs the scoped gate:86 ```bash87 specdev spec-check spec \88 --repo-root ./devspec_toolkit --spec-root ./spec --git-root .89 ```906. Returns structured summary `{mode: "author", edits_applied: ..., gate_status: ..., errors_remaining: [...]}`.9192After Agent returns:931. Parse return JSON.942. If `status != "blocker"`: check `gate_status`. If `gate_status: "errors"` and errors cannot95 be resolved within specdev-impl's budget, surface them to the user. Do not proceed to the96 review step if the artifact is structurally invalid.973. If `status == "blocker"` (see `specdev-impl.md` § "Blocker emission protocol"):98 a. Validate shape: `questions[]` non-empty; each has `{id, question, header, options[2..4]}`.99 If malformed → HALT and surface to user (do NOT re-dispatch on a malformed payload).100 Malformed includes: `questions[]` empty, any entry missing required fields, artifact101 written AND `status: "blocker"` simultaneously (timing-constraint violation).102 b. Persist audit trail:103 ```bash104 mkdir -p .specdev/blockers/105 ```106 Write `.specdev/blockers/blocker_step-<NN>_author_<unix_ts>.json` with the full payload.107 c. Chunk questions into groups of ≤4. Call `AskUserQuestion` once per chunk, sequentially.108 Collect all answers keyed by `question.id`.109 If the user dismisses or does not answer an AskUserQuestion call (empty answer set110 returned), HALT immediately. Surface: "Blocker unresolved: user did not answer111 clarification questions. Re-invoke /specdev-step <NN> to retry." Write a HALT artifact112 noting `aborted_by_user` to `.specdev/blockers/blocker_step-<NN>_author_aborted_<unix_ts>.json`.113 Do not re-dispatch. Re-invoke the skill to retry from round 1.114 d. Build re-dispatch prompt:115 - Original dispatch input verbatim.116 - PLUS a `## User answers (from blocker bridge)` section listing each117 `{id, question, selected_label, selected_description, user_notes_if_any}`.118 - PLUS a `## Context from prior dispatch` section quoting the agent's `context` field.119 e. Increment `author_blocker_round` counter (per-dispatch-site, scoped to this author120 dispatch chain, independent of fix-phase counter; starts at 0 on first dispatch; cap = 2121 re-dispatches (counter values 0, 1, 2); does not persist across skill invocations).122 f. If `author_blocker_round > 2`: HALT, surface to user (persistent blocking — no auto-retry).123 g. Fresh Agent dispatch with the augmented prompt. Continue from step 1.124 Note: lossy re-dispatch — accepted cost; the re-dispatched agent re-reads all context125 from scratch; user answers are the ONLY persistence across the bridge.126 SendMessage-based clean resumption is deferred.127128If the author step returns with `gate_status: "errors"` and the errors cannot be resolved129within specdev-impl's budget, surface them to the user. Do not proceed to the review step130if the artifact is structurally invalid.131132#### Author-extend dispatch (extend existing artifact)133134When `--extend "<intent>"` was supplied and the artifact already exists, dispatch135`specdev-impl` with `mode: "author-extend"`:136137```json138{139 "mode": "author-extend",140 "target": "spec/<NN>_*.json",141 "intent": "<the --extend intent string verbatim>",142 "seed_path": "<value of --seed if supplied, else omit field>"143}144```145146Pass `target` and `intent`. Pass `seed_path` only if `--seed` was supplied. Do NOT pass147`insert_pointer` — the subagent derives the correct jq-path from the prompt contract.148Do NOT build a content payload — the subagent does the authoring from `intent`.149150The agent:1511. Reads `devspec_toolkit/docs/prompts/shared_expectations.md` first.1522. Probes the existing artifact structure via `specdev json structure` / `json keys`.1533. Reads `devspec_toolkit/prompts/prompt_<NN>_*.md`.1544. Authors the new structured content object from `intent` + optional `seed_path` + contract + upstream.1555. Applies via `specdev json insert` / `specdev json patch` — NEVER Write.1566. Runs the scoped gate:157 ```bash158 specdev spec-check spec \159 --repo-root ./devspec_toolkit --spec-root ./spec --git-root .160 ```1617. Returns structured summary `{mode: "author-extend", edits_applied: ..., gate_status: ..., errors_remaining: [...], forward_replay_debt: "..."}`.162163After Agent returns:1641. Parse return JSON.1652. If `status != "blocker"`: check `gate_status`. If `gate_status: "errors"` and errors cannot166 be resolved within specdev-impl's budget, surface them to the user. Do not proceed to the167 review step if the artifact is structurally invalid.1683. If `status == "blocker"` (see `specdev-impl.md` § "Blocker emission protocol"):169 a. Validate shape: `questions[]` non-empty; each has `{id, question, header, options[2..4]}`.170 If malformed → HALT and surface to user (do NOT re-dispatch on a malformed payload).171 Malformed includes: `questions[]` empty, any entry missing required fields, edits applied172 AND `status: "blocker"` simultaneously (timing-constraint violation).173 b. Persist audit trail:174 ```bash175 mkdir -p .specdev/blockers/176 ```177 Write `.specdev/blockers/blocker_step-<NN>_author-extend_<unix_ts>.json` with the full payload.178 c. Chunk questions into groups of ≤4. Call `AskUserQuestion` once per chunk, sequentially.179 Collect all answers keyed by `question.id`.180 If the user dismisses or does not answer an AskUserQuestion call (empty answer set returned),181 HALT immediately. Surface: "Blocker unresolved: user did not answer clarification questions.182 Re-invoke /specdev-step <NN> --extend ... to retry." Write a HALT artifact noting183 `aborted_by_user` to `.specdev/blockers/blocker_step-<NN>_author-extend_aborted_<unix_ts>.json`.184 Do not re-dispatch.185 d. Build re-dispatch prompt:186 - Original dispatch input verbatim.187 - PLUS a `## User answers (from blocker bridge)` section listing each188 `{id, question, selected_label, selected_description, user_notes_if_any}`.189 - PLUS a `## Context from prior dispatch` section quoting the agent's `context` field.190 e. Increment `author_extend_blocker_round` counter (per-dispatch-site, scoped to this191 author-extend dispatch chain, independent of author-phase and fix-phase counters;192 starts at 0 on first dispatch; cap = 2 re-dispatches (counter values 0, 1, 2); does not193 persist across skill invocations).194 f. If `author_extend_blocker_round > 2`: HALT, surface to user (persistent blocking — no auto-retry).195 g. Fresh Agent dispatch with the augmented prompt. Continue from step 1.196 Note: lossy re-dispatch — accepted cost; user answers are the ONLY persistence across the bridge.1974. On clean gate: surface the `forward_replay_debt` notice from the return JSON to the user.198 W595 CONTENT_STALENESS will fire on the next spec-check or forward-replay run for downstream199 steps that have not yet incorporated the newly inserted content. Operator must replay downstream200 steps to clear the debt (e.g., `/specdev-review step-<NN+1> --with-replay`).201202### Step 2 — Review-fix loop203204After the author step completes with a clean gate, run the review-fix loop inline using205the same protocol as `/specdev-review`:2062071. Dispatch `specdev-scope` with `{ "scope": "step-<NN>", "change_set": "git_diff" }`.2082. For each round up to max_rounds=5:209 a. Dispatch all planned `specdev-reviewer` instances in parallel (single message,210 multiple Agent tool calls).211 b. Merge with the jq one-liner (paths per K_agentification.md §11.7;212 ensure directory exists once: `mkdir -p .specdev/findings`):213 ```bash214 jq -s '{round: .[0].round, scope: .[0].scope, generated_at: (now | floor), findings: (map(.findings) | add | unique_by({kind, location, signature}))}' \215 .specdev/findings/findings_step-<NN>_<round>_r*.json > .specdev/findings/findings_step-<NN>_<round>.json216 ```217 c. If `findings[]` is empty: CONVERGED.218 d. Else dispatch `specdev-impl` with `mode: "fix"` and the merged findings path.219 After Agent returns (blocker handling — see `specdev-impl.md` § "Blocker emission protocol"):220 1. Parse return JSON.221 2. If `status != "blocker"`: check `gate_status` and `errors_remaining`; carry forward.222 3. If `status == "blocker"`:223 a. Validate shape: `questions[]` non-empty; each has `{id, question, header, options[2..4]}`.224 If malformed → HALT and surface to user.225 Malformed includes: `questions[]` empty, any entry missing required fields,226 edits applied AND `status: "blocker"` simultaneously (timing-constraint violation —227 blocker window is closed after the first edit).228 b. Persist: `mkdir -p .specdev/blockers/` then write229 `.specdev/blockers/blocker_step-<NN>_fix_r<round>_<unix_ts>.json`.230 c. Chunk questions ≤4. Call `AskUserQuestion` once per chunk, sequentially.231 Collect answers keyed by `question.id`.232 If the user dismisses or does not answer an AskUserQuestion call (empty answer set233 returned), HALT immediately. Surface: "Blocker unresolved: user did not answer234 clarification questions. Re-invoke /specdev-step <NN> to retry." Write a HALT235 artifact noting `aborted_by_user` to `.specdev/blockers/blocker_step-<NN>_fix_aborted_<unix_ts>.json`.236 Do not re-dispatch.237 d. Build re-dispatch prompt: original fix dispatch input verbatim238 + `## User answers (from blocker bridge)` section listing each239 `{id, question, selected_label, selected_description, user_notes_if_any}`240 + `## Context from prior dispatch` section (agent's `context` field).241 e. Increment `fix_blocker_round` counter (per-dispatch-site, scoped to this fix242 dispatch chain, independent of author-phase counter; starts at 0 on first dispatch;243 cap = 2 re-dispatches (counter values 0, 1, 2); does not persist across skill244 invocations; resets to 0 at the start of each new outer review-fix round (R1/R2/.../R5)).245 f. If `fix_blocker_round > 2`: HALT, surface to user.246 g. Fresh Agent dispatch with augmented prompt. Continue from step 1.247 Note: lossy re-dispatch — accepted cost; SendMessage-based resumption deferred.248 e. Increment round and continue.2493. If round 5 completes with findings remaining: HALT.250251 Write the HALT artifact:252 ```253 .specdev/findings/findings_step-<NN>_5_<unix_timestamp>.json254 ```255 This is a timestamped copy of the round-5 merged findings file. It is the audit trail.256 Do not promote it to a canonical name. The timestamped file IS the record.257258 Print:259 ```260 HALT: max_rounds=5 reached with unresolved findings.261 Findings path: .specdev/findings/findings_step-<NN>_5_<unix_timestamp>.json262 Finding count: <N> (<P0_count> P0, <P1_count> P1, <P2_count> P2)263 Human action required: proceed-with-gaps | replay | hand-edit then re-invoke /specdev-step <NN>264 ```265266 Do not silently accept partial convergence. HALT is a first-class verdict.267268The scope identifier for this step is `step-<NN>` (e.g. `step-04`, `step-13a`).269270---271272## Hand-off273274After the review loop completes, report the final verdict:275276```277/specdev-step <NN> complete.278Author gate: <clean | errors>279Review verdict: CONVERGED at round <N> | HALT at round 5280Artifact: spec/<NN>_*.json281Findings path (on HALT): .specdev/findings/findings_step-<NN>_5_<unix_timestamp>.json282```283284---285286## Flag discipline287288Three-flag protocol for all validation/governance commands:289```290--repo-root ./devspec_toolkit --spec-root ./spec --git-root .291```292293`specdev json` read/shape/edit subcommands: pass `--repo-root` only.294Exception: `specdev json resolve-pointers` accepts `--git-root`.295`canon-accept`: pass `--git-root`, NOT `--spec-root`.296297Never read `spec/*.json` directly.298299---300301## What this skill does NOT do302303- Does not review existing artifacts without authoring. Use `/specdev-review` for that.304- Does not manage trinity-plan gating. Use `/specdev-trinity --phase plan` for that.305- Does not handle 16b/16c. Plan-phase and Discovery-phase steps only306 (see K_agentification.md §9).307- Does not commit changes. User authorizes commits separately.308- Does not run reviewers sequentially within a round. Parallel dispatch is required.309- Does not skip AskUserQuestion on a blocker payload. Blocker questions must be presented310 to the user via the harness before re-dispatching.311- Does not author a fresh artifact when `spec/<NN>_*.json` already exists (Step 1312 pre-dispatch check short-circuits). For upstream propagation use313 `/specdev-review step-<NN> --with-replay`. For NL-intent-driven new content use314 `/specdev-step <NN> --extend "<intent>"` (author-extend mode). For direct JSON insertion315 of already-composed content use `specdev json insert/patch` then `/specdev-review step-<NN>`.