cc-workspace 5.2.2 → 5.2.3

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 CHANGED
@@ -1,20 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.2.3] — 2026-03-09
4
+
5
+ ### Agent Teams — correct tool mechanism
6
+
7
+ The `Teammate` tool referenced in previous versions does not exist in Claude Code.
8
+ Agent Teams actually works via `TeamCreate` + `Agent(subagent_type, team_name)` + `SendMessage`.
9
+
10
+ - **Replaced all `Teammate` references with real Agent Teams tools** — team-lead,
11
+ e2e-validator, dispatch-feature, qa-ruthless, incident-debug now use `TeamCreate`,
12
+ `TeamDelete`, and `SendMessage` instead of the non-existent `Teammate` tool.
13
+
14
+ - **Teammate spawn workflow documented** — dispatch-feature now includes the explicit
15
+ 3-step workflow: `TeamCreate` → `Agent(implementer, team_name)` → `SendMessage`.
16
+
17
+ - **validate-spawn-prompt hook updated** — matcher changed from `Teammate` to `Agent`,
18
+ with a `subagent_type` filter to only validate implementer spawns (skips Explore).
19
+
20
+ - **model-routing rule updated** — routing table now documents the real mechanism.
21
+
22
+ - **Auto-enable Agent Teams on install** — `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is
23
+ now automatically injected into `~/.claude/settings.json` during install/update.
24
+
3
25
  ## [5.2.2] — 2026-03-09
4
26
 
5
27
  ### Agent Teams enforcement
6
28
 
7
29
  - **Removed `Task(implementer)` from agent tools** — team-lead and e2e-validator can no
8
- longer spawn implementers as subagents. All implementer spawns now go through the
9
- `Teammate` tool exclusively, enforcing the Agent Teams communication protocol
10
- (SendMessage/wait loop, micro-QA between commits).
30
+ longer spawn implementers as subagents via Task. Implementers must be spawned through
31
+ Agent Teams (TeamCreate + Agent with team_name).
11
32
 
12
- - **e2e-validator gains `Teammate, SendMessage`** — can now delegate `--fix` repairs
13
- through the proper teammate protocol instead of Task subagents.
33
+ - **e2e-validator gains Agent Teams tools** — can now delegate `--fix` repairs
34
+ through the proper teammate protocol.
14
35
 
15
36
  - **Auto-enable Agent Teams on install** — `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` is
16
37
  now automatically injected into `~/.claude/settings.json` during `npx cc-workspace install`.
17
- Users no longer need to set this environment variable manually.
18
38
 
19
39
  ## [5.2.1] — 2026-03-06
20
40
 
package/bin/cli.js CHANGED
@@ -291,7 +291,7 @@ function generateSettings(orchDir) {
291
291
  // guard-session-checkout.sh is NOT here — it's in implementer agent
292
292
  // frontmatter only. team-lead doesn't have Bash, and teammates don't
293
293
  // inherit orchestrator hooks.
294
- withMatcher("Teammate", "validate-spawn-prompt.sh", 5)
294
+ withMatcher("Agent", "validate-spawn-prompt.sh", 5)
295
295
  ],
296
296
  SessionStart: [
297
297
  withoutMatcher("orphan-cleanup.sh", 10),
@@ -331,7 +331,7 @@ You are the tech lead. You never write application code in repos.
331
331
  You clarify, plan, manage git directly, delegate to teammates, run micro-QA.
332
332
 
333
333
  ## Security
334
- - \`tools\`: Read, Write, Edit, Bash, Glob, Grep, Task(Explore), Teammate, SendMessage
334
+ - \`tools\`: Read, Write, Edit, Bash, Glob, Grep, Task(Explore), TeamCreate, TeamDelete, SendMessage
335
335
  - Bash allowed for: git (branch, worktree, log), test/typecheck in /tmp/ worktrees (micro-QA)
336
336
  - Hook \`PreToolUse\` path-aware: Write/Edit/MultiEdit only allowed in orchestrator/
337
337
 
@@ -11,7 +11,7 @@ description: >
11
11
  model: opus
12
12
  tools: >
13
13
  Read, Write, Edit, Bash, Glob, Grep,
14
- Task(Explore), Teammate, SendMessage,
14
+ Task(Explore), TeamCreate, TeamDelete, SendMessage,
15
15
  mcp__chrome-devtools__navigate_page,
16
16
  mcp__chrome-devtools__click,
17
17
  mcp__chrome-devtools__fill,
@@ -40,7 +40,7 @@ maxTurns: 150
40
40
 
41
41
  ## CRITICAL — Non-negotiable rules (read FIRST)
42
42
 
43
- 1. **NEVER modify application code** — delegate via `--fix` + Teammate(implementer)
43
+ 1. **NEVER modify application code** — delegate via `--fix` + Agent Teams (TeamCreate + Agent(implementer, team_name))
44
44
  2. **No worktrees** — work directly on repos at the correct branch (merged or session)
45
45
  3. **Health checks BEFORE tests** — never run tests against unhealthy services
46
46
  4. **Always teardown** — `docker compose down -v` even on failure
@@ -242,7 +242,7 @@ Not tied to a specific plan — runs all existing E2E tests.
242
242
  If failures exist after report and user confirms:
243
243
 
244
244
  1. Read session JSON for the plan → get `worktree_path` per repo (still exists if session not closed)
245
- 2. Spawn one **Teammate(implementer)** per failing repo with:
245
+ 2. Create a team (`TeamCreate`), then spawn one **Agent(subagent_type: "implementer", team_name: ...)** per failing repo with:
246
246
  - `worktree_path` from session JSON (or source branch if already merged)
247
247
  - Failure details from the E2E report
248
248
  - Session branch
@@ -9,7 +9,7 @@ description: >
9
9
  Never codes in repos — can write in orchestrator/ and run git commands.
10
10
  Triggered via claude --agent team-lead.
11
11
  model: opus
12
- tools: Read, Write, Edit, Bash, Glob, Grep, Task(Explore), Teammate, SendMessage
12
+ tools: Read, Write, Edit, Bash, Glob, Grep, Task(Explore), TeamCreate, TeamDelete, SendMessage
13
13
  memory: project
14
14
  maxTurns: 200
15
15
  hooks:
@@ -135,7 +135,7 @@ This table is your quick reference — **defer to the skill for specifics**.
135
135
  | 2 — Plan | Write ./plans/{name}.md from _TEMPLATE.md | Wait for user validation |
136
136
  | 2.5 — Git setup | `git branch` + `git worktree add` via Bash | Only after plan validation |
137
137
  | 2.9 — Pre-dispatch | Verify branches + worktrees exist and are clean | Auto-fix simple cases |
138
- | 3 — Dispatch | ONE Teammate per repo, all commits sequential | See @dispatch-feature/references/spawn-templates.md |
138
+ | 3 — Dispatch | ONE teammate per repo (via TeamCreate + Agent), all commits sequential | See @dispatch-feature/references/spawn-templates.md |
139
139
  | 4 — Micro-QA | Bash tests + Haiku diff after each commit | Green light or fix instruction |
140
140
  | 5 — Post-impl | cross-service → qa-ruthless → reviewer → (security-auditor if needed) → merge-prep → retro | All mandatory except security-auditor |
141
141
 
@@ -12,7 +12,7 @@ description: >
12
12
  "dispatch", "start dev", "launch teammates", or provides a spec.
13
13
  argument-hint: "[feature description]"
14
14
  context: fork
15
- allowed-tools: Read, Write, Bash, Glob, Grep, Task, Teammate, SendMessage
15
+ allowed-tools: Read, Write, Bash, Glob, Grep, Task, TeamCreate, TeamDelete, SendMessage
16
16
  ---
17
17
 
18
18
  # Dispatch Feature — Clarify, Plan, Git, Delegate, Track
@@ -177,12 +177,23 @@ Only proceed to Phase 3 once all checks pass.
177
177
 
178
178
  ## Phase 3: Dispatch — one teammate per repo
179
179
 
180
- **ONE teammate per repo.** Each teammate receives the complete repo plan and handles
181
- all its commit units sequentially. It signals after each commit and waits for green light.
180
+ **ONE teammate per repo.** Use `TeamCreate` to create a team for the session, then spawn
181
+ each repo's implementer via `Agent(subagent_type: "implementer", team_name: ...)`.
182
+ Each teammate receives the complete repo plan and handles all its commit units sequentially.
183
+ It signals after each commit via `SendMessage` and waits for green light.
182
184
 
183
185
  This is fundamentally different from the old model (one subagent per commit unit).
184
186
  The teammate has the full picture of its repo and can escalate intelligently at any point.
185
187
 
188
+ ### Teammate spawn — workflow
189
+
190
+ ```
191
+ 1. TeamCreate(team_name: "session-{name}")
192
+ 2. For each repo in wave:
193
+ Agent(subagent_type: "implementer", team_name: "session-{name}", prompt: "...")
194
+ 3. SendMessage to coordinate (green light, fix instructions, STOP)
195
+ ```
196
+
186
197
  ### Teammate spawn prompt — context tiering
187
198
 
188
199
  See @references/spawn-templates.md for full templates.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  # validate-spawn-prompt.sh
3
- # PreToolUse hook (matcher: Teammate): validates that teammate spawn prompts
3
+ # PreToolUse hook (matcher: Agent): validates that teammate spawn prompts
4
4
  # contain the required context before allowing the spawn.
5
5
  # v5.0: Updated for one-teammate-per-repo model with worktree_path and signal protocol.
6
6
  # ALL checks are non-blocking warnings (exit 0 + stdout).
@@ -8,6 +8,12 @@ set -euo pipefail
8
8
 
9
9
  INPUT=$(cat)
10
10
 
11
+ # Only validate implementer spawns (skip Explore and other subagent types)
12
+ SUBAGENT_TYPE=$(echo "$INPUT" | jq -r '.tool_input.subagent_type // empty' 2>/dev/null) || true
13
+ if [ "$SUBAGENT_TYPE" != "implementer" ]; then
14
+ exit 0
15
+ fi
16
+
11
17
  # Extract the spawn prompt from tool input
12
18
  PROMPT=$(echo "$INPUT" | jq -r '.tool_input.prompt // empty' 2>/dev/null) || true
13
19
 
@@ -48,12 +54,12 @@ fi
48
54
 
49
55
  # Check 3: Worktree path (v5 — teammates receive a ready worktree)
50
56
  if ! echo "$PROMPT" | grep -qiE '(worktree.path|worktree.ready|go directly|/tmp/[a-z])' 2>/dev/null; then
51
- BLOCKERS+="- Missing worktree_path in spawn prompt. Teammate needs the /tmp/ path prepared by Opus.\n"
57
+ BLOCKERS+="- Missing worktree_path in spawn prompt. Implementer needs the /tmp/ path prepared by Opus.\n"
52
58
  fi
53
59
 
54
60
  # Check 4: Signal protocol instruction
55
61
  if ! echo "$PROMPT" | grep -qiE '(SendMessage|signal protocol|commit N done|green light|wait for)' 2>/dev/null; then
56
- BLOCKERS+="- Missing signal protocol instruction. Teammate must know to SendMessage after each commit and wait for green light.\n"
62
+ BLOCKERS+="- Missing signal protocol instruction. Implementer must know to SendMessage after each commit and wait for green light.\n"
57
63
  fi
58
64
 
59
65
  # Check 5: CLAUDE.md instruction
@@ -8,7 +8,7 @@ description: >
8
8
  stack traces or error logs. Also French triggers: "erreur", "ça marche pas".
9
9
  argument-hint: "[error description or stack trace]"
10
10
  context: fork
11
- allowed-tools: Read, Write, Glob, Grep, Task, Teammate, SendMessage
11
+ allowed-tools: Read, Write, Glob, Grep, Task, TeamCreate, TeamDelete, SendMessage
12
12
  ---
13
13
 
14
14
  # Incident Debug — Multi-Layer Investigation
@@ -10,7 +10,7 @@ description: >
10
10
  argument-hint: "[plan-name or 'all']"
11
11
  context: fork
12
12
  model: opus
13
- allowed-tools: Read, Write, Glob, Grep, Task, Teammate, SendMessage
13
+ allowed-tools: Read, Write, Glob, Grep, Task, TeamCreate, TeamDelete, SendMessage
14
14
  ---
15
15
 
16
16
  # QA Ruthless — Adversarial Quality Review
@@ -20,9 +20,9 @@ If you write application code in a repo (not a markdown plan, not a git command,
20
20
  | Role | Model | Mechanism |
21
21
  |------|-------|-----------|
22
22
  | Orchestrator | **Opus** | `claude --agent team-lead` (frontmatter `model: opus`) |
23
- | Implementation teammates | **Sonnet** | `Teammate` tool via Agent Teams |
23
+ | Implementation teammates | **Sonnet** | `TeamCreate` + `Agent(implementer, team_name)` via Agent Teams |
24
24
  | QA orchestration | **Opus** | `qa-ruthless` skill (frontmatter `model: opus`) |
25
- | QA investigators | **Sonnet** | `Teammate` tool via Agent Teams (spawned by qa-ruthless) |
25
+ | QA investigators | **Sonnet** | `TeamCreate` + `Agent(implementer, team_name)` via Agent Teams (spawned by qa-ruthless) |
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) |
@@ -55,5 +55,5 @@ Rationale: Opus knows what to look for based on the feature. Haiku summaries los
55
55
  Constraint: Opus reads only files directly related to the feature scope.
56
56
 
57
57
  ## Implementer model
58
- Implementation teammates use **Sonnet** via the `Teammate` tool.
58
+ Implementation teammates use **Sonnet** via Agent Teams (`TeamCreate` + `Agent(subagent_type: "implementer", team_name: ...)`).
59
59
  One teammate per repo. The teammate handles all commit units for its repo sequentially.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-workspace",
3
- "version": "5.2.2",
3
+ "version": "5.2.3",
4
4
  "description": "Claude Code multi-workspace orchestrator \u2014 skills, hooks, agents, and templates for multi-service projects",
5
5
  "bin": {
6
6
  "cc-workspace": "./bin/cli.js"