specweave 1.0.259 → 1.0.261

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.
Files changed (70) hide show
  1. package/CLAUDE.md +40 -25
  2. package/bin/specweave.js +11 -0
  3. package/dist/dashboard/assets/index-CDl14O5G.css +1 -0
  4. package/dist/dashboard/assets/index-CmqBqnWd.js +11 -0
  5. package/dist/dashboard/index.html +14 -0
  6. package/dist/src/cli/commands/dashboard.d.ts +18 -0
  7. package/dist/src/cli/commands/dashboard.d.ts.map +1 -0
  8. package/dist/src/cli/commands/dashboard.js +142 -0
  9. package/dist/src/cli/commands/dashboard.js.map +1 -0
  10. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +9 -4
  11. package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
  12. package/dist/src/core/lazy-loading/llm-plugin-detector.js +9 -4
  13. package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
  14. package/dist/src/dashboard/server/command-runner.d.ts +21 -0
  15. package/dist/src/dashboard/server/command-runner.d.ts.map +1 -0
  16. package/dist/src/dashboard/server/command-runner.js +92 -0
  17. package/dist/src/dashboard/server/command-runner.js.map +1 -0
  18. package/dist/src/dashboard/server/dashboard-server.d.ts +33 -0
  19. package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -0
  20. package/dist/src/dashboard/server/dashboard-server.js +867 -0
  21. package/dist/src/dashboard/server/dashboard-server.js.map +1 -0
  22. package/dist/src/dashboard/server/data/activity-stream.d.ts +27 -0
  23. package/dist/src/dashboard/server/data/activity-stream.d.ts.map +1 -0
  24. package/dist/src/dashboard/server/data/activity-stream.js +142 -0
  25. package/dist/src/dashboard/server/data/activity-stream.js.map +1 -0
  26. package/dist/src/dashboard/server/data/claude-log-parser.d.ts +34 -0
  27. package/dist/src/dashboard/server/data/claude-log-parser.d.ts.map +1 -0
  28. package/dist/src/dashboard/server/data/claude-log-parser.js +218 -0
  29. package/dist/src/dashboard/server/data/claude-log-parser.js.map +1 -0
  30. package/dist/src/dashboard/server/data/cost-aggregator.d.ts +36 -0
  31. package/dist/src/dashboard/server/data/cost-aggregator.d.ts.map +1 -0
  32. package/dist/src/dashboard/server/data/cost-aggregator.js +156 -0
  33. package/dist/src/dashboard/server/data/cost-aggregator.js.map +1 -0
  34. package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts +62 -0
  35. package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts.map +1 -0
  36. package/dist/src/dashboard/server/data/dashboard-data-aggregator.js +361 -0
  37. package/dist/src/dashboard/server/data/dashboard-data-aggregator.js.map +1 -0
  38. package/dist/src/dashboard/server/data/plugin-scanner.d.ts +35 -0
  39. package/dist/src/dashboard/server/data/plugin-scanner.d.ts.map +1 -0
  40. package/dist/src/dashboard/server/data/plugin-scanner.js +96 -0
  41. package/dist/src/dashboard/server/data/plugin-scanner.js.map +1 -0
  42. package/dist/src/dashboard/server/data/sync-audit-reader.d.ts +38 -0
  43. package/dist/src/dashboard/server/data/sync-audit-reader.d.ts.map +1 -0
  44. package/dist/src/dashboard/server/data/sync-audit-reader.js +94 -0
  45. package/dist/src/dashboard/server/data/sync-audit-reader.js.map +1 -0
  46. package/dist/src/dashboard/server/file-watcher.d.ts +19 -0
  47. package/dist/src/dashboard/server/file-watcher.d.ts.map +1 -0
  48. package/dist/src/dashboard/server/file-watcher.js +104 -0
  49. package/dist/src/dashboard/server/file-watcher.js.map +1 -0
  50. package/dist/src/dashboard/server/router.d.ts +16 -0
  51. package/dist/src/dashboard/server/router.d.ts.map +1 -0
  52. package/dist/src/dashboard/server/router.js +110 -0
  53. package/dist/src/dashboard/server/router.js.map +1 -0
  54. package/dist/src/dashboard/server/sse-manager.d.ts +25 -0
  55. package/dist/src/dashboard/server/sse-manager.d.ts.map +1 -0
  56. package/dist/src/dashboard/server/sse-manager.js +75 -0
  57. package/dist/src/dashboard/server/sse-manager.js.map +1 -0
  58. package/dist/src/dashboard/types.d.ts +194 -0
  59. package/dist/src/dashboard/types.d.ts.map +1 -0
  60. package/dist/src/dashboard/types.js +2 -0
  61. package/dist/src/dashboard/types.js.map +1 -0
  62. package/package.json +12 -2
  63. package/plugins/specweave/hooks/user-prompt-submit.sh +79 -154
  64. package/plugins/specweave/skills/auto/SKILL.md +35 -0
  65. package/plugins/specweave/skills/do/SKILL.md +32 -2
  66. package/plugins/specweave/skills/increment/SKILL.md +1 -1
  67. package/plugins/specweave/skills/increment-planner/SKILL.md +26 -0
  68. package/plugins/specweave/skills/increment-work-router/SKILL.md +37 -9
  69. package/plugins/specweave/skills/plan/SKILL.md +37 -0
  70. package/plugins/specweave/skills/team-lead/SKILL.md +1 -1
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Execute increment tasks following spec and plan with sync hooks. Use when saying "implement", "start working", "execute tasks", or "continue increment".
2
+ description: Execute increment tasks following spec and plan with sync hooks. Use when saying "implement", "start working", "execute tasks", or "continue increment". IMPORTANT - Before starting, check task count and domain count. If 3+ domains or 15+ tasks, recommend /sw:team-lead instead (ask user for confirmation, or auto-invoke in auto mode).
3
3
  argument-hint: "<increment-id>"
4
4
  hooks:
5
5
  PostToolUse:
@@ -55,13 +55,43 @@ When no ID provided, auto-select (NEVER ask user for ID):
55
55
  2. **Load files**: Read `spec.md`, `plan.md`, `tasks.md`, `tests.md`
56
56
  3. **Load living docs**: Check ADRs and specs in `.specweave/docs/internal/` for related context
57
57
  4. **Verify readiness**: Status is planned/in-progress, no blocking deps, tasks exist
58
- 5. **Task count validation**: If >25 tasks, warn and offer to split or phase execution
58
+ 5. **Task count validation**: If >25 tasks, warn and offer to split, phase, or use `/sw:auto`/`/sw:team-lead`
59
59
  6. **Validate AC presence** (MANDATORY):
60
60
  ```bash
61
61
  bash plugins/specweave/hooks/pre-increment-start.sh <increment-path>
62
62
  ```
63
63
  If fails: run `/sw:embed-acs`, then retry. Do NOT proceed without ACs in spec.md.
64
64
 
65
+ ### Step 2.5: Execution Strategy Check
66
+
67
+ **Skip this step if already running inside `/sw:auto` or `/sw:team-lead`.** Check `.specweave/state/auto-mode.json` — if `active: true`, skip.
68
+
69
+ Assess increment complexity to recommend the best execution mode:
70
+
71
+ 1. **Count pending tasks**: `grep -c '^\- \[ \]\|Status\*\*: \[ \]' tasks.md`
72
+ 2. **Count domains**: Scan spec.md and plan.md for distinct technology areas (frontend, backend, database, API, DevOps, security, mobile, ML/AI). Each distinct area = 1 domain.
73
+ 3. **Count ACs**: `grep -c 'AC-US' spec.md`
74
+
75
+ **Recommendation matrix** (see CLAUDE.md Execution Strategy):
76
+
77
+ | Tasks | Domains | Action |
78
+ |-------|---------|--------|
79
+ | ≤8 | 1 | Proceed with `/sw:do` silently |
80
+ | 9-15 | 1-2 | Suggest `/sw:auto` for unattended execution |
81
+ | >15 | 1-2 | Recommend `/sw:auto` (many tasks benefit from autonomous loop) |
82
+ | any | 3+ | Recommend `/sw:team-lead` for parallel multi-agent execution |
83
+
84
+ **When recommending (non-auto mode)**, use `AskUserQuestion` with these options:
85
+ - `/sw:do` — Continue manual step-by-step (current mode)
86
+ - `/sw:auto` — Autonomous sequential execution (unattended, stop-hook loop)
87
+ - `/sw:team-lead` — Parallel multi-agent execution (higher quality for multi-domain, uses more tokens)
88
+
89
+ Include trade-off note: "Team-lead and auto modes consume more tokens but deliver higher precision and quality for complex work."
90
+
91
+ If user chooses auto or team-lead, invoke the chosen skill with the increment ID and **stop /sw:do execution**.
92
+
93
+ **In auto mode (`.specweave/state/auto-mode.json` active)**: If 3+ domains detected, automatically invoke `/sw:team-lead` instead of proceeding sequentially.
94
+
65
95
  ### Step 3: TDD Setup
66
96
 
67
97
  Read `testMode` from metadata.json:
@@ -126,7 +126,7 @@ After skill completes:
126
126
 
127
127
  Files: spec.md, plan.md, tasks.md, metadata.json
128
128
 
129
- Next: /sw:do 0003 (start implementation)
129
+ Next: /sw:do 0003 | /sw:auto 0003 | /sw:team-lead (see Execution Strategy)
130
130
  ```
131
131
 
132
132
  ## Error Handling
@@ -200,6 +200,32 @@ Skill({ skill: "sw:architect", args: "Design architecture for increment XXXX" })
200
200
  Skill({ skill: "sw:test-aware-planner", args: "Generate tasks for increment XXXX" })
201
201
  ```
202
202
 
203
+ ## Step 5: Execution Strategy Recommendation
204
+
205
+ After delegation completes (architect + test-aware-planner have created plan.md and tasks.md), analyze the increment:
206
+
207
+ 1. **Count tasks**: `grep -c '^\- \[ \]\|^### T-' tasks.md`
208
+ 2. **Count domains** from spec.md user stories and plan.md architecture (frontend, backend, database, API, DevOps, security, mobile, ML/AI)
209
+ 3. **Classify**: Low (≤8 tasks, 1 domain) | Medium (9-15, 1-2 domains) | High (>15 OR 3+ domains)
210
+
211
+ **Show recommendation in output:**
212
+
213
+ ```
214
+ EXECUTION STRATEGY
215
+ ================================================
216
+ Tasks: [N] | Domains: [M] | Complexity: [Low/Medium/High]
217
+
218
+ /sw:do <id> - Step-by-step, full control
219
+ /sw:auto <id> - Autonomous sequential (unattended)
220
+ /sw:team-lead - Parallel multi-agent (best quality for multi-domain, higher token cost)
221
+ ```
222
+
223
+ - **Low**: Show `/sw:do <id>` as next step (default behavior)
224
+ - **Medium**: Show `/sw:do <id>` and recommend `/sw:auto <id>` for unattended execution
225
+ - **High**: Recommend `/sw:team-lead` as primary, with `/sw:auto` and `/sw:do` as alternatives
226
+
227
+ See CLAUDE.md Execution Strategy section for the full decision matrix.
228
+
203
229
  ## Usage
204
230
 
205
231
  ```typescript
@@ -107,6 +107,29 @@ Compare user's request against active increment:
107
107
  - **Medium match (40-70%)**: Related area → Ask confirmation
108
108
  - **Low match (<40%)**: Unrelated → Suggest new increment
109
109
 
110
+ ### Step 3.5: Assess Complexity (before routing)
111
+
112
+ **Before routing to `/sw:do`, assess the target increment's complexity:**
113
+
114
+ ```bash
115
+ # Count pending tasks
116
+ PENDING=$(grep -c '^\- \[ \]\|Status\*\*: \[ \]' "$INCREMENT_PATH/tasks.md" 2>/dev/null || echo 0)
117
+
118
+ # Count domains from spec.md + plan.md
119
+ DOMAINS=$(grep -ciE 'frontend|backend|database|api|devops|security|mobile|ml|ai' "$INCREMENT_PATH/spec.md" "$INCREMENT_PATH/plan.md" 2>/dev/null | sort -u | wc -l)
120
+ ```
121
+
122
+ **Modify routing based on complexity** (see CLAUDE.md Execution Strategy):
123
+
124
+ | Tasks | Domains | Routing Modification |
125
+ |-------|---------|---------------------|
126
+ | ≤8 | 1 | Route to `/sw:do` as usual |
127
+ | 9-15 | 1-2 | Route to `/sw:do` + add tip: "Tip: use `/sw:auto <id>` for unattended execution" |
128
+ | >15 | 1-2 | Suggest `/sw:auto <id>` — "This increment has [N] tasks. Consider `/sw:auto` for autonomous execution." |
129
+ | any | 3+ | Suggest `/sw:team-lead` — "This increment spans [M] domains. Consider `/sw:team-lead` for parallel multi-agent execution (higher quality, uses more tokens)." |
130
+
131
+ In non-auto mode: always ask user before switching mode. In auto mode: use team-lead automatically for 3+ domains.
132
+
110
133
  ### Step 4: Route Intelligently
111
134
 
112
135
  **Scenario A: High relevance to active increment**
@@ -286,15 +309,20 @@ Would you like to:
286
309
 
287
310
  ## Decision Matrix
288
311
 
289
- | User Intent | Active Increments | Relevance | Action |
290
- |-------------|------------------|-----------|--------|
291
- | "Implement auth" | 1 (auth-related) | High (>70%) | Auto `/sw:do` |
292
- | "Implement auth" | 1 (unrelated) | Low (<40%) | Ask: New or add to current? |
293
- | "Implement auth" | 0 | N/A | Auto `/sw:increment` |
294
- | "Implement auth" | 2+ | N/A | Ask which increment |
295
- | "Let's continue" | 1 | N/A | Auto `/sw:do` |
296
- | "Let's continue" | 2+ | N/A | Ask which increment |
297
- | "Let's continue" | 0 | N/A | "No active increment. What should we build?" |
312
+ | User Intent | Active Increments | Relevance | Complexity | Action |
313
+ |-------------|------------------|-----------|------------|--------|
314
+ | "Implement auth" | 1 (auth-related) | High (>70%) | Low | Auto `/sw:do` |
315
+ | "Implement auth" | 1 (auth-related) | High (>70%) | Medium | Auto `/sw:do` + suggest `/sw:auto` |
316
+ | "Implement auth" | 1 (auth-related) | High (>70%) | High | Suggest `/sw:auto` or `/sw:team-lead` |
317
+ | "Implement auth" | 1 (unrelated) | Low (<40%) | Any | Ask: New or add to current? |
318
+ | "Implement auth" | 0 | N/A | Any | Auto `/sw:increment` |
319
+ | "Implement auth" | 2+ | N/A | Any | Ask which increment |
320
+ | "Let's continue" | 1 | N/A | Low/Med | Auto `/sw:do` |
321
+ | "Let's continue" | 1 | N/A | High | Auto `/sw:do` + suggest mode switch |
322
+ | "Let's continue" | 2+ | N/A | Any | Ask which increment |
323
+ | "Let's continue" | 0 | N/A | Any | "No active increment. What should we build?" |
324
+
325
+ **Complexity**: Low (≤8 tasks, 1 domain) | Medium (9-15 tasks, 1-2 domains) | High (>15 tasks OR 3+ domains)
298
326
 
299
327
  ## Relevance Matching Logic
300
328
 
@@ -77,6 +77,43 @@ Generate `plan.md` and `tasks.md` for an increment using Architect Agent and tes
77
77
  - PLANNING → ACTIVE transition (tasks.md now exists)
78
78
  - Update lastUpdated timestamp
79
79
 
80
+ 6. **Execution Strategy Recommendation** (MANDATORY):
81
+ After generating tasks.md, analyze complexity and output a recommendation:
82
+
83
+ **6a. Count pending tasks** in the generated tasks.md (count `[ ]` markers)
84
+
85
+ **6b. Detect domains** from file paths and task descriptions:
86
+ - Frontend: `src/components/`, `src/pages/`, `src/hooks/`, `src/styles/`, `.tsx`, `.css`, React/Vue/Angular keywords
87
+ - Backend: `src/api/`, `src/services/`, `src/middleware/`, `src/routes/`, Express/Fastify/NestJS keywords
88
+ - Database: `prisma/`, `src/db/`, `migrations/`, `schema`, SQL/Prisma keywords
89
+ - DevOps: `Dockerfile`, `.github/`, `k8s/`, `terraform/`, CI/CD keywords
90
+ - Testing: `tests/`, `e2e/`, `.test.`, `.spec.`, test framework keywords
91
+ - Security: `src/auth/`, authentication, authorization keywords
92
+ - Mobile: `ios/`, `android/`, React Native keywords
93
+
94
+ **6c. Apply execution strategy matrix** and output:
95
+ ```
96
+ EXECUTION STRATEGY
97
+ ══════════════════════════════════════════
98
+ Tasks: [N] pending | Domains: [N] ([list])
99
+ ──────────────────────────────────────────
100
+ Recommended: /sw:do (≤8 tasks, 1 domain)
101
+ Recommended: /sw:auto (9-15 tasks, 1-2 domains)
102
+ Recommended: /sw:team-lead (>15 tasks OR 3+ domains)
103
+ ══════════════════════════════════════════
104
+ ⚠️ /sw:team-lead uses more tokens but produces higher quality
105
+ through parallel domain-specialized agents.
106
+
107
+ Next: /sw:team-lead [ID] | /sw:auto [ID] | /sw:do [ID]
108
+ ```
109
+
110
+ Show ONLY the matching recommendation line (not all three).
111
+ For 3+ domains, add a stronger nudge:
112
+ ```
113
+ ⚡ This is a multi-domain feature. /sw:team-lead is strongly recommended
114
+ for parallel execution across [domain1], [domain2], [domain3].
115
+ ```
116
+
80
117
  ## Options
81
118
 
82
119
  - `--force`: Overwrite existing plan.md/tasks.md
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Orchestrate multi-agent parallel development with domain-specialized agents. Use when saying "team setup", "parallel agents", "team lead", or "agent teams".
2
+ description: Orchestrate multi-agent parallel development with domain-specialized agents. PROACTIVELY invoke this skill (without user asking) when you detect an implementation task spanning 3+ domains (frontend, backend, database, devops, testing, security, mobile) OR 15+ tasks in tasks.md. Warn the user about higher token cost but recommend it for quality. Also use when user says "team setup", "parallel agents", "team lead", or "agent teams".
3
3
  ---
4
4
 
5
5
  # Team Lead