nitm-ai-dev-toolkit 5.2.0 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +24 -0
  3. package/bin/cli.js +1 -1
  4. package/package.json +1 -1
  5. package/src/monorepo/.agents/skills/dispatching-parallel-agents/SKILL.md +1 -1
  6. package/src/monorepo/.agents/skills/factory/SKILL.md +36 -13
  7. package/src/monorepo/.agents/skills/factory/roles/approve.md +3 -2
  8. package/src/monorepo/.agents/skills/factory/roles/review-code.md +2 -1
  9. package/src/monorepo/.agents/skills/factory/roles/spec.md +3 -1
  10. package/src/monorepo/.claude/agents-snippets/implementer.md +5 -1
  11. package/src/monorepo/.claude/commands/bootstrap-patch.md +2 -2
  12. package/src/monorepo/.claude/commands/constitution.md +1 -1
  13. package/src/monorepo/.claude/commands/create-skill.md +1 -1
  14. package/src/monorepo/.claude/commands/implement-feature.md +2 -2
  15. package/src/monorepo/.claude/commands/implement-fixes.md +1 -1
  16. package/src/monorepo/.claude/commands/implement.md +1 -1
  17. package/src/monorepo/.claude/commands/plan.md +1 -1
  18. package/src/monorepo/.claude/prompt-snippets/assign-tasks.md +3 -2
  19. package/src/monorepo/.claude/prompt-snippets/bootstrap-patch.md +15 -10
  20. package/src/monorepo/.claude/prompt-snippets/constitution.md +7 -1
  21. package/src/monorepo/.claude/prompt-snippets/create-skill.md +10 -0
  22. package/src/monorepo/.claude/prompt-snippets/implement-feature.md +39 -57
  23. package/src/monorepo/.claude/prompt-snippets/implement-fixes.md +31 -40
  24. package/src/monorepo/.claude/prompt-snippets/implement.md +101 -35
  25. package/src/monorepo/.claude/prompt-snippets/plan.md +19 -1
  26. package/src/monorepo/.claude/prompt-snippets/specify.md +9 -2
  27. package/src/monorepo/.claude/prompt-snippets/tasks.md +5 -5
  28. package/src/monorepo/.claude/rules-snippets/documentation.md +9 -1
  29. package/src/monorepo/.claude/rules-snippets/fit-review.md +62 -0
  30. package/src/monorepo/.claude/rules-snippets/subagent-workflow.md +71 -27
  31. package/src/monorepo/.cursor/commands/bootstrap-patch.md +1 -1
  32. package/src/monorepo/.cursor/commands/implement-feature.md +1 -1
  33. package/src/monorepo/.github/prompts/bootstrap-patch.prompt.md +1 -1
  34. package/src/monorepo/.github/prompts/constitution.prompt.md +1 -0
  35. package/src/monorepo/.github/prompts/create-skill.prompt.md +1 -0
  36. package/src/monorepo/.github/prompts/implement-feature.prompt.md +1 -1
  37. package/src/monorepo/.github/prompts/plan.prompt.md +1 -0
  38. package/src/monorepo/.opencode/commands/bootstrap-patch.md +1 -1
  39. package/src/monorepo/.opencode/commands/implement-feature.md +1 -1
  40. package/src/monorepo/AGENTS.md +12 -5
  41. package/src/monorepo/factory/README.md +3 -1
  42. package/src/repo/.agents/skills/dispatching-parallel-agents/SKILL.md +1 -1
  43. package/src/repo/.agents/skills/factory/SKILL.md +36 -13
  44. package/src/repo/.agents/skills/factory/roles/approve.md +3 -2
  45. package/src/repo/.agents/skills/factory/roles/review-code.md +2 -1
  46. package/src/repo/.agents/skills/factory/roles/spec.md +3 -1
  47. package/src/repo/.claude/agents-snippets/implementer.md +5 -1
  48. package/src/repo/.claude/commands/bootstrap-patch.md +2 -2
  49. package/src/repo/.claude/commands/constitution.md +1 -1
  50. package/src/repo/.claude/commands/create-skill.md +1 -1
  51. package/src/repo/.claude/commands/implement-feature.md +2 -2
  52. package/src/repo/.claude/commands/implement-fixes.md +1 -1
  53. package/src/repo/.claude/commands/implement.md +1 -1
  54. package/src/repo/.claude/commands/plan.md +1 -1
  55. package/src/repo/.claude/prompt-snippets/assign-tasks.md +3 -2
  56. package/src/repo/.claude/prompt-snippets/bootstrap-patch.md +15 -10
  57. package/src/repo/.claude/prompt-snippets/constitution.md +7 -1
  58. package/src/repo/.claude/prompt-snippets/create-skill.md +10 -0
  59. package/src/repo/.claude/prompt-snippets/implement-feature.md +38 -58
  60. package/src/repo/.claude/prompt-snippets/implement-fixes.md +33 -34
  61. package/src/repo/.claude/prompt-snippets/implement.md +101 -35
  62. package/src/repo/.claude/prompt-snippets/plan.md +19 -3
  63. package/src/repo/.claude/prompt-snippets/specify.md +9 -2
  64. package/src/repo/.claude/prompt-snippets/tasks.md +6 -6
  65. package/src/repo/.claude/rules-snippets/documentation.md +11 -1
  66. package/src/repo/.claude/rules-snippets/fit-review.md +62 -0
  67. package/src/repo/.claude/rules-snippets/subagent-workflow.md +71 -27
  68. package/src/repo/.cursor/commands/bootstrap-patch.md +1 -1
  69. package/src/repo/.cursor/commands/implement-feature.md +1 -1
  70. package/src/repo/.github/prompts/bootstrap-patch.prompt.md +2 -2
  71. package/src/repo/.github/prompts/constitution.prompt.md +1 -1
  72. package/src/repo/.github/prompts/create-skill.prompt.md +1 -1
  73. package/src/repo/.github/prompts/implement-feature.prompt.md +2 -2
  74. package/src/repo/.github/prompts/implement-fixes.prompt.md +1 -1
  75. package/src/repo/.github/prompts/implement.prompt.md +1 -1
  76. package/src/repo/.github/prompts/plan.prompt.md +1 -1
  77. package/src/repo/.opencode/commands/bootstrap-patch.md +1 -1
  78. package/src/repo/.opencode/commands/implement-feature.md +1 -1
  79. package/src/repo/AGENTS.md +17 -6
  80. package/src/repo/factory/README.md +3 -1
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Patch AI instructions by fetching updates from the toolkit repo and applying new/updated/missing guidance
3
- allowed-tools: "Read, Write, Edit, Bash(*)"
3
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
4
4
  argument-hint: "optional patch options"
5
5
  ---
6
6
 
@@ -10,6 +10,6 @@ argument-hint: "optional patch options"
10
10
  | Agent | When to use |
11
11
  |-------|-------------|
12
12
  | `fixer` | Standard patch — incremental changes to existing config |
13
- | `planner` | Complex patch — cross-cutting changes needing analysis first |
13
+ | `reviewer` | Independent read-only review before approval and after apply |
14
14
 
15
15
  Follow the prompt defined in [.claude/prompt-snippets/bootstrap-patch.md](../prompt-snippets/bootstrap-patch.md).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Create or update the project constitution defining core principles and guidelines
3
- allowed-tools: "Read, Write, Edit, Bash(*)"
3
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
4
4
  argument-hint: "no arguments required"
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Create a new agent skill following VS Code and agentskills.io specifications
3
- allowed-tools: "Read, Write, Edit, Bash(*)"
3
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
4
4
  argument-hint: "skill name and requirements"
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Implement a feature by completing tasks sequentially
3
- allowed-tools: "Read, Write, Edit, Bash(*)"
3
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
4
4
  argument-hint: "feature specification or task list"
5
5
  ---
6
6
 
@@ -10,6 +10,6 @@ argument-hint: "feature specification or task list"
10
10
  | Agent | When to use |
11
11
  |-------|-------------|
12
12
  | `fixer` | Bounded feature work — spec is clear, files are known |
13
- | `feature-builder` | Complex feature — needs research, planning, and coordination |
13
+ | `feature-builder` | Complex feature build — builder only; the orchestrator still runs the review |
14
14
 
15
15
  Follow the prompt defined in [.claude/prompt-snippets/implement-feature.md](../prompt-snippets/implement-feature.md).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Implement bug fixes with proper tracking and validation
3
- allowed-tools: "Read, Write, Edit, Bash(*)"
3
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
4
4
  argument-hint: "bug description or fix requirements"
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Execute implementation tasks from a task list or specification
3
- allowed-tools: "Read, Write, Edit, Bash(*)"
3
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
4
4
  argument-hint: "task list or specification"
5
5
  ---
6
6
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Create an implementation plan from a feature specification or requirement
3
- allowed-tools: "Read, Write, Edit, Bash(*)"
3
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
4
4
  argument-hint: "feature specification or requirement"
5
5
  ---
6
6
 
@@ -49,6 +49,7 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
49
49
 
50
50
  1. **Parse Document**:
51
51
  - Load the specified document (.md, .txt, .json)
52
+ - For `tasks.md`, load sibling `spec.md` when present; otherwise load sibling `plan.md` under **Requirements Source** and **Acceptance Criteria** as the requirements source. For a requirement document supplied directly, use its requirements and acceptance criteria. If the source or criteria are missing or unclear, ask the user before creating tickets; do not require creating a specification.
52
53
  - Detect document structure (headers, lists, task categories)
53
54
  - For `tasks.md`, detect the format first:
54
55
  - **Slim** (has `- [ ] T<n>` or `- [x] T<n>` lines): each such line is one task. The text after the ID is the summary. Sub-bullets, if any, are subtasks. A line already has a ticket only when it ends with ` — {{PROJECT_KEY}}-<digits>`; skip it then. Any other ` — ` suffix (e.g. ` — depends on T3`) is a note, not a key: keep the line
@@ -72,7 +73,7 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
72
73
  - **Task**: Implementation work, 2-8 story points (avoid < 2 SP)
73
74
  - **Subtask**: Only for complex tasks, 1-3 story points (use sparingly)
74
75
 
75
- 4. **Estimate Effort** (`tasks.md` has no effort field: take hours from `plan.md` for the matching work, or estimate from the scope in `spec.md`):
76
+ 4. **Estimate Effort** (`tasks.md` has no effort field: take hours from `plan.md` for the matching work, or estimate from the selected requirements source):
76
77
  - 0.5-1 hours → **Merge with related task** (too small alone)
77
78
  - 2-3 hours → 2 story points
78
79
  - 4-6 hours → 3-5 story points
@@ -84,7 +85,7 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
84
85
  - Link child issues to parents
85
86
  - Set assignees, labels, and story points
86
87
  - Create dependency links where noted
87
- - Ticket description: the task summary plus the acceptance criteria from `spec.md` for that deliverable
88
+ - Ticket description: the task summary plus the acceptance criteria from the selected requirements source for that deliverable (`spec.md` when present, otherwise `plan.md` for a task checklist, or the directly supplied requirement document). Preserve the original criteria and constraints; include a source path/issue key and section reference. Do not copy acceptance criteria into `tasks.md`.
88
89
  - **Slim `tasks.md`**: append ` — <KEY>` at the end of the task's line, after any notes (`- [ ] T1 Schema + migration — PROJ-124`)
89
90
  - **Legacy `tasks.md`**: never write back. Record heading → ticket key in the report instead
90
91
 
@@ -185,26 +185,28 @@ The CLI runs the same patch flow without an AI session: `npx nitm-ai-dev-toolkit
185
185
 
186
186
  ### Summary
187
187
 
188
- - **Auto-apply**: X add + Y update entries, as printed by `patch`
188
+ - **Apply after review and user approval**: X add + Y update entries, as printed by `patch`
189
189
  - **Review needed**: Z needs-review files and W wrapper proposals
190
190
  - **Not written**: N not-relevant or retired entries
191
191
  - **No action**: W files already current
192
192
  ```
193
193
 
194
- 5. **Confirm and Apply**:
194
+ **Independent review loop (before approval/apply, including dry-run):**
195
+ - The orchestrator derives acceptance checks from the user's request and the safeguards above; no new spec, plan, persistent state, or configuration is required. The patch author prepares/repairs the proposal and reports evidence, but cannot approve its own work.
196
+ - The orchestrator dispatches an independent read-only `reviewer` (or available read-only agent), not the patch author or its self-review. Give it the original request, target/source version evidence, current project files, proposed diffs/report (including merges and removals), and check results. Review scope, relevance/retirement decisions, preserved customizations, trust/version gates, and backup/approval requirements.
197
+ - The reviewer returns `VERDICT: PASS` or `VERDICT: CHANGES`; each blocking finding names the file, problem, and required repair. Send findings or failed checks back to the patch author, repair the proposal, verify it, and re-review the revised proposal. Repeat until PASS or BLOCKED; never proceed merely because a round limit was reached.
198
+ - Only the orchestrator accepts the proposal, after independently inspecting the evidence for every acceptance check and the current review PASS. A reviewer PASS alone is not acceptance and never replaces user approval. If an independent reviewer or required evidence/check is unavailable, report **BLOCKED** with what would unblock it; do not apply or claim completion.
199
+
200
+ 5. **Confirm and Apply** (only the accepted proposal):
195
201
  - If `--dry-run` flag: Output the report without making changes
196
- - Otherwise: Present the report and ask the user to confirm with (Y/n)
202
+ - Otherwise: Present the reviewed report and ask the user to confirm with (Y/n). Before writes, back up affected existing files/config and confirm the source, project state, and patch still match the reviewed proposal; if they changed, regenerate and repeat review and user approval. Apply only approved changes.
197
203
  - On confirmation:
198
204
  a. **Add and update**: run `npx nitm-ai-dev-toolkit patch`. It writes only the add and update entries it printed; do not copy template files by hand
199
205
  b. **Retirements**: after approval, record each path in `.nitm/retired.json` with a reason and date. Do not delete files to retire them
200
- c. **Needs review**: propose a merge per file (structural additions, preserved project values) and apply it only after the operator approves that file. Wrappers that inline policy: propose moving the content into the snippet and reducing the wrapper to a thin link (see Thin Wrapper Policy in `bootstrap.md`)
206
+ c. **Needs review**: include each proposed merge (structural additions, preserved project values) in Step 4's report and independent review, and apply it only after the operator approves that file. Wrappers that inline policy: propose moving the content into the snippet and reducing the wrapper to a thin link (see Thin Wrapper Policy in `bootstrap.md`)
201
207
  d. **OpenCode plugins**: Apply only the approved obsolete Ponytail cleanup above after backing up the known obsolete toolkit copies and local config; preserve all unrelated local/global plugins. Never add Ponytail to project config.
202
208
  e. **Toolkit version**: Keep the `.toolkit-version` value the CLI writes for the verified target version (the installed package version, 4.0.0 or later; never hard-coded) only after the approved migration and OpenCode preflight pass (or OpenCode is confirmed out of scope).
203
- f. **Git commit**: Stage and commit all changes with message:
204
- ```bash
205
- git add -A
206
- git commit -m "chore: patch AI instructions from toolkit [$(date +%Y-%m-%d)]"
207
- ```
209
+ f. **Git commit**: Do not auto-commit. Only if the user explicitly requests a commit, and only after Step 7 acceptance, stage just this patch's approved paths; never stage unrelated changes.
208
210
 
209
211
  6. **Cleanup**:
210
212
 
@@ -216,6 +218,9 @@ The CLI runs the same patch flow without an AI session: `npx nitm-ai-dev-toolkit
216
218
  - Verify no `{{PLACEHOLDER}}` syntax was accidentally re-introduced
217
219
  - Confirm all files are valid (no broken frontmatter, no syntax errors)
218
220
  - List any new placeholders that need manual `bootstrap` to fill
221
+ - Inspect the actual applied diff/files against the approved proposal and backups: verify preserved project values/config, relevance/retirements, approved merges/removals, and the target version marker. Run the applicable syntax/frontmatter checks and report commands/results, not assumed runtime validation.
222
+ - Dispatch the independent read-only reviewer on the actual applied outcome, approval scope, and validation evidence using the same verdict contract above. On findings or failed checks, repair only within the approved scope, rerun validation, and re-review; any new/unapproved change must return through proposal review and user approval before writes.
223
+ - Only the orchestrator reports **ACCEPTED** when the current outcome has review PASS and verified evidence for every acceptance check. Missing reviewer/evidence means **BLOCKED**, never completion. For `--dry-run`, accept only the reviewed preview and explicitly report that nothing was applied or post-apply verified. Acceptance never authorizes extra writes, deletions, or a commit.
219
224
 
220
225
  ## Smart Merge Strategy
221
226
 
@@ -240,4 +245,4 @@ When a file has been bootstrapped (placeholders replaced with real values), the
240
245
  - **Non-destructive by default**: Always show changes before applying
241
246
  - **Preserve customizations**: Never lose project-specific configuration
242
247
  - **Incremental**: Only apply what's changed, don't re-bootstrap everything
243
- - **Auditable**: Commit message includes date for tracking patch history
248
+ - **Auditable**: Report approved paths, review verdicts, and verification evidence; commit only on explicit request
@@ -2,7 +2,7 @@ You are helping to create or update the project constitution at `docs/constituti
2
2
 
3
3
  ## Your Task
4
4
 
5
- 1. **Load existing constitution** (if it exists) at `docs/constitution.md`.
5
+ 1. **Load existing constitution** (if it exists) at `docs/constitution.md`. Retain its original content for comparison during review.
6
6
 
7
7
  2. **Collect project information**:
8
8
  - Project name and description
@@ -25,6 +25,12 @@ You are helping to create or update the project constitution at `docs/constituti
25
25
 
26
26
  5. **Save** the constitution to `docs/constitution.md`.
27
27
 
28
+ 6. **Review and accept the artifact** before reporting completion:
29
+ - The orchestrator dispatches an independent, read-only reviewer with the original request, gathered requirements, original constitution (or confirmation this is new), saved constitution, and validation results. Review the actual artifact for contradictions, unintended policy changes, and requirements coverage; return `VERDICT: PASS` or `VERDICT: CHANGES` with blocking findings and section references.
30
+ - Repair blocking findings within the agreed scope, repeat affected validation checks, and re-review the changed artifact independently. Repeat until PASS or blocked; unresolved policy decisions go to the user, not an invented amendment.
31
+ - Only the orchestrator accepts, after an independent PASS and evidence that every requirement and applicable validation check is satisfied. If an independent reviewer is unavailable, report BLOCKED; self-review cannot substitute for independent acceptance.
32
+ - Keep human/team approval and the constitution's amendment governance separate from artifact acceptance. This review adds no commit, push, or apply step.
33
+
28
34
  ## Constitution Template
29
35
 
30
36
  ```markdown
@@ -299,6 +299,16 @@ After validation, create the skill:
299
299
  - `assets/`
300
300
  4. **Add resource files**: Based on skill requirements
301
301
 
302
+ ## Artifact Review and Acceptance
303
+
304
+ Before Post-Creation or a success summary, the orchestrator must:
305
+
306
+ 1. Dispatch an independent, read-only reviewer with the original request, gathered requirements, created skill and resource paths, and validation results. Review the actual files for naming/frontmatter, structure, reference resolution, and coverage of the requested capability; return `VERDICT: PASS` or `VERDICT: CHANGES` with blocking findings and file references.
307
+ 2. Repair blocking findings within the agreed scope, repeat affected validation checks, and re-review the changed artifacts independently. Repeat until PASS or blocked; ask the user rather than inventing requirements or expanding scope.
308
+ 3. Accept only after the independent reviewer returns PASS and the orchestrator verifies every requirement and applicable validation check against evidence. If an independent reviewer is unavailable, report BLOCKED; self-review cannot substitute for independent acceptance.
309
+
310
+ Keep any required human approval separate from artifact acceptance. This review adds no commit, push, or apply step.
311
+
302
312
  ## Post-Creation
303
313
 
304
314
  After creating the skill:
@@ -11,41 +11,42 @@ Implement a feature by completing tasks sequentially with proper tracking.
11
11
 
12
12
  ## Orchestrator Checkpoint
13
13
 
14
- > **🛑 Before starting**: This command involves planning, implementation, testing, and review.
15
- > Use the **orchestrator-first** flow. Delegate to the **Feature Builder** coordinator or use
16
- > the `subagent-driven-development` skill to dispatch a fresh subagent per task.
17
- > See `.claude/rules-snippets/subagent-workflow.md` for full patterns.
14
+ > **🛑 Before starting**: Every task and the whole feature run the delivery loop in
15
+ > [implement.md](implement.md). Dispatch the builder directly with that loop. Do not route through a
16
+ > planning skill, and do not write a spec or plan first. **Feature Builder** may be the builder for a
17
+ > task, but its own review never replaces the independent review, and only the orchestrator accepts.
18
18
 
19
19
  ## Process
20
20
 
21
21
  > **📋 Standards**: Follow [Coding Standards](../rules-snippets/coding-standards.md), [Testing](../rules-snippets/testing.md), and [Documentation](../rules-snippets/documentation.md).
22
22
 
23
23
  1. **Load Feature Context**:
24
- - Read specification from `docs/features/{{ISSUE_ID}}-{{FEATURE_NAME}}/spec.md`
25
- - Read implementation plan from `docs/features/{{ISSUE_ID}}-{{FEATURE_NAME}}/plan.md`
26
- - Read task list from `docs/features/{{ISSUE_ID}}-{{FEATURE_NAME}}/tasks.md`
27
- - Review `AGENTS.md` for project patterns
24
+ - The supplied feature text or task list is the requirement. Do not require a spec or plan first.
25
+ - If `docs/features/{{ISSUE_ID}}-{{FEATURE_NAME}}/` exists, read whichever of `spec.md`, `plan.md` and `tasks.md` it contains as context. Skip any that are absent.
26
+ - Review `AGENTS.md` for project patterns.
27
+ - Turn every requirement of the feature into an acceptance criterion and discover the real checks, as in [implement.md](implement.md) step 1.
28
+ - Preserve the original full-feature text, acceptance criteria, and real checks separately for aggregate feature review; task-local inputs must not overwrite them.
28
29
 
29
30
  2. **Parallelization Analysis**:
30
31
  - Scan task list for `[P]` markers and independent tasks
31
32
  - Group tasks by domain (backend, frontend, docs, tests)
32
- - Tasks that touch **different files with no shared state** → dispatch in parallel
33
+ - Tasks that touch **different files with no shared state** → run their loops in parallel
33
34
  - Tasks with dependencies or shared files → keep sequential
35
+ - Tasks with an unknown or undeclared write set → keep sequential until the scope is established
34
36
  - Use `dispatching-parallel-agents` skill when 3+ independent tasks exist
35
37
 
36
- 3. **Create Feature Branch**:
38
+ 3. **Create Feature Branch** (before any build):
37
39
 
38
40
  ```bash
39
41
  git checkout -b feature/{{FEATURE_NAME}}
40
42
  git pull origin {{DEFAULT_BRANCH}}
41
43
  ```
42
44
 
43
- 4. **Task Implementation** (sequential or parallel per analysis):
45
+ Then take the baseline snapshot as in implement.md step 1, before any build.
44
46
 
45
- For tasks with dependencies, execute in order.
46
- For `[P]` tasks with no shared state, **dispatch parallel subagents** — one per task domain:
47
+ 4. **Task Implementation** (sequential or parallel per analysis):
47
48
 
48
- For each task:
49
+ For each task, in dependency order:
49
50
 
50
51
  a. **Mark Task In Progress**
51
52
 
@@ -53,70 +54,49 @@ Implement a feature by completing tasks sequentially with proper tracking.
53
54
  - Search codebase for similar patterns
54
55
  - Review referenced files
55
56
  - Understand dependencies
57
+ - Before entering the task's delivery loop, bind the current task's original text unchanged, task-local acceptance criteria, and applicable real checks as in implement.md step 1. Use these inputs for the builder, verification, independent reviewer, and acceptance in steps 2–5. Do not use another task's criteria or require later tasks to pass. Keep the saved baseline unchanged.
56
58
 
57
- c. **Implement (TDD required)**:
58
- - Follow the acceptance criteria in `spec.md` for this task's deliverable
59
- - Use patterns from `AGENTS.md`
60
- - **Write a failing test first** — one behavior per test, clear name, real code
61
- - **Verify it fails** — watch it fail for the right reason (feature missing, not error)
62
- - **Write minimal code to pass** — simplest implementation, no over-engineering
63
- - **Verify it passes** — all tests green, no regressions
64
- - **Refactor** — clean up only after green (remove duplication, improve names)
65
- - Ensure type safety
66
- - See `test-driven-development/SKILL.md` for the full cycle
67
-
68
- d. **Validate**:
69
- - Run type checking: `{{PACKAGE_MANAGER}} run check-types`
70
- - Run linter: `{{PACKAGE_MANAGER}} run lint`
71
- - Run tests: `{{PACKAGE_MANAGER}} run test`
72
- - Build: `{{PACKAGE_MANAGER}} run build`
73
-
74
- e. **Update Documentation**:
75
- - Ensure `docs/features/{{ISSUE_ID}}-{{FEATURE_NAME}}/spec.md` reflects final implementation
76
- - Update `plan.md` if implementation deviated from original plan
77
- - Update `docs/api/` if any API surfaces changed
78
- - Update `README.md` if setup steps, commands, or env vars changed
79
- - Add entry to `CHANGELOG.md` under `[Unreleased]`
80
- - See `.claude/rules-snippets/documentation.md` for full pre-commit checklist
81
-
82
- f. **Commit Changes**:
59
+ c. **Delivery loop for the task** (implement.md steps 2–5):
60
+ - Builder: write the failing test first, watch it fail for the right reason, make the minimal change to pass, then refactor (TDD). Update the docs the task requires: `docs/api/` if API surfaces changed, `README.md` if setup steps, commands, or env vars changed, and `CHANGELOG.md` under `[Unreleased]`. Update a feature `spec.md` or `plan.md` only if one exists.
61
+ - Orchestrator: verify the checks yourself, dispatch the independent read-only reviewer, then decide.
62
+ - Repair goes back to the builder. Repeat until the task is accepted or blocked. Do not commit or tick the task before acceptance.
63
+ - See `.claude/rules-snippets/documentation.md` for the full pre-commit checklist.
64
+
65
+ d. **Commit the Task** (after acceptance, only when there are accepted changes): stage only this task's paths, never `git add -A` or a foreign change, then commit. Skip the commit when nothing is staged.
83
66
 
84
67
  ```bash
85
68
  git commit -m "feat({{SCOPE}}): {{DESCRIPTION}}"
86
69
  ```
87
70
 
88
- f. **Mark Task Complete**:
71
+ e. **Mark Task Complete** (after the commit):
89
72
  - Slim `tasks.md`: tick `- [x]` on the task's line
90
73
  - Legacy `tasks.md`: tick `- [x]` only on checkboxes under the current task's heading (until the next heading). Never tick checkboxes under other headings. If that heading has no checkboxes, report "no checkboxes under <heading>; nothing ticked" and continue
91
74
 
92
- 5. **Post-Implementation Review**:
93
- - Dispatch **Reviewer** agent on all changes before proceeding
94
- - If reviewer requests changes, route back to the original domain specialist
95
- - Use `verification-before-completion` skill for final quality gate
96
-
97
- 6. **Create Pull Request**:
75
+ 5. **Feature Review** (aggregate loop, every round):
76
+ - Restore the saved full-feature text, acceptance criteria, and real checks as the inputs for aggregate verification, independent review, and acceptance.
77
+ - Run implement.md steps 3, 4 and 5 for the **whole feature**, against every requirement from step 1, not only the last task.
78
+ - Review scope: the current working tree against the merge-base, `git diff $(git merge-base {{DEFAULT_BRANCH}} HEAD)`. This covers committed task work, uncommitted repairs, and new files (read the untracked ones directly). Do not review only `{{DEFAULT_BRANCH}}...HEAD`: it misses uncommitted repairs and new files. Compare preexisting files against the saved baseline copies from step 1, as in implement.md step 4.
79
+ - Repairs go to the builder that owns each file, uncommitted. Then run steps 3–5 again on the current tree.
80
+ - Exits are the same as implement.md step 5: accepted, blocked, or needs a user decision. There is no round limit. Only acceptance ends the feature review successfully.
98
81
 
99
- After all tasks complete:
82
+ 6. **Create Pull Request** (only after the feature review is accepted):
100
83
 
101
- a. **Final Validation**:
102
- - All tests passing
103
- - No type errors
104
- - No linter errors
105
- - Build successful
84
+ a. **Final Validation**: after all tasks are reconciled, run the project's full required regression checks once on the final integrated tree (implement.md step 3): the repo-defined full suite, lint, typecheck, and build, where they exist. Every required check must pass on this tree. Any edit after this run requires revalidation.
106
85
 
107
- b. **Push and Create PR**:
86
+ b. **Commit and push**: if accepted feature-review changes are still uncommitted, commit them once, staging only the feature's paths, and skip the commit when nothing is staged. Do not create repair-only commits.
108
87
 
109
88
  ```bash
89
+ git commit -m "feat({{SCOPE}}): {{DESCRIPTION}}" # only when there are uncommitted accepted changes
110
90
  git push -u origin feature/{{FEATURE_NAME}}
111
91
  ```
112
92
 
113
93
  - Create PR targeting `{{DEFAULT_BRANCH}}`
114
- - Include feature summary and testing notes
94
+ - Include feature summary, the AC evidence, and testing notes
115
95
 
116
96
  7. **Report Status**:
117
- - Completed tasks count
118
- - PR URL
119
- - Ready for code review
97
+ - Tasks accepted (count) and any task blocked or awaiting a user decision
98
+ - Feature review verdict and `ACCEPTED` or `BLOCKED` / `NOT ACCEPTED` with the open items
99
+ - PR URL, only when accepted
120
100
 
121
101
  ## Guidelines
122
102
 
@@ -11,10 +11,12 @@ Implement bug fixes and corrections with proper validation and documentation.
11
11
 
12
12
  ## Orchestrator Checkpoint
13
13
 
14
- > **🛑 For multiple independent fixes**: If fixing 2+ unrelated bugs, use `dispatching-parallel-agents`
15
- > to dispatch one subagent per bug (different root causes, different files = parallel-safe).
16
- > For a single focused fix, proceed directly — single-agent is appropriate.
17
- > See `.claude/rules-snippets/subagent-workflow.md` for patterns.
14
+ > **🛑 Every fix runs the delivery loop** in [implement.md](implement.md). Initialize steps 1 and 2 below
15
+ > before any reproduction or build. Then one builder reproduces and fixes the bug, and the orchestrator
16
+ > repeats verify, review and decide until the fix is accepted or a stop condition is reached. Do not
17
+ > fix the bug inline, and do not write a spec or plan first.
18
+ > For several unrelated bugs, run one loop per bug, each with its own builder. Use
19
+ > `dispatching-parallel-agents` only when their root causes and files do not overlap.
18
20
 
19
21
  ## Workflow Modes
20
22
 
@@ -25,55 +27,51 @@ Implement bug fixes and corrections with proper validation and documentation.
25
27
 
26
28
  > **📋 Standards**: Follow [Coding Standards](../rules-snippets/coding-standards.md) and [Documentation](../rules-snippets/documentation.md).
27
29
 
28
- 1. **Load Fix Context**:
30
+ 1. **Load Fix Context** (orchestrator, before any build):
29
31
  - Retrieve issue details if applicable
30
- - Understand the reported bug
31
- - Identify affected code areas
32
+ - The reported bug and any stated expected behavior are the requirement. Do not require a spec or plan first.
33
+ - Identify the affected code areas
34
+ - Turn the requirements into acceptance criteria, one per requirement: for example "the reported behavior no longer occurs" and "existing behavior the bug touches still works". Discover the real checks as in [implement.md](implement.md) step 1.
35
+
36
+ 2. **Create Fix Branch and Capture Baseline** (orchestrator, before any build):
32
37
 
33
- 2. **Create Fix Branch**:
34
38
  ```bash
35
39
  git checkout {{DEFAULT_BRANCH}}
36
40
  git pull origin {{DEFAULT_BRANCH}}
37
41
  git checkout -b fix/{{FIX_DESCRIPTION}}
38
42
  ```
39
43
 
40
- 3. **Reproduce & Test (TDD required)**:
41
- - Identify root cause
42
- - **Write a failing test that reproduces the bug** — this proves you understand the issue
43
- - **Verify it fails** — watch it fail for the right reason
44
- - See `test-driven-development/SKILL.md` for the bug fix workflow
45
-
46
- 4. **Implement Fix**:
47
- - Write minimal code to make the failing test pass
48
- - Fix only the reported issue
49
- - Maintain backward compatibility
50
- - **Verify all tests pass** — run the full suite, no regressions
51
-
52
- 5. **Validate Fix**:
53
- - Run type checking: `{{PACKAGE_MANAGER}} run check-types`
54
- - Run tests: `{{PACKAGE_MANAGER}} run test`
55
- - Build: `{{PACKAGE_MANAGER}} run build`
56
- - Verify fix resolves the issue
57
- - Check for regressions
58
-
59
- 6. **Commit and Push**:
44
+ Then take the baseline snapshot as in implement.md step 1, before any build.
45
+
46
+ 3. **Reproduce and Build** (builder, implement.md step 2):
47
+ - Dispatch one builder with the bug report, the AC list, the discovered checks, the base commit and the baseline.
48
+ - The builder identifies the root cause and writes a **failing test that reproduces the bug**. It watches the test fail for the right reason, then makes the minimal change that passes it. The reproduction belongs to the builder, not to the orchestrator.
49
+ - Fix only the reported issue. Maintain backward compatibility. Leave all changes uncommitted, including new files.
50
+
51
+ 4. **Verify, Review and Decide** (repeat implement.md steps 3, 4 and 5 until an exit):
52
+ - Verify: rerun the reproducing test and confirm it passes now, run every check that covers an AC, and run the full test suite for regressions.
53
+ - Review: the independent read-only reviewer checks the fix, the reproducing test, and the untracked files.
54
+ - Decide: repair goes back to the same builder. Repeat until `ACCEPTED`, `BLOCKED`, or `NOT ACCEPTED: needs decision`. There is no round limit. A review PASS alone never accepts.
55
+
56
+ 5. **Commit and Push** (only after `ACCEPTED`, and only when there are accepted changes): stage only the fix's paths, never `git add -A` or a foreign change. Skip the commit when nothing is staged.
60
57
  ```bash
61
58
  git commit -m "fix({{SCOPE}}): {{FIX_DESCRIPTION}}"
62
59
  git push -u origin fix/{{FIX_DESCRIPTION}}
63
60
  ```
64
61
 
65
- 7. **Create Pull Request**:
62
+ 6. **Create Pull Request** (only after `ACCEPTED`):
66
63
  - Target: `{{DEFAULT_BRANCH}}`
67
64
  - Include:
68
65
  - Root cause explanation
69
66
  - Fix approach description
70
- - Testing performed
67
+ - Testing performed, with the reproducing test and its failing-then-passing output
71
68
  - Potential impacts
72
69
 
73
- 8. **Report Status**:
70
+ 7. **Report Status**:
74
71
  - Bug fixed and root cause
75
- - Validation completed
76
- - PR ready for review
72
+ - Review verdict and `ACCEPTED`, or `BLOCKED` / `NOT ACCEPTED` with the open items
73
+ - Validation evidence per AC
74
+ - PR ready for review (only when accepted)
77
75
 
78
76
  **Include a Fixes Applied table** summarizing every change:
79
77
 
@@ -99,7 +97,7 @@ Implement bug fixes and corrections with proper validation and documentation.
99
97
  - **Minimal Scope**: Fix only the reported issue
100
98
  - **No Refactoring**: Avoid unrelated code changes
101
99
  - **Backward Compatible**: Don't break existing functionality
102
- - **Test First**: Write a failing test reproducing the bug before writing the fix — no exceptions
100
+ - **Test First**: The builder writes a failing test reproducing the bug before writing the fix — no exceptions
103
101
  - **Document**: Record the fix in changelog if significant
104
102
 
105
103
  ## Documentation
@@ -110,6 +108,7 @@ For significant fixes, document in `docs/fixes/` or `CHANGELOG.md`:
110
108
  ## [{{VERSION}}] - {{DATE}}
111
109
 
112
110
  ### Fixed
111
+
113
112
  - {{FIX_DESCRIPTION}} ({{ISSUE_KEY}})
114
113
  - Root cause: {{ROOT_CAUSE}}
115
114
  - Solution: {{SOLUTION}}