nitm-ai-dev-toolkit 5.1.3 → 5.2.1

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 (62) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/package.json +1 -1
  3. package/src/monorepo/.claude/agents-snippets/implementer.md +5 -1
  4. package/src/monorepo/.claude/commands/bootstrap-patch.md +2 -2
  5. package/src/monorepo/.claude/commands/constitution.md +1 -1
  6. package/src/monorepo/.claude/commands/create-skill.md +1 -1
  7. package/src/monorepo/.claude/commands/implement-feature.md +2 -2
  8. package/src/monorepo/.claude/commands/implement-fixes.md +1 -1
  9. package/src/monorepo/.claude/commands/implement.md +1 -1
  10. package/src/monorepo/.claude/commands/plan.md +1 -1
  11. package/src/monorepo/.claude/prompt-snippets/assign-tasks.md +3 -2
  12. package/src/monorepo/.claude/prompt-snippets/bootstrap-patch.md +15 -10
  13. package/src/monorepo/.claude/prompt-snippets/constitution.md +7 -1
  14. package/src/monorepo/.claude/prompt-snippets/create-skill.md +10 -0
  15. package/src/monorepo/.claude/prompt-snippets/implement-feature.md +38 -57
  16. package/src/monorepo/.claude/prompt-snippets/implement-fixes.md +31 -40
  17. package/src/monorepo/.claude/prompt-snippets/implement.md +93 -35
  18. package/src/monorepo/.claude/prompt-snippets/plan.md +19 -1
  19. package/src/monorepo/.claude/prompt-snippets/tasks.md +5 -5
  20. package/src/monorepo/.claude/rules-snippets/documentation.md +9 -1
  21. package/src/monorepo/.claude/rules-snippets/subagent-workflow.md +13 -0
  22. package/src/monorepo/.cursor/commands/bootstrap-patch.md +1 -1
  23. package/src/monorepo/.cursor/commands/implement-feature.md +1 -1
  24. package/src/monorepo/.github/prompts/bootstrap-patch.prompt.md +1 -1
  25. package/src/monorepo/.github/prompts/constitution.prompt.md +1 -0
  26. package/src/monorepo/.github/prompts/create-skill.prompt.md +1 -0
  27. package/src/monorepo/.github/prompts/implement-feature.prompt.md +1 -1
  28. package/src/monorepo/.github/prompts/plan.prompt.md +1 -0
  29. package/src/monorepo/.opencode/commands/bootstrap-patch.md +1 -1
  30. package/src/monorepo/.opencode/commands/implement-feature.md +1 -1
  31. package/src/monorepo/AGENTS.md +4 -0
  32. package/src/repo/.claude/agents-snippets/implementer.md +5 -1
  33. package/src/repo/.claude/commands/bootstrap-patch.md +2 -2
  34. package/src/repo/.claude/commands/constitution.md +1 -1
  35. package/src/repo/.claude/commands/create-skill.md +1 -1
  36. package/src/repo/.claude/commands/implement-feature.md +2 -2
  37. package/src/repo/.claude/commands/implement-fixes.md +1 -1
  38. package/src/repo/.claude/commands/implement.md +1 -1
  39. package/src/repo/.claude/commands/plan.md +1 -1
  40. package/src/repo/.claude/prompt-snippets/assign-tasks.md +3 -2
  41. package/src/repo/.claude/prompt-snippets/bootstrap-patch.md +15 -10
  42. package/src/repo/.claude/prompt-snippets/constitution.md +7 -1
  43. package/src/repo/.claude/prompt-snippets/create-skill.md +10 -0
  44. package/src/repo/.claude/prompt-snippets/implement-feature.md +37 -58
  45. package/src/repo/.claude/prompt-snippets/implement-fixes.md +33 -34
  46. package/src/repo/.claude/prompt-snippets/implement.md +93 -35
  47. package/src/repo/.claude/prompt-snippets/plan.md +19 -3
  48. package/src/repo/.claude/prompt-snippets/tasks.md +6 -6
  49. package/src/repo/.claude/rules-snippets/documentation.md +11 -1
  50. package/src/repo/.claude/rules-snippets/subagent-workflow.md +13 -0
  51. package/src/repo/.cursor/commands/bootstrap-patch.md +1 -1
  52. package/src/repo/.cursor/commands/implement-feature.md +1 -1
  53. package/src/repo/.github/prompts/bootstrap-patch.prompt.md +2 -2
  54. package/src/repo/.github/prompts/constitution.prompt.md +1 -1
  55. package/src/repo/.github/prompts/create-skill.prompt.md +1 -1
  56. package/src/repo/.github/prompts/implement-feature.prompt.md +2 -2
  57. package/src/repo/.github/prompts/implement-fixes.prompt.md +1 -1
  58. package/src/repo/.github/prompts/implement.prompt.md +1 -1
  59. package/src/repo/.github/prompts/plan.prompt.md +1 -1
  60. package/src/repo/.opencode/commands/bootstrap-patch.md +1 -1
  61. package/src/repo/.opencode/commands/implement-feature.md +1 -1
  62. package/src/repo/AGENTS.md +5 -1
package/CHANGELOG.md CHANGED
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
15
 
16
16
  ### Changed
17
17
 
18
+ - `create-skill`, `constitution`, `plan`, and `bootstrap-patch` gain scoped independent artifact review → repair → re-review → orchestrator acceptance gates; missing reviewers block acceptance, and human approval remains separate. Plan review checks the planning artifacts, not a code build loop.
18
19
  - `patch` and `upgrade` classify every template file against the project before writing: **add** (missing and applicable), **update** (unchanged since the toolkit wrote it, and the template changed), **current**, **needs review** (locally changed, or undecided relevance), **not relevant**, and **retired**. The plan prints, with a reason for each entry, before anything is written.
19
20
  - Relevance comes from the project. Tracker CLI skills follow the git `origin` host (GitHub, GitLab, Bitbucket) or the `trackers` list; `playwright-test` follows Playwright; `prisma-migrations` follows Prisma; `component-structure` and `ui-accessibility` follow a UI framework; the empty MCP templates are not added. When the tracker cannot be detected, tracker skills are held for review rather than guessed.
20
21
  - `patch` never overwrites a locally changed file, even with `--force`; it reports the file under needs review. `upgrade` without `--force` behaves the same. `upgrade --force` runs `install --force`, which does overwrite locally changed files. `patch` and `upgrade` update only files the toolkit wrote and the project has not changed since (manifest hash).
@@ -26,8 +27,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
26
27
  - Bootstrap skill cleanup and the upgrade steps retire by recording in `.nitm/retired.json` rather than deleting. Deleting a skill directory needs separate approval and a backup.
27
28
  - Upgrade pre-commit hook: installed only with approval, in a git repository, and never over an existing `.git/hooks/pre-commit`. Project hooks (plugin-only, `${CLAUDE_PLUGIN_ROOT}`) are copied only with approval, and existing files are skipped.
28
29
 
30
+ - `implement`, `implement-feature` and `implement-fixes` (repo and monorepo) share one delivery loop in `prompt-snippets/implement.md`: the orchestrator sets acceptance checks, a builder builds, a read-only reviewer returns `VERDICT: PASS` or `VERDICT: CHANGES`, and only the orchestrator accepts. Builders no longer accept or tick their own work. Feature and fixes flows review before committing or pushing. Claude commands allow `Task` and Copilot prompts grant `agent` so the orchestrator can dispatch. The loop repeats (build, verify, review, decide) until accepted, blocked, or a user decision is needed; there is no round limit. Acceptance needs a `VERDICT: PASS` from an independent reviewer and evidence for every requirement and required check; a missing reviewer, an undiscoverable check or a blocker stops the loop as BLOCKED. Review compares each file with a saved baseline snapshot (tracked changes via `git diff --binary HEAD`, preexisting files via their saved copies), reads new untracked files, and uses the merge-base diff for features. Accepting only reports; a commit happens only where the calling flow asks, and stages just the accepted paths. `AGENTS.md` and the documentation checklist carry a narrow supplied-task exception: these commands do not require spec or plan documents. Fixes initialize the branch and baseline before one builder reproduces the bug. The generic and feature prompts no longer invoke `subagent-driven-development`. No spec or plan is required before a build. Tests: `test/implement-loop.test.js`.
31
+ - Subagent workflow (`.claude/rules-snippets/subagent-workflow.md`, repo and monorepo) gains a model capacity fallback: when a subagent stops on a capacity, quota or reset-wait failure, it keeps the same agent and tries the configured fallback models once each, then stops and reports. Covered by `test/model-capacity-fallback.test.js`.
32
+
29
33
  ### Fixed
30
34
 
35
+ - Feature delivery loops initialize task-local requirements, acceptance criteria and checks before each task, reserving the full feature criteria for aggregate review. Requirement-only plans retain requirements and acceptance criteria for `/tasks` and `/assign-tasks` when no specification exists, in both template layouts.
31
36
  - `.opencode/commands/review-staged.md` (repo and monorepo) had lost its link to `.claude/prompt-snippets/review-staged.md`. It is a thin wrapper with the link again.
32
37
 
33
38
  ### Migration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitm-ai-dev-toolkit",
3
- "version": "5.1.3",
3
+ "version": "5.2.1",
4
4
  "description": "Scaffold AI agent config (Cursor, GitHub Copilot, Claude Code, OpenCode, Codex) into any repo, then hand off to your AI agent to finish setup.",
5
5
  "bin": {
6
6
  "nitm-ai-dev-toolkit": "bin/cli.js"
@@ -19,7 +19,11 @@ You are an implementation specialist. Your job is to write production-quality co
19
19
  - Write tests alongside implementation
20
20
  - Use existing patterns and utilities — don't reinvent
21
21
  - Keep changes focused on the assigned task
22
- - If something is unclear, **ask** before proceeding
22
+ - If the task is unclear in a way that changes what you build, **ask** before proceeding. Otherwise build the task as written.
23
+ - **You build; you do not accept.** Your self-review and report are evidence for the orchestrator, not approval. An independent reviewer and the orchestrator decide.
24
+ - Leave your changes uncommitted and do not tick tasks. Commit or tick only when your calling flow asks, and only after acceptance.
25
+ - Report each acceptance criterion as `pass` with the command and its result, or `not verified` with the reason.
26
+ - In repair mode, answer every blocking review item: fix it, or say in your report why it should stand.
23
27
 
24
28
  ## Output
25
29
 
@@ -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,7 +1,7 @@
1
1
  ---
2
2
  description: Create or update the project constitution defining core principles and guidelines
3
3
  argument-hint: "no arguments required"
4
- allowed-tools: "Read, Write, Edit, Bash(*)"
4
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
5
5
  ---
6
6
 
7
7
  # Project Constitution
@@ -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
  tags: [skill-creation, agent-skills, documentation, automation]
6
6
  version: 1.0.0
@@ -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,7 +1,7 @@
1
1
  ---
2
2
  description: Execute implementation tasks from a task list or specification
3
3
  argument-hint: "task list or specification"
4
- allowed-tools: "Read, Write, Edit, Bash(*)"
4
+ allowed-tools: "Read, Write, Edit, Bash(*), Task"
5
5
  ---
6
6
 
7
7
  # Execute Implementation Tasks
@@ -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
 
@@ -47,6 +47,7 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
47
47
 
48
48
  1. **Parse Document**:
49
49
  - Load the specified document (.md, .txt, .json)
50
+ - 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.
50
51
  - Detect document structure (headers, lists, task categories)
51
52
  - For `tasks.md`, detect the format first:
52
53
  - **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
@@ -70,7 +71,7 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
70
71
  - **Task**: Implementation work, 2-8 story points (avoid < 2 SP tasks)
71
72
  - **Subtask**: Only for complex tasks needing breakdown, 1-3 story points
72
73
 
73
- 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`):
74
+ 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):
74
75
  - 0.5-1 hours → Merge with related task (too small alone)
75
76
  - 2-3 hours → 2 story points
76
77
  - 4-6 hours → 3-5 story points
@@ -82,7 +83,7 @@ When interacting with {{ISSUE_TRACKER}}, use MCP tools first (see the `issue-tra
82
83
  - Link child issues to parents
83
84
  - Set assignees, labels, and story points
84
85
  - Create dependency links where noted
85
- - Ticket description: the task summary plus the acceptance criteria from `spec.md` for that deliverable
86
+ - 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`.
86
87
  - **Slim `tasks.md`**: append ` — <KEY>` at the end of the task's line, after any notes (`- [ ] T1 Schema + migration — PROJ-124`)
87
88
  - **Legacy `tasks.md`**: never write back. Record heading → ticket key in the report instead
88
89
 
@@ -184,26 +184,28 @@ The CLI runs the same patch flow without an AI session: `npx nitm-ai-dev-toolkit
184
184
 
185
185
  ### Summary
186
186
 
187
- - **Auto-apply**: X add + Y update entries, as printed by `patch`
187
+ - **Apply after review and user approval**: X add + Y update entries, as printed by `patch`
188
188
  - **Review needed**: Z needs-review files and W wrapper proposals
189
189
  - **Not written**: N not-relevant or retired entries
190
190
  - **No action**: W files already current
191
191
  ```
192
192
 
193
- 5. **Confirm and Apply**:
193
+ **Independent review loop (before approval/apply, including dry-run):**
194
+ - 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.
195
+ - 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.
196
+ - 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.
197
+ - 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.
198
+
199
+ 5. **Confirm and Apply** (only the accepted proposal):
194
200
  - If `--dry-run` flag: Output the report without making changes
195
- - Otherwise: Present the report and ask the user to confirm with (Y/n)
201
+ - 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.
196
202
  - On confirmation:
197
203
  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
198
204
  b. **Retirements**: after approval, record each path in `.nitm/retired.json` with a reason and date. Do not delete files to retire them
199
- 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`)
205
+ 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`)
200
206
  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.
201
207
  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).
202
- f. **Git commit**: Stage and commit all changes with message:
203
- ```bash
204
- git add -A
205
- git commit -m "chore: patch AI instructions from toolkit [$(date +%Y-%m-%d)]"
206
- ```
208
+ 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.
207
209
 
208
210
  6. **Cleanup**:
209
211
 
@@ -215,6 +217,9 @@ The CLI runs the same patch flow without an AI session: `npx nitm-ai-dev-toolkit
215
217
  - Verify no `{{PLACEHOLDER}}` syntax was accidentally re-introduced
216
218
  - Confirm all files are valid (no broken frontmatter, no syntax errors)
217
219
  - List any new placeholders that need manual `bootstrap` to fill
220
+ - 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.
221
+ - 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.
222
+ - 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.
218
223
 
219
224
  ## Smart Merge Strategy
220
225
 
@@ -239,4 +244,4 @@ When a file has been bootstrapped (placeholders replaced with real values), the
239
244
  - **Non-destructive by default**: Always show changes before applying
240
245
  - **Preserve customizations**: Never lose project-specific configuration
241
246
  - **Incremental**: Only apply what's changed, don't re-bootstrap everything
242
- - **Auditable**: Commit message includes date for tracking patch history
247
+ - **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:
@@ -5,113 +5,94 @@ Implement a feature by completing tasks sequentially with proper tracking.
5
5
  ## Usage
6
6
 
7
7
  ```
8
-
9
8
  /implement-feature {{ISSUE_KEY}}-123
10
9
  /implement-feature apps/{{APP_NAME}}/docs/features/{{FEATURE_NAME}}/tasks.md
11
-
12
- ````
10
+ ```
13
11
 
14
12
  ## Orchestrator Checkpoint
15
13
 
16
- > **🛑 Before starting**: This command involves planning, implementation, testing, and review.
17
- > Use the **orchestrator-first** flow. Delegate to the **Feature Builder** coordinator or use
18
- > the `subagent-driven-development` skill to dispatch a fresh subagent per task.
19
- > 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.
20
18
 
21
19
  ## Process
22
20
 
23
21
  1. **Load Feature Context**:
24
- - Read specification from `apps/{{APP_NAME}}/docs/features/{{ISSUE_ID}}-{{FEATURE_NAME}}/spec.md`
25
- - Read implementation plan from `apps/{{APP_NAME}}/docs/features/{{ISSUE_ID}}-{{FEATURE_NAME}}/plan.md`
26
- - Read task list from `apps/{{APP_NAME}}/docs/features/{{ISSUE_ID}}-{{FEATURE_NAME}}/tasks.md`
27
- - Review `AGENTS.md` for project patterns
22
+ - The supplied feature text or task list is the requirement. Do not require a spec or plan first.
23
+ - If `apps/{{APP_NAME}}/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.
24
+ - Review `AGENTS.md` for project patterns.
25
+ - Turn every requirement of the feature into an acceptance criterion and discover the real checks, as in [implement.md](implement.md) step 1.
26
+ - Preserve the original full-feature text, acceptance criteria, and real checks separately for aggregate feature review; task-local inputs must not overwrite them.
28
27
 
29
28
  2. **Parallelization Analysis**:
30
29
  - Scan task list for `[P]` markers and independent tasks
31
30
  - Group tasks by domain (backend, frontend, docs, tests)
32
- - Tasks that touch **different files with no shared state** → dispatch in parallel
31
+ - Tasks that touch **different files with no shared state** → run their loops in parallel
33
32
  - Tasks with dependencies or shared files → keep sequential
34
33
  - Use `dispatching-parallel-agents` skill when 3+ independent tasks exist
35
34
 
36
- 3. **Create Feature Branch**:
35
+ 3. **Create Feature Branch** (before any build):
36
+
37
37
  ```bash
38
38
  git checkout -b feature/{{FEATURE_NAME}}
39
39
  git pull origin {{DEFAULT_BRANCH}}
40
- ````
40
+ ```
41
41
 
42
- 4. **Task Implementation** (sequential or parallel per analysis):
42
+ Then take the baseline snapshot as in implement.md step 1, before any build.
43
43
 
44
- For tasks with dependencies, execute in order.
45
- For `[P]` tasks with no shared state, **dispatch parallel subagents** — one per task domain:
44
+ 4. **Task Implementation** (sequential or parallel per analysis):
46
45
 
47
- For each task:
46
+ For each task, in dependency order:
48
47
 
49
48
  a. **Mark Task In Progress**
50
49
 
51
50
  b. **Research & Understand**:
52
-
53
51
  - Search codebase for similar patterns
54
52
  - Review referenced files
55
53
  - Understand dependencies
54
+ - 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
55
 
57
- c. **Implement (TDD required)**:
58
-
59
- - Follow the acceptance criteria in `spec.md` for this task's deliverable
60
- - Use patterns from `AGENTS.md`
61
- - **Write a failing test first** — one behavior per test, clear name, real code
62
- - **Verify it fails** — watch it fail for the right reason (feature missing, not error)
63
- - **Write minimal code to pass** — simplest implementation, no over-engineering
64
- - **Verify it passes** — all tests green, no regressions
65
- - **Refactor** — clean up only after green (remove duplication, improve names)
66
- - Ensure type safety
67
- - See `test-driven-development/SKILL.md` for the full cycle
68
-
69
- d. **Validate**:
56
+ c. **Delivery loop for the task** (implement.md steps 2–5):
57
+ - 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 in its app or package.
58
+ - Orchestrator: verify the checks yourself, dispatch the independent read-only reviewer, then decide.
59
+ - Repair goes back to the builder. Repeat until the task is accepted or blocked. Do not commit or tick the task before acceptance.
70
60
 
71
- - Run type checking: `{{PACKAGE_MANAGER}} run check-types`
72
- - Run linter: `{{PACKAGE_MANAGER}} run lint`
73
- - Run tests: `{{PACKAGE_MANAGER}} run test`
74
- - Build: `{{PACKAGE_MANAGER}} run build`
75
-
76
- e. **Commit Changes**:
61
+ 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.
77
62
 
78
63
  ```bash
79
64
  git commit -m "feat({{SCOPE}}): {{DESCRIPTION}}"
80
65
  ```
81
66
 
82
- f. **Mark Task Complete**:
67
+ e. **Mark Task Complete** (after the commit):
83
68
  - Slim `tasks.md`: tick `- [x]` on the task's line
84
69
  - 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
85
70
 
86
- 5. **Post-Implementation Review**:
87
- - Dispatch **Reviewer** agent on all changes before proceeding
88
- - If reviewer requests changes, route back to the original domain specialist
89
- - Use `verification-before-completion` skill for final quality gate
90
-
91
- 6. **Create Pull Request**:
92
-
93
- After all tasks complete:
71
+ 5. **Feature Review** (aggregate loop, every round):
72
+ - Restore the saved full-feature text, acceptance criteria, and real checks as the inputs for aggregate verification, independent review, and acceptance.
73
+ - Run implement.md steps 3, 4 and 5 for the **whole feature**, against every requirement from step 1, not only the last task.
74
+ - 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.
75
+ - Repairs go to the builder that owns each file, uncommitted. Then run steps 3–5 again on the current tree.
76
+ - 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.
94
77
 
95
- a. **Final Validation**:
78
+ 6. **Create Pull Request** (only after the feature review is accepted):
96
79
 
97
- - All tests passing
98
- - No type errors
99
- - No linter errors
100
- - Build successful
80
+ a. **Final Validation**: the accepted verify results from step 5 (every required check ran and passed).
101
81
 
102
- b. **Push and Create PR**:
82
+ 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.
103
83
 
104
84
  ```bash
85
+ git commit -m "feat({{SCOPE}}): {{DESCRIPTION}}" # only when there are uncommitted accepted changes
105
86
  git push -u origin feature/{{FEATURE_NAME}}
106
87
  ```
107
88
 
108
89
  - Create PR targeting `{{DEFAULT_BRANCH}}`
109
- - Include feature summary and testing notes
90
+ - Include feature summary, the AC evidence, and testing notes
110
91
 
111
92
  7. **Report Status**:
112
- - Completed tasks count
113
- - PR URL
114
- - Ready for code review
93
+ - Tasks accepted (count) and any task blocked or awaiting a user decision
94
+ - Feature review verdict and `ACCEPTED` or `BLOCKED` / `NOT ACCEPTED` with the open items
95
+ - PR URL, only when accepted
115
96
 
116
97
  ## Guidelines
117
98
 
@@ -5,18 +5,18 @@ Implement bug fixes and corrections with proper validation and documentation.
5
5
  ## Usage
6
6
 
7
7
  ```
8
-
9
8
  /implement-fixes {{ISSUE_KEY}}-456
10
9
  /implement-fixes "Fix authentication timeout issue"
11
-
12
- ````
10
+ ```
13
11
 
14
12
  ## Orchestrator Checkpoint
15
13
 
16
- > **🛑 For multiple independent fixes**: If fixing 2+ unrelated bugs, use `dispatching-parallel-agents`
17
- > to dispatch one subagent per bug (different root causes, different files = parallel-safe).
18
- > For a single focused fix, proceed directly — single-agent is appropriate.
19
- > 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.
20
20
 
21
21
  ## Workflow Modes
22
22
 
@@ -25,60 +25,51 @@ Implement bug fixes and corrections with proper validation and documentation.
25
25
 
26
26
  ## Process
27
27
 
28
- 1. **Load Fix Context**:
28
+ 1. **Load Fix Context** (orchestrator, before any build):
29
29
  - Retrieve issue details if applicable
30
- - Understand the reported bug
31
- - Identify affected code areas
30
+ - The reported bug and any stated expected behavior are the requirement. Do not require a spec or plan first.
31
+ - Identify the affected code areas
32
+ - 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.
33
+
34
+ 2. **Create Fix Branch and Capture Baseline** (orchestrator, before any build):
32
35
 
33
- 2. **Create Fix Branch**:
34
36
  ```bash
35
37
  git checkout {{DEFAULT_BRANCH}}
36
38
  git pull origin {{DEFAULT_BRANCH}}
37
39
  git checkout -b fix/{{FIX_DESCRIPTION}}
38
- ````
39
-
40
- 3. **Reproduce & Test (TDD required)**:
41
-
42
- - Identify root cause
43
- - **Write a failing test that reproduces the bug** — this proves you understand the issue
44
- - **Verify it fails** — watch it fail for the right reason
45
- - See `test-driven-development/SKILL.md` for the bug fix workflow
46
-
47
- 4. **Implement Fix**:
48
-
49
- - Write minimal code to make the failing test pass
50
- - Fix only the reported issue
51
- - Maintain backward compatibility
52
- - **Verify all tests pass** — run the full suite, no regressions
40
+ ```
53
41
 
54
- 5. **Validate Fix**:
42
+ Then take the baseline snapshot as in implement.md step 1, before any build.
55
43
 
56
- - Run type checking: `{{PACKAGE_MANAGER}} run check-types`
57
- - Run tests: `{{PACKAGE_MANAGER}} run test`
58
- - Build: `{{PACKAGE_MANAGER}} run build`
59
- - Verify fix resolves the issue
60
- - Check for regressions
44
+ 3. **Reproduce and Build** (builder, implement.md step 2):
45
+ - Dispatch one builder with the bug report, the AC list, the discovered checks, the base commit and the baseline.
46
+ - 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.
47
+ - Fix only the reported issue. Maintain backward compatibility. Leave all changes uncommitted, including new files.
61
48
 
62
- 6. **Commit and Push**:
49
+ 4. **Verify, Review and Decide** (repeat implement.md steps 3, 4 and 5 until an exit):
50
+ - 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.
51
+ - Review: the independent read-only reviewer checks the fix, the reproducing test, and the untracked files.
52
+ - 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.
63
53
 
54
+ 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.
64
55
  ```bash
65
56
  git commit -m "fix({{SCOPE}}): {{FIX_DESCRIPTION}}"
66
57
  git push -u origin fix/{{FIX_DESCRIPTION}}
67
58
  ```
68
59
 
69
- 7. **Create Pull Request**:
70
-
60
+ 6. **Create Pull Request** (only after `ACCEPTED`):
71
61
  - Target: `{{DEFAULT_BRANCH}}`
72
62
  - Include:
73
63
  - Root cause explanation
74
64
  - Fix approach description
75
- - Testing performed
65
+ - Testing performed, with the reproducing test and its failing-then-passing output
76
66
  - Potential impacts
77
67
 
78
- 8. **Report Status**:
68
+ 7. **Report Status**:
79
69
  - Bug fixed and root cause
80
- - Validation completed
81
- - PR ready for review
70
+ - Review verdict and `ACCEPTED`, or `BLOCKED` / `NOT ACCEPTED` with the open items
71
+ - Validation evidence per AC
72
+ - PR ready for review (only when accepted)
82
73
 
83
74
  **Include a Fixes Applied table** summarizing every change:
84
75
 
@@ -104,7 +95,7 @@ Implement bug fixes and corrections with proper validation and documentation.
104
95
  - **Minimal Scope**: Fix only the reported issue
105
96
  - **No Refactoring**: Avoid unrelated code changes
106
97
  - **Backward Compatible**: Don't break existing functionality
107
- - **Test First**: Write a failing test reproducing the bug before writing the fix — no exceptions
98
+ - **Test First**: The builder writes a failing test reproducing the bug before writing the fix — no exceptions
108
99
  - **Document**: Record the fix in changelog if significant
109
100
 
110
101
  ## Documentation