cc-workspace 5.2.5 → 6.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.
- package/CHANGELOG.md +49 -0
- package/README.md +16 -14
- package/global-skills/agents/e2e-validator.md +1 -1
- package/global-skills/agents/implementer.md +9 -14
- package/global-skills/agents/reviewer.md +2 -2
- package/global-skills/agents/security-auditor.md +3 -3
- package/global-skills/agents/team-lead.md +37 -21
- package/global-skills/agents/workspace-init.md +1 -1
- package/global-skills/bootstrap-repo/SKILL.md +1 -1
- package/global-skills/cleanup/SKILL.md +1 -1
- package/global-skills/cross-service-check/SKILL.md +1 -1
- package/global-skills/cycle-retrospective/SKILL.md +2 -2
- package/global-skills/dispatch-feature/SKILL.md +99 -121
- package/global-skills/dispatch-feature/references/anti-patterns.md +22 -12
- package/global-skills/dispatch-feature/references/rollback-protocol.md +23 -8
- package/global-skills/dispatch-feature/references/spawn-templates.md +27 -45
- package/global-skills/doctor/SKILL.md +1 -1
- package/global-skills/hooks/orphan-cleanup.sh +1 -1
- package/global-skills/hooks/permission-auto-approve.sh +2 -2
- package/global-skills/hooks/user-prompt-guard.sh +3 -3
- package/global-skills/incident-debug/SKILL.md +1 -1
- package/global-skills/merge-prep/SKILL.md +1 -1
- package/global-skills/metrics/SKILL.md +2 -2
- package/global-skills/plan-review/SKILL.md +1 -1
- package/global-skills/qa-ruthless/SKILL.md +1 -1
- package/global-skills/refresh-profiles/SKILL.md +1 -1
- package/global-skills/rules/model-routing.md +5 -4
- package/global-skills/session/SKILL.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.3.0] — 2026-03-11
|
|
4
|
+
|
|
5
|
+
### Two-tier worktree model + patch extraction (no more micro-QA Haiku)
|
|
6
|
+
|
|
7
|
+
Major workflow change: teammates now work in **isolated temporary worktrees** instead of
|
|
8
|
+
directly in the session worktree. The team lead extracts a patch after each commit unit,
|
|
9
|
+
applies it to the session worktree, and the user reviews uncommitted changes in their IDE.
|
|
10
|
+
|
|
11
|
+
**Two worktree types:**
|
|
12
|
+
- **Session worktree** (`/tmp/{repo}-{session-name}`): created once per session, persists
|
|
13
|
+
until session close. This is the reference branch where commits accumulate.
|
|
14
|
+
- **Temporary worktree** (`/tmp/{repo}-commit-{N}`): created per commit unit from session
|
|
15
|
+
worktree HEAD. The teammate works here. Destroyed after patch extraction.
|
|
16
|
+
|
|
17
|
+
**New 10-step cycle per commit unit:**
|
|
18
|
+
1. Team lead creates temp worktree from session worktree HEAD
|
|
19
|
+
2. Team lead dispatches teammate with temp worktree path
|
|
20
|
+
3. Teammate codes, runs tests, signals "ready" (never commits)
|
|
21
|
+
4. Team lead extracts diff: `git add -A && git diff --cached --binary HEAD`
|
|
22
|
+
5. Team lead applies patch to session worktree: `git apply`
|
|
23
|
+
6. Team lead removes temp worktree
|
|
24
|
+
7. Team lead informs user: "review in your IDE"
|
|
25
|
+
8. User validates (or requests corrections)
|
|
26
|
+
9. Team lead commits in session worktree
|
|
27
|
+
10. Next commit unit
|
|
28
|
+
|
|
29
|
+
**Micro-QA Haiku removed:**
|
|
30
|
+
- No more Haiku diff review step — the user reviews directly in their IDE
|
|
31
|
+
- Haiku micro-QA subagent template deleted from spawn-templates.md
|
|
32
|
+
- Micro-QA row removed from model-routing.md routing table
|
|
33
|
+
- Phase 3 and 4 merged into a single Phase 3 (Dispatch + Patch + Review + Commit)
|
|
34
|
+
- Phase 5 (post-impl) renumbered to Phase 4
|
|
35
|
+
|
|
36
|
+
**Files changed:**
|
|
37
|
+
- `agents/team-lead.md` — rules 4, 5, 8 rewritten; workflow table updated; commit tracking without "qa" field; "What you CAN write" updated for patch commands
|
|
38
|
+
- `agents/implementer.md` — description updated for temp worktree; startup simplified (no more leftover changes check)
|
|
39
|
+
- `agents/reviewer.md` — Phase 5 → Phase 4 reference
|
|
40
|
+
- `agents/security-auditor.md` — Phase 5 → Phase 4 references
|
|
41
|
+
- `dispatch-feature/SKILL.md` — Phase 3 rewritten (10-step cycle); Phase 4 removed (merged into Phase 3); Phase 5 renumbered to Phase 4; session recovery adapted; mode descriptions updated
|
|
42
|
+
- `dispatch-feature/references/spawn-templates.md` — all templates use temp_worktree_path; Haiku micro-QA template deleted; failure handling updated
|
|
43
|
+
- `dispatch-feature/references/anti-patterns.md` — micro-QA references replaced; new anti-pattern 19 (never let teammate work in session worktree); new common mistakes rows
|
|
44
|
+
- `dispatch-feature/references/rollback-protocol.md` — split into "before patch apply" and "after patch apply" failure cases
|
|
45
|
+
- `rules/model-routing.md` — Haiku micro-QA row removed; Gather→Reason pattern updated
|
|
46
|
+
- `hooks/orphan-cleanup.sh` — added `/tmp/*-commit-*` pattern for temp worktree cleanup
|
|
47
|
+
- `hooks/user-prompt-guard.sh` — micro-QA → patch extraction in role reminder
|
|
48
|
+
- `hooks/permission-auto-approve.sh` — micro-QA comments updated
|
|
49
|
+
- `metrics/SKILL.md` — micro-QA first-pass rate → patch-apply first-pass rate
|
|
50
|
+
- `cycle-retrospective/SKILL.md` — Phase 5 → Phase 4
|
|
51
|
+
|
|
3
52
|
## [5.2.5] — 2026-03-11
|
|
4
53
|
|
|
5
54
|
### Fix: team-lead can now spawn teammates
|
package/README.md
CHANGED
|
@@ -230,9 +230,9 @@ parallel in each repo via Agent Teams.
|
|
|
230
230
|
|
|
231
231
|
| Role | Model | What it does |
|
|
232
232
|
|------|-------|-------------|
|
|
233
|
-
| **Orchestrator** | Opus 4.6 | Clarifies, plans, manages git, delegates,
|
|
233
|
+
| **Orchestrator** | Opus 4.6 | Clarifies, plans, manages git, delegates, extracts patches. Writes in orchestrator/ only. |
|
|
234
234
|
| **Init** | Sonnet 4.6 | Diagnostic + interactive workspace configuration. Run once. |
|
|
235
|
-
| **Teammates** | Sonnet 4.6 | Implement in an isolated worktree. One per commit unit, writes code without committing, signals when ready
|
|
235
|
+
| **Teammates** | Sonnet 4.6 | Implement in an isolated temp worktree. One per commit unit, writes code without committing, signals when ready. Team lead extracts patch. |
|
|
236
236
|
| **Data extractors** | Haiku | Read-only. Collect raw data (types, configs, logs). Never judge or conclude. |
|
|
237
237
|
| **QA** | Opus 4.6 | Hostile mode. Spawns Sonnet investigators. Min 3 problems found per service. |
|
|
238
238
|
| **Reviewer** | Opus 4.6 | Evidence-based code review. Scope check + architecture + constitution compliance. |
|
|
@@ -254,10 +254,12 @@ parallel in each repo via Agent Teams.
|
|
|
254
254
|
CLARIFY -> ask max 5 questions if ambiguity
|
|
255
255
|
PLAN -> write the plan in ./plans/, wait for approval
|
|
256
256
|
SESSION -> create session branches + worktrees in impacted repos (Phase 2.5)
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
DISPATCH -> For each commit unit:
|
|
258
|
+
1. Create temp worktree from session worktree HEAD
|
|
259
|
+
2. Teammate implements in temp worktree (never commits)
|
|
260
|
+
3. Team lead extracts patch, applies to session worktree
|
|
261
|
+
4. User reviews in IDE, team lead commits after approval
|
|
262
|
+
Waves: API/data → frontend → infra/config
|
|
261
263
|
VERIFY -> cross-service-check + qa-ruthless + reviewer + (security-auditor)
|
|
262
264
|
MERGE -> merge-prep (PRs, conflict detection)
|
|
263
265
|
RETRO -> cycle-retrospective (mandatory)
|
|
@@ -280,7 +282,7 @@ Protection layers:
|
|
|
280
282
|
|
|
281
283
|
| Skill | Role | Trigger |
|
|
282
284
|
|-------|------|---------|
|
|
283
|
-
| **dispatch-feature** | 4 modes: Clarify -> Plan -> Git -> Delegate ->
|
|
285
|
+
| **dispatch-feature** | 4 modes: Clarify -> Plan -> Git -> Delegate -> Patch -> Review -> Track | "Implement X", "new feature" |
|
|
284
286
|
| **qa-ruthless** | Hostile QA + UX audit (Opus) | "QA", "review", "test" |
|
|
285
287
|
| **cross-service-check** | Inter-repo consistency | "cross-service", "pre-merge" |
|
|
286
288
|
| **incident-debug** | Multi-layer diagnostic | "Bug", "500", "not working" |
|
|
@@ -564,7 +566,7 @@ With `--chrome`, the agent:
|
|
|
564
566
|
|---|---------|--------|
|
|
565
567
|
| 1 | **Agent tool for team-lead** | Fixed missing `Agent` tool in team-lead's tool list — the team-lead can now spawn implementer teammates via `Agent(subagent_type: "implementer", team_name: ...)`. |
|
|
566
568
|
| 2 | **One teammate per commit unit** | Shift from one teammate per repo (handling all commits) to one implementer per commit unit. Eliminates the unreliable "signal and wait" pattern — each implementer handles exactly one unit then stops. |
|
|
567
|
-
| 3 | **User reviews before commit** | Implementers write code without committing.
|
|
569
|
+
| 3 | **User reviews before commit** | Implementers write code in temp worktrees without committing. Team lead extracts patch, applies to session worktree. User reviews in IDE. Team lead commits after approval. _(v5.3.0: micro-QA Haiku removed, replaced by patch extraction + user IDE review)_ |
|
|
568
570
|
| 4 | **PreToolUse hook blocks git add/commit** | Implementer frontmatter now includes a Bash hook that physically blocks `git add` and `git commit`. Even if the model ignores instructions, commits are prevented. |
|
|
569
571
|
| 5 | **Team lead commits** | The team lead (not the implementer) runs `git add` + `git commit` in the worktree after user approval. Commit tracking includes `user_committed` and `files_modified` fields. |
|
|
570
572
|
| 6 | **Sequential with user gate** | Intra-repo commit units are strictly sequential with a user review gate between each. Cross-repo parallelism is preserved. |
|
|
@@ -578,9 +580,9 @@ With `--chrome`, the agent:
|
|
|
578
580
|
| 1 | **Skills & rules now LOCAL** | Installed in `orchestrator/.claude/skills/` and `rules/` instead of `~/.claude/`. Only agents remain global. Claude behaves normally outside orchestrator/. |
|
|
579
581
|
| 2 | **Automatic legacy cleanup** | `update --force` removes old global skills/rules from `~/.claude/` (from versions < 5.2). |
|
|
580
582
|
| 3 | **Reviewer agent (Opus)** | Evidence-based code review: scope check (plan vs implemented), architecture assessment, constitution compliance. Anchored on constitution + CLAUDE.md + plan, never on legacy code. |
|
|
581
|
-
| 4 | **Security auditor agent (Opus)** | 7-phase audit: auth flow tracing, tenant isolation, secrets scan, dependency CVEs, input validation, headers/CORS, session-scoped delta analysis. Conditional in Phase
|
|
583
|
+
| 4 | **Security auditor agent (Opus)** | 7-phase audit: auth flow tracing, tenant isolation, secrets scan, dependency CVEs, input validation, headers/CORS, session-scoped delta analysis. Conditional in Phase 4 (post-impl). |
|
|
582
584
|
| 5 | **qa-ruthless explicit Opus** | Added `model: opus` in frontmatter. Previously inherited from caller context. |
|
|
583
|
-
| 6 | **
|
|
585
|
+
| 6 | **Post-impl phase expanded** | Now: cross-service → qa-ruthless → reviewer → (security-auditor) → merge-prep → cycle-retrospective. _(v5.3.0: renumbered from Phase 5 to Phase 4)_ |
|
|
584
586
|
|
|
585
587
|
---
|
|
586
588
|
|
|
@@ -592,7 +594,7 @@ With `--chrome`, the agent:
|
|
|
592
594
|
| 2 | **Secure `permission-auto-approve.sh`** | Compound commands rejected before pattern matching. |
|
|
593
595
|
| 3 | **Robust `detectProjectType`** | JSON.parse + dependency lookup instead of string.includes(). |
|
|
594
596
|
| 4 | **Split orphan cleanup** | Extracted into separate `orphan-cleanup.sh` hook. |
|
|
595
|
-
| 5 | **JSON format for micro-QA** | Haiku returns structured `{"status":"OK"}` instead of free text. |
|
|
597
|
+
| 5 | **JSON format for micro-QA** | Haiku returns structured `{"status":"OK"}` instead of free text. _(v5.3.0: micro-QA Haiku removed entirely)_ |
|
|
596
598
|
| 6 | **Chrome MCP check in doctor** | Verifies Chrome DevTools MCP configuration. |
|
|
597
599
|
| 7 | **Hook unit tests** | `test_hooks.sh` with ~30 assertions. CLI unit tests with ~50 assertions. |
|
|
598
600
|
|
|
@@ -602,9 +604,9 @@ With `--chrome`, the agent:
|
|
|
602
604
|
|
|
603
605
|
| # | Feature | Detail |
|
|
604
606
|
|---|---------|--------|
|
|
605
|
-
| 1 | **Opus has Bash** | `disallowedTools: Bash` removed from team-lead. Opus manages git (branches, worktrees) and
|
|
606
|
-
| 2 | **One teammate per repo** | Shift from one subagent per commit unit to one teammate per repo. Sequential commits with signal+wait protocol. _(v5.2.3:
|
|
607
|
-
| 3 | **Micro-QA between every commit** | Bash tests + Haiku diff review after each commit. _(v5.
|
|
607
|
+
| 1 | **Opus has Bash** | `disallowedTools: Bash` removed from team-lead. Opus manages git (branches, worktrees) and patch extraction directly. |
|
|
608
|
+
| 2 | **One teammate per repo** | Shift from one subagent per commit unit to one teammate per repo. Sequential commits with signal+wait protocol. _(v5.2.3: one per commit unit; v5.3.0: temp worktrees + patch extraction)_ |
|
|
609
|
+
| 3 | **Micro-QA between every commit** | Bash tests + Haiku diff review after each commit. _(v5.3.0: removed entirely — replaced by patch extraction + user IDE review)_ |
|
|
608
610
|
| 4 | **Worktrees after plan validation** | Branches and worktrees created by Opus only after user approves the plan. |
|
|
609
611
|
| 5 | **Worktrees persist** | `/tmp/` worktrees live until `session close`. No pruning during active sessions. |
|
|
610
612
|
| 6 | **cycle-retrospective mandatory** | Required Phase 5 step, not optional. |
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implementer
|
|
3
|
-
prompt_version: 5.
|
|
3
|
+
prompt_version: 5.3.0
|
|
4
4
|
description: >
|
|
5
|
-
Implementation teammate for a single commit unit. Receives a
|
|
6
|
-
from the orchestrator
|
|
7
|
-
committing, signals when code is ready for review. No git setup,
|
|
8
|
-
add, no git commit. The team lead
|
|
5
|
+
Implementation teammate for a single commit unit. Receives a temporary
|
|
6
|
+
worktree from the orchestrator for a single commit unit. Writes code
|
|
7
|
+
without committing, signals when code is ready for review. No git setup,
|
|
8
|
+
no git add, no git commit. The team lead extracts the patch after signal.
|
|
9
9
|
model: sonnet
|
|
10
10
|
tools: Read, Write, Edit, MultiEdit, Bash, Glob, Grep, SendMessage
|
|
11
11
|
memory: project
|
|
@@ -56,15 +56,15 @@ You are a focused implementer for one commit unit. You write code and run tests
|
|
|
56
56
|
commit unit, then signal that the code is ready for review.
|
|
57
57
|
The orchestrator and user will review your work and commit it.
|
|
58
58
|
|
|
59
|
-
## Startup — go directly to your worktree
|
|
59
|
+
## Startup — go directly to your temporary worktree
|
|
60
60
|
|
|
61
61
|
The orchestrator provides:
|
|
62
|
-
- `worktree_path`: the /tmp/ path of your
|
|
63
|
-
- `session_branch`: the branch
|
|
62
|
+
- `worktree_path`: the /tmp/ path of your isolated temporary worktree (created fresh for this commit unit)
|
|
63
|
+
- `session_branch`: the branch checked out (with all previous commits)
|
|
64
64
|
- Your single commit unit to implement
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
|
-
# 1. Go to your worktree — it's ready
|
|
67
|
+
# 1. Go to your worktree — it's ready and clean
|
|
68
68
|
cd {worktree_path}
|
|
69
69
|
|
|
70
70
|
# 2. Verify you're on the right branch
|
|
@@ -72,11 +72,6 @@ git branch --show-current # must show session/{name}
|
|
|
72
72
|
|
|
73
73
|
# 3. Check what's already on the branch (from previous commits)
|
|
74
74
|
git log --oneline -5
|
|
75
|
-
|
|
76
|
-
# 4. Check for existing uncommitted changes
|
|
77
|
-
git status --short
|
|
78
|
-
# Uncommitted changes may exist from a previous unit — this is normal in this workflow.
|
|
79
|
-
# Assess: if they look like work from a previous unit, leave them. If junk, ask orchestrator.
|
|
80
75
|
```
|
|
81
76
|
|
|
82
77
|
**macOS note**: /tmp is a symlink to /private/tmp. Both paths are valid.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer
|
|
3
|
-
prompt_version: 5.
|
|
3
|
+
prompt_version: 5.3.0
|
|
4
4
|
description: >
|
|
5
5
|
Senior code reviewer agent. Reads the full diff of a session branch
|
|
6
6
|
(or any branch/PR) and produces evidence-based review comments.
|
|
7
7
|
Judges implementation choices against constitution + CLAUDE.md + plan,
|
|
8
8
|
NOT against existing legacy code. Detects scope drift (plan vs implemented).
|
|
9
9
|
Standalone: claude --agent reviewer
|
|
10
|
-
Also recommended in dispatch-feature Phase
|
|
10
|
+
Also recommended in dispatch-feature Phase 4 (post-impl) after qa-ruthless.
|
|
11
11
|
model: opus
|
|
12
12
|
tools: Read, Bash, Glob, Grep, Task(Explore)
|
|
13
13
|
memory: project
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-auditor
|
|
3
|
-
prompt_version: 5.
|
|
3
|
+
prompt_version: 5.3.0
|
|
4
4
|
description: >
|
|
5
5
|
Security audit agent for multi-service workspaces. Traces auth flows
|
|
6
6
|
end-to-end, audits tenant isolation, scans for secrets and exposed
|
|
@@ -8,7 +8,7 @@ description: >
|
|
|
8
8
|
and reviews input validation. Produces a structured security report
|
|
9
9
|
with severity ratings.
|
|
10
10
|
Standalone: claude --agent security-auditor
|
|
11
|
-
Also invocable by team-lead in Phase
|
|
11
|
+
Also invocable by team-lead in Phase 4 (post-impl) for security-sensitive plans,
|
|
12
12
|
or on-demand when user says "security", "audit", "pentest", "vulns",
|
|
13
13
|
"tenant leak", "auth check", "secrets scan", "OWASP".
|
|
14
14
|
model: opus
|
|
@@ -324,7 +324,7 @@ Write to `./plans/{plan-name}.md` (append) if session-scoped, or `./plans/securi
|
|
|
324
324
|
|
|
325
325
|
## Invocation by team-lead
|
|
326
326
|
|
|
327
|
-
The team-lead can invoke this agent in Phase
|
|
327
|
+
The team-lead can invoke this agent in Phase 4 (post-impl) when the plan involves:
|
|
328
328
|
- Auth changes (new endpoints, middleware modifications, token handling)
|
|
329
329
|
- New models with tenant data
|
|
330
330
|
- File upload features
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: team-lead
|
|
3
|
-
prompt_version:
|
|
3
|
+
prompt_version: 6.0.0
|
|
4
4
|
description: >
|
|
5
5
|
Main orchestrator for multi-service workspaces. Clarifies specs,
|
|
6
6
|
plans in markdown, manages git (branches, worktrees) directly,
|
|
7
|
-
delegates implementation to one teammate per commit unit
|
|
8
|
-
|
|
7
|
+
delegates implementation to one teammate per commit unit in temp worktrees,
|
|
8
|
+
commits directly in the temp worktree after micro-QA, destroys the temp
|
|
9
|
+
worktree, user reviews via git checkout session/{name} in their real repo.
|
|
9
10
|
Never codes in repos — can write in orchestrator/ and run git commands.
|
|
10
11
|
Triggered via claude --agent team-lead.
|
|
11
12
|
model: opus
|
|
@@ -40,17 +41,19 @@ hooks:
|
|
|
40
41
|
|
|
41
42
|
1. **NEVER write code in repos** — delegate ALL repo code work to teammates
|
|
42
43
|
2. **ONE teammate per COMMIT UNIT** — one implementer per commit unit, sequentially within each repo
|
|
43
|
-
3. **Opus manages ALL git** — branches, worktrees, verification. Teammates receive a
|
|
44
|
-
4. **
|
|
45
|
-
5. **
|
|
44
|
+
3. **Opus manages ALL git** — branches, worktrees, verification. Teammates receive a temp worktree path
|
|
45
|
+
4. **Direct commit in temp worktree** — after teammate finishes and micro-QA passes, team lead commits directly in the temp worktree (on the session branch), then destroys the temp worktree. No patch extraction, no session worktree
|
|
46
|
+
5. **Only temp worktrees** — created per commit unit from the session branch, destroyed after team lead commits. No persistent session worktree
|
|
46
47
|
6. **Full constitution in EVERY spawn prompt** — teammates don't receive it automatically
|
|
47
48
|
7. **UX standards for frontend teammates** — inject frontend-ux-standards.md content
|
|
48
|
-
8. **Sequential within a service** — commit N+1 only after commit N is
|
|
49
|
+
8. **Sequential within a service** — commit N+1 only after commit N is committed, user has reviewed via checkout, AND user has approved. Cross-service parallelism OK
|
|
49
50
|
9. **git branch, NEVER git checkout -b** in repos — checkout disrupts parallel sessions
|
|
50
51
|
10. **Teammates must run tests before signaling** — a "code ready" signal without test results is rejected. Re-spawn for retest
|
|
51
52
|
11. **Max 2 re-dispatches** per commit unit — then escalate to user, never loop
|
|
52
53
|
12. **Source branch from workspace.md** unless user specifies an override in initial prompt
|
|
53
|
-
13. **NEVER let implementer commit** — only the team lead commits, after
|
|
54
|
+
13. **NEVER let implementer commit** — only the team lead commits, after micro-QA in the temp worktree
|
|
55
|
+
14. **ALWAYS TeamCreate before Agent(implementer)** — bare `Agent(subagent_type: "implementer")` without `team_name` is INVALID and will be denied. Correct: `TeamCreate` once per session, then `Agent(subagent_type: "implementer", team_name: "session-{name}", prompt: ...)`. No other way.
|
|
56
|
+
15. **FOREGROUND Agent calls for implementers** — Agent calls for single-repo sequential dispatch are FOREGROUND (blocking). Never use `run_in_background: true`. The foreground call blocks until the teammate finishes and returns the result directly — no polling, no SendMessage waiting needed. For cross-repo parallelism, multiple foreground Agent calls in a single message is OK.
|
|
54
57
|
|
|
55
58
|
## Identity
|
|
56
59
|
|
|
@@ -58,6 +61,21 @@ You are a senior tech lead managing AI developers (Sonnet teammates) via Agent T
|
|
|
58
61
|
Direct, rigorous, demanding, protective. The constitution is non-negotiable.
|
|
59
62
|
You manage git yourself — you don't delegate git setup to subagents.
|
|
60
63
|
|
|
64
|
+
## How to spawn implementers (MANDATORY sequence)
|
|
65
|
+
|
|
66
|
+
> The Agent tool description mentions `subagent_type: "implementer"` but OMITS the required
|
|
67
|
+
> `team_name` parameter. Calling Agent without team_name WILL FAIL. Always use this sequence:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
# Once per session:
|
|
71
|
+
TeamCreate(team_name: "session-{name}")
|
|
72
|
+
|
|
73
|
+
# For each commit unit:
|
|
74
|
+
Agent(subagent_type: "implementer", team_name: "session-{name}", prompt: "...")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Do NOT call `Agent(subagent_type: "implementer")` without `team_name`. It will be denied.
|
|
78
|
+
|
|
61
79
|
## Startup
|
|
62
80
|
|
|
63
81
|
On startup, check if ./workspace.md contains [UNCONFIGURED].
|
|
@@ -82,7 +100,7 @@ On startup: scan ../ for directories with .git/, exclude orchestrator/.
|
|
|
82
100
|
## Session management
|
|
83
101
|
|
|
84
102
|
Sessions provide branch isolation for parallel features.
|
|
85
|
-
Each session maps to a session/{name} branch per impacted repo
|
|
103
|
+
Each session maps to a session/{name} branch per impacted repo.
|
|
86
104
|
|
|
87
105
|
### On startup: detect active sessions
|
|
88
106
|
Scan ./.sessions/ for active session JSON files. Display them if found.
|
|
@@ -105,10 +123,8 @@ Store the effective source branch in session.json under source_branch_override i
|
|
|
105
123
|
"repos": {
|
|
106
124
|
"{repo}": {
|
|
107
125
|
"path": "../{repo}",
|
|
108
|
-
"worktree_path": "/tmp/{repo}-{session-name}",
|
|
109
126
|
"source_branch": "{effective-source-branch}",
|
|
110
127
|
"session_branch": "session/{name}",
|
|
111
|
-
"worktree_created": true,
|
|
112
128
|
"commits": {}
|
|
113
129
|
}
|
|
114
130
|
}
|
|
@@ -116,11 +132,11 @@ Store the effective source branch in session.json under source_branch_override i
|
|
|
116
132
|
```
|
|
117
133
|
|
|
118
134
|
### Commit tracking
|
|
119
|
-
Update after each
|
|
135
|
+
Update after each commit + user approval:
|
|
120
136
|
```json
|
|
121
137
|
"commits": {
|
|
122
|
-
"1": { "status": "✅", "hash": "abc123", "files_modified": ["src/foo.ts", "src/bar.ts"], "
|
|
123
|
-
"2": { "status": "⏳", "hash": null, "files_modified": null, "
|
|
138
|
+
"1": { "status": "✅", "hash": "abc123", "files_modified": ["src/foo.ts", "src/bar.ts"], "user_approved": true },
|
|
139
|
+
"2": { "status": "⏳", "hash": null, "files_modified": null, "user_approved": false }
|
|
124
140
|
}
|
|
125
141
|
```
|
|
126
142
|
|
|
@@ -134,11 +150,10 @@ This table is your quick reference — **defer to the skill for specifics**.
|
|
|
134
150
|
| 0 — Clarify | Max 5 questions as concrete choices | Skip if user says "go"/"autonome" |
|
|
135
151
|
| 1 — Explore | Read/Glob/Grep repos directly (no Haiku) | Only files related to the feature |
|
|
136
152
|
| 2 — Plan | Write ./plans/{name}.md from _TEMPLATE.md | Wait for user validation |
|
|
137
|
-
| 2.5 — Git setup | `git branch`
|
|
138
|
-
| 2.9 — Pre-dispatch | Verify branches
|
|
139
|
-
| 3 — Dispatch | ONE teammate per
|
|
140
|
-
| 4 —
|
|
141
|
-
| 5 — Post-impl | cross-service → qa-ruthless → reviewer → (security-auditor if needed) → merge-prep → retro | All mandatory except security-auditor |
|
|
153
|
+
| 2.5 — Git setup | `git branch` via Bash (no worktree here) | Only after plan validation |
|
|
154
|
+
| 2.9 — Pre-dispatch | Verify branches exist, no stale temp worktrees | Auto-fix simple cases |
|
|
155
|
+
| 3 — Dispatch + Commit + Review | ONE teammate per commit unit in temp worktree (foreground), micro-QA, team lead commits in temp worktree, destroy temp worktree, user reviews via checkout | See @dispatch-feature/SKILL.md Phase 3 |
|
|
156
|
+
| 4 — Post-impl | cross-service → qa-ruthless → reviewer → (security-auditor if needed) → merge-prep → retro | All mandatory except security-auditor |
|
|
142
157
|
|
|
143
158
|
## Rollback & failure handling
|
|
144
159
|
|
|
@@ -153,8 +168,9 @@ Quick reference:
|
|
|
153
168
|
## What you CAN write / execute
|
|
154
169
|
- Plans, sessions, workspace.md, constitution.md — anything in orchestrator/
|
|
155
170
|
- Git commands on sibling repos (branch, worktree, log — never checkout on main trees)
|
|
156
|
-
-
|
|
157
|
-
- `git add` + `git commit` in
|
|
171
|
+
- `git worktree add` / `git worktree remove` for temp worktrees
|
|
172
|
+
- `git add -A` + `git commit` in temp worktrees AFTER micro-QA passes
|
|
173
|
+
- `git update-ref` on session branches to revert rejected commits
|
|
158
174
|
|
|
159
175
|
## Memory hygiene
|
|
160
176
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cycle-retrospective
|
|
3
|
-
prompt_version: 5.
|
|
3
|
+
prompt_version: 5.3.0
|
|
4
4
|
description: >
|
|
5
|
-
MANDATORY post-cycle learning and knowledge capture. Always runs as Phase
|
|
5
|
+
MANDATORY post-cycle learning and knowledge capture. Always runs as Phase 4 (post-impl)
|
|
6
6
|
of dispatch-feature after qa-ruthless and merge-prep. Analyzes QA findings, teammate
|
|
7
7
|
session logs, and implementation patterns to improve repo CLAUDE.md files,
|
|
8
8
|
service profiles, and project constitution.
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dispatch-feature
|
|
3
|
-
prompt_version:
|
|
3
|
+
prompt_version: 6.0.0
|
|
4
4
|
description: >
|
|
5
5
|
Orchestrate multi-service feature implementation. Clarifies ambiguities,
|
|
6
6
|
explores repos directly (no upfront Haiku scan), writes a persistent
|
|
7
|
-
markdown plan, sets up git branches
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
security-auditor (when needed),
|
|
12
|
-
Use whenever the user describes a
|
|
13
|
-
"
|
|
7
|
+
markdown plan, sets up git branches after plan validation, spawns one
|
|
8
|
+
teammate per commit unit in a temp worktree, team lead commits directly
|
|
9
|
+
in the temp worktree after micro-QA, destroys the temp worktree, user
|
|
10
|
+
reviews via git checkout session/{name} in their real repo. Runs
|
|
11
|
+
cross-service-check, qa-ruthless, reviewer, security-auditor (when needed),
|
|
12
|
+
merge-prep, and cycle-retrospective. Use whenever the user describes a
|
|
13
|
+
feature, says "implement", "new feature", "dispatch", "start dev",
|
|
14
|
+
"launch teammates", or provides a spec.
|
|
14
15
|
argument-hint: "[feature description]"
|
|
15
16
|
context: fork
|
|
16
17
|
allowed-tools: Read, Write, Bash, Glob, Grep, Task, TeamCreate, TeamDelete, SendMessage
|
|
@@ -27,7 +28,7 @@ Before any phase, check which mode was selected:
|
|
|
27
28
|
|
|
28
29
|
| Mode | Behavior |
|
|
29
30
|
|------|----------|
|
|
30
|
-
| **A — Full** | All phases 0-
|
|
31
|
+
| **A — Full** | All phases 0-4 (default) |
|
|
31
32
|
| **B — Quick plan** | Skip Phase 0 (Clarify). Start at Phase 1 exploration with specs as-is. |
|
|
32
33
|
| **C — Go direct** | Skip Phases 0-2. Dispatch immediately from user specs. |
|
|
33
34
|
| **D — Single-service** | Phases 0-2, then spawn ONE teammate. No waves. |
|
|
@@ -40,16 +41,16 @@ User provides clear specs upfront (e.g. a Jira ticket, a detailed description).
|
|
|
40
41
|
1. Skip Phase 0 entirely — do NOT ask clarification questions
|
|
41
42
|
2. Run Phase 1 (targeted exploration) scoped to the user's specs
|
|
42
43
|
3. Run Phase 2 (plan) — write the plan from specs + exploration
|
|
43
|
-
4. Phases 2.5
|
|
44
|
+
4. Phases 2.5-4 proceed normally (git setup, dispatch + commit + review, post-impl)
|
|
44
45
|
5. If ambiguities emerge during exploration, ask then (max 3 focused questions)
|
|
45
46
|
|
|
46
47
|
### Mode C — Go direct details
|
|
47
48
|
|
|
48
49
|
For hotfixes, quick patches, or when the user provides exact instructions.
|
|
49
|
-
1. Skip Phases 0
|
|
50
|
-
2. Run Phase 2.5 (git setup) — still create session branch
|
|
50
|
+
1. Skip Phases 0-2 — no clarification, no exploration, no written plan
|
|
51
|
+
2. Run Phase 2.5 (git setup) — still create session branch
|
|
51
52
|
3. Spawn ONE teammate per impacted repo with the user's specs as-is
|
|
52
|
-
4.
|
|
53
|
+
4. Direct commit in temp worktree + user review via checkout still runs after each commit unit
|
|
53
54
|
5. Post-impl: skip cross-service-check, run qa-ruthless (scoped), merge-prep, retro
|
|
54
55
|
6. Write a minimal plan retroactively after dispatch for traceability
|
|
55
56
|
|
|
@@ -154,10 +155,12 @@ Opus runs git directly via Bash. No subagents for git setup.
|
|
|
154
155
|
|
|
155
156
|
For each impacted repo:
|
|
156
157
|
1. `git -C ../{repo} branch session/{name} {source_branch}` — **git branch**, never checkout -b
|
|
157
|
-
2. `git
|
|
158
|
-
3. Verify worktree appears in `git worktree list`
|
|
158
|
+
2. Verify branch exists: `git -C ../{repo} log --oneline -1 session/{name}`
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
**No session worktree.** Only the session branch is created here.
|
|
161
|
+
Temp worktrees for each commit unit are created in Phase 3 and destroyed after commit.
|
|
162
|
+
|
|
163
|
+
Write `.sessions/{name}.json` with session metadata (name, created, status, per-repo: path, source_branch, session_branch, commits map).
|
|
161
164
|
|
|
162
165
|
PR target at session close = effective source branch.
|
|
163
166
|
|
|
@@ -169,40 +172,67 @@ Verify via Bash for each repo. Abort and fix before proceeding:
|
|
|
169
172
|
| Check | Fix if failed |
|
|
170
173
|
|-------|---------------|
|
|
171
174
|
| Session branch exists | `git -C ../{repo} branch session/{name} {source_branch}` |
|
|
172
|
-
|
|
|
173
|
-
| Worktree on correct branch | Inspect — may need worktree remove + re-add |
|
|
174
|
-
| Worktree is clean (no uncommitted leftovers) | Inspect, commit useful changes or `git checkout -- .` |
|
|
175
|
+
| No stale temp worktrees for this session | `git -C ../{repo} worktree remove /tmp/{repo}-commit-* --force` |
|
|
175
176
|
| Repo is reachable | Escalate to user |
|
|
176
177
|
|
|
177
178
|
Only proceed to Phase 3 once all checks pass.
|
|
178
179
|
|
|
179
|
-
## Phase 3: Dispatch
|
|
180
|
+
## Phase 3: Dispatch + Commit + Review
|
|
180
181
|
|
|
181
182
|
**ONE teammate per commit unit.** Use `TeamCreate` to create a team for the session, then
|
|
182
183
|
spawn one implementer per commit unit via `Agent(subagent_type: "implementer", team_name: ...)`.
|
|
183
|
-
Each implementer
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
1. Run micro-QA (Phase 4)
|
|
188
|
-
2. Present results to user for review (worktree path, diff, tests)
|
|
189
|
-
3. Wait for user approval
|
|
190
|
-
4. Team lead commits via Bash (git add + git commit in worktree)
|
|
191
|
-
5. Verify commit, update session.json, proceed to next unit
|
|
184
|
+
Each implementer works in an **isolated temp worktree**, writes code without committing,
|
|
185
|
+
signals when ready, then STOPS. The team lead performs micro-QA, commits directly in the
|
|
186
|
+
temp worktree (on the session branch), destroys the temp worktree, and the user reviews
|
|
187
|
+
via `git checkout session/{name}` in their real repo.
|
|
192
188
|
|
|
193
|
-
###
|
|
189
|
+
### Cycle per commit unit
|
|
194
190
|
|
|
195
191
|
```
|
|
196
|
-
1. TeamCreate(team_name: "session-{name}")
|
|
192
|
+
1. TeamCreate(team_name: "session-{name}") — once per session
|
|
197
193
|
2. For each commit unit (sequentially within a repo):
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
194
|
+
|
|
195
|
+
a. Create temp worktree from session branch:
|
|
196
|
+
git -C ../{repo} worktree add /tmp/{repo}-commit-{N} session/{name}
|
|
197
|
+
|
|
198
|
+
b. Dispatch teammate (FOREGROUND — blocks until teammate finishes):
|
|
199
|
+
Agent(subagent_type: "implementer", team_name: "session-{name}",
|
|
200
|
+
prompt with worktree_path = /tmp/{repo}-commit-{N} and ONE commit unit)
|
|
201
|
+
⚠️ Do NOT use run_in_background for single-repo sequential dispatch.
|
|
202
|
+
The foreground call blocks until the teammate finishes — no polling needed.
|
|
203
|
+
|
|
204
|
+
c. Teammate finishes (foreground Agent call returns with result)
|
|
205
|
+
|
|
206
|
+
d. Micro-QA on the temp worktree:
|
|
207
|
+
- git -C /tmp/{repo}-commit-{N} diff --stat
|
|
208
|
+
- Verify: files modified match commit unit scope, no dead code, tests passed
|
|
209
|
+
|
|
210
|
+
e. Commit in the temp worktree (on the session/{name} branch):
|
|
211
|
+
cd /tmp/{repo}-commit-{N}
|
|
212
|
+
git add -A
|
|
213
|
+
git commit -m "type(scope): description"
|
|
214
|
+
Verify: git log --oneline -1
|
|
215
|
+
|
|
216
|
+
f. Remove temp worktree:
|
|
217
|
+
git -C ../{repo} worktree remove /tmp/{repo}-commit-{N}
|
|
218
|
+
|
|
219
|
+
g. Inform user:
|
|
220
|
+
"Commit {N} ready on branch session/{name} of {repo}.
|
|
221
|
+
Run `git -C ../{repo} checkout session/{name}` to review in your IDE.
|
|
222
|
+
Approve or request corrections."
|
|
223
|
+
WAIT for user approval.
|
|
224
|
+
|
|
225
|
+
h. If user rejects:
|
|
226
|
+
Revert the commit on the session branch:
|
|
227
|
+
PARENT=$(git -C ../{repo} rev-parse session/{name}~1)
|
|
228
|
+
git -C ../{repo} update-ref refs/heads/session/{name} $PARENT
|
|
229
|
+
Create new temp worktree, re-dispatch with fix instructions (max 2 retries)
|
|
230
|
+
|
|
231
|
+
i. If user approves:
|
|
232
|
+
Remind user to switch back if needed:
|
|
233
|
+
"You can run `git -C ../{repo} checkout {source_branch}` to return to your working branch."
|
|
234
|
+
|
|
235
|
+
j. Update session.json, proceed to next commit unit
|
|
206
236
|
```
|
|
207
237
|
|
|
208
238
|
### Teammate spawn prompt — context tiering
|
|
@@ -210,7 +240,7 @@ After the implementer signals "code ready":
|
|
|
210
240
|
See @references/spawn-templates.md for full templates.
|
|
211
241
|
|
|
212
242
|
**Always inject (Tier 1):**
|
|
213
|
-
1. `worktree_path`: /tmp/{repo}-{
|
|
243
|
+
1. `worktree_path`: /tmp/{repo}-commit-{N}/ — temp worktree, ready, no git setup needed
|
|
214
244
|
2. `session_branch`: session/{name}
|
|
215
245
|
3. This commit unit's tasks ONLY + summary of what previous units implemented
|
|
216
246
|
4. Constitution rules (all from constitution.md, translated to English)
|
|
@@ -232,112 +262,57 @@ See @references/spawn-templates.md for full templates.
|
|
|
232
262
|
|
|
233
263
|
### Parallelism
|
|
234
264
|
|
|
235
|
-
- Different repos in same wave → spawn commit units in parallel ✅
|
|
265
|
+
- Different repos in same wave → spawn commit units in parallel (multiple foreground Agent calls in a single message) ✅
|
|
236
266
|
- Same repo → sequential, one commit unit at a time with user review gate ❌
|
|
237
267
|
|
|
238
268
|
### Wave execution
|
|
239
269
|
|
|
240
270
|
1. Spawn wave 1 commit units (parallel across repos, sequential within each repo)
|
|
241
|
-
2. For each commit unit: implementer writes → micro-QA →
|
|
242
|
-
3. Wait for ALL wave 1 commit units to be user-
|
|
271
|
+
2. For each commit unit: implementer writes in temp worktree → micro-QA → team lead commits in temp worktree → destroy temp worktree → user reviews via checkout
|
|
272
|
+
3. Wait for ALL wave 1 commit units to be user-approved
|
|
243
273
|
4. Collect validated API contracts from wave 1 results
|
|
244
274
|
5. Spawn wave 2 commit units with validated contracts
|
|
245
275
|
6. Repeat for wave 3
|
|
246
276
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
After each implementer signals "code ready":
|
|
250
|
-
|
|
251
|
-
### Step 1 — Bash verification (Opus direct)
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
# 1. Verify uncommitted changes exist
|
|
255
|
-
git -C /tmp/{repo}-{session-name} status --short
|
|
256
|
-
git -C /tmp/{repo}-{session-name} diff --stat
|
|
257
|
-
|
|
258
|
-
# 2. Run scoped tests — adapt command to repo stack:
|
|
259
|
-
# PHP/Laravel:
|
|
260
|
-
cd /tmp/{repo}-{session-name} && php artisan test --filter={CommitScope} 2>&1 | tail -30
|
|
261
|
-
# Vue/Node:
|
|
262
|
-
cd /tmp/{repo}-{session-name} && npm run typecheck 2>&1 | tail -20
|
|
263
|
-
# Go:
|
|
264
|
-
cd /tmp/{repo}-{session-name} && go test ./... 2>&1 | tail -20
|
|
265
|
-
# Python:
|
|
266
|
-
cd /tmp/{repo}-{session-name} && pytest {scope_path} -v 2>&1 | tail -30
|
|
267
|
-
|
|
268
|
-
# 3. Check for debug artifacts in uncommitted changes
|
|
269
|
-
git -C /tmp/{repo}-{session-name} diff \
|
|
270
|
-
| grep -E "(console\.log|dd\(|var_dump|\.only\(|TODO|FIXME|debugger|dump\()" \
|
|
271
|
-
| head -20
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Step 2 — Haiku diff review (Task subagent, read-only)
|
|
275
|
-
|
|
276
|
-
Use the Haiku micro-QA template from @references/spawn-templates.md (section "Haiku micro-QA subagent template").
|
|
277
|
-
|
|
278
|
-
Spawn Task(Explore, model: haiku) with that template, injecting `git diff` output (uncommitted changes).
|
|
277
|
+
### User review presentation
|
|
279
278
|
|
|
280
|
-
|
|
281
|
-
Haiku needs the exact structured prompt to return clean JSON.
|
|
282
|
-
|
|
283
|
-
### Step 3 — User review, then team lead commits
|
|
284
|
-
|
|
285
|
-
If Step 1 and Step 2 pass, present to the user:
|
|
279
|
+
Present to the user after committing and destroying the temp worktree:
|
|
286
280
|
|
|
287
281
|
```
|
|
288
282
|
## Commit unit {N}/{total} for {repo} — ready for review
|
|
289
283
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
🔍 Micro-QA: {OK or issues}
|
|
284
|
+
Branch: session/{name}
|
|
285
|
+
Files modified: {git diff --stat output from micro-QA}
|
|
286
|
+
Tests: {pass/fail summary from teammate result}
|
|
294
287
|
|
|
295
|
-
|
|
296
|
-
|
|
288
|
+
Run: git -C ../{repo} checkout session/{name}
|
|
289
|
+
Review in your IDE, then approve or request corrections.
|
|
297
290
|
```
|
|
298
291
|
|
|
299
292
|
**WAIT for user approval.**
|
|
300
293
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
git -C /tmp/{repo}-{
|
|
304
|
-
|
|
294
|
+
If the user requests modifications:
|
|
295
|
+
1. Revert the commit: `PARENT=$(git -C ../{repo} rev-parse session/{name}~1) && git -C ../{repo} update-ref refs/heads/session/{name} $PARENT`
|
|
296
|
+
2. Create a NEW temp worktree: `git -C ../{repo} worktree add /tmp/{repo}-commit-{N}-retry session/{name}`
|
|
297
|
+
3. Re-spawn implementer with fix instructions in the new temp worktree
|
|
298
|
+
4. Max 2 retries per commit unit, then escalate to user
|
|
305
299
|
|
|
306
|
-
|
|
307
|
-
git -C /tmp/{repo}-{session-name} log --oneline -1
|
|
308
|
-
```
|
|
300
|
+
### Update after each commit unit
|
|
309
301
|
|
|
310
302
|
Update session.json with the commit hash:
|
|
311
303
|
```json
|
|
312
304
|
"commits": {
|
|
313
|
-
"N": { "status": "✅", "hash": "abc123", "files_modified": [...], "
|
|
305
|
+
"N": { "status": "✅", "hash": "abc123", "files_modified": [...], "user_approved": true }
|
|
314
306
|
}
|
|
315
307
|
```
|
|
316
308
|
|
|
317
|
-
If the user requests modifications → re-spawn implementer for the same commit unit with fix instructions.
|
|
318
|
-
|
|
319
|
-
### Decision (Steps 1-2)
|
|
320
|
-
|
|
321
|
-
| Bash | Haiku | Action |
|
|
322
|
-
|------|-------|--------|
|
|
323
|
-
| OK | OK | Present to user for review (Step 3). Team lead commits after approval |
|
|
324
|
-
| FAIL | any | Opus analyzes failure, re-spawns implementer with fix instructions OR escalates |
|
|
325
|
-
| OK | BLOCKER | Opus evaluates blocker severity, re-spawns with fix instructions or escalates |
|
|
326
|
-
|
|
327
|
-
Retry limit: max 2 per commit unit → escalate to user, stop the wave.
|
|
328
|
-
|
|
329
|
-
### Update after each commit unit
|
|
330
|
-
|
|
331
309
|
```bash
|
|
332
|
-
# Update plan progress tracker
|
|
333
|
-
# Mark commit N ✅ or ❌
|
|
334
|
-
|
|
335
|
-
# Update session.json commits tracking
|
|
310
|
+
# Update plan progress tracker — mark commit N ✅ or ❌
|
|
336
311
|
# Add session log entry:
|
|
337
|
-
# [HH:MM] {repo}-commit-{N}: {status}, {hash}, {N} files, tests {pass/fail},
|
|
312
|
+
# [HH:MM] {repo}-commit-{N}: {status}, {hash}, {N} files, tests {pass/fail}, user_approved: true
|
|
338
313
|
```
|
|
339
314
|
|
|
340
|
-
## Phase
|
|
315
|
+
## Phase 4: Post-implementation (all mandatory)
|
|
341
316
|
|
|
342
317
|
1. **cross-service-check** — inter-repo consistency (API shapes, env vars, gateway routes)
|
|
343
318
|
2. **qa-ruthless** — adversarial QA, min 3 findings per service
|
|
@@ -363,13 +338,16 @@ For targeted fixes or single-repo work:
|
|
|
363
338
|
|
|
364
339
|
1. Read ./workspace.md for project context
|
|
365
340
|
2. List ./plans/ for active plans
|
|
366
|
-
3. Check ./.sessions/ for active session JSON
|
|
341
|
+
3. Check ./.sessions/ for active session JSON
|
|
367
342
|
4. Read active plan — statuses and session log tell you where you are
|
|
368
|
-
5. Verify
|
|
369
|
-
6. Check
|
|
370
|
-
- If
|
|
371
|
-
- If
|
|
372
|
-
7.
|
|
343
|
+
5. Verify session branches exist: `git -C ../{repo} log --oneline -1 session/{name}` for each repo
|
|
344
|
+
6. Check for orphaned temp worktrees (`/tmp/{repo}-commit-*`):
|
|
345
|
+
- If temp worktree has uncommitted changes → commit them on the session branch, remove worktree, present to user for review
|
|
346
|
+
- If temp worktree is clean → remove it (work was lost, re-dispatch)
|
|
347
|
+
7. Check `user_approved` field in session.json to determine where to resume:
|
|
348
|
+
- If last unit has `user_approved: true` → spawn next unit's implementer
|
|
349
|
+
- If last unit has `user_approved: false` or missing → check session branch HEAD, present last commit to user for review
|
|
350
|
+
8. Resume from the appropriate step (temp worktree creation, dispatch, or user review)
|
|
373
351
|
|
|
374
352
|
## Anti-patterns
|
|
375
353
|
|
|
@@ -36,23 +36,30 @@ Reference file for dispatch-feature and team-lead. Loaded on-demand.
|
|
|
36
36
|
13. **NEVER use git checkout -b in repos** — use git branch {name} {source} (no checkout).
|
|
37
37
|
Checkout changes the working directory, which disrupts other sessions running in parallel.
|
|
38
38
|
|
|
39
|
-
14. **NEVER skip micro-QA
|
|
40
|
-
Waiting until the final QA is too late — issues compound across units.
|
|
39
|
+
14. **NEVER skip micro-QA before committing** — after teammate finishes, verify diff --stat, check files match commit unit scope, confirm tests passed. Only then commit in the temp worktree. Skipping micro-QA means bad code gets committed to the session branch.
|
|
41
40
|
|
|
42
|
-
15. **NEVER
|
|
43
|
-
|
|
41
|
+
15. **NEVER leave temp worktrees alive after committing** — destroy them immediately after commit.
|
|
42
|
+
Stale temp worktrees waste disk and can cause branch lock conflicts.
|
|
44
43
|
|
|
45
44
|
16. **NEVER over-split commit units** — 10+ commit units per service is excessive.
|
|
46
45
|
Sweet spot: 2-5 per repo. Each spawn has context loading overhead.
|
|
47
46
|
|
|
48
|
-
17. **NEVER spawn the next commit unit before user has
|
|
49
|
-
user must review and approve
|
|
47
|
+
17. **NEVER spawn the next commit unit before user has approved the previous** — team lead must commit
|
|
48
|
+
in temp worktree, user must review via checkout and approve — only then spawn the next unit's implementer.
|
|
50
49
|
|
|
51
50
|
18. **NEVER let implementer run git add or git commit** — the implementer writes code and runs tests.
|
|
52
|
-
The team lead commits after
|
|
51
|
+
The team lead commits after micro-QA. The PreToolUse hook blocks git add/commit as a safety net.
|
|
53
52
|
|
|
54
|
-
19. **NEVER
|
|
55
|
-
|
|
53
|
+
19. **NEVER let a teammate work outside their temp worktree** — teammates always work in isolated temp
|
|
54
|
+
worktrees (/tmp/{repo}-commit-{N}). The session branch is the reference where commits accumulate.
|
|
55
|
+
Direct teammate access to the real repo risks corruption of committed work.
|
|
56
|
+
|
|
57
|
+
20. **NEVER call Agent(subagent_type: "implementer") without team_name** — bare Agent calls
|
|
58
|
+
without team_name are invalid and will be denied. The Agent tool description omits this
|
|
59
|
+
requirement. If denied, do NOT debug — just follow the TeamCreate + Agent(team_name) pattern.
|
|
60
|
+
|
|
61
|
+
21. **NEVER skip TeamCreate before spawning implementers** — `TeamCreate(team_name: "session-{name}")`
|
|
62
|
+
must be called once per session BEFORE any `Agent(subagent_type: "implementer", team_name: ...)`.
|
|
56
63
|
|
|
57
64
|
## Common mistakes to watch for
|
|
58
65
|
|
|
@@ -63,10 +70,13 @@ Reference file for dispatch-feature and team-lead. Loaded on-demand.
|
|
|
63
70
|
| Plan has vague tasks like "implement feature" | Each task should have a clear input→output | Rewrite plan with specific tasks before dispatch |
|
|
64
71
|
| API contract has {} placeholder | Frontend can't build types | Complete the contract shapes before wave 2 |
|
|
65
72
|
| Two teammates spawned on same repo | Git conflicts guaranteed | Kill one, let the remaining handle all commits |
|
|
66
|
-
| Implementer runs git add/commit | Code committed without
|
|
67
|
-
| Next unit spawned before user
|
|
73
|
+
| Implementer runs git add/commit | Code committed without micro-QA | PreToolUse hook should block it; if bypassed, revert with git update-ref |
|
|
74
|
+
| Next unit spawned before user approved previous | Commits pile up without review | Wait for user approval before spawning next unit |
|
|
75
|
+
| Temp worktree not cleaned up after commit | git worktree list shows stale entries | git -C ../{repo} worktree remove /tmp/{repo}-commit-{N} --force |
|
|
76
|
+
| Agent called with run_in_background for single-repo | Team lead sleeps, doesn't detect completion | Always use foreground (blocking) Agent calls for sequential dispatch |
|
|
68
77
|
| No signal from teammate after implementation | Silent failure | Check worktree git status/diff, ask teammate to signal or escalate |
|
|
69
78
|
| Worktree missing after crash | git worktree list shows nothing | Recreate worktree from session branch: git worktree add /tmp/... session/{name} |
|
|
79
|
+
| Agent called without team_name | Denied by system, wasted turns debugging | Use TeamCreate first, then Agent with team_name. See rule 20 above |
|
|
70
80
|
| Giant commit (500+ lines) | Unreadable PR | Note in session log; teammate should split next time |
|
|
71
81
|
| Commit unit not self-contained | Teammate can't understand scope | Rewrite: each unit must be understandable with only previous context |
|
|
72
|
-
| cycle-retrospective skipped | Lessons not captured | Always run Phase
|
|
82
|
+
| cycle-retrospective skipped | Lessons not captured | Always run Phase 4 (post-impl) fully — retrospective is mandatory |
|
|
@@ -7,7 +7,7 @@ Reference file for team-lead and dispatch-feature. Loaded on-demand.
|
|
|
7
7
|
If an implementer corrupts the session branch (bad merge, broken state):
|
|
8
8
|
|
|
9
9
|
1. Identify the last known good commit hash (from plan's session log)
|
|
10
|
-
2.
|
|
10
|
+
2. Reset the session branch:
|
|
11
11
|
```
|
|
12
12
|
git -C ../[repo] update-ref refs/heads/session/{name} [good-commit-hash]
|
|
13
13
|
```
|
|
@@ -20,18 +20,33 @@ If the branch is unrecoverable:
|
|
|
20
20
|
3. Re-dispatch ALL commit units for this service from scratch
|
|
21
21
|
4. Warn the user — this resets all progress on this service
|
|
22
22
|
|
|
23
|
-
## Discarding
|
|
23
|
+
## Discarding changes (failed commit unit)
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Two cases depending on when the failure occurs:
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
### Before commit (failure in temp worktree during implementation)
|
|
28
|
+
|
|
29
|
+
If the teammate fails tests or produces bad code in the temp worktree:
|
|
30
|
+
|
|
31
|
+
1. Remove the temp worktree: `git -C ../{repo} worktree remove --force /tmp/{repo}-commit-{N}`
|
|
32
|
+
2. Mark the commit unit ❌ in the plan with reason
|
|
33
|
+
3. Create a new temp worktree: `git -C ../{repo} worktree add /tmp/{repo}-commit-{N}-retry session/{name}`
|
|
34
|
+
4. Re-spawn implementer with corrected instructions in the new temp worktree
|
|
35
|
+
5. If 2 retries fail → escalate to user
|
|
36
|
+
|
|
37
|
+
### After commit (user rejects changes after reviewing via checkout)
|
|
38
|
+
|
|
39
|
+
If the team lead committed in the temp worktree but the user rejects it after review:
|
|
40
|
+
|
|
41
|
+
1. Revert the commit on the session branch:
|
|
28
42
|
```bash
|
|
29
|
-
git -C
|
|
30
|
-
git -C
|
|
43
|
+
PARENT=$(git -C ../{repo} rev-parse session/{name}~1)
|
|
44
|
+
git -C ../{repo} update-ref refs/heads/session/{name} $PARENT
|
|
31
45
|
```
|
|
32
46
|
2. Mark the commit unit ❌ in the plan with reason
|
|
33
|
-
3.
|
|
34
|
-
4.
|
|
47
|
+
3. Create a new temp worktree: `git -C ../{repo} worktree add /tmp/{repo}-commit-{N}-retry session/{name}`
|
|
48
|
+
4. Re-spawn implementer with corrected instructions (include user feedback)
|
|
49
|
+
5. If 2 retries fail → escalate to user
|
|
35
50
|
|
|
36
51
|
## Failed dispatch tracking
|
|
37
52
|
|
|
@@ -2,18 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Reference file for dispatch-feature and team-lead. Loaded on-demand.
|
|
4
4
|
|
|
5
|
-
> v5.
|
|
6
|
-
> committing, then signals when code is ready
|
|
7
|
-
>
|
|
8
|
-
>
|
|
9
|
-
>
|
|
10
|
-
> fill with all rules from
|
|
5
|
+
> v5.3.0 model: ONE teammate per COMMIT UNIT in a temporary worktree. The teammate
|
|
6
|
+
> writes code without committing, then signals when code is ready. The team lead
|
|
7
|
+
> extracts a patch, applies it to the session worktree, and the user reviews in
|
|
8
|
+
> their IDE. Teammates receive a temp worktree — NO git setup in spawn prompts.
|
|
9
|
+
> Implementers do NOT receive the constitution automatically. Every spawn template
|
|
10
|
+
> below includes a "Constitution" section that you MUST fill with all rules from
|
|
11
|
+
> your workspace's constitution.md.
|
|
12
|
+
|
|
13
|
+
> **PREREQUISITE**: Before using any template below, you MUST have already called
|
|
14
|
+
> `TeamCreate(team_name: "session-{name}")`. Every `Agent()` call that spawns an
|
|
15
|
+
> implementer MUST include `team_name: "session-{name}"`. Omitting `team_name`
|
|
16
|
+
> will cause a denial — do not attempt to debug, just add it.
|
|
11
17
|
|
|
12
18
|
## Context tiering — what to inject per repo type
|
|
13
19
|
|
|
14
20
|
| Context | Backend repo | Frontend repo | Infra repo |
|
|
15
21
|
|---------|:-:|:-:|:-:|
|
|
16
|
-
|
|
|
22
|
+
| temp_worktree_path + session_branch | ALWAYS | ALWAYS | ALWAYS |
|
|
17
23
|
| This commit unit's tasks ONLY + context summary | ALWAYS | ALWAYS | ALWAYS |
|
|
18
24
|
| Constitution rules | ALWAYS | ALWAYS | ALWAYS |
|
|
19
25
|
| Signal-when-ready instruction (no commit) | ALWAYS | ALWAYS | ALWAYS |
|
|
@@ -21,7 +27,7 @@ Reference file for dispatch-feature and team-lead. Loaded on-demand.
|
|
|
21
27
|
| UX standards | Never | If UI commits | Never |
|
|
22
28
|
|
|
23
29
|
> **No git instructions in spawn prompts.** The implementer agent knows it has
|
|
24
|
-
> a ready worktree. Only provide the
|
|
30
|
+
> a ready worktree. Only provide: temp_worktree_path (the /tmp/{repo}-commit-{N} path), session_branch.
|
|
25
31
|
|
|
26
32
|
## Backend/API teammate spawn template
|
|
27
33
|
|
|
@@ -29,7 +35,7 @@ Reference file for dispatch-feature and team-lead. Loaded on-demand.
|
|
|
29
35
|
You are the implementer teammate for [{repo}].
|
|
30
36
|
|
|
31
37
|
## Your workspace
|
|
32
|
-
-
|
|
38
|
+
- Temporary worktree (ready, isolated, go directly here): {temp_worktree_path}
|
|
33
39
|
- Session branch: {session_branch}
|
|
34
40
|
- Your worktree is already on the correct branch — no git setup needed.
|
|
35
41
|
|
|
@@ -58,9 +64,9 @@ Do NOT run git add or git commit. Leave all changes uncommitted.
|
|
|
58
64
|
The team lead will commit after user review.
|
|
59
65
|
|
|
60
66
|
## Instructions
|
|
61
|
-
1. Go directly to your worktree: cd {
|
|
67
|
+
1. Go directly to your worktree: cd {temp_worktree_path}
|
|
62
68
|
2. Read the repo CLAUDE.md — follow its conventions throughout
|
|
63
|
-
3. Check git log to see what
|
|
69
|
+
3. Check git log to see what previous commits already implemented
|
|
64
70
|
4. Implement your commit unit — run tests and report results
|
|
65
71
|
5. Do NOT run git add or git commit
|
|
66
72
|
6. List dead code found
|
|
@@ -74,7 +80,7 @@ The team lead will commit after user review.
|
|
|
74
80
|
You are the implementer teammate for [{repo}].
|
|
75
81
|
|
|
76
82
|
## Your workspace
|
|
77
|
-
-
|
|
83
|
+
- Temporary worktree (ready, isolated, go directly here): {temp_worktree_path}
|
|
78
84
|
- Session branch: {session_branch}
|
|
79
85
|
- Your worktree is already on the correct branch — no git setup needed.
|
|
80
86
|
|
|
@@ -105,9 +111,9 @@ Do NOT run git add or git commit. Leave all changes uncommitted.
|
|
|
105
111
|
The team lead will commit after user review.
|
|
106
112
|
|
|
107
113
|
## Instructions
|
|
108
|
-
1. Go directly to your worktree: cd {
|
|
114
|
+
1. Go directly to your worktree: cd {temp_worktree_path}
|
|
109
115
|
2. Read the repo CLAUDE.md — follow its conventions throughout
|
|
110
|
-
3. Check git log to see what
|
|
116
|
+
3. Check git log to see what previous commits already implemented
|
|
111
117
|
4. Implement your commit unit
|
|
112
118
|
5. For every UI component: implement all 4 states (skeleton, empty+CTA, error+retry, success)
|
|
113
119
|
6. Run tests — report pass/fail in your signal
|
|
@@ -122,7 +128,7 @@ The team lead will commit after user review.
|
|
|
122
128
|
You are the implementer teammate for [{repo}] (infrastructure/configuration).
|
|
123
129
|
|
|
124
130
|
## Your workspace
|
|
125
|
-
-
|
|
131
|
+
- Temporary worktree (ready, isolated, go directly here): {temp_worktree_path}
|
|
126
132
|
- Session branch: {session_branch}
|
|
127
133
|
- Your worktree is already on the correct branch — no git setup needed.
|
|
128
134
|
|
|
@@ -146,47 +152,23 @@ Do NOT run git add or git commit. Leave all changes uncommitted.
|
|
|
146
152
|
The team lead will commit after user review.
|
|
147
153
|
|
|
148
154
|
## Instructions
|
|
149
|
-
1. Go directly to your worktree: cd {
|
|
155
|
+
1. Go directly to your worktree: cd {temp_worktree_path}
|
|
150
156
|
2. Implement ONLY configuration changes — no application code
|
|
151
157
|
3. Verify consistency with other services (env vars, routes, schemas)
|
|
152
158
|
4. Do NOT run git add or git commit
|
|
153
159
|
5. Escalate if you hit configuration decisions not covered by the plan
|
|
154
160
|
```
|
|
155
161
|
|
|
156
|
-
## Haiku micro-QA subagent template
|
|
157
|
-
|
|
158
|
-
Used by Opus in Phase 4 micro-QA on uncommitted changes (git diff, not git diff HEAD~1 HEAD).
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
Read the following git diff (uncommitted changes) and return ONLY a JSON object — no markdown, no preamble:
|
|
162
|
-
|
|
163
|
-
If no issues found:
|
|
164
|
-
{"status":"OK"}
|
|
165
|
-
|
|
166
|
-
If a blocking issue found:
|
|
167
|
-
{"status":"BLOCKER","file":"path/to/file","line":42,"reason":"specific reason"}
|
|
168
|
-
|
|
169
|
-
Check for:
|
|
170
|
-
1. API contract consistency — do returned/sent fields match the contract shapes provided?
|
|
171
|
-
2. Unjustified TypeScript 'any' — any usage that loses type safety without clear reason
|
|
172
|
-
3. Missing error handling — new public endpoints or functions without error handling
|
|
173
|
-
4. Obvious logic errors — visible in the diff without running the code
|
|
174
|
-
|
|
175
|
-
Return ONLY the JSON object. No text before or after it.
|
|
176
|
-
|
|
177
|
-
Diff (uncommitted):
|
|
178
|
-
{git diff output}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
162
|
## Failure handling
|
|
182
163
|
|
|
183
|
-
When a teammate signals a failure or when
|
|
164
|
+
When a teammate signals a failure or when patch extraction/apply fails:
|
|
184
165
|
|
|
185
166
|
| Situation | Action |
|
|
186
167
|
|-----------|--------|
|
|
187
|
-
| Tests fail on commit unit N | Re-spawn implementer with fix instructions
|
|
188
|
-
|
|
|
168
|
+
| Tests fail on commit unit N | Re-spawn implementer with fix instructions in a NEW temp worktree |
|
|
169
|
+
| Patch apply fails | Try `git apply --3way`; if still fails, keep temp worktree, escalate to user |
|
|
189
170
|
| Architectural decision not in plan | STOP the wave, escalate to user, resume after direction |
|
|
190
|
-
| Teammate silent / no signal | Check worktree git status/diff, re-spawn or escalate |
|
|
171
|
+
| Teammate silent / no signal | Check temp worktree git status/diff, re-spawn or escalate |
|
|
191
172
|
| Max 2 retries on same commit | Mark ❌ ESCALATED, stop the wave, present to user |
|
|
173
|
+
| User rejects changes | Discard in session worktree, create new temp worktree, re-dispatch with fix instructions |
|
|
192
174
|
| Corrupted branch | Use rollback protocol (see team-lead agent / rollback-protocol.md) |
|
|
@@ -12,7 +12,7 @@ SESSIONS_DIR="$PROJECT_DIR/.sessions"
|
|
|
12
12
|
ORPHAN_COUNT=0
|
|
13
13
|
|
|
14
14
|
shopt -s nullglob
|
|
15
|
-
for wt in /tmp/*-session-* /tmp/e2e-*; do
|
|
15
|
+
for wt in /tmp/*-session-* /tmp/*-commit-* /tmp/e2e-*; do
|
|
16
16
|
[ -d "$wt" ] || continue
|
|
17
17
|
|
|
18
18
|
# Check if this worktree belongs to an active session
|
|
@@ -26,7 +26,7 @@ if [ "$TOOL_NAME" = "Bash" ]; then
|
|
|
26
26
|
|
|
27
27
|
# SECURITY: reject compound commands — never auto-approve chained operations
|
|
28
28
|
# This prevents `git branch session/x && rm -rf /` style bypasses
|
|
29
|
-
# Exception: `cd /tmp/... && <safe-test-command>` is a legitimate
|
|
29
|
+
# Exception: `cd /tmp/... && <safe-test-command>` is a legitimate verification pattern
|
|
30
30
|
if echo "$COMMAND" | grep -qE '(&&|\|\||[;|]|`|\$\()'; then
|
|
31
31
|
# Allow: cd /tmp/{worktree} && {test-command}
|
|
32
32
|
if echo "$COMMAND" | grep -qE '^\s*cd\s+(/private)?/tmp/[a-zA-Z][a-zA-Z0-9_-]+\s+&&\s+(npm run (typecheck|test|lint)|php artisan test|go test|pytest|npx vitest|npx jest|yarn test|pnpm test)\b'; then
|
|
@@ -56,7 +56,7 @@ if [ "$TOOL_NAME" = "Bash" ]; then
|
|
|
56
56
|
exit 0
|
|
57
57
|
fi
|
|
58
58
|
|
|
59
|
-
# Safe typecheck/test commands in /tmp/ worktrees
|
|
59
|
+
# Safe typecheck/test commands in /tmp/ worktrees
|
|
60
60
|
# Compound check above already rejected chained commands
|
|
61
61
|
if echo "$COMMAND" | grep -qE '^\s*cd\s+(/private)?/tmp/[a-zA-Z]'; then
|
|
62
62
|
echo "$ALLOW_JSON"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# user-prompt-guard.sh
|
|
3
3
|
# UserPromptSubmit hook: conditionally reminds the orchestrator of its role.
|
|
4
|
-
# v5.
|
|
5
|
-
# purposes (branch creation, worktree management,
|
|
4
|
+
# v5.3: Updated to reflect that Opus can run git/bash on repos for orchestration
|
|
5
|
+
# purposes (branch creation, worktree management, patch extraction), but not code changes.
|
|
6
6
|
# Non-blocking (exit 0 + stdout = context injection).
|
|
7
7
|
set -euo pipefail
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ PROMPT=$(echo "$INPUT" | jq -r '.prompt // empty' 2>/dev/null) || true
|
|
|
13
13
|
|
|
14
14
|
# Only inject reminder if user prompt matches direct code-writing patterns
|
|
15
15
|
if echo "$PROMPT" | grep -qiE '(modifie.*fichier|édite.*(api|front|light|spring|scraper|krakend|dashboard)|patch.*service|écris.*dans.*repo|write.*in.*repo|code.*dans.*repo)' 2>/dev/null; then
|
|
16
|
-
echo "Role reminder: Writing application code in sibling repos is for teammates. You can write in orchestrator/ (plans, workspace.md, constitution.md) and run git commands (branch, worktree, log
|
|
16
|
+
echo "Role reminder: Writing application code in sibling repos is for teammates. You can write in orchestrator/ (plans, workspace.md, constitution.md) and run git commands (branch, worktree, log, diff, apply) in /tmp/ worktrees for patch extraction. For repo application code changes: spawn a teammate."
|
|
17
17
|
fi
|
|
18
18
|
|
|
19
19
|
exit 0
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: metrics
|
|
3
|
-
prompt_version: 5.
|
|
3
|
+
prompt_version: 5.3.0
|
|
4
4
|
description: >
|
|
5
5
|
Quantitative analysis of orchestrator performance. Parses session logs,
|
|
6
6
|
completed plans, and QA reports to produce KPIs: re-dispatch rate,
|
|
7
|
-
|
|
7
|
+
patch-apply first-pass rate, commits per session, QA findings distribution,
|
|
8
8
|
escalation rate, and phase timing estimates.
|
|
9
9
|
Use: /metrics, /metrics last-5, /metrics session-name.
|
|
10
10
|
Helps justify model routing decisions and prompt improvements.
|
|
@@ -8,7 +8,7 @@ globs: ["workspace.md", "plans/**", "constitution.md", "templates/**"]
|
|
|
8
8
|
## Golden rule
|
|
9
9
|
The orchestrator NEVER writes application code in repos. It describes what teammates must do.
|
|
10
10
|
Writing plans, workspace.md, constitution.md in orchestrator/ is expected and normal.
|
|
11
|
-
Running git commands (branch, worktree, log) and test/typecheck in /tmp/ worktrees is expected
|
|
11
|
+
Running git commands (branch, worktree, log, diff, apply) and test/typecheck in /tmp/ worktrees is expected.
|
|
12
12
|
If you write application code in a repo (not a markdown plan, not a git command, not a test run), you have failed — delegate.
|
|
13
13
|
|
|
14
14
|
## Security layers (3 layers in agent frontmatter)
|
|
@@ -26,7 +26,6 @@ If you write application code in a repo (not a markdown plan, not a git command,
|
|
|
26
26
|
| Code reviewer | **Opus** | `claude --agent reviewer` (evidence-based review, architecture judgment) |
|
|
27
27
|
| Security auditor | **Opus** | `claude --agent security-auditor` (auth flows, tenant isolation, secrets, CVEs) |
|
|
28
28
|
| Plan review | **Sonnet** | `plan-review` skill (constitution compliance needs reasoning) |
|
|
29
|
-
| Micro-QA diff review | **Haiku** | `Task(Explore, model: haiku)` — structured diff check only |
|
|
30
29
|
| Data extractors (cross-check, debug, retro) | **Haiku** | `Task(Explore, model: haiku)` — raw data extraction only |
|
|
31
30
|
|
|
32
31
|
## Gather → Reason pattern
|
|
@@ -41,8 +40,7 @@ Skills that need both data collection and analysis use a two-phase approach:
|
|
|
41
40
|
the raw data and performs all analysis: comparison, correlation, judgment, diagnosis,
|
|
42
41
|
and report writing.
|
|
43
42
|
|
|
44
|
-
This pattern applies to: `cross-service-check`, `incident-debug`, `cycle-retrospective
|
|
45
|
-
and micro-QA diff review in dispatch-feature Phase 4.
|
|
43
|
+
This pattern applies to: `cross-service-check`, `incident-debug`, `cycle-retrospective`.
|
|
46
44
|
|
|
47
45
|
It does NOT apply to: `qa-ruthless` (QA investigators are Sonnet — they need to run tests
|
|
48
46
|
and reason about code quality), `plan-review` (Sonnet — constitution compliance requires reasoning).
|
|
@@ -56,4 +54,7 @@ Constraint: Opus reads only files directly related to the feature scope.
|
|
|
56
54
|
|
|
57
55
|
## Implementer model
|
|
58
56
|
Implementation teammates use **Sonnet** via Agent Teams (`TeamCreate` + `Agent(subagent_type: "implementer", team_name: ...)`).
|
|
57
|
+
**WARNING**: The Agent tool description does not mention `team_name`, but it is REQUIRED.
|
|
58
|
+
Bare `Agent(subagent_type: "implementer")` without `team_name` will be denied.
|
|
59
|
+
Always call `TeamCreate(team_name: "session-{name}")` first.
|
|
59
60
|
One teammate per commit unit. Each implementer handles a single commit unit, writes code without committing, and signals when ready for review.
|
package/package.json
CHANGED