@arthai/agents 1.0.4 → 1.0.6

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 (131) hide show
  1. package/README.md +55 -3
  2. package/VERSION +1 -1
  3. package/agents/troubleshooter.md +132 -0
  4. package/bin/cli.js +366 -0
  5. package/bundles/canvas.json +1 -1
  6. package/bundles/compass.json +1 -1
  7. package/bundles/counsel.json +1 -0
  8. package/bundles/cruise.json +1 -1
  9. package/bundles/forge.json +12 -1
  10. package/bundles/prism.json +1 -0
  11. package/bundles/scalpel.json +5 -2
  12. package/bundles/sentinel.json +8 -2
  13. package/bundles/shield.json +1 -0
  14. package/bundles/spark.json +1 -0
  15. package/compiler.sh +14 -0
  16. package/dist/plugins/canvas/.claude-plugin/plugin.json +1 -1
  17. package/dist/plugins/canvas/VERSION +1 -0
  18. package/dist/plugins/canvas/commands/planning.md +100 -11
  19. package/dist/plugins/canvas/hooks/hooks.json +16 -0
  20. package/dist/plugins/canvas/hooks/project-setup.sh +109 -0
  21. package/dist/plugins/canvas/templates/CLAUDE.md.managed-block +123 -0
  22. package/dist/plugins/canvas/templates/CLAUDE.md.template +111 -0
  23. package/dist/plugins/compass/.claude-plugin/plugin.json +1 -1
  24. package/dist/plugins/compass/VERSION +1 -0
  25. package/dist/plugins/compass/commands/planning.md +100 -11
  26. package/dist/plugins/compass/hooks/hooks.json +16 -0
  27. package/dist/plugins/compass/hooks/project-setup.sh +109 -0
  28. package/dist/plugins/compass/templates/CLAUDE.md.managed-block +123 -0
  29. package/dist/plugins/compass/templates/CLAUDE.md.template +111 -0
  30. package/dist/plugins/counsel/.claude-plugin/plugin.json +1 -1
  31. package/dist/plugins/counsel/VERSION +1 -0
  32. package/dist/plugins/counsel/hooks/hooks.json +10 -0
  33. package/dist/plugins/counsel/hooks/project-setup.sh +109 -0
  34. package/dist/plugins/counsel/templates/CLAUDE.md.managed-block +123 -0
  35. package/dist/plugins/counsel/templates/CLAUDE.md.template +111 -0
  36. package/dist/plugins/cruise/.claude-plugin/plugin.json +1 -1
  37. package/dist/plugins/cruise/VERSION +1 -0
  38. package/dist/plugins/cruise/hooks/hooks.json +16 -0
  39. package/dist/plugins/cruise/hooks/project-setup.sh +109 -0
  40. package/dist/plugins/cruise/templates/CLAUDE.md.managed-block +123 -0
  41. package/dist/plugins/cruise/templates/CLAUDE.md.template +111 -0
  42. package/dist/plugins/forge/.claude-plugin/plugin.json +1 -1
  43. package/dist/plugins/forge/VERSION +1 -0
  44. package/dist/plugins/forge/agents/troubleshooter.md +132 -0
  45. package/dist/plugins/forge/commands/implement.md +99 -1
  46. package/dist/plugins/forge/commands/planning.md +100 -11
  47. package/dist/plugins/forge/hooks/escalation-guard.sh +177 -0
  48. package/dist/plugins/forge/hooks/hooks.json +22 -0
  49. package/dist/plugins/forge/hooks/project-setup.sh +109 -0
  50. package/dist/plugins/forge/templates/CLAUDE.md.managed-block +123 -0
  51. package/dist/plugins/forge/templates/CLAUDE.md.template +111 -0
  52. package/dist/plugins/prime/.claude-plugin/plugin.json +1 -1
  53. package/dist/plugins/prime/VERSION +1 -0
  54. package/dist/plugins/prime/agents/troubleshooter.md +132 -0
  55. package/dist/plugins/prime/commands/calibrate.md +20 -0
  56. package/dist/plugins/prime/commands/ci-fix.md +36 -0
  57. package/dist/plugins/prime/commands/fix.md +23 -0
  58. package/dist/plugins/prime/commands/implement.md +99 -1
  59. package/dist/plugins/prime/commands/planning.md +100 -11
  60. package/dist/plugins/prime/commands/qa-incident.md +54 -0
  61. package/dist/plugins/prime/commands/restart.md +186 -30
  62. package/dist/plugins/prime/hooks/escalation-guard.sh +177 -0
  63. package/dist/plugins/prime/hooks/hooks.json +60 -0
  64. package/dist/plugins/prime/hooks/post-config-change-restart-reminder.sh +86 -0
  65. package/dist/plugins/prime/hooks/post-server-crash-watch.sh +120 -0
  66. package/dist/plugins/prime/hooks/pre-server-port-guard.sh +110 -0
  67. package/dist/plugins/prime/hooks/project-setup.sh +109 -0
  68. package/dist/plugins/prime/hooks/sync-agents.sh +99 -12
  69. package/dist/plugins/prime/templates/CLAUDE.md.managed-block +123 -0
  70. package/dist/plugins/prime/templates/CLAUDE.md.template +111 -0
  71. package/dist/plugins/prism/.claude-plugin/plugin.json +1 -1
  72. package/dist/plugins/prism/VERSION +1 -0
  73. package/dist/plugins/prism/commands/qa-incident.md +54 -0
  74. package/dist/plugins/prism/hooks/hooks.json +12 -0
  75. package/dist/plugins/prism/hooks/project-setup.sh +109 -0
  76. package/dist/plugins/prism/templates/CLAUDE.md.managed-block +123 -0
  77. package/dist/plugins/prism/templates/CLAUDE.md.template +111 -0
  78. package/dist/plugins/scalpel/.claude-plugin/plugin.json +1 -1
  79. package/dist/plugins/scalpel/VERSION +1 -0
  80. package/dist/plugins/scalpel/agents/troubleshooter.md +132 -0
  81. package/dist/plugins/scalpel/commands/ci-fix.md +36 -0
  82. package/dist/plugins/scalpel/commands/fix.md +23 -0
  83. package/dist/plugins/scalpel/hooks/escalation-guard.sh +177 -0
  84. package/dist/plugins/scalpel/hooks/hooks.json +24 -0
  85. package/dist/plugins/scalpel/hooks/project-setup.sh +109 -0
  86. package/dist/plugins/scalpel/templates/CLAUDE.md.managed-block +123 -0
  87. package/dist/plugins/scalpel/templates/CLAUDE.md.template +111 -0
  88. package/dist/plugins/sentinel/.claude-plugin/plugin.json +1 -1
  89. package/dist/plugins/sentinel/VERSION +1 -0
  90. package/dist/plugins/sentinel/agents/troubleshooter.md +132 -0
  91. package/dist/plugins/sentinel/commands/restart.md +186 -30
  92. package/dist/plugins/sentinel/hooks/escalation-guard.sh +177 -0
  93. package/dist/plugins/sentinel/hooks/hooks.json +64 -0
  94. package/dist/plugins/sentinel/hooks/post-config-change-restart-reminder.sh +86 -0
  95. package/dist/plugins/sentinel/hooks/post-server-crash-watch.sh +120 -0
  96. package/dist/plugins/sentinel/hooks/pre-server-port-guard.sh +110 -0
  97. package/dist/plugins/sentinel/hooks/project-setup.sh +109 -0
  98. package/dist/plugins/sentinel/templates/CLAUDE.md.managed-block +123 -0
  99. package/dist/plugins/sentinel/templates/CLAUDE.md.template +111 -0
  100. package/dist/plugins/shield/.claude-plugin/plugin.json +1 -1
  101. package/dist/plugins/shield/VERSION +1 -0
  102. package/dist/plugins/shield/hooks/hooks.json +22 -12
  103. package/dist/plugins/shield/hooks/project-setup.sh +109 -0
  104. package/dist/plugins/shield/templates/CLAUDE.md.managed-block +123 -0
  105. package/dist/plugins/shield/templates/CLAUDE.md.template +111 -0
  106. package/dist/plugins/spark/.claude-plugin/plugin.json +1 -1
  107. package/dist/plugins/spark/VERSION +1 -0
  108. package/dist/plugins/spark/commands/calibrate.md +20 -0
  109. package/dist/plugins/spark/hooks/hooks.json +10 -0
  110. package/dist/plugins/spark/hooks/project-setup.sh +109 -0
  111. package/dist/plugins/spark/templates/CLAUDE.md.managed-block +123 -0
  112. package/dist/plugins/spark/templates/CLAUDE.md.template +111 -0
  113. package/hook-defs.json +31 -0
  114. package/hooks/escalation-guard.sh +177 -0
  115. package/hooks/post-config-change-restart-reminder.sh +86 -0
  116. package/hooks/post-server-crash-watch.sh +120 -0
  117. package/hooks/pre-server-port-guard.sh +110 -0
  118. package/hooks/project-setup.sh +109 -0
  119. package/hooks/sync-agents.sh +99 -12
  120. package/install.sh +2 -2
  121. package/package.json +1 -1
  122. package/portable.manifest +7 -1
  123. package/skills/calibrate/SKILL.md +20 -0
  124. package/skills/ci-fix/SKILL.md +36 -0
  125. package/skills/fix/SKILL.md +23 -0
  126. package/skills/implement/SKILL.md +99 -1
  127. package/skills/license/SKILL.md +159 -0
  128. package/skills/planning/SKILL.md +100 -11
  129. package/skills/publish/SKILL.md +3 -0
  130. package/skills/qa-incident/SKILL.md +54 -0
  131. package/skills/restart/SKILL.md +187 -31
@@ -0,0 +1,159 @@
1
+ ---
2
+ name: license
3
+ description: "Manage license keys — issue, revoke, list, verify. Usage: /license <issue|revoke|list|verify> <args>"
4
+ user-invocable: true
5
+ arguments: "<issue|revoke|list|verify> <args>"
6
+ ---
7
+
8
+ # /license — License Key Management
9
+
10
+ Manage license keys for the claude-agents toolkit. Issue keys to new users, revoke access, list active keys, verify a key works.
11
+
12
+ ## Prerequisites
13
+
14
+ - Cloudflare wrangler authenticated (`npx wrangler whoami`)
15
+ - KV namespace ID: `4ce2c105e0964b4789dcc717a3fb0464`
16
+ - Worker URL: `https://license-worker.muddassar-shaikh.workers.dev`
17
+
18
+ ## Commands
19
+
20
+ ### `/license issue <org-name> [--tier indie|team|enterprise]`
21
+
22
+ Generate a new license key and add it to Cloudflare KV.
23
+
24
+ ```bash
25
+ # 1. Generate random key
26
+ NEW_KEY="ARTH-$(openssl rand -hex 2 | tr 'a-f' 'A-F')-$(openssl rand -hex 2 | tr 'a-f' 'A-F')-$(openssl rand -hex 2 | tr 'a-f' 'A-F')-$(openssl rand -hex 2 | tr 'a-f' 'A-F')"
27
+
28
+ # 2. Compute SHA-256 hash
29
+ HASH=$(echo -n "$NEW_KEY" | shasum -a 256 | awk '{print $1}')
30
+
31
+ # 3. Seed into KV
32
+ npx wrangler kv key put \
33
+ --namespace-id="4ce2c105e0964b4789dcc717a3fb0464" \
34
+ "key:$NEW_KEY" \
35
+ "{\"hash\":\"$HASH\",\"org\":\"<org-name>\",\"tier\":\"<tier>\",\"status\":\"active\",\"issued_at\":\"$(date +%Y-%m-%d)\",\"activations\":[]}"
36
+
37
+ # 4. Verify it works
38
+ curl -s -X POST https://license-worker.muddassar-shaikh.workers.dev/validate \
39
+ -H "Content-Type: application/json" \
40
+ -d "{\"key\":\"$NEW_KEY\"}"
41
+ # Should return: {"valid":true,"org":"<org-name>","tier":"<tier>"}
42
+
43
+ # 5. (Optional) Add hash to authorized-keys.txt for clone-install users
44
+ echo "# <org-name>" >> ~/.claude-agents/authorized-keys.txt
45
+ echo "$HASH" >> ~/.claude-agents/authorized-keys.txt
46
+ ```
47
+
48
+ **Output to give the customer:**
49
+ ```
50
+ Your arthai license key: ARTH-XXXX-XXXX-XXXX-XXXX
51
+
52
+ To activate:
53
+ npx @arthai/agents activate ARTH-XXXX-XXXX-XXXX-XXXX
54
+
55
+ To install:
56
+ npx @arthai/agents install forge .
57
+
58
+ Available bundles: forge, scalpel, spark, sentinel, prism, canvas, compass, prime
59
+ ```
60
+
61
+ Default tier is `indie` if not specified.
62
+
63
+ ---
64
+
65
+ ### `/license revoke <key>`
66
+
67
+ Disable a license key. Takes effect within 24h (cache TTL).
68
+
69
+ ```bash
70
+ # 1. Remove from Cloudflare KV
71
+ npx wrangler kv key delete \
72
+ --namespace-id="4ce2c105e0964b4789dcc717a3fb0464" \
73
+ "key:<ARTH-XXXX-XXXX-XXXX-XXXX>"
74
+
75
+ # 2. Remove from authorized-keys.txt (if they're also a clone user)
76
+ # Find their hash:
77
+ HASH=$(echo -n "<ARTH-XXXX-XXXX-XXXX-XXXX>" | shasum -a 256 | awk '{print $1}')
78
+ echo "Remove this hash from ~/.claude-agents/authorized-keys.txt: $HASH"
79
+ # Then commit + push authorized-keys.txt
80
+
81
+ # 3. Verify revocation
82
+ curl -s -X POST https://license-worker.muddassar-shaikh.workers.dev/validate \
83
+ -H "Content-Type: application/json" \
84
+ -d "{\"key\":\"<ARTH-XXXX-XXXX-XXXX-XXXX>\"}"
85
+ # Should return: {"valid":false,"reason":"invalid_key"}
86
+ ```
87
+
88
+ **Two-surface revocation (BOTH required for full revocation):**
89
+ 1. KV deletion — blocks npm-path users immediately (next validation)
90
+ 2. authorized-keys.txt removal — blocks clone-install users (next git pull + session)
91
+
92
+ ---
93
+
94
+ ### `/license list`
95
+
96
+ List all active license keys in KV.
97
+
98
+ ```bash
99
+ npx wrangler kv key list --namespace-id="4ce2c105e0964b4789dcc717a3fb0464"
100
+ ```
101
+
102
+ To see details for a specific key:
103
+ ```bash
104
+ npx wrangler kv key get --namespace-id="4ce2c105e0964b4789dcc717a3fb0464" "key:<ARTH-XXXX-XXXX-XXXX-XXXX>"
105
+ ```
106
+
107
+ ---
108
+
109
+ ### `/license verify <key>`
110
+
111
+ Check if a specific key is valid.
112
+
113
+ ```bash
114
+ curl -s -X POST https://license-worker.muddassar-shaikh.workers.dev/validate \
115
+ -H "Content-Type: application/json" \
116
+ -d "{\"key\":\"<ARTH-XXXX-XXXX-XXXX-XXXX>\"}"
117
+ ```
118
+
119
+ Returns:
120
+ - Valid: `{"valid":true,"org":"name","tier":"indie"}`
121
+ - Invalid: `{"valid":false,"reason":"invalid_key"}`
122
+
123
+ ---
124
+
125
+ ## Full User Lifecycle
126
+
127
+ ```
128
+ NEW USER ONBOARDING:
129
+ 1. User finds toolkit (npm, marketplace, docs)
130
+ 2. User tries: npx @arthai/agents install forge .
131
+ → "License required. Get a key at arthai.dev/pricing"
132
+ 3. User contacts you
133
+ 4. You run: /license issue customer-name
134
+ 5. You send them the key
135
+ 6. User runs: npx @arthai/agents activate ARTH-XXXX-XXXX-XXXX-XXXX
136
+ → "License activated"
137
+ 7. User runs: npx @arthai/agents install forge .
138
+ → Toolkit installed, all skills work
139
+
140
+ KEY ROTATION:
141
+ 1. /license issue customer-name (new key)
142
+ 2. Send new key to customer
143
+ 3. Customer runs: npx @arthai/agents activate ARTH-NEW-KEY
144
+ 4. /license revoke ARTH-OLD-KEY (after grace period)
145
+
146
+ REVOCATION:
147
+ 1. /license revoke ARTH-XXXX-XXXX-XXXX-XXXX
148
+ 2. Remove hash from authorized-keys.txt + commit + push
149
+ 3. Within 24h: user's toolkit is disabled on next session
150
+ ```
151
+
152
+ ## Configuration
153
+
154
+ | Setting | Value |
155
+ |---------|-------|
156
+ | KV Namespace ID | `4ce2c105e0964b4789dcc717a3fb0464` |
157
+ | Worker URL | `https://license-worker.muddassar-shaikh.workers.dev` |
158
+ | Cache TTL | 24 hours (revocation delay) |
159
+ | Key format | `ARTH-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}` |
@@ -60,7 +60,86 @@ Map user choices:
60
60
 
61
61
  Store the resolved mode as `DEBATE_MODE` (values: `lite`, `fast`, `full`).
62
62
 
63
- ### 3. Codebase Scan
63
+ ### 3. Phase 0: Spec Generation (before debate)
64
+
65
+ Before any debate rounds, the PM generates a **spec doc** that becomes the foundation for all subsequent work. This ensures user stories and edge cases are defined BEFORE architecture decisions.
66
+
67
+ **Create the specs directory:**
68
+ ```bash
69
+ mkdir -p .claude/specs
70
+ ```
71
+
72
+ **Spawn PM agent (subagent_type="product-manager", model="sonnet") for spec generation only:**
73
+
74
+ Prompt:
75
+ ```
76
+ You are a Product Manager generating a spec doc for the feature "{feature-name}".
77
+
78
+ Feature brief: {FEATURE_BRIEF}
79
+
80
+ Generate a spec doc with these sections:
81
+
82
+ ## User Stories
83
+ Write 3-7 user stories covering the happy path and key error states.
84
+ Format: "As a [user type], I want [action], so that [outcome]"
85
+ Each story must have:
86
+ - **Story ID**: US-1, US-2, etc.
87
+ - **Priority**: P0 (must-have for launch) or P1 (important but deferrable)
88
+ - **Acceptance**: specific testable condition that proves this story is done
89
+
90
+ Example:
91
+ US-1 [P0]: As a new developer, I want to install the toolkit with one command,
92
+ so that I can start using it without manual configuration.
93
+ Acceptance: `npx @arthai/agents install forge .` succeeds and skills are available.
94
+
95
+ ## User Journey
96
+ Step-by-step flow from the user's first interaction to completion.
97
+ Include:
98
+ - **Happy path**: numbered steps (1. User does X → 2. System responds Y → ...)
99
+ - **Decision points**: where the user makes a choice (mark with ◆)
100
+ - **Error branches**: where things can go wrong (mark with ✗ and show recovery path)
101
+
102
+ Format as a text flowchart:
103
+ ```
104
+ 1. User discovers feature
105
+ 2. User does [action]
106
+ ◆ Decision: [choice A] or [choice B]
107
+ → Choice A: proceed to step 3
108
+ → Choice B: proceed to step 5
109
+ 3. System responds with [result]
110
+ ✗ Error: [what went wrong] → Recovery: [how to fix]
111
+ 4. ...
112
+ ```
113
+
114
+ ## Edge Cases
115
+ Structured list of what can go wrong. For each:
116
+ - **ID**: EC-1, EC-2, etc.
117
+ - **Scenario**: what triggers this edge case
118
+ - **Expected behavior**: what should happen (not crash, not hang)
119
+ - **Severity**: Critical (blocks user) / High (degrades experience) / Medium (inconvenience)
120
+ - **Linked story**: which user story this edge case relates to
121
+
122
+ ## Success Criteria
123
+ Measurable outcomes tied to user stories. These become the acceptance criteria
124
+ that /implement and /qa use to validate the implementation.
125
+ - Each criterion references a story ID
126
+ - Each criterion is binary: pass or fail, no subjective judgment
127
+ ```
128
+
129
+ **Write the output to `.claude/specs/{feature-name}.md`** with this frontmatter:
130
+
131
+ ```markdown
132
+ ---
133
+ feature: {feature-name}
134
+ generated: {ISO date}
135
+ stories: {count}
136
+ edge_cases: {count}
137
+ ---
138
+ ```
139
+
140
+ **Store the spec content as `FEATURE_SPEC`** — this is injected into the shared context block for all debate participants.
141
+
142
+ ### 4. Codebase Scan
64
143
 
65
144
  Spawn an `explore-light` subagent (model: haiku) to scan for relevant files:
66
145
 
@@ -70,7 +149,7 @@ prompt: "For a feature called '{feature-name}', find: (1) related backend routes
70
149
 
71
150
  Store the result as `CODEBASE_CONTEXT`.
72
151
 
73
- ### 4. Create Team + Tasks
152
+ ### 5. Create Team + Tasks
74
153
 
75
154
  Create team: `planning-{feature-name}`
76
155
 
@@ -78,12 +157,13 @@ Create these tasks:
78
157
 
79
158
  | Task | Owner | Subject |
80
159
  |------|-------|---------|
81
- | 1 | product-manager | Define product spec for {feature-name} |
160
+ | 0 | product-manager | Generate spec doc for {feature-name} (Phase 0 — already done above) |
161
+ | 1 | product-manager | Define product scope for {feature-name} (uses spec as input) |
82
162
  | 2 | architect | Design technical plan for {feature-name} |
83
163
  | 3 (if --design) | design-thinker | Create design brief for {feature-name} |
84
164
  | 4 (if not --lite) | devils-advocate | Challenge scope and feasibility for {feature-name} |
85
165
 
86
- ### 5. Build Shared Context Block
166
+ ### 6. Build Shared Context Block
87
167
 
88
168
  Compose this block to inject into every teammate's spawn prompt:
89
169
 
@@ -97,6 +177,11 @@ Auth: {AUTH_APPROACH}
97
177
  ## Feature: {feature-name}
98
178
  {FEATURE_BRIEF}
99
179
 
180
+ ## Spec Doc (from Phase 0)
181
+ {FEATURE_SPEC}
182
+
183
+ (Full spec at: .claude/specs/{feature-name}.md)
184
+
100
185
  ## Relevant Codebase
101
186
  {CODEBASE_CONTEXT}
102
187
 
@@ -116,13 +201,13 @@ This planning session runs in {DEBATE_MODE} mode.
116
201
  - If DA recommends KILL and user overrides, record as USER OVERRIDE in the plan.
117
202
  ```
118
203
 
119
- ### 6. Spawn Teammates (ALL IN ONE MESSAGE — parallel)
204
+ ### 7. Spawn Teammates (ALL IN ONE MESSAGE — parallel)
120
205
 
121
206
  Spawn all teammates in a **single message** with multiple Task tool calls:
122
207
 
123
208
  **Always spawn:**
124
209
  - **product-manager** (subagent_type="product-manager", model="opus")
125
- - Prompt: "{SHARED_CONTEXT}\n\nYou are the PM. Own the 'what' and 'why'.\n\nIn Round 1, you LEAD with your scope claim. Format your must-haves as:\n [M1] requirement — BECAUSE reason\n [M2] ...\nMaximum 5 MUST-HAVEs. Also list NICE-TO-HAVEs with CUT-IF conditions, EXPLICIT EXCLUSIONS, and success metrics.\n\nIn Round 2, you COUNTER the architect's approach: does it deliver user value, is it over-engineered, what is the time-to-value?\n\nIn Round 3 (full mode only), you DEFEND against the devil's advocate's risk case. Accept or reject each risk with evidence."
210
+ - Prompt: "{SHARED_CONTEXT}\n\nYou are the PM. Own the 'what' and 'why'. You generated the spec doc in Phase 0 — your user stories and edge cases are in the shared context above. Use them as the foundation for your scope claim.\n\nIn Round 1, you LEAD with your scope claim. Each must-have should trace to one or more user stories (reference by ID, e.g., 'US-1, US-3'). Format your must-haves as:\n [M1] requirement — BECAUSE reason (traces to US-X)\n [M2] ...\nMaximum 5 MUST-HAVEs. Also list NICE-TO-HAVEs with CUT-IF conditions, EXPLICIT EXCLUSIONS, and success metrics.\n\nIn Round 2, you COUNTER the architect's approach: does it deliver the user journey as specified? Is it over-engineered? What is the time-to-value? Reference edge cases the approach doesn't handle.\n\nIn Round 3 (full mode only), you DEFEND against the devil's advocate's risk case. Accept or reject each risk with evidence. Reference user stories to justify why a must-have cannot be cut."
126
211
 
127
212
  - **architect** (subagent_type="architect", model="opus")
128
213
  - Prompt: "{SHARED_CONTEXT}\n\nYou are the Architect. Own the 'how'.\n\nIn Round 1, you COUNTER the PM's scope from a feasibility lens. Challenge feasibility, flag hidden complexity, identify scope creep vectors, propose a counter-scope.\n\nIn Round 2, you LEAD with your technical approach: API contract, DB changes, architecture decision + WHY, task breakdown with S/M/L/XL estimates, implementation cost, dependencies, risks.\n\nIn Round 3 (full mode only), you DEFEND against the devil's advocate's risk case. Accept or reject each risk with evidence. Keep it simple for early-stage. Push back on scope that doesn't match the development stage."
@@ -142,7 +227,7 @@ Spawn all teammates in a **single message** with multiple Task tool calls:
142
227
  - **gtm-expert** (subagent_type="gtm-expert", model="sonnet")
143
228
  - Prompt: "{SHARED_CONTEXT}\n\nYou are the GTM Expert. Own distribution and launch strategy. Advise on positioning, viral mechanics, and launch sequencing. Challenge the team on how users will discover and adopt this feature. Your output feeds into Round 3 as additional evidence for the devil's advocate."
144
229
 
145
- ### 7. Structured Debate Protocol
230
+ ### 8. Structured Debate Protocol
146
231
 
147
232
  Facilitate the following rounds in sequence. Each phase completes before the next begins.
148
233
 
@@ -281,7 +366,7 @@ Each matched item is flagged as a RISK NOTE in the plan.
281
366
 
282
367
  ---
283
368
 
284
- ### 8. Convergence Logic
369
+ ### 9. Convergence Logic
285
370
 
286
371
  **Plan is APPROVED when ALL of the following are true after all applicable rounds complete:**
287
372
  - Rounds 1 and 2 have zero UNRESOLVED items
@@ -298,7 +383,7 @@ If user overrides a KILL recommendation, record as `USER OVERRIDE` in the plan.
298
383
 
299
384
  In lite and fast modes, skip convergence checks for rounds that were not run. Apply only the checks applicable to completed rounds.
300
385
 
301
- ### 9. Scope Lock
386
+ ### 10. Scope Lock
302
387
 
303
388
  After convergence, compute a `scope_hash`:
304
389
  - Concatenate all locked MUST-HAVE strings from Round 1 in order
@@ -307,7 +392,7 @@ After convergence, compute a `scope_hash`:
307
392
 
308
393
  When `/implement` loads the plan, it can verify the hash against the locked must-haves to detect tampering.
309
394
 
310
- ### 10. Write Plan File + Present to User
395
+ ### 11. Write Plan File + Present to User
311
396
 
312
397
  Synthesize teammate outputs into a structured plan and **write it to `.claude/plans/{feature-name}.md`** using the Write tool. This file is read by `/implement` to auto-configure the implementation team.
313
398
 
@@ -319,6 +404,7 @@ feature: {feature-name}
319
404
  debate_mode: {DEBATE_MODE}
320
405
  scope_hash: {SHA-256 of locked must-haves}
321
406
  da_confidence: {HIGH|MEDIUM|LOW|N/A}
407
+ spec: specs/{feature-name}.md
322
408
  layers:
323
409
  - frontend # include if ANY frontend tasks exist
324
410
  - backend # include if ANY backend tasks exist
@@ -326,6 +412,9 @@ layers:
326
412
 
327
413
  # Planning Summary: {feature-name}
328
414
 
415
+ ## Spec Reference
416
+ See `.claude/specs/{feature-name}.md` for user stories, user journey, edge cases, and success criteria.
417
+
329
418
  ## Problem & User Segment (from PM)
330
419
  ...
331
420
 
@@ -396,7 +485,7 @@ layers:
396
485
 
397
486
  Present the plan to the user for review.
398
487
 
399
- ### 11. Cleanup
488
+ ### 12. Cleanup
400
489
 
401
490
  After user reviews the plan:
402
491
  - Send shutdown_request to all teammates.
@@ -216,3 +216,6 @@ Tell the user to test in Claude Code:
216
216
  | `marketplace.json not found` | File at repo root instead of `.claude-plugin/` | Move to `.claude-plugin/marketplace.json` |
217
217
  | `E403 cannot publish over previous version` | VERSION not bumped | Derive from git tag, not VERSION file |
218
218
  | `Plugin directory not found at path` | `source` path in marketplace.json is wrong | Must be `./plugins/<name>` relative to marketplace root |
219
+ | Version defaults to 1.0.0 | `actions/checkout` uses shallow clone, tags not fetched | Add `fetch-depth: 0` and `fetch-tags: true` to checkout step |
220
+ | Skills not showing in Claude Code | Skills in `skills/` not `commands/` | User-invocable skills must be in `commands/` as flat .md files |
221
+ | npx install doesn't register | Files in `.claude/plugins/` not discovered | npx should copy to `.claude/skills/` + `.claude/agents/`, not `.claude/plugins/` |
@@ -42,6 +42,60 @@ affected_files:
42
42
 
43
43
  4. **Confirm to user**: "Incident logged. Next `/qa` run will generate a regression test targeting this issue."
44
44
 
45
+ ## Auto-Logging from Escalation (Circuit Breaker Resolution)
46
+
47
+ When an agent resolves a stuck situation (circuit breaker was tripped, then the issue was fixed),
48
+ the resolution should be logged automatically. This enables future agents to find the fix
49
+ without repeating the same debugging journey.
50
+
51
+ **Trigger:** Any workflow that resolves an error after the escalation guard tripped (3+ consecutive failures).
52
+
53
+ **Auto-log format** — create `.claude/qa-knowledge/incidents/{date}-escalation-{slug}.md`:
54
+
55
+ ```markdown
56
+ ---
57
+ date: {today YYYY-MM-DD}
58
+ severity: medium
59
+ status: covered
60
+ type: escalation-resolution
61
+ error_signature: {from .claude/.escalation-state.json}
62
+ affected_files:
63
+ - {files that were modified to fix the issue}
64
+ ---
65
+ # Escalation: {brief description of what was stuck}
66
+
67
+ ## Error
68
+ {exact error message that triggered the circuit breaker}
69
+
70
+ ## What Was Tried (failed)
71
+ 1. {attempt 1 from escalation state} → {result}
72
+ 2. {attempt 2} → {result}
73
+ 3. {attempt 3} → {result}
74
+
75
+ ## Root Cause
76
+ {what was actually wrong}
77
+
78
+ ## Fix Applied
79
+ {what change resolved the issue}
80
+
81
+ ## How to Prevent
82
+ {if applicable — what convention or check would catch this earlier}
83
+
84
+ ## Search Keywords
85
+ {error message fragments, file names, command patterns — for future KB searches}
86
+ ```
87
+
88
+ **Also update** `.claude/qa-knowledge/bug-patterns.md` if this represents a new pattern:
89
+ ```
90
+ ## {Pattern name}
91
+ - **Signature:** {error message or command pattern}
92
+ - **Root cause:** {common reason}
93
+ - **Fix:** {standard resolution}
94
+ - **First seen:** {date}
95
+ ```
96
+
97
+ This closes the learning loop: stuck → escalate → fix → log → future agents find it instantly.
98
+
45
99
  ## If No Description Provided
46
100
 
47
101
  Ask: "Describe the issue you want to log (e.g., 'admin page crashes when user has no sessions')"