cc-workspace 4.5.1 → 4.6.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/README.md CHANGED
@@ -208,6 +208,28 @@ The orchestrator (Opus) never touches repo code. It clarifies the need,
208
208
  writes a plan in markdown, then sends teammates (Sonnet) to work in
209
209
  parallel in each repo via Agent Teams.
210
210
 
211
+ ### Architecture
212
+
213
+ ```
214
+ orchestrator/
215
+ ┌─────────────────────┐
216
+ You ◄──────────► │ Team Lead (Opus) │
217
+ clarify, plan, │ writes plans/*.md │
218
+ review └────────┬────────────┘
219
+ │ spawn
220
+ ┌───────────────┼───────────────┐
221
+ │ │ │
222
+ ▼ ▼ ▼
223
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
224
+ │ Implementer │ │ Implementer │ │ QA Ruthless │
225
+ │ (Sonnet) │ │ (Sonnet) │ │ (Sonnet) │
226
+ └──────┬───────┘ └──────┬───────┘ └──────────────┘
227
+ │ commit │ commit
228
+ ▼ ▼ Explorer
229
+ /tmp/repo-api /tmp/repo-front (Haiku)
230
+ session/feat session/feat read-only
231
+ ```
232
+
211
233
  ### Who does what
212
234
 
213
235
  | Role | Model | What it does |
@@ -231,15 +253,49 @@ parallel in each repo via Agent Teams.
231
253
  ### The dispatch-feature workflow (Mode A)
232
254
 
233
255
  ```
234
- CLARIFY -> ask max 5 questions if ambiguity
235
- PLAN -> write the plan in ./plans/, wait for approval
236
- SESSION -> create session branches in impacted repos (Phase 2.5)
237
- SPAWN -> Wave 1: API/data in parallel
238
- Wave 2: frontend with validated API contract
239
- Wave 3: infra/config if applicable
240
- COLLECT -> update the plan with results
241
- VERIFY -> cross-service-check + qa-ruthless
242
- REPORT -> final summary
256
+ User describes feature
257
+
258
+
259
+ ┌─── Phase 0: CLARIFY ───┐
260
+ Ask max 5 questions │
261
+ if ambiguity │
262
+ └────────┬────────────────┘
263
+
264
+ ┌─── Phase 1-2: PLAN ────┐
265
+ │ Load context │
266
+ │ Write plan in ./plans/ │
267
+ │ Commit units + contract │
268
+ │ Wait for approval ◄─┐ │
269
+ │ │ No ──┘ │
270
+ └────┼────────────────────┘
271
+ │ Yes
272
+
273
+ ┌─── Phase 2.5: SESSION ─┐
274
+ │ git branch session/name │
275
+ │ in each impacted repo │
276
+ └────────┬────────────────┘
277
+
278
+ ┌─── Phase 3: DISPATCH ──────────────────────────┐
279
+ │ │
280
+ │ Wave 1: Producers (API, data, auth) │
281
+ │ ├── Implementer → Commit 1/3 │
282
+ │ ├── Implementer → Commit 2/3 │
283
+ │ └── Implementer → Commit 3/3 │
284
+ │ │ contracts validated │
285
+ │ ▼ │
286
+ │ Wave 2: Consumers (frontend, integrations) │
287
+ │ │ │
288
+ │ ▼ │
289
+ │ Wave 3: Infra (gateway, config) │
290
+ │ │
291
+ └────────┬────────────────────────────────────────┘
292
+
293
+ ┌─── Phase 4-5: VERIFY ──┐
294
+ │ cross-service-check │
295
+ │ + qa-ruthless │
296
+ └────────┬────────────────┘
297
+
298
+ Final summary + propose fixes
243
299
  ```
244
300
 
245
301
  ### Security — path-aware writes
@@ -518,6 +574,19 @@ With `--chrome`, the agent:
518
574
 
519
575
  ---
520
576
 
577
+ ## Changelog v4.5.1 -> v4.6.0
578
+
579
+ | # | Feature | Detail |
580
+ |---|---------|--------|
581
+ | 1 | **Framework-agnostic UX standards** | `frontend-ux-standards.md` no longer hardcodes Quasar. Breakpoints, dialogs, and design system sections now reference the project's chosen library. Constitution overrides are documented. |
582
+ | 2 | **Rollback protocol externalized** | Rollback and failed dispatch procedures moved from team-lead agent prompt (203→~170 lines) to `references/rollback-protocol.md`. Reduces base context load. |
583
+ | 3 | **LSP fallback documented** | `qa-ruthless` and `incident-debug` now include explicit Grep+Glob fallback when LSP tool is unavailable. |
584
+ | 4 | **`cc-workspace uninstall`** | New CLI command to cleanly remove all global components from `~/.claude/`. Interactive confirmation. Local orchestrator/ preserved. |
585
+ | 5 | **workspace-init fixes** | Removed hardcoded version ("v4.0" → dynamic). Fixed skills count in diagnostic (9 → 13). |
586
+ | 6 | **ASCII diagrams in README** | Architecture overview and dispatch workflow now have visual diagrams (ASCII art, compatible with GitHub and npm). |
587
+
588
+ ---
589
+
521
590
  ## Changelog v4.4.0 -> v4.5.0
522
591
 
523
592
  | # | Feature | Detail |
package/bin/cli.js CHANGED
@@ -825,6 +825,65 @@ switch (command) {
825
825
  break;
826
826
  }
827
827
 
828
+ case "uninstall": {
829
+ log(BANNER_SMALL);
830
+ step("Uninstalling global components");
831
+
832
+ const readline = require("readline");
833
+ const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
834
+ const ask = (q) => new Promise(r => rl.question(q, r));
835
+
836
+ (async () => {
837
+ const answer = await ask(
838
+ ` Remove all cc-workspace components from ${c.dim}~/.claude/${c.reset}? [y/N] `
839
+ );
840
+ if (answer.toLowerCase() !== "y") {
841
+ log(` ${c.dim}Cancelled.${c.reset}\n`);
842
+ rl.close();
843
+ return;
844
+ }
845
+
846
+ // Skills
847
+ if (fs.existsSync(GLOBAL_SKILLS)) {
848
+ const skipDirs = new Set(["rules", "agents", "hooks", "templates"]);
849
+ const skillDirs = fs.readdirSync(SKILLS_DIR, { withFileTypes: true })
850
+ .filter(e => e.isDirectory() && !skipDirs.has(e.name))
851
+ .map(e => e.name);
852
+ let n = 0;
853
+ for (const name of skillDirs) {
854
+ const target = path.join(GLOBAL_SKILLS, name);
855
+ if (fs.existsSync(target)) { fs.rmSync(target, { recursive: true }); n++; }
856
+ }
857
+ ok(`${n} skills removed`);
858
+ }
859
+
860
+ // Rules
861
+ for (const f of ["context-hygiene.md", "model-routing.md"]) {
862
+ const fp = path.join(GLOBAL_RULES, f);
863
+ if (fs.existsSync(fp)) fs.unlinkSync(fp);
864
+ }
865
+ ok("Rules removed");
866
+
867
+ // Agents
868
+ for (const f of ["team-lead.md", "implementer.md", "workspace-init.md", "e2e-validator.md"]) {
869
+ const fp = path.join(GLOBAL_AGENTS, f);
870
+ if (fs.existsSync(fp)) fs.unlinkSync(fp);
871
+ }
872
+ ok("Agents removed");
873
+
874
+ // Version file
875
+ if (fs.existsSync(VERSION_FILE)) fs.unlinkSync(VERSION_FILE);
876
+ ok("Version tracking removed");
877
+
878
+ log("");
879
+ log(` ${c.green}${c.bold}Uninstall complete.${c.reset}`);
880
+ log(` ${c.dim}Local orchestrator/ directories are preserved — remove them manually if needed.${c.reset}`);
881
+ log("");
882
+ rl.close();
883
+ })();
884
+ break;
885
+ }
886
+
828
887
  case "version":
829
888
  case "--version":
830
889
  case "-v": {
@@ -864,6 +923,10 @@ switch (command) {
864
923
  log(` ${c.cyan}npx cc-workspace session close${c.reset} ${c.dim}<name>${c.reset}`);
865
924
  log(` Interactive close: create PRs, delete branches, clean up.`);
866
925
  log("");
926
+ log(` ${c.cyan}npx cc-workspace uninstall${c.reset}`);
927
+ log(` Remove all global components from ~/.claude/ (interactive).`);
928
+ log(` Local orchestrator/ directories are preserved.`);
929
+ log("");
867
930
  log(` ${c.cyan}npx cc-workspace version${c.reset}`);
868
931
  log(` Show package and installed versions.`);
869
932
  log("");
@@ -150,37 +150,10 @@ See @dispatch-feature/references/spawn-templates.md for full templates.
150
150
  ### Wave completion
151
151
  All commit units of all services in a wave must be ✅ before launching next wave.
152
152
 
153
- ## Rollback protocol
154
-
155
- If an implementer corrupts the session branch (bad merge, broken state):
156
-
157
- 1. Identify the last known good commit hash (from plan's session log)
158
- 2. Spawn a Task subagent (Bash):
159
- ```
160
- git -C ../[repo] update-ref refs/heads/session/{name} [good-commit-hash]
161
- ```
162
- 3. Mark the commit unit ❌ in the plan with reason
163
- 4. Re-dispatch with corrected instructions
164
-
165
- If the branch is unrecoverable:
166
- 1. Delete the branch: `git -C ../[repo] branch -D session/{name}`
167
- 2. Recreate from source: `git -C ../[repo] branch session/{name} {source_branch}`
168
- 3. Re-dispatch ALL commit units for this service from scratch
169
- 4. Warn the user — this resets all progress on this service
170
-
171
- ## Failed dispatch tracking
172
-
173
- After 2 failed re-dispatches of a commit unit:
174
-
175
- 1. Mark as `❌ ESCALATED` in the plan
176
- 2. Record in the plan's **Failed dispatches** section:
177
- - Commit unit title
178
- - Failure reason (from implementer report)
179
- - Attempted fixes
180
- - Suggested resolution
181
- 3. **STOP the wave** — do NOT continue to the next commit unit
182
- 4. Present the failure to the user, ask for direction
183
- 5. Resume only after user provides corrective action
153
+ ## Rollback & failure handling
154
+
155
+ See @dispatch-feature/references/rollback-protocol.md for the full rollback and
156
+ failed dispatch escalation procedures.
184
157
 
185
158
  ## What you CAN write
186
159
  - Plans in `./plans/`
@@ -13,7 +13,7 @@ maxTurns: 80
13
13
 
14
14
  # Workspace Init — Diagnostic & Configuration
15
15
 
16
- You are the initialization agent for the orchestrator workspace v4.0.
16
+ You are the initialization agent for the orchestrator workspace.
17
17
  Your job: verify everything is in place, fix what can be fixed,
18
18
  and guide the user to configure what needs their input.
19
19
 
@@ -50,7 +50,7 @@ Check global components (read-only, no auto-fix):
50
50
 
51
51
  | # | Check | If missing |
52
52
  |---|-------|-----------|
53
- | 10 | `~/.claude/skills/` contains all 9 skills | List the missing ones |
53
+ | 10 | `~/.claude/skills/` contains all 13 skills | List the missing ones |
54
54
  | 11 | `~/.claude/rules/` contains context-hygiene.md, model-routing.md | List the missing ones |
55
55
  | 12 | `~/.claude/agents/` contains team-lead.md, implementer.md, workspace-init.md | List the missing ones |
56
56
 
@@ -3,6 +3,11 @@
3
3
  This document is injected into every frontend teammate's prompt.
4
4
  It defines the minimum expected UX quality level.
5
5
 
6
+ > **Project-specific overrides**: If `constitution.md` defines a design system
7
+ > (e.g., MUI, Ant Design, Vuetify, Shadcn), those rules take precedence over
8
+ > the framework-specific examples below. The principles (4 states, responsive,
9
+ > a11y, forms) are universal — only the component names and breakpoints change.
10
+
6
11
  ## The 4 mandatory states
7
12
 
8
13
  Every component that displays data MUST implement:
@@ -33,8 +38,9 @@ Every component that displays data MUST implement:
33
38
  ## Responsive
34
39
 
35
40
  - **Mobile first**: build the mobile version first
36
- - Quasar breakpoints: `$breakpoint-xs` (0-599), `$breakpoint-sm` (600-1023),
37
- `$breakpoint-md` (1024-1439), `$breakpoint-lg` (1440+)
41
+ - Use the project's breakpoint system. Common defaults:
42
+ - xs (0-599), sm (600-1023), md (1024-1439), lg (1440+)
43
+ - Adapt to the actual framework (Quasar `$breakpoint-*`, Tailwind `sm:/md:/lg:`, MUI `useMediaQuery`, etc.)
38
44
  - Data tables on mobile: switch to card/list view, no horizontal scroll
39
45
  - Forms on mobile: stacked fields, appropriate native keyboard (inputmode)
40
46
  - Primary actions: accessible with the thumb (bottom zone of the screen)
@@ -45,7 +51,7 @@ Every component that displays data MUST implement:
45
51
  - **Optimistic updates** for quick actions (toggle, delete)
46
52
  with rollback on API error
47
53
  - **Confirmation** for destructive actions (delete, reset)
48
- via Quasar dialog, not window.confirm()
54
+ via the project's dialog/modal component, never window.confirm()
49
55
  - **Transitions** between states: fade 150ms by default
50
56
  - **Disabled state** clear on buttons during processing (no double submit)
51
57
 
@@ -67,7 +73,7 @@ Every component that displays data MUST implement:
67
73
 
68
74
  ## Design system
69
75
 
70
- - Use native Quasar components first (QTable, QForm, QDialog...)
71
- - Do not reinvent a component that exists in Quasar
72
- - Colors, spacing, and typography follow the project's Quasar theme
73
- - Icons come from a single set (Material Icons or the configured one)
76
+ - Use the project's component library first (e.g., Quasar, MUI, Ant Design, Vuetify, Shadcn)
77
+ - Do not reinvent a component that exists in the chosen library
78
+ - Colors, spacing, and typography follow the project's theme/design tokens
79
+ - Icons come from a single set (the one configured in the project)
@@ -0,0 +1,35 @@
1
+ # Rollback & Failed Dispatch Protocol
2
+
3
+ Reference file for team-lead and dispatch-feature. Loaded on-demand.
4
+
5
+ ## Rollback protocol
6
+
7
+ If an implementer corrupts the session branch (bad merge, broken state):
8
+
9
+ 1. Identify the last known good commit hash (from plan's session log)
10
+ 2. Spawn a Task subagent (Bash):
11
+ ```
12
+ git -C ../[repo] update-ref refs/heads/session/{name} [good-commit-hash]
13
+ ```
14
+ 3. Mark the commit unit ❌ in the plan with reason
15
+ 4. Re-dispatch with corrected instructions
16
+
17
+ If the branch is unrecoverable:
18
+ 1. Delete the branch: `git -C ../[repo] branch -D session/{name}`
19
+ 2. Recreate from source: `git -C ../[repo] branch session/{name} {source_branch}`
20
+ 3. Re-dispatch ALL commit units for this service from scratch
21
+ 4. Warn the user — this resets all progress on this service
22
+
23
+ ## Failed dispatch tracking
24
+
25
+ After 2 failed re-dispatches of a commit unit:
26
+
27
+ 1. Mark as `❌ ESCALATED` in the plan
28
+ 2. Record in the plan's **Failed dispatches** section:
29
+ - Commit unit title
30
+ - Failure reason (from implementer report)
31
+ - Attempted fixes
32
+ - Suggested resolution
33
+ 3. **STOP the wave** — do NOT continue to the next commit unit
34
+ 4. Present the failure to the user, ask for direction
35
+ 5. Resume only after user provides corrective action
@@ -33,8 +33,8 @@ If unclear, investigate all layers.
33
33
  ## Phase 2: Investigate (parallel)
34
34
 
35
35
  Spawn investigators via Agent Teams (Teammate tool):
36
- - **API/Backend**: full Sonnet teammate with write-capable investigation. Use the **LSP tool** (go-to-definition, find-references) to trace error call chains
37
- - **Frontend, Gateway, Infra, Auth**: lightweight Explore subagents (Task, Haiku) for read-only scan. Use LSP tool where available for tracing
36
+ - **API/Backend**: full Sonnet teammate with write-capable investigation. Use the **LSP tool** (go-to-definition, find-references) to trace error call chains. If LSP is unavailable, fall back to Grep + Glob for tracing references manually.
37
+ - **Frontend, Gateway, Infra, Auth**: lightweight Explore subagents (Task, Haiku) for read-only scan. Use LSP tool where available for tracing, or Grep + Glob as fallback.
38
38
 
39
39
  Multiple teammates can share findings and challenge each other's hypotheses.
40
40
  This adversarial pattern finds root causes faster than sequential investigation.
@@ -42,7 +42,8 @@ Spawn one teammate per service impacted. All run in parallel via Agent Teams.
42
42
 
43
43
  Include in spawn prompt: **full constitution (all rules from constitution.md)**, plan context, then these steps:
44
44
  1. Run test suite — report pass/fail with details
45
- 2. Use the **LSP tool** (go-to-definition, find-references) to trace call chains
45
+ 2. Use the **LSP tool** (go-to-definition, find-references) to trace call chains.
46
+ If LSP is unavailable, fall back to Grep + Glob for tracing references manually.
46
47
  3. **Constitution check**: multi-tenant scoping, secrets, rollback, test coverage
47
48
  4. **Code quality**: missing validation, missing auth checks, N+1, error handling, race conditions
48
49
  5. **Dead code hunt**: unused imports, unreachable methods, abandoned feature flags
@@ -54,7 +55,8 @@ Include in spawn prompt: **full constitution (all rules from constitution.md)**,
54
55
 
55
56
  Include in spawn prompt: **full constitution (all rules from constitution.md)**, plan context, UX standards, then these steps:
56
57
  1. Run tests — report pass/fail
57
- 2. Use the **LSP tool** for tracing component dependencies and store usage
58
+ 2. Use the **LSP tool** for tracing component dependencies and store usage.
59
+ If LSP is unavailable, fall back to Grep + Glob for tracing references manually.
58
60
  3. **UX audit** on every new/modified component: 4 states (skeleton not spinner, empty+CTA, error+retry, smooth success), responsive, a11y, interactions (debounce, optimistic, confirmation), forms (inline validation, error messages, preserve data)
59
61
  4. **Constitution check**: data precision, feedback <200ms
60
62
  5. **Code quality**: TypeScript `any`, unsafe `as`, infinite loops, XSS via v-html
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-workspace",
3
- "version": "4.5.1",
3
+ "version": "4.6.1",
4
4
  "description": "Claude Code multi-workspace orchestrator — skills, hooks, agents, and templates for multi-service projects",
5
5
  "bin": {
6
6
  "cc-workspace": "./bin/cli.js"