cc-workspace 4.7.0 → 5.2.1
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 +291 -0
- package/README.md +123 -41
- package/bin/cli.js +313 -134
- package/global-skills/agents/e2e-validator.md +151 -32
- package/global-skills/agents/implementer.md +80 -68
- package/global-skills/agents/reviewer.md +192 -0
- package/global-skills/agents/security-auditor.md +345 -0
- package/global-skills/agents/team-lead.md +93 -101
- package/global-skills/agents/workspace-init.md +16 -5
- package/global-skills/bootstrap-repo/SKILL.md +1 -0
- package/global-skills/cleanup/SKILL.md +35 -25
- package/global-skills/cross-service-check/SKILL.md +1 -0
- package/global-skills/cycle-retrospective/SKILL.md +6 -4
- package/global-skills/dispatch-feature/SKILL.md +225 -173
- package/global-skills/dispatch-feature/references/anti-patterns.md +52 -35
- package/global-skills/dispatch-feature/references/spawn-templates.md +140 -97
- package/global-skills/doctor/SKILL.md +124 -25
- package/global-skills/e2e-validator/references/container-strategies.md +55 -23
- package/global-skills/hooks/orphan-cleanup.sh +60 -0
- package/global-skills/hooks/permission-auto-approve.sh +61 -4
- package/global-skills/hooks/session-start-context.sh +10 -47
- package/global-skills/hooks/test_hooks.sh +242 -0
- package/global-skills/hooks/user-prompt-guard.sh +6 -6
- package/global-skills/hooks/validate-spawn-prompt.sh +40 -30
- package/global-skills/incident-debug/SKILL.md +1 -0
- package/global-skills/merge-prep/SKILL.md +1 -0
- package/global-skills/metrics/SKILL.md +139 -0
- package/global-skills/plan-review/SKILL.md +2 -1
- package/global-skills/qa-ruthless/SKILL.md +2 -0
- package/global-skills/refresh-profiles/SKILL.md +1 -0
- package/global-skills/rules/context-hygiene.md +4 -19
- package/global-skills/rules/model-routing.md +31 -18
- package/global-skills/session/SKILL.md +41 -20
- package/global-skills/templates/workspace.template.md +1 -1
- package/package.json +4 -3
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Model routing rules. The orchestrator never writes in repos — it delegates to teammates. Can write in orchestrator
|
|
2
|
+
description: Model routing rules. The orchestrator never writes application code in repos — it delegates to teammates. Can write in orchestrator/, run git commands, and run test commands in /tmp/ worktrees.
|
|
3
3
|
globs: ["workspace.md", "plans/**", "constitution.md", "templates/**"]
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Model Routing
|
|
7
7
|
|
|
8
8
|
## Golden rule
|
|
9
|
-
The orchestrator NEVER writes code in repos. It describes what teammates must do.
|
|
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
|
-
|
|
11
|
+
Running git commands (branch, worktree, log) and test/typecheck in /tmp/ worktrees is expected (micro-QA).
|
|
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.
|
|
12
13
|
|
|
13
|
-
## Security layers (3 layers in agent frontmatter
|
|
14
|
-
1. **Agent frontmatter**: `
|
|
15
|
-
2. **Agent frontmatter**: `
|
|
16
|
-
3. **Agent
|
|
14
|
+
## Security layers (3 layers in agent frontmatter)
|
|
15
|
+
1. **Agent frontmatter**: `tools` — whitelist of permitted tools
|
|
16
|
+
2. **Agent frontmatter hooks**: `PreToolUse` Write|Edit|MultiEdit — path-aware deny for writes outside orchestrator/
|
|
17
|
+
3. **Agent frontmatter hooks**: `PreToolUse` Bash (implementer only) — blocks git checkout on main working trees
|
|
17
18
|
|
|
18
19
|
## Routing table
|
|
19
20
|
| Role | Model | Mechanism |
|
|
20
21
|
|------|-------|-----------|
|
|
21
|
-
| Orchestrator | **Opus
|
|
22
|
-
| Implementation teammates | **Sonnet
|
|
23
|
-
| QA
|
|
24
|
-
|
|
|
25
|
-
|
|
|
22
|
+
| Orchestrator | **Opus** | `claude --agent team-lead` (frontmatter `model: opus`) |
|
|
23
|
+
| Implementation teammates | **Sonnet** | `Teammate` tool via Agent Teams |
|
|
24
|
+
| QA orchestration | **Opus** | `qa-ruthless` skill (frontmatter `model: opus`) |
|
|
25
|
+
| QA investigators | **Sonnet** | `Teammate` tool via Agent Teams (spawned by qa-ruthless) |
|
|
26
|
+
| Code reviewer | **Opus** | `claude --agent reviewer` (evidence-based review, architecture judgment) |
|
|
27
|
+
| Security auditor | **Opus** | `claude --agent security-auditor` (auth flows, tenant isolation, secrets, CVEs) |
|
|
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
|
+
| Data extractors (cross-check, debug, retro) | **Haiku** | `Task(Explore, model: haiku)` — raw data extraction only |
|
|
26
31
|
|
|
27
32
|
## Gather → Reason pattern
|
|
28
33
|
|
|
@@ -36,11 +41,19 @@ Skills that need both data collection and analysis use a two-phase approach:
|
|
|
36
41
|
the raw data and performs all analysis: comparison, correlation, judgment, diagnosis,
|
|
37
42
|
and report writing.
|
|
38
43
|
|
|
39
|
-
This pattern applies to: `cross-service-check`, `incident-debug`, `cycle-retrospective
|
|
44
|
+
This pattern applies to: `cross-service-check`, `incident-debug`, `cycle-retrospective`,
|
|
45
|
+
and micro-QA diff review in dispatch-feature Phase 4.
|
|
46
|
+
|
|
40
47
|
It does NOT apply to: `qa-ruthless` (QA investigators are Sonnet — they need to run tests
|
|
41
|
-
and reason about code quality), `plan-review` (
|
|
48
|
+
and reason about code quality), `plan-review` (Sonnet — constitution compliance requires reasoning).
|
|
49
|
+
|
|
50
|
+
## dispatch-feature Phase 1 exception
|
|
51
|
+
|
|
52
|
+
In `dispatch-feature` Phase 1, Opus explores repos **directly** using Read/Glob/Grep.
|
|
53
|
+
There is NO upfront Haiku explorer scan.
|
|
54
|
+
Rationale: Opus knows what to look for based on the feature. Haiku summaries lose critical context.
|
|
55
|
+
Constraint: Opus reads only files directly related to the feature scope.
|
|
42
56
|
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
Agent Teams teammates (Teammate tool) get automatic isolation.
|
|
57
|
+
## Implementer model
|
|
58
|
+
Implementation teammates use **Sonnet** via the `Teammate` tool.
|
|
59
|
+
One teammate per repo. The teammate handles all commit units for its repo sequentially.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: session
|
|
3
|
+
prompt_version: 5.2.1
|
|
3
4
|
description: >
|
|
4
5
|
Manage parallel feature sessions. List active sessions, show detailed status
|
|
5
|
-
with commits per repo, or close a session (PRs + branch cleanup).
|
|
6
|
-
Use: /session, /session status <
|
|
7
|
-
argument-hint: "[list | status <
|
|
6
|
+
with commits per repo, or close a session (PRs + branch cleanup + worktree removal).
|
|
7
|
+
Use: /session, /session status <n>, /session close <n>.
|
|
8
|
+
argument-hint: "[list | status <n> | close <n>]"
|
|
8
9
|
context: fork
|
|
9
10
|
allowed-tools: Bash, Read, Glob, Grep
|
|
10
11
|
---
|
|
@@ -29,50 +30,70 @@ List all sessions with their status:
|
|
|
29
30
|
```
|
|
30
31
|
For each .sessions/*.json:
|
|
31
32
|
- Name, status (active/closed), created date
|
|
32
|
-
- For each repo: session branch,
|
|
33
|
+
- For each repo: session branch, worktree_path, worktree exists?
|
|
33
34
|
- Commit count on session branch vs source branch
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
Run for each active session repo:
|
|
37
38
|
```bash
|
|
38
|
-
git -C ../
|
|
39
|
+
git -C ../{repo} log session/{name} --oneline --not {source_branch} 2>/dev/null | wc -l
|
|
40
|
+
# Check worktree exists
|
|
41
|
+
ls -d {worktree_path} 2>/dev/null && echo "exists" || echo "missing"
|
|
39
42
|
```
|
|
40
43
|
|
|
41
44
|
Present as a clean table.
|
|
42
45
|
|
|
43
|
-
### /session status <
|
|
46
|
+
### /session status <n>
|
|
44
47
|
Detailed view of one session:
|
|
45
48
|
```bash
|
|
46
49
|
# For each repo in the session JSON:
|
|
47
|
-
git -C ../
|
|
48
|
-
git -C ../
|
|
50
|
+
git -C ../{repo} log session/{name} --oneline --not {source_branch} 2>/dev/null
|
|
51
|
+
git -C ../{repo} diff --stat {source_branch}..session/{name} 2>/dev/null
|
|
52
|
+
# Worktree status
|
|
53
|
+
git -C ../{repo} worktree list 2>/dev/null | grep session/{name}
|
|
49
54
|
```
|
|
50
55
|
|
|
51
|
-
Show: commits list, files changed, lines added/removed.
|
|
56
|
+
Show: commits list, files changed, lines added/removed, worktree path and status.
|
|
52
57
|
|
|
53
|
-
### /session close <
|
|
54
|
-
Interactive close — ask before EACH action
|
|
58
|
+
### /session close <n>
|
|
59
|
+
Interactive close — ask before EACH action.
|
|
60
|
+
|
|
61
|
+
**IMPORTANT**: Worktrees are cleaned up HERE (not during the session). This is the
|
|
62
|
+
designated cleanup point for session worktrees.
|
|
55
63
|
|
|
56
64
|
1. **For each repo**: offer to create PR
|
|
57
65
|
```bash
|
|
58
|
-
gh pr create --repo
|
|
59
|
-
--title "
|
|
66
|
+
gh pr create --repo {remote} --base {source_branch} --head session/{name} \
|
|
67
|
+
--title "{session-name}: {repo}" --body "Session: {session-name}"
|
|
68
|
+
```
|
|
69
|
+
Ask: "Create PR session/{name} → {source_branch} in {repo}? [y/N]"
|
|
70
|
+
Note: PR target is the effective source_branch stored in session JSON (respects overrides).
|
|
71
|
+
|
|
72
|
+
2. **For each repo**: offer to remove worktree
|
|
73
|
+
First check for uncommitted changes:
|
|
74
|
+
```bash
|
|
75
|
+
git -C {worktree_path} status --short 2>/dev/null
|
|
76
|
+
```
|
|
77
|
+
If dirty: warn before removal.
|
|
78
|
+
Ask: "Remove worktree {worktree_path} for {repo}? [y/N]"
|
|
79
|
+
```bash
|
|
80
|
+
git -C ../{repo} worktree remove {worktree_path} --force
|
|
81
|
+
git -C ../{repo} worktree prune
|
|
60
82
|
```
|
|
61
|
-
Ask: "Create PR session/X → source in [repo]? [y/N]"
|
|
62
83
|
|
|
63
|
-
|
|
84
|
+
3. **For each repo**: offer to delete session branch
|
|
64
85
|
First check for unpushed commits:
|
|
65
86
|
```bash
|
|
66
|
-
git -C ../
|
|
87
|
+
git -C ../{repo} log session/{name} --oneline --not --remotes 2>/dev/null
|
|
67
88
|
```
|
|
68
89
|
If unpushed: warn before deletion.
|
|
69
|
-
Ask: "Delete branch session/
|
|
90
|
+
Ask: "Delete branch session/{name} in {repo}? [y/N]"
|
|
70
91
|
```bash
|
|
71
|
-
git -C ../
|
|
92
|
+
git -C ../{repo} branch -D session/{name}
|
|
72
93
|
```
|
|
73
94
|
|
|
74
|
-
|
|
75
|
-
Ask: "Delete .sessions/
|
|
95
|
+
4. **Session file**: offer to delete or mark closed
|
|
96
|
+
Ask: "Delete .sessions/{name}.json? [y/N]"
|
|
76
97
|
If no → mark status as "closed" in the JSON.
|
|
77
98
|
|
|
78
99
|
## Output format
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-workspace",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Claude Code multi-workspace orchestrator
|
|
3
|
+
"version": "5.2.1",
|
|
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"
|
|
7
7
|
},
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"bin/",
|
|
10
10
|
"global-skills/",
|
|
11
11
|
"LICENSE",
|
|
12
|
-
"README.md"
|
|
12
|
+
"README.md",
|
|
13
|
+
"CHANGELOG.md"
|
|
13
14
|
],
|
|
14
15
|
"keywords": [
|
|
15
16
|
"claude",
|