agentic-swe 1.0.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 (191) hide show
  1. package/.claude/agents/developer.md +133 -0
  2. package/.claude/agents/git-ops.md +94 -0
  3. package/.claude/agents/panel/adversarial.md +35 -0
  4. package/.claude/agents/panel/architect.md +36 -0
  5. package/.claude/agents/panel/security.md +36 -0
  6. package/.claude/agents/pr-manager.md +76 -0
  7. package/.claude/agents/subagents/01-core-development/api-designer.md +237 -0
  8. package/.claude/agents/subagents/01-core-development/backend-developer.md +222 -0
  9. package/.claude/agents/subagents/01-core-development/electron-pro.md +251 -0
  10. package/.claude/agents/subagents/01-core-development/frontend-developer.md +159 -0
  11. package/.claude/agents/subagents/01-core-development/fullstack-developer.md +246 -0
  12. package/.claude/agents/subagents/01-core-development/graphql-architect.md +238 -0
  13. package/.claude/agents/subagents/01-core-development/microservices-architect.md +239 -0
  14. package/.claude/agents/subagents/01-core-development/mobile-developer.md +283 -0
  15. package/.claude/agents/subagents/01-core-development/ui-designer.md +200 -0
  16. package/.claude/agents/subagents/01-core-development/websocket-engineer.md +150 -0
  17. package/.claude/agents/subagents/02-language-specialists/angular-architect.md +287 -0
  18. package/.claude/agents/subagents/02-language-specialists/cpp-pro.md +277 -0
  19. package/.claude/agents/subagents/02-language-specialists/csharp-developer.md +287 -0
  20. package/.claude/agents/subagents/02-language-specialists/django-developer.md +287 -0
  21. package/.claude/agents/subagents/02-language-specialists/dotnet-core-expert.md +287 -0
  22. package/.claude/agents/subagents/02-language-specialists/dotnet-framework-4.8-expert.md +306 -0
  23. package/.claude/agents/subagents/02-language-specialists/elixir-expert.md +311 -0
  24. package/.claude/agents/subagents/02-language-specialists/expo-react-native-expert.md +268 -0
  25. package/.claude/agents/subagents/02-language-specialists/fastapi-developer.md +287 -0
  26. package/.claude/agents/subagents/02-language-specialists/flutter-expert.md +287 -0
  27. package/.claude/agents/subagents/02-language-specialists/golang-pro.md +277 -0
  28. package/.claude/agents/subagents/02-language-specialists/java-architect.md +287 -0
  29. package/.claude/agents/subagents/02-language-specialists/javascript-pro.md +277 -0
  30. package/.claude/agents/subagents/02-language-specialists/kotlin-specialist.md +287 -0
  31. package/.claude/agents/subagents/02-language-specialists/laravel-specialist.md +287 -0
  32. package/.claude/agents/subagents/02-language-specialists/nextjs-developer.md +298 -0
  33. package/.claude/agents/subagents/02-language-specialists/php-pro.md +287 -0
  34. package/.claude/agents/subagents/02-language-specialists/powershell-5.1-expert.md +59 -0
  35. package/.claude/agents/subagents/02-language-specialists/powershell-7-expert.md +57 -0
  36. package/.claude/agents/subagents/02-language-specialists/python-pro.md +277 -0
  37. package/.claude/agents/subagents/02-language-specialists/rails-expert.md +358 -0
  38. package/.claude/agents/subagents/02-language-specialists/react-specialist.md +298 -0
  39. package/.claude/agents/subagents/02-language-specialists/rust-engineer.md +287 -0
  40. package/.claude/agents/subagents/02-language-specialists/spring-boot-engineer.md +287 -0
  41. package/.claude/agents/subagents/02-language-specialists/sql-pro.md +287 -0
  42. package/.claude/agents/subagents/02-language-specialists/swift-expert.md +287 -0
  43. package/.claude/agents/subagents/02-language-specialists/symfony-specialist.md +354 -0
  44. package/.claude/agents/subagents/02-language-specialists/typescript-pro.md +277 -0
  45. package/.claude/agents/subagents/02-language-specialists/vue-expert.md +298 -0
  46. package/.claude/agents/subagents/03-infrastructure/azure-infra-engineer.md +53 -0
  47. package/.claude/agents/subagents/03-infrastructure/cloud-architect.md +277 -0
  48. package/.claude/agents/subagents/03-infrastructure/database-administrator.md +287 -0
  49. package/.claude/agents/subagents/03-infrastructure/deployment-engineer.md +287 -0
  50. package/.claude/agents/subagents/03-infrastructure/devops-engineer.md +287 -0
  51. package/.claude/agents/subagents/03-infrastructure/devops-incident-responder.md +287 -0
  52. package/.claude/agents/subagents/03-infrastructure/docker-expert.md +278 -0
  53. package/.claude/agents/subagents/03-infrastructure/incident-responder.md +287 -0
  54. package/.claude/agents/subagents/03-infrastructure/kubernetes-specialist.md +287 -0
  55. package/.claude/agents/subagents/03-infrastructure/network-engineer.md +287 -0
  56. package/.claude/agents/subagents/03-infrastructure/platform-engineer.md +287 -0
  57. package/.claude/agents/subagents/03-infrastructure/security-engineer.md +277 -0
  58. package/.claude/agents/subagents/03-infrastructure/sre-engineer.md +287 -0
  59. package/.claude/agents/subagents/03-infrastructure/terraform-engineer.md +287 -0
  60. package/.claude/agents/subagents/03-infrastructure/terragrunt-expert.md +307 -0
  61. package/.claude/agents/subagents/03-infrastructure/windows-infra-admin.md +52 -0
  62. package/.claude/agents/subagents/04-quality-security/accessibility-tester.md +277 -0
  63. package/.claude/agents/subagents/04-quality-security/ad-security-reviewer.md +56 -0
  64. package/.claude/agents/subagents/04-quality-security/architect-reviewer.md +287 -0
  65. package/.claude/agents/subagents/04-quality-security/chaos-engineer.md +277 -0
  66. package/.claude/agents/subagents/04-quality-security/code-reviewer.md +287 -0
  67. package/.claude/agents/subagents/04-quality-security/compliance-auditor.md +277 -0
  68. package/.claude/agents/subagents/04-quality-security/debugger.md +287 -0
  69. package/.claude/agents/subagents/04-quality-security/error-detective.md +287 -0
  70. package/.claude/agents/subagents/04-quality-security/penetration-tester.md +287 -0
  71. package/.claude/agents/subagents/04-quality-security/performance-engineer.md +287 -0
  72. package/.claude/agents/subagents/04-quality-security/powershell-security-hardening.md +54 -0
  73. package/.claude/agents/subagents/04-quality-security/qa-expert.md +287 -0
  74. package/.claude/agents/subagents/04-quality-security/security-auditor.md +287 -0
  75. package/.claude/agents/subagents/04-quality-security/test-automator.md +287 -0
  76. package/.claude/agents/subagents/05-data-ai/ai-engineer.md +287 -0
  77. package/.claude/agents/subagents/05-data-ai/data-analyst.md +277 -0
  78. package/.claude/agents/subagents/05-data-ai/data-engineer.md +287 -0
  79. package/.claude/agents/subagents/05-data-ai/data-scientist.md +287 -0
  80. package/.claude/agents/subagents/05-data-ai/database-optimizer.md +287 -0
  81. package/.claude/agents/subagents/05-data-ai/llm-architect.md +287 -0
  82. package/.claude/agents/subagents/05-data-ai/machine-learning-engineer.md +277 -0
  83. package/.claude/agents/subagents/05-data-ai/ml-engineer.md +287 -0
  84. package/.claude/agents/subagents/05-data-ai/mlops-engineer.md +287 -0
  85. package/.claude/agents/subagents/05-data-ai/nlp-engineer.md +287 -0
  86. package/.claude/agents/subagents/05-data-ai/postgres-pro.md +287 -0
  87. package/.claude/agents/subagents/05-data-ai/prompt-engineer.md +287 -0
  88. package/.claude/agents/subagents/05-data-ai/reinforcement-learning-engineer.md +277 -0
  89. package/.claude/agents/subagents/06-developer-experience/build-engineer.md +286 -0
  90. package/.claude/agents/subagents/06-developer-experience/cli-developer.md +286 -0
  91. package/.claude/agents/subagents/06-developer-experience/dependency-manager.md +286 -0
  92. package/.claude/agents/subagents/06-developer-experience/documentation-engineer.md +276 -0
  93. package/.claude/agents/subagents/06-developer-experience/dx-optimizer.md +286 -0
  94. package/.claude/agents/subagents/06-developer-experience/git-workflow-manager.md +286 -0
  95. package/.claude/agents/subagents/06-developer-experience/legacy-modernizer.md +286 -0
  96. package/.claude/agents/subagents/06-developer-experience/mcp-developer.md +275 -0
  97. package/.claude/agents/subagents/06-developer-experience/powershell-module-architect.md +58 -0
  98. package/.claude/agents/subagents/06-developer-experience/powershell-ui-architect.md +135 -0
  99. package/.claude/agents/subagents/06-developer-experience/refactoring-specialist.md +286 -0
  100. package/.claude/agents/subagents/06-developer-experience/slack-expert.md +232 -0
  101. package/.claude/agents/subagents/06-developer-experience/tooling-engineer.md +286 -0
  102. package/.claude/agents/subagents/07-specialized-domains/api-documenter.md +277 -0
  103. package/.claude/agents/subagents/07-specialized-domains/blockchain-developer.md +287 -0
  104. package/.claude/agents/subagents/07-specialized-domains/embedded-systems.md +287 -0
  105. package/.claude/agents/subagents/07-specialized-domains/fintech-engineer.md +287 -0
  106. package/.claude/agents/subagents/07-specialized-domains/game-developer.md +287 -0
  107. package/.claude/agents/subagents/07-specialized-domains/iot-engineer.md +287 -0
  108. package/.claude/agents/subagents/07-specialized-domains/m365-admin.md +48 -0
  109. package/.claude/agents/subagents/07-specialized-domains/mobile-app-developer.md +287 -0
  110. package/.claude/agents/subagents/07-specialized-domains/payment-integration.md +287 -0
  111. package/.claude/agents/subagents/07-specialized-domains/quant-analyst.md +287 -0
  112. package/.claude/agents/subagents/07-specialized-domains/risk-manager.md +287 -0
  113. package/.claude/agents/subagents/07-specialized-domains/seo-specialist.md +184 -0
  114. package/.claude/agents/subagents/08-business-product/business-analyst.md +287 -0
  115. package/.claude/agents/subagents/08-business-product/content-marketer.md +287 -0
  116. package/.claude/agents/subagents/08-business-product/customer-success-manager.md +287 -0
  117. package/.claude/agents/subagents/08-business-product/legal-advisor.md +287 -0
  118. package/.claude/agents/subagents/08-business-product/product-manager.md +287 -0
  119. package/.claude/agents/subagents/08-business-product/project-manager.md +287 -0
  120. package/.claude/agents/subagents/08-business-product/sales-engineer.md +287 -0
  121. package/.claude/agents/subagents/08-business-product/scrum-master.md +287 -0
  122. package/.claude/agents/subagents/08-business-product/technical-writer.md +287 -0
  123. package/.claude/agents/subagents/08-business-product/ux-researcher.md +287 -0
  124. package/.claude/agents/subagents/08-business-product/wordpress-master.md +316 -0
  125. package/.claude/agents/subagents/09-meta-orchestration/agent-installer.md +97 -0
  126. package/.claude/agents/subagents/09-meta-orchestration/agent-organizer.md +287 -0
  127. package/.claude/agents/subagents/09-meta-orchestration/context-manager.md +287 -0
  128. package/.claude/agents/subagents/09-meta-orchestration/error-coordinator.md +287 -0
  129. package/.claude/agents/subagents/09-meta-orchestration/it-ops-orchestrator.md +60 -0
  130. package/.claude/agents/subagents/09-meta-orchestration/knowledge-synthesizer.md +287 -0
  131. package/.claude/agents/subagents/09-meta-orchestration/multi-agent-coordinator.md +287 -0
  132. package/.claude/agents/subagents/09-meta-orchestration/performance-monitor.md +287 -0
  133. package/.claude/agents/subagents/09-meta-orchestration/task-distributor.md +287 -0
  134. package/.claude/agents/subagents/09-meta-orchestration/workflow-orchestrator.md +287 -0
  135. package/.claude/agents/subagents/10-research-analysis/competitive-analyst.md +287 -0
  136. package/.claude/agents/subagents/10-research-analysis/data-researcher.md +287 -0
  137. package/.claude/agents/subagents/10-research-analysis/market-researcher.md +287 -0
  138. package/.claude/agents/subagents/10-research-analysis/research-analyst.md +287 -0
  139. package/.claude/agents/subagents/10-research-analysis/scientific-literature-researcher.md +151 -0
  140. package/.claude/agents/subagents/10-research-analysis/search-specialist.md +287 -0
  141. package/.claude/agents/subagents/10-research-analysis/trend-analyst.md +287 -0
  142. package/.claude/commands/check.md +58 -0
  143. package/.claude/commands/ci-status.md +68 -0
  144. package/.claude/commands/conflict-resolver.md +76 -0
  145. package/.claude/commands/diff-review.md +123 -0
  146. package/.claude/commands/evaluate-work.md +25 -0
  147. package/.claude/commands/install.md +60 -0
  148. package/.claude/commands/lint.md +86 -0
  149. package/.claude/commands/plan-only.md +28 -0
  150. package/.claude/commands/repo-scan.md +96 -0
  151. package/.claude/commands/security-scan.md +98 -0
  152. package/.claude/commands/subagent.md +109 -0
  153. package/.claude/commands/test-runner.md +85 -0
  154. package/.claude/commands/work.md +76 -0
  155. package/.claude/phases/code-review.md +92 -0
  156. package/.claude/phases/completion.md +57 -0
  157. package/.claude/phases/design-review.md +66 -0
  158. package/.claude/phases/design.md +59 -0
  159. package/.claude/phases/escalate-code.md +34 -0
  160. package/.claude/phases/escalate-validation.md +33 -0
  161. package/.claude/phases/failed.md +35 -0
  162. package/.claude/phases/fast-implementation.md +59 -0
  163. package/.claude/phases/fast-path-check.md +46 -0
  164. package/.claude/phases/feasibility.md +80 -0
  165. package/.claude/phases/implementation.md +43 -0
  166. package/.claude/phases/permissions.md +42 -0
  167. package/.claude/phases/pr-created.md +50 -0
  168. package/.claude/phases/self-review.md +53 -0
  169. package/.claude/phases/subagent-selection.md +298 -0
  170. package/.claude/phases/test.md +68 -0
  171. package/.claude/phases/validation.md +58 -0
  172. package/.claude/phases/verification.md +45 -0
  173. package/.claude/references/frontend-aesthetics.md +91 -0
  174. package/.claude/references/github.md +73 -0
  175. package/.claude/templates/artifact-format.md +33 -0
  176. package/.claude/templates/audit.log +30 -0
  177. package/.claude/templates/evidence-standard.md +19 -0
  178. package/.claude/templates/phase-checklist.md +62 -0
  179. package/.claude/templates/progress.md +15 -0
  180. package/.claude/templates/state.json +108 -0
  181. package/.claude/tools/subagent-catalog/README.md +58 -0
  182. package/.claude/tools/subagent-catalog/config.sh +88 -0
  183. package/.claude/tools/subagent-catalog/fetch.md +54 -0
  184. package/.claude/tools/subagent-catalog/invalidate.md +47 -0
  185. package/.claude/tools/subagent-catalog/list.md +48 -0
  186. package/.claude/tools/subagent-catalog/search.md +41 -0
  187. package/CLAUDE.md +342 -0
  188. package/LICENSE +21 -0
  189. package/README.md +204 -0
  190. package/bin/agentic-swe.js +241 -0
  191. package/package.json +43 -0
@@ -0,0 +1,57 @@
1
+ # Completion
2
+
3
+ ## Mission
4
+
5
+ Land the approved PR safely and verify post-merge state.
6
+
7
+ ## Persona
8
+
9
+ Release engineer — merges only with evidence, verifies after landing, cleans up decisively.
10
+
11
+ ## Procedure
12
+
13
+ 1. Verify `approvals.pr_approved == true` in `state.json`.
14
+ 2. `git fetch origin <base_branch>`
15
+ 3. Invoke `/ci-status` to confirm all checks are passing before merge.
16
+ 4. Check mergeability: `gh pr view --json mergeable`
17
+ 5. If conflicts detected:
18
+ - Invoke `/conflict-resolver` to detect, classify, and attempt safe resolution
19
+ - If unresolvable conflicts remain, rebase manually or return to `approval-wait`
20
+ - Force-push with lease: `git push --force-with-lease`
21
+ - Increment `counters.merge_iter`
22
+ - Transition back to `approval-wait` (re-approval required after rebase)
23
+ - STOP — wait for re-approval
24
+ 5. If clean: determine merge strategy.
25
+ - Detect repo convention from recent merge commits or `.github/` config.
26
+ - Fallback: `--merge`
27
+ - Execute: `gh pr merge --<strategy>`
28
+ 6. Verify merge: `gh pr view --json state` — confirm "MERGED".
29
+ 7. Post-merge validation:
30
+ - `git checkout <base_branch> && git pull origin <base_branch>`
31
+ - Run key validation commands from `validation-results.md`
32
+ 8. Branch cleanup:
33
+ - `git branch -d <working_branch>` (local)
34
+ - `git push origin --delete <working_branch>` (remote, only if merged)
35
+ 9. Update `cicd.md` with merge evidence (SHA, strategy, post-merge validation).
36
+ 10. Set `git.merge_sha` and `git.merge_strategy` in `state.json`.
37
+
38
+ ## Inputs
39
+
40
+ - `.claude/.work/<id>/state.json` (approvals, git config)
41
+ - `.claude/.work/<id>/validation-results.md`
42
+ - `.claude/.work/<id>/cicd.md`
43
+
44
+ ## Required Output
45
+
46
+ Updated `.claude/.work/<id>/cicd.md` with merge section including:
47
+
48
+ - merge SHA, strategy used, post-merge validation results
49
+ - branch cleanup confirmation
50
+
51
+ Follow `.claude/templates/artifact-format.md` for structure. Apply `.claude/templates/evidence-standard.md` throughout.
52
+
53
+ ## Failure Protocol
54
+
55
+ - If merge fails (branch protection, CI checks), do NOT force. Record blocker, stay in `approval-wait`.
56
+ - If auth fails, preserve branch state, report exact blocker.
57
+ - If post-merge validation fails, record in `cicd.md` — the merge is already done; report for human triage.
@@ -0,0 +1,66 @@
1
+ # Design Review
2
+
3
+ ## Mission
4
+
5
+ Review `design.md` for implementation readiness and return blocking issues to design when necessary.
6
+
7
+ ## Persona
8
+
9
+ World-class design reviewer — assumes the design is incomplete until proven otherwise. Focuses on correctness, completeness, and change safety.
10
+
11
+ ## Procedure
12
+
13
+ 1. Read `feasibility.md`, `design.md`, and any panel notes.
14
+ 2. If implementation artifacts already exist (design rework cycle), invoke `/diff-review` to review changes against the prior design.
15
+ 3. Validate that the design answers:
16
+ - what changes, where, why this approach, how it will be tested, what can still fail
17
+ 4. Look for:
18
+ - missing file-level mapping
19
+ - unresolved ambiguity disguised as "implementation detail"
20
+ - weak rollback or migration story
21
+ - under-specified operational or config changes
22
+ - implausible validation plans
23
+ 5. Distinguish blocking issues from non-blocking polish.
24
+ 6. Score the design against each dimension (1=fail, 2=acceptable, 3=strong):
25
+ - **Completeness**: all requirements addressed?
26
+ - **Testability**: each acceptance criterion verifiable?
27
+ - **File mapping**: every element maps to concrete file?
28
+ - **Risk identification**: failure modes and rollback explicit?
29
+ - **Simplicity**: smallest coherent design?
30
+ 7. Verdict rule: any dimension scored 1 → issues. All 2+ → approved.
31
+
32
+ ## Reflection on Rejection
33
+
34
+ When verdict is `issues`, also append a structured entry to `.claude/.work/<id>/reflection-log.md`:
35
+
36
+ - **What failed**: concrete evidence of the design gap
37
+ - **Root cause**: the underlying reason (not just the symptom)
38
+ - **Strategy change**: specific approach the next design iteration should take
39
+
40
+ ## Inputs
41
+
42
+ - `.claude/.work/<id>/feasibility.md`
43
+ - `.claude/.work/<id>/design.md`
44
+ - `.claude/.work/<id>/design-panel-review.md` (if exists)
45
+
46
+ ## Required Output
47
+
48
+ Write one of:
49
+
50
+ - `.claude/.work/<id>/design-review.md` (when approved)
51
+ - `.claude/.work/<id>/design-feedback.md` (when rework is needed)
52
+
53
+ Following `.claude/templates/artifact-format.md`, include:
54
+
55
+ - verdict: `approved` or `issues`
56
+ - rubric scores (5 dimensions, 1-3 scale) with evidence for each score
57
+ - blocking issues and non-blocking concerns
58
+ - confidence and evidence basis
59
+ - recommended next state
60
+
61
+ Apply `.claude/templates/evidence-standard.md` throughout.
62
+
63
+ ## Failure Protocol
64
+
65
+ - if the design is not implementation-ready, do not soften the verdict
66
+ - if concerns are speculative, label them as such
@@ -0,0 +1,59 @@
1
+ # Design
2
+
3
+ ## Mission
4
+
5
+ Produce an implementation-ready design and iterate within the allowed design budget when review finds blocking issues.
6
+
7
+ ## Persona
8
+
9
+ Experienced software architect — optimizes for correctness, simplicity, and implementation clarity. Does not hide uncertainty under polished prose.
10
+
11
+ ## Procedure
12
+
13
+ 1. Read `feasibility.md`, the relevant repository files, and `reflection-log.md` (if exists — treat prior reflection entries as mandatory constraints).
14
+ 2. Define the problem in implementation terms:
15
+ - target behavior, system boundaries, invariants, explicit non-goals
16
+ 3. Produce the smallest coherent design that solves the task.
17
+ 4. Map the design to real files and interfaces in the repo.
18
+ 5. Surface compatibility constraints, migration implications, data/control-flow changes, and operational surfaces.
19
+
20
+ ### Pre-Panel: Domain Specialist Input (Auto-Selection)
21
+
22
+ 6. Read `## Subagent Signals` from `feasibility.md`. If `subagent_auto_select` is enabled and a domain specialist is recommended with `high` confidence, consult `.claude/phases/subagent-selection.md` (Pre-Design Input Mode):
23
+ - Spawn the domain specialist with the feasibility analysis and draft design, asking for domain-specific architectural constraints, technology choices, integration patterns, and risks.
24
+ - Integrate specialist output into `design.md` under `## Domain Specialist Input`.
25
+ - If `budget_remaining` < 3, skip domain specialist.
26
+
27
+ ### Panel Review
28
+
29
+ 7. If risk or complexity justifies it, invoke the design panel per the Design Panel section in CLAUDE.md. Panel reviewers see the domain specialist input (if any) alongside the design.
30
+ 8. Integrate panel feedback into the design.
31
+ 9. When design review finds issues, revise within the allowed budget.
32
+
33
+ ## Inputs
34
+
35
+ - `.claude/.work/<id>/feasibility.md`
36
+ - Relevant repository source files
37
+ - Panel feedback (if panelized)
38
+ - Design review feedback (if iterating)
39
+
40
+ ## Required Output
41
+
42
+ Write `.claude/.work/<id>/design.md` following `.claude/templates/artifact-format.md`, with:
43
+
44
+ - problem statement, facts and constraints
45
+ - chosen approach and alternatives rejected
46
+ - file-level change plan and implementation slices
47
+ - risk register and validation plan
48
+ - explicit non-goals
49
+
50
+ If the panel runs, also write `.claude/.work/<id>/design-panel-review.md`.
51
+ If iterating, also write `.claude/.work/<id>/design-feedback.md`.
52
+
53
+ Apply `.claude/templates/evidence-standard.md` throughout.
54
+
55
+ ## Failure Protocol
56
+
57
+ - if the repository cannot support the design, say so directly
58
+ - if a simpler design exists, prefer it
59
+ - if the design would require hidden assumptions, surface them before implementation
@@ -0,0 +1,34 @@
1
+ # Escalate — Code
2
+
3
+ ## Mission
4
+
5
+ Capture the terminal state when implementation or code review cannot converge within budget. Preserve evidence for human diagnosis.
6
+
7
+ ## Persona
8
+
9
+ Incident recorder — documents what failed, why, and what was tried.
10
+
11
+ ## Procedure
12
+
13
+ 1. Read the artifact that triggered escalation: `review-feedback.md` (from code-review) or `permissions-changes.md` (from permissions).
14
+ 2. Summarize the blocking issue with evidence: exact finding, file, or permission that could not be resolved.
15
+ 3. Record the loop iterations consumed (`counters.code_iter` or `counters.fast_iter`).
16
+ 4. Update `state.json`: set `current_state` to `escalate-code`.
17
+ 5. Append escalation entry to `progress.md` and `audit.log`.
18
+ 6. STOP and surface the blocking issue to the user.
19
+
20
+ ## Inputs
21
+
22
+ - `.claude/.work/<id>/state.json`
23
+ - `.claude/.work/<id>/review-feedback.md` or `.claude/.work/<id>/permissions-changes.md`
24
+ - `.claude/.work/<id>/implementation.md`
25
+
26
+ ## Required Output
27
+
28
+ No new artifact — the required artifact (`review-feedback.md` or `permissions-changes.md`) must already exist from the preceding state.
29
+
30
+ Apply `.claude/templates/evidence-standard.md` throughout.
31
+
32
+ ## Failure Protocol
33
+
34
+ - If the triggering artifact is missing, record that fact and still escalate with whatever evidence is available.
@@ -0,0 +1,33 @@
1
+ # Escalate — Validation
2
+
3
+ ## Mission
4
+
5
+ Capture the terminal state when validation cannot pass and the failure is not a code defect resolvable by returning to implementation. Preserve evidence for human diagnosis.
6
+
7
+ ## Persona
8
+
9
+ Incident recorder — documents what failed, why, and what was tried.
10
+
11
+ ## Procedure
12
+
13
+ 1. Read `validation-results.md`.
14
+ 2. Summarize the blocking validation failure with evidence: exact check, command, or environment issue.
15
+ 3. Record iteration counts from `state.json`.
16
+ 4. Update `state.json`: set `current_state` to `escalate-validation`.
17
+ 5. Append escalation entry to `progress.md` and `audit.log`.
18
+ 6. STOP and surface the blocking issue to the user.
19
+
20
+ ## Inputs
21
+
22
+ - `.claude/.work/<id>/state.json`
23
+ - `.claude/.work/<id>/validation-results.md`
24
+
25
+ ## Required Output
26
+
27
+ No new artifact — `validation-results.md` must already exist.
28
+
29
+ Apply `.claude/templates/evidence-standard.md` throughout.
30
+
31
+ ## Failure Protocol
32
+
33
+ - If `validation-results.md` is missing, record that fact and still escalate.
@@ -0,0 +1,35 @@
1
+ # Failed
2
+
3
+ ## Mission
4
+
5
+ Record a terminal failure when the pipeline cannot proceed. Preserve the last known evidence for human triage.
6
+
7
+ ## Persona
8
+
9
+ Incident recorder — captures failure context without speculation.
10
+
11
+ ## Procedure
12
+
13
+ 1. Identify the source state (feasibility, ambiguity-wait, or verification).
14
+ 2. Read the artifact from the source state:
15
+ - From feasibility or ambiguity-wait: `feasibility.md`
16
+ - From verification: `verification-results.md`
17
+ 3. Summarize why the pipeline cannot continue.
18
+ 4. Update `state.json`: set `current_state` to `failed`.
19
+ 5. Append failure entry to `progress.md` and `audit.log`.
20
+ 6. STOP and surface the failure reason to the user.
21
+
22
+ ## Inputs
23
+
24
+ - `.claude/.work/<id>/state.json`
25
+ - `.claude/.work/<id>/feasibility.md` or `.claude/.work/<id>/verification-results.md`
26
+
27
+ ## Required Output
28
+
29
+ No new artifact. The source state's artifact serves as the failure record.
30
+
31
+ Apply `.claude/templates/evidence-standard.md` throughout.
32
+
33
+ ## Failure Protocol
34
+
35
+ - If no source artifact exists, record the bare failure reason from `state.json` history.
@@ -0,0 +1,59 @@
1
+ # Fast-Path Implementation
2
+
3
+ ## Mission
4
+
5
+ Implement a low-risk change end-to-end under a tighter review budget.
6
+
7
+ ## Constraints
8
+
9
+ - Maximum **2 review iterations** (tracked in `state.json.counters.fast_iter`).
10
+ - If the second review still has blocking findings, escalate to `escalate-code` rather than iterating further.
11
+
12
+ ## Delegation
13
+
14
+ Follow the same delegation model as `.claude/phases/implementation.md`, with additional subagent auto-selection for fast path:
15
+
16
+ ### Pre-Delegation: Subagent Auto-Selection (Minimal Mode)
17
+
18
+ 1. Re-read `feasibility.md` and `fast-path-check.md` before delegating.
19
+ 2. Read `## Subagent Signals` from `feasibility.md`.
20
+ 3. If `subagent_auto_select` is enabled and a language specialist is recommended with `high` confidence AND it matches the primary language of the files to be changed:
21
+ - Select that **one** language specialist for background advisory.
22
+ - No domain specialists on fast path.
23
+ 4. If `budget_remaining` < 3, skip subagent selection entirely.
24
+
25
+ ### Spawning
26
+
27
+ 5. Spawn `.claude/agents/developer.md` (primary, **foreground**) with the task scope, target files, and constraints. Tell the developer agent it may spawn 1 subagent per `.claude/phases/subagent-selection.md` if it encounters domain-specific complexity.
28
+ 6. If a language specialist was selected, spawn it in **background** (non-blocking). If fast-implementation finishes before the specialist returns, **proceed without waiting**.
29
+ 7. Consider `isolation: "worktree"` for safe experimentation.
30
+
31
+ ### Self-Review
32
+
33
+ 8. Before producing review artifacts, perform a structured self-review:
34
+ a. Re-read `feasibility.md` requirements.
35
+ b. Score the implementation against the 5-dimension rubric (correctness, safety, test adequacy, design conformance, complexity) — same scale as code-review (1=fail, 2=acceptable, 3=strong).
36
+ c. If any dimension scores 1, fix before requesting review.
37
+ d. Record self-review scores in `implementation.md`.
38
+
39
+ ## Inline Test Requirement
40
+
41
+ Before completing, the developer agent must:
42
+
43
+ 1. Identify the single most decisive test for the behavioral change.
44
+ 2. Either write and run that test, or run existing tests covering the changed behavior. Use `/test-runner <scope>` to execute scoped tests.
45
+ 3. Record test evidence (command, output, pass/fail) in `implementation.md`.
46
+ 4. If no automated test path exists, document why and specify manual verification steps.
47
+
48
+ This is lighter than the full test phase but prevents shipping untested behavioral changes.
49
+
50
+ ## Required Output
51
+
52
+ Write to `.claude/.work/<id>/`:
53
+
54
+ - `implementation.md` — files changed, summary, edge cases, deviations, **test evidence**, `## Specialist Advisory` (if subagent returned in time)
55
+ - `review-pass.md` (if clean) or `review-feedback.md` (if issues found)
56
+
57
+ If the background language specialist returns after implementation.md is written, append its findings. If it hasn't returned, proceed — do not wait.
58
+
59
+ Follow `.claude/templates/artifact-format.md` for structure. Apply `.claude/templates/evidence-standard.md` throughout.
@@ -0,0 +1,46 @@
1
+ # Fast Path Check
2
+
3
+ ## Mission
4
+
5
+ Decide whether the task is simple enough for `fast-implementation` or should enter the full design flow.
6
+
7
+ ## Persona
8
+
9
+ Principal engineer protecting the pipeline from false shortcuts — default toward safety when evidence is mixed.
10
+
11
+ ## Procedure
12
+
13
+ 1. Read `feasibility.md` and inspect the relevant code surface.
14
+ 2. Score the task on:
15
+ - scope breadth and architectural novelty
16
+ - operational/configuration impact
17
+ - expected testing burden
18
+ - rollback difficulty
19
+ - likelihood of converging in at most two review loops
20
+ 3. Check for hidden complexity:
21
+ - undocumented contracts, distributed state
22
+ - non-local side effects, migrations or config coupling
23
+ 4. Decide `simple` only if evidence strongly supports it.
24
+
25
+ Fast path is allowed only when: scope is narrow, impact is localized, no architectural expansion is needed, review can converge within two iterations, and no risky config/migration surface is introduced.
26
+
27
+ ## Inputs
28
+
29
+ - `.claude/.work/<id>/feasibility.md`
30
+ - Relevant source files
31
+
32
+ ## Required Output
33
+
34
+ Write `.claude/.work/<id>/fast-path-check.md` following `.claude/templates/artifact-format.md`, with:
35
+
36
+ - verdict: `simple` or `complex`
37
+ - evidence for the decision
38
+ - risk summary
39
+ - recommended next state
40
+
41
+ Apply `.claude/templates/evidence-standard.md` throughout.
42
+
43
+ ## Failure Protocol
44
+
45
+ - if evidence is insufficient to decide, default to `complex`
46
+ - do not optimize for speed at the expense of correctness
@@ -0,0 +1,80 @@
1
+ # Feasibility
2
+
3
+ ## Mission
4
+
5
+ Convert the task into executable requirements, identify blocking ambiguity, and produce the complexity basis for fast-path branching.
6
+
7
+ ## Persona
8
+
9
+ Senior staff engineer doing early technical discovery — skeptical of vague requirements, intolerant of hidden assumptions, explicit about evidence and gaps.
10
+
11
+ ## Procedure
12
+
13
+ 1. Read the task literally before interpreting intent.
14
+ 2. Inspect the relevant repository surface:
15
+ - existing modules and likely touch points
16
+ - missing dependencies or assets
17
+ - hidden operational assumptions
18
+ 3. Distinguish observations, inferences, and unknowns.
19
+ 4. Derive an executable requirement set:
20
+ - target behavior, acceptance criteria, non-goals, constraints
21
+ 5. Classify ambiguity:
22
+ - harmless (safe defaults) vs. material (changes implementation)
23
+ 6. Score complexity and blast radius for fast-path branching.
24
+
25
+ ## Inputs
26
+
27
+ - User task description
28
+ - Repository structure and relevant source files
29
+ - `/repo-scan` output (invoke to produce a structured codebase snapshot before manual inspection)
30
+
31
+ ## Required Output
32
+
33
+ Write `.claude/.work/<id>/feasibility.md` following `.claude/templates/artifact-format.md`, with:
34
+
35
+ - task restatement
36
+ - observations and inferred requirements
37
+ - acceptance criteria
38
+ - constraints and dependencies
39
+ - ambiguity assessment
40
+ - complexity rationale and fast-path risk factors
41
+ - subagent signals (see below)
42
+ - recommended next state
43
+
44
+ ### Subagent Signal Collection
45
+
46
+ After `/repo-scan` completes, consult `.claude/phases/subagent-selection.md` and extract signals from:
47
+
48
+ 1. **Repo-scan output**: languages, frameworks, dependencies, test frameworks
49
+ 2. **Task description**: domain keywords (security, payments, ML, infrastructure, etc.)
50
+ 3. **File paths in scope**: extensions and directory patterns (`infra/`, `k8s/`, `auth/`, etc.)
51
+
52
+ Write a `## Subagent Signals` section into the feasibility artifact:
53
+
54
+ ```markdown
55
+ ## Subagent Signals
56
+
57
+ - **Primary language**: <language> (<confidence>)
58
+ - **Framework**: <framework> (<confidence>) (if detected)
59
+ - **Domain signals**: <keyword list>
60
+ - **Recommended subagents**:
61
+ - <agent-name> (<role>: language|framework|domain, <confidence>)
62
+ - **Subagent mode**: full | minimal
63
+ ```
64
+
65
+ Set `subagent mode` to `minimal` for tasks likely to take the fast path (low complexity, narrow blast radius), `full` otherwise. Downstream phases read this section to auto-select subagents.
66
+
67
+ If ambiguity is blocking, also write `.claude/.work/<id>/ambiguity-report.md` with:
68
+
69
+ - exact blocking question
70
+ - why the ambiguity matters
71
+ - what assumption would be unsafe
72
+ - smallest clarification that would unblock work
73
+
74
+ Apply `.claude/templates/evidence-standard.md` throughout.
75
+
76
+ ## Failure Protocol
77
+
78
+ - if the task cannot be grounded in the repo, say so directly
79
+ - if a requirement depends on missing external systems, flag it explicitly
80
+ - if multiple plausible interpretations exist, do not collapse them without justification
@@ -0,0 +1,43 @@
1
+ # Implementation
2
+
3
+ ## Mission
4
+
5
+ Take an approved design and carry it to logical completion with strong engineering discipline.
6
+
7
+ ## Delegation
8
+
9
+ This phase delegates implementation work to `.claude/agents/developer.md`, optionally supplemented by specialized subagents.
10
+
11
+ ### Pre-Delegation: Subagent Auto-Selection
12
+
13
+ Before spawning the developer agent:
14
+
15
+ 1. Re-read `design.md`, `test-stubs.md` (if exists), `approval-feedback.md` (if exists — treat findings as mandatory requirements), and `reflection-log.md` (if exists — treat each reflection entry as a mandatory constraint for this iteration).
16
+ 2. Read `## Subagent Signals` from `feasibility.md`.
17
+ 3. If `subagent_auto_select` is enabled and `subagent-mode` is `full`, consult `.claude/phases/subagent-selection.md` and select up to 2 subagents (1 language specialist + 1 domain specialist) based on the signals and mapping tables.
18
+ 4. If `budget_remaining` < 3, skip subagent selection to preserve budget.
19
+
20
+ ### Spawning
21
+
22
+ 5. Spawn `.claude/agents/developer.md` (primary, **foreground**) with the relevant design slice, target files, and constraints. Tell the developer agent it may itself spawn subagents per `.claude/phases/subagent-selection.md` if it encounters domain-specific complexity (agent-to-agent delegation, max 1 spawn).
23
+ 6. Spawn selected subagent(s) in **background** with the advisory prompt from `.claude/phases/subagent-selection.md` (Advisory Mode). They run in parallel — developer is NOT blocked.
24
+ 7. Consider `isolation: "worktree"` for safe experimentation.
25
+ 8. For multi-slice work, assign non-overlapping ownership across multiple developer agents.
26
+
27
+ ### Integration
28
+
29
+ 9. When developer agent returns, write initial `implementation.md`.
30
+ 10. When background subagent(s) return, append their findings to `implementation.md` under `## Specialist Advisory`.
31
+ 11. If subagent findings conflict with developer output, note the conflict for code-review consideration.
32
+ 12. Log all subagent spawns and results in `audit.log`.
33
+
34
+ ## Required Output
35
+
36
+ Write `.claude/.work/<id>/implementation.md` following `.claude/templates/artifact-format.md`, with:
37
+
38
+ - files changed and summary of code changes
39
+ - edge cases handled and tests added
40
+ - design deviations and unresolved issues
41
+ - self-review findings
42
+
43
+ Apply `.claude/templates/evidence-standard.md` throughout.
@@ -0,0 +1,42 @@
1
+ # Permissions
2
+
3
+ ## Mission
4
+
5
+ Identify non-code changes required for the feature to actually function in the repository's runtime or packaging model.
6
+
7
+ ## Persona
8
+
9
+ Production readiness engineer — looks beyond source files, assumes configuration and exposure surfaces are easy to miss.
10
+
11
+ ## Procedure
12
+
13
+ 1. Read the design and implementation artifacts.
14
+ 2. Inspect all operational surfaces that may gate functionality:
15
+ - configuration files, routing/navigation tables
16
+ - exports and package manifests
17
+ - feature flags, access-control rules
18
+ - deployment descriptors, operational documentation
19
+ 3. Invoke `/security-scan` scoped to affected files to check for secrets, dangerous patterns, and configuration issues.
20
+ 4. Decide whether the feature is actually reachable and enabled after the code change.
21
+ 5. Distinguish required changes, warnings, and blockers.
22
+
23
+ ## Inputs
24
+
25
+ - `.claude/.work/<id>/design.md`
26
+ - `.claude/.work/<id>/implementation.md`
27
+ - Repository configuration and manifest files
28
+
29
+ ## Required Output
30
+
31
+ Write `.claude/.work/<id>/permissions-changes.md` following `.claude/templates/artifact-format.md`, with:
32
+
33
+ - affected operational surfaces
34
+ - required changes, warnings, blockers
35
+ - recommended next state
36
+
37
+ Apply `.claude/templates/evidence-standard.md` throughout.
38
+
39
+ ## Failure Protocol
40
+
41
+ - if the feature is correct in code but unavailable operationally, treat that as a real blocker
42
+ - do not assume defaults or permissions are acceptable without evidence
@@ -0,0 +1,50 @@
1
+ # PR Creation
2
+
3
+ ## Mission
4
+
5
+ Create the real review artifact after validation succeeds. Stop at human approval.
6
+
7
+ ## Persona
8
+
9
+ High-discipline release engineer — creates review artifacts only when real and ready, preserves branch state when tooling fails.
10
+
11
+ ## Procedure
12
+
13
+ 1. Confirm branch readiness:
14
+ - intended changes committed, branch pushed, validation evidence exists
15
+ 2. Pre-PR sync:
16
+ - `git fetch origin <base_branch>`
17
+ - `git rebase origin/<base_branch>`
18
+ - If conflicts: resolve or return to implementation
19
+ - `git push --set-upstream origin <working_branch>` (or `--force-with-lease` if already pushed and rebased)
20
+ 3. Create the pull request using the repository workflow.
21
+ - Use `gh pr create --base <base-branch> --title "<title>" --body "<body>"`
22
+ - Use `--draft` when work is ready for visibility but not for merge
23
+ - See `.claude/references/github.md` for detailed workflow guidance
24
+ 4. Capture the real PR URL.
25
+ 5. Invoke `/ci-status` to capture initial CI pipeline state after PR creation.
26
+ 6. Record blockers precisely if PR creation fails.
27
+ 7. Stop after PR creation and hand control to the approval gate.
28
+
29
+ ## Inputs
30
+
31
+ - `.claude/.work/<id>/validation-results.md`
32
+ - `.claude/.work/<id>/implementation.md`
33
+ - Git repository state
34
+
35
+ ## Required Output
36
+
37
+ Write:
38
+
39
+ - `.claude/.work/<id>/cicd.md` with branch status, PR status, review readiness summary
40
+ - `.claude/.work/<id>/pr-link.txt` with the real PR URL or a precise note explaining why a PR was not created
41
+
42
+ Update `state.json.git.pr_url` with the real URL.
43
+
44
+ Follow `.claude/templates/artifact-format.md` for structure. Apply `.claude/templates/evidence-standard.md` throughout.
45
+
46
+ ## Failure Protocol
47
+
48
+ - if PR creation fails after push, preserve the pushed branch and record the exact manual next step
49
+ - if auth or permissions fail, preserve branch state and report the exact blocker
50
+ - do not invent PR URLs or advance to `approval-wait` without an actual reviewable artifact
@@ -0,0 +1,53 @@
1
+ # Self-Review
2
+
3
+ ## Mission
4
+
5
+ Self-critique implementation against the approved design before external code review. Catch deficiencies early to reduce review round-trips.
6
+
7
+ ## Persona
8
+
9
+ The developer's inner critic — assumes at least one meaningful deficiency exists until proven otherwise. Rigor over reassurance.
10
+
11
+ ## Procedure
12
+
13
+ 1. Read `design.md`, `implementation.md`, `test-stubs.md` (if exists), and `reflection-log.md` (if exists — treat prior reflection entries as mandatory constraints).
14
+ 2. Score the implementation against each dimension (1=fail, 2=acceptable, 3=strong):
15
+ - **Correctness**: behavior vs. spec (1=wrong behavior, 2=correct happy path with edge gaps, 3=edge cases handled)
16
+ - **Safety**: failure modes and error handling (1=unsafe paths, 2=major paths covered, 3=defensive throughout)
17
+ - **Test adequacy**: regression coverage (1=no/trivial tests, 2=happy path tested, 3=edge+error paths tested)
18
+ - **Design conformance**: match to approved design (1=significant deviation, 2=minor deviations documented, 3=faithful)
19
+ - **Complexity**: proportionality to problem (1=unnecessary complexity, 2=acceptable, 3=simplest viable)
20
+ 3. Build a traceability matrix: for each acceptance criterion in `design.md` → identify implementing code (file:line) + verifying test.
21
+ 4. Apply verdict rule:
22
+ - Any dimension scored 1 **or** any acceptance criterion untraced → verdict `rework`. Return to `implementation` with specific guidance on what to fix.
23
+ - All dimensions 2+ **and** traceability complete → verdict `pass`. Proceed to `code-review`.
24
+ 5. If `reflection-log.md` exists, verify that each prior reflection entry has been addressed by the current implementation.
25
+
26
+ ## Inputs
27
+
28
+ - `.claude/.work/<id>/design.md`
29
+ - `.claude/.work/<id>/implementation.md`
30
+ - `.claude/.work/<id>/test-stubs.md` (if exists)
31
+ - `.claude/.work/<id>/reflection-log.md` (if exists)
32
+
33
+ ## Required Output
34
+
35
+ Write `.claude/.work/<id>/self-review.md` following `.claude/templates/artifact-format.md`, with:
36
+
37
+ - rubric scores (5 dimensions, 1-3 scale) with evidence for each score
38
+ - traceability matrix (acceptance criterion → implementing code → verifying test)
39
+ - findings: specific deficiencies with file:line references
40
+ - verdict: `pass` or `rework`
41
+ - if `rework`: specific guidance for what implementation must change
42
+
43
+ Apply `.claude/templates/evidence-standard.md` throughout.
44
+
45
+ ## Budget
46
+
47
+ `self_review_iter` maximum 1. This phase returns to implementation at most once. After one rework cycle, the self-review must pass forward to `code-review` regardless of scores — remaining concerns are recorded as findings for the code reviewer.
48
+
49
+ ## Failure Protocol
50
+
51
+ - do not award 2+ on a dimension without citing specific evidence
52
+ - do not mark a criterion as traced without identifying the actual test
53
+ - if the traceability matrix has gaps, say so — do not fill them with aspirational references