@arthai/agents 1.0.5 → 1.0.7
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.
- package/README.md +33 -3
- package/VERSION +1 -1
- package/agents/troubleshooter.md +132 -0
- package/bin/cli.js +296 -0
- package/bundles/canvas.json +1 -1
- package/bundles/compass.json +1 -1
- package/bundles/counsel.json +1 -0
- package/bundles/cruise.json +1 -1
- package/bundles/forge.json +12 -1
- package/bundles/prism.json +1 -0
- package/bundles/scalpel.json +5 -2
- package/bundles/sentinel.json +8 -2
- package/bundles/shield.json +1 -0
- package/bundles/spark.json +1 -0
- package/compiler.sh +14 -0
- package/dist/plugins/canvas/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/canvas/VERSION +1 -0
- package/dist/plugins/canvas/commands/planning.md +100 -11
- package/dist/plugins/canvas/hooks/hooks.json +16 -0
- package/dist/plugins/canvas/hooks/project-setup.sh +109 -0
- package/dist/plugins/canvas/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/canvas/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/compass/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/compass/VERSION +1 -0
- package/dist/plugins/compass/commands/planning.md +100 -11
- package/dist/plugins/compass/hooks/hooks.json +16 -0
- package/dist/plugins/compass/hooks/project-setup.sh +109 -0
- package/dist/plugins/compass/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/compass/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/counsel/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/counsel/VERSION +1 -0
- package/dist/plugins/counsel/hooks/hooks.json +10 -0
- package/dist/plugins/counsel/hooks/project-setup.sh +109 -0
- package/dist/plugins/counsel/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/counsel/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/cruise/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/cruise/VERSION +1 -0
- package/dist/plugins/cruise/hooks/hooks.json +16 -0
- package/dist/plugins/cruise/hooks/project-setup.sh +109 -0
- package/dist/plugins/cruise/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/cruise/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/forge/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/forge/VERSION +1 -0
- package/dist/plugins/forge/agents/troubleshooter.md +132 -0
- package/dist/plugins/forge/commands/implement.md +99 -1
- package/dist/plugins/forge/commands/planning.md +100 -11
- package/dist/plugins/forge/hooks/escalation-guard.sh +177 -0
- package/dist/plugins/forge/hooks/hooks.json +22 -0
- package/dist/plugins/forge/hooks/project-setup.sh +109 -0
- package/dist/plugins/forge/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/forge/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/prime/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/prime/VERSION +1 -0
- package/dist/plugins/prime/agents/troubleshooter.md +132 -0
- package/dist/plugins/prime/commands/calibrate.md +20 -0
- package/dist/plugins/prime/commands/ci-fix.md +36 -0
- package/dist/plugins/prime/commands/fix.md +23 -0
- package/dist/plugins/prime/commands/implement.md +99 -1
- package/dist/plugins/prime/commands/planning.md +100 -11
- package/dist/plugins/prime/commands/qa-incident.md +54 -0
- package/dist/plugins/prime/commands/restart.md +186 -30
- package/dist/plugins/prime/hooks/escalation-guard.sh +177 -0
- package/dist/plugins/prime/hooks/hooks.json +60 -0
- package/dist/plugins/prime/hooks/post-config-change-restart-reminder.sh +86 -0
- package/dist/plugins/prime/hooks/post-server-crash-watch.sh +120 -0
- package/dist/plugins/prime/hooks/pre-server-port-guard.sh +110 -0
- package/dist/plugins/prime/hooks/project-setup.sh +109 -0
- package/dist/plugins/prime/hooks/sync-agents.sh +99 -12
- package/dist/plugins/prime/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/prime/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/prism/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/prism/VERSION +1 -0
- package/dist/plugins/prism/commands/qa-incident.md +54 -0
- package/dist/plugins/prism/hooks/hooks.json +12 -0
- package/dist/plugins/prism/hooks/project-setup.sh +109 -0
- package/dist/plugins/prism/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/prism/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/scalpel/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/scalpel/VERSION +1 -0
- package/dist/plugins/scalpel/agents/troubleshooter.md +132 -0
- package/dist/plugins/scalpel/commands/ci-fix.md +36 -0
- package/dist/plugins/scalpel/commands/fix.md +23 -0
- package/dist/plugins/scalpel/hooks/escalation-guard.sh +177 -0
- package/dist/plugins/scalpel/hooks/hooks.json +24 -0
- package/dist/plugins/scalpel/hooks/project-setup.sh +109 -0
- package/dist/plugins/scalpel/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/scalpel/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/sentinel/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/sentinel/VERSION +1 -0
- package/dist/plugins/sentinel/agents/troubleshooter.md +132 -0
- package/dist/plugins/sentinel/commands/restart.md +186 -30
- package/dist/plugins/sentinel/hooks/escalation-guard.sh +177 -0
- package/dist/plugins/sentinel/hooks/hooks.json +64 -0
- package/dist/plugins/sentinel/hooks/post-config-change-restart-reminder.sh +86 -0
- package/dist/plugins/sentinel/hooks/post-server-crash-watch.sh +120 -0
- package/dist/plugins/sentinel/hooks/pre-server-port-guard.sh +110 -0
- package/dist/plugins/sentinel/hooks/project-setup.sh +109 -0
- package/dist/plugins/sentinel/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/sentinel/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/shield/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/shield/VERSION +1 -0
- package/dist/plugins/shield/hooks/hooks.json +22 -12
- package/dist/plugins/shield/hooks/project-setup.sh +109 -0
- package/dist/plugins/shield/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/shield/templates/CLAUDE.md.template +111 -0
- package/dist/plugins/spark/.claude-plugin/plugin.json +1 -1
- package/dist/plugins/spark/VERSION +1 -0
- package/dist/plugins/spark/commands/calibrate.md +20 -0
- package/dist/plugins/spark/hooks/hooks.json +10 -0
- package/dist/plugins/spark/hooks/project-setup.sh +109 -0
- package/dist/plugins/spark/templates/CLAUDE.md.managed-block +123 -0
- package/dist/plugins/spark/templates/CLAUDE.md.template +111 -0
- package/hook-defs.json +31 -0
- package/hooks/escalation-guard.sh +177 -0
- package/hooks/post-config-change-restart-reminder.sh +86 -0
- package/hooks/post-server-crash-watch.sh +120 -0
- package/hooks/pre-server-port-guard.sh +110 -0
- package/hooks/project-setup.sh +109 -0
- package/hooks/sync-agents.sh +99 -12
- package/install.sh +2 -2
- package/package.json +1 -1
- package/portable.manifest +7 -1
- package/skills/calibrate/SKILL.md +20 -0
- package/skills/ci-fix/SKILL.md +36 -0
- package/skills/fix/SKILL.md +23 -0
- package/skills/implement/SKILL.md +99 -1
- package/skills/license/SKILL.md +159 -0
- package/skills/planning/SKILL.md +100 -11
- package/skills/qa-incident/SKILL.md +54 -0
- package/skills/restart/SKILL.md +187 -31
|
@@ -29,9 +29,15 @@ If no feature name is provided, use AskUserQuestion to get it.
|
|
|
29
29
|
If the plan file exists:
|
|
30
30
|
- Read it with the Read tool.
|
|
31
31
|
- Parse the YAML frontmatter to extract the `layers` array (`frontend`, `backend`, or both).
|
|
32
|
+
- Parse the `spec` field from frontmatter (e.g., `spec: specs/feature-name.md`).
|
|
32
33
|
- Use `layers` to determine which agents to spawn (see Agent Selection below).
|
|
33
34
|
- Use the full file content as `PLAN`.
|
|
34
35
|
|
|
36
|
+
**Also check for a spec file** at `.claude/specs/{feature-name}.md` (written by `/planning` Phase 0):
|
|
37
|
+
- If it exists, read it and store as `FEATURE_SPEC`.
|
|
38
|
+
- Extract `USER_STORIES` (the ## User Stories section) and `EDGE_CASES` (the ## Edge Cases section).
|
|
39
|
+
- These are passed to implementation agents and QA for better coverage.
|
|
40
|
+
|
|
35
41
|
If the plan file does NOT exist:
|
|
36
42
|
- Check conversation history for a recent `/planning` output. If found, use it as `PLAN` and infer layers from task breakdown.
|
|
37
43
|
- If neither exists, ask the user with AskUserQuestion:
|
|
@@ -136,6 +142,43 @@ Include the results in the shared context block below so agents match existing
|
|
|
136
142
|
patterns instead of inventing new ones. This is 60x cheaper than having each
|
|
137
143
|
Sonnet agent independently explore the codebase.
|
|
138
144
|
|
|
145
|
+
### 3c. Consult Knowledge Base (before agents start)
|
|
146
|
+
|
|
147
|
+
Before spawning implementation agents, check the knowledge base for relevant context:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
1. .claude/knowledge/shared/conventions.md — coding rules and project gotchas
|
|
151
|
+
2. .claude/knowledge/shared/patterns.md — architecture patterns to follow
|
|
152
|
+
3. .claude/knowledge/qa-knowledge/ — past incidents in the same area
|
|
153
|
+
4. git log --all --grep="fix:" --oneline -10 — recent bug fixes that may be relevant
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Include any relevant findings in the shared context block as `KNOWLEDGE_CONTEXT`.
|
|
157
|
+
This prevents agents from repeating past mistakes or contradicting established patterns.
|
|
158
|
+
|
|
159
|
+
### 3d. Escalation Protocol for Implementation Agents
|
|
160
|
+
|
|
161
|
+
Add this to every implementation agent's prompt:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
## When You Get Stuck (MANDATORY PROTOCOL)
|
|
165
|
+
|
|
166
|
+
If a command fails or a fix doesn't work:
|
|
167
|
+
1. DO NOT retry the same approach more than twice
|
|
168
|
+
2. After 2 failures with same error: STOP and consult knowledge base
|
|
169
|
+
- .claude/knowledge/shared/conventions.md
|
|
170
|
+
- .claude/knowledge/qa-knowledge/ (search for error keywords)
|
|
171
|
+
- git log --all --grep="<error keyword>" --oneline -10
|
|
172
|
+
3. After 3 failures: escalate with a STUCK REPORT:
|
|
173
|
+
- Error: [exact message]
|
|
174
|
+
- Attempts: [what you tried, why each failed]
|
|
175
|
+
- Evidence: [logs, state, KB results]
|
|
176
|
+
- What you need: [access/data/decision]
|
|
177
|
+
- Recommendation: [your best option]
|
|
178
|
+
4. Send the stuck report to team-lead via SendMessage
|
|
179
|
+
5. If a troubleshooter agent is available, team-lead may spawn one to help
|
|
180
|
+
```
|
|
181
|
+
|
|
139
182
|
### 4. Build Shared Context Block
|
|
140
183
|
|
|
141
184
|
```
|
|
@@ -148,6 +191,16 @@ Auth: {AUTH_APPROACH}
|
|
|
148
191
|
## Implementation Plan
|
|
149
192
|
{PLAN}
|
|
150
193
|
|
|
194
|
+
## User Stories (from spec — trace your work to these)
|
|
195
|
+
{USER_STORIES}
|
|
196
|
+
|
|
197
|
+
(If no spec exists, this section is omitted.)
|
|
198
|
+
|
|
199
|
+
## Edge Cases (from spec — handle these in your implementation)
|
|
200
|
+
{EDGE_CASES}
|
|
201
|
+
|
|
202
|
+
(If no spec exists, this section is omitted.)
|
|
203
|
+
|
|
151
204
|
## API Contract
|
|
152
205
|
{API_CONTRACT}
|
|
153
206
|
|
|
@@ -206,7 +259,7 @@ Check `.claude/project-profile.md` first (if /calibrate has run). Otherwise the
|
|
|
206
259
|
|
|
207
260
|
**Always spawn:**
|
|
208
261
|
- **qa** (subagent_type="qa", model="sonnet", name="qa")
|
|
209
|
-
- Prompt: "{SHARED_CONTEXT}\n\nYou are QA. Your job: (1) Review backend and frontend implementations as they complete. (2) Ask teammates 'why did you do X?' when something looks wrong. (
|
|
262
|
+
- Prompt: "{SHARED_CONTEXT}\n\nYou are QA. Your job: (1) Review backend and frontend implementations as they complete. (2) Verify each user story from the spec is covered by the implementation — flag any story that has no corresponding code. (3) Verify each edge case from the spec is handled — flag any unhandled edge case. (4) Ask teammates 'why did you do X?' when something looks wrong. (5) Run validation checks (linters, type checkers, build commands). (6) Report issues back to the responsible teammate. (7) Mark your tasks done when all checks pass. Do NOT write code — only review and validate.\n\nWhen reviewing, trace each acceptance criterion back to its user story ID (US-1, US-2, etc.) and confirm the implementation satisfies it. Check edge cases (EC-1, EC-2, etc.) have explicit handling in the code."
|
|
210
263
|
|
|
211
264
|
### 5b. Red Team Phase
|
|
212
265
|
|
|
@@ -341,6 +394,7 @@ After PASS (or user override of BLOCK):
|
|
|
341
394
|
|
|
342
395
|
### 6. Monitor + Coordinate
|
|
343
396
|
|
|
397
|
+
**Standard coordination:**
|
|
344
398
|
- Watch TaskList for progress.
|
|
345
399
|
- If backend finishes API endpoints, nudge frontend to unblock.
|
|
346
400
|
- If a teammate is stuck, relay context from the other teammate.
|
|
@@ -349,6 +403,50 @@ After PASS (or user override of BLOCK):
|
|
|
349
403
|
- If `REDTEAM_MODE=once`, defer Step 5b until all implementation steps are complete.
|
|
350
404
|
- Track `REDTEAM_CYCLE`. If a BLOCK verdict is returned from Step 5b.4, pause all progress and escalate to the user before continuing.
|
|
351
405
|
|
|
406
|
+
**Escalation handling (when an agent sends a STUCK REPORT):**
|
|
407
|
+
|
|
408
|
+
When an agent reports they're stuck (via SendMessage with stuck report format):
|
|
409
|
+
|
|
410
|
+
1. **Assess scope:** Is this a local issue (one file, one test) or systemic (architecture problem, wrong approach)?
|
|
411
|
+
|
|
412
|
+
2. **If local issue (single file/test failure):**
|
|
413
|
+
- Check if another teammate can help (e.g., backend stuck on a frontend integration → ask frontend agent)
|
|
414
|
+
- Spawn a troubleshooter agent with the stuck report + error context
|
|
415
|
+
- Relay the troubleshooter's diagnosis back to the stuck agent
|
|
416
|
+
- If troubleshooter confidence is LOW → escalate to user with structured options
|
|
417
|
+
|
|
418
|
+
3. **If systemic issue (architecture problem, multiple agents affected):**
|
|
419
|
+
- PAUSE all agents (don't let them keep building on a broken foundation)
|
|
420
|
+
- Escalate to user immediately:
|
|
421
|
+
```
|
|
422
|
+
IMPLEMENTATION BLOCKED
|
|
423
|
+
|
|
424
|
+
What happened: [agent] hit [error] after [N] attempts
|
|
425
|
+
Scope: [local/systemic] — [why you think so]
|
|
426
|
+
Impact: [which tasks are blocked]
|
|
427
|
+
Troubleshooter says: [diagnosis if spawned]
|
|
428
|
+
|
|
429
|
+
Options:
|
|
430
|
+
[1] Fix the root cause (I'll explain what needs to change)
|
|
431
|
+
[2] Adjust the plan (scope down to avoid this area)
|
|
432
|
+
[3] Abort implementation (save work done so far)
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
4. **If two agents are stuck simultaneously:**
|
|
436
|
+
- This is almost always a systemic issue → treat as systemic
|
|
437
|
+
- Do NOT spawn two troubleshooters — diagnose once, fix at the root
|
|
438
|
+
|
|
439
|
+
5. **If a task shows no progress for 3+ consecutive idle cycles:**
|
|
440
|
+
- Check in with the agent: "What's your status on Task #N?"
|
|
441
|
+
- If no meaningful progress → treat as stuck (even without explicit stuck report)
|
|
442
|
+
|
|
443
|
+
**Red team finding escalation:**
|
|
444
|
+
|
|
445
|
+
When red team finds issues that the developer can't fix:
|
|
446
|
+
- If the fix requires changes outside their file ownership → orchestrator makes the cross-cutting change
|
|
447
|
+
- If the fix requires a plan change → escalate to user: "Red team found [issue] that requires changing the plan. Original plan said [X], but we need [Y]. Approve?"
|
|
448
|
+
- If the fix is beyond the team's capability → acknowledge, log it, and add to the PR description as a known limitation
|
|
449
|
+
|
|
352
450
|
### 7. Cleanup Implementation Team
|
|
353
451
|
|
|
354
452
|
- Send shutdown_request to all teammates.
|
|
@@ -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}` |
|
package/skills/planning/SKILL.md
CHANGED
|
@@ -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.
|
|
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
|
-
###
|
|
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
|
-
|
|
|
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
|
-
###
|
|
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
|
-
###
|
|
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
|
|
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
|
-
###
|
|
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
|
-
###
|
|
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
|
-
###
|
|
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
|
-
###
|
|
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
|
-
###
|
|
488
|
+
### 12. Cleanup
|
|
400
489
|
|
|
401
490
|
After user reviews the plan:
|
|
402
491
|
- Send shutdown_request to all teammates.
|
|
@@ -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')"
|