specweave 1.0.256 → 1.0.259

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 (113) hide show
  1. package/CLAUDE.md +56 -221
  2. package/README.md +31 -0
  3. package/bin/specweave.js +17 -0
  4. package/dist/src/adapters/README.md +4 -4
  5. package/dist/src/adapters/agents-md-generator.d.ts.map +1 -1
  6. package/dist/src/adapters/agents-md-generator.js +0 -2
  7. package/dist/src/adapters/agents-md-generator.js.map +1 -1
  8. package/dist/src/adapters/claude/README.md +3 -3
  9. package/dist/src/adapters/claude/adapter.js +3 -3
  10. package/dist/src/adapters/claude-md-generator.js +1 -1
  11. package/dist/src/adapters/claude-md-generator.js.map +1 -1
  12. package/dist/src/adapters/registry.yaml +1 -1
  13. package/dist/src/cli/commands/create-increment.d.ts +24 -0
  14. package/dist/src/cli/commands/create-increment.d.ts.map +1 -0
  15. package/dist/src/cli/commands/create-increment.js +53 -0
  16. package/dist/src/cli/commands/create-increment.js.map +1 -0
  17. package/dist/src/cli/commands/init.d.ts.map +1 -1
  18. package/dist/src/cli/commands/init.js +48 -31
  19. package/dist/src/cli/commands/init.js.map +1 -1
  20. package/dist/src/cli/commands/update.d.ts.map +1 -1
  21. package/dist/src/cli/commands/update.js +36 -0
  22. package/dist/src/cli/commands/update.js.map +1 -1
  23. package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -1
  24. package/dist/src/cli/helpers/init/directory-structure.js +13 -1
  25. package/dist/src/cli/helpers/init/directory-structure.js.map +1 -1
  26. package/dist/src/cli/helpers/init/summary-banner.d.ts +11 -0
  27. package/dist/src/cli/helpers/init/summary-banner.d.ts.map +1 -1
  28. package/dist/src/cli/helpers/init/summary-banner.js +49 -3
  29. package/dist/src/cli/helpers/init/summary-banner.js.map +1 -1
  30. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  31. package/dist/src/cli/helpers/issue-tracker/index.js +0 -1
  32. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  33. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
  34. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +6 -2
  35. package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
  36. package/dist/src/core/ac-progress-sync.d.ts +13 -0
  37. package/dist/src/core/ac-progress-sync.d.ts.map +1 -1
  38. package/dist/src/core/ac-progress-sync.js +28 -0
  39. package/dist/src/core/ac-progress-sync.js.map +1 -1
  40. package/dist/src/core/config/types.d.ts +24 -1
  41. package/dist/src/core/config/types.d.ts.map +1 -1
  42. package/dist/src/core/config/types.js +6 -1
  43. package/dist/src/core/config/types.js.map +1 -1
  44. package/dist/src/core/doctor/checkers/project-structure-checker.d.ts +1 -0
  45. package/dist/src/core/doctor/checkers/project-structure-checker.d.ts.map +1 -1
  46. package/dist/src/core/doctor/checkers/project-structure-checker.js +53 -3
  47. package/dist/src/core/doctor/checkers/project-structure-checker.js.map +1 -1
  48. package/dist/src/core/fabric/security-scanner.d.ts.map +1 -1
  49. package/dist/src/core/fabric/security-scanner.js +70 -9
  50. package/dist/src/core/fabric/security-scanner.js.map +1 -1
  51. package/dist/src/core/increment/increment-utils.d.ts +6 -0
  52. package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
  53. package/dist/src/core/increment/increment-utils.js +5 -0
  54. package/dist/src/core/increment/increment-utils.js.map +1 -1
  55. package/dist/src/core/living-docs/discovery.d.ts +2 -0
  56. package/dist/src/core/living-docs/discovery.d.ts.map +1 -1
  57. package/dist/src/core/living-docs/discovery.js +91 -17
  58. package/dist/src/core/living-docs/discovery.js.map +1 -1
  59. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts +5 -0
  60. package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts.map +1 -1
  61. package/dist/src/core/living-docs/intelligent-analyzer/index.js +3 -3
  62. package/dist/src/core/living-docs/intelligent-analyzer/index.js.map +1 -1
  63. package/dist/src/core/living-docs/lsp-bootstrapper.d.ts +64 -0
  64. package/dist/src/core/living-docs/lsp-bootstrapper.d.ts.map +1 -0
  65. package/dist/src/core/living-docs/lsp-bootstrapper.js +118 -0
  66. package/dist/src/core/living-docs/lsp-bootstrapper.js.map +1 -0
  67. package/dist/src/core/project/project-service.d.ts +10 -1
  68. package/dist/src/core/project/project-service.d.ts.map +1 -1
  69. package/dist/src/core/project/project-service.js +37 -2
  70. package/dist/src/core/project/project-service.js.map +1 -1
  71. package/dist/src/core/universal-auto-create.d.ts +64 -0
  72. package/dist/src/core/universal-auto-create.d.ts.map +1 -0
  73. package/dist/src/core/universal-auto-create.js +228 -0
  74. package/dist/src/core/universal-auto-create.js.map +1 -0
  75. package/package.json +1 -1
  76. package/plugins/specweave/PLUGIN.md +0 -3
  77. package/plugins/specweave/commands/living-docs.md +0 -2
  78. package/plugins/specweave/hooks/stop-sync.sh +34 -5
  79. package/plugins/specweave/hooks/user-prompt-submit.sh +115 -326
  80. package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +19 -5
  81. package/plugins/specweave/hooks/v2/handlers/ac-sync-dispatcher.sh +14 -4
  82. package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +181 -0
  83. package/plugins/specweave/lib/hooks/sync-living-docs.js +4 -2
  84. package/plugins/specweave/scripts/skill-context.sh +160 -0
  85. package/plugins/specweave/skills/architect/SKILL.md +1 -1
  86. package/plugins/specweave/skills/archive-increments/SKILL.md +13 -3
  87. package/plugins/specweave/skills/auto/SKILL.md +92 -1038
  88. package/plugins/specweave/skills/do/SKILL.md +66 -1106
  89. package/plugins/specweave/skills/docs/SKILL.md +124 -56
  90. package/plugins/specweave/skills/done/SKILL.md +76 -1406
  91. package/plugins/specweave/skills/framework/SKILL.md +1 -1
  92. package/plugins/specweave/skills/increment/SKILL.md +1 -1
  93. package/plugins/specweave/skills/increment-planner/SKILL.md +29 -19
  94. package/plugins/specweave/skills/jobs/SKILL.md +52 -0
  95. package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +1 -1
  96. package/plugins/specweave/skills/save/SKILL.md +51 -1372
  97. package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +1 -1
  98. package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +1 -1
  99. package/plugins/specweave/skills/validate/SKILL.md +65 -848
  100. package/plugins/specweave-backend/skills/database-optimizer/SKILL.md +1 -1
  101. package/plugins/specweave-backend/skills/graphql/SKILL.md +1 -1
  102. package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +1 -1
  103. package/plugins/specweave-frontend/skills/frontend/SKILL.md +1 -1
  104. package/plugins/specweave-frontend/skills/frontend-architect/SKILL.md +1 -1
  105. package/plugins/specweave-frontend/skills/frontend-design/SKILL.md +1 -1
  106. package/plugins/specweave-frontend/skills/i18n-expert/SKILL.md +1 -1
  107. package/plugins/specweave-payments/skills/billing-automation/SKILL.md +1 -1
  108. package/plugins/specweave-testing/skills/accessibility-testing/SKILL.md +1 -1
  109. package/src/templates/CLAUDE.md.template +50 -356
  110. package/src/templates/config.json.template +5 -1
  111. package/plugins/specweave/commands/brownfield-analyzer.md +0 -408
  112. package/plugins/specweave/commands/brownfield-onboarder.md +0 -837
  113. package/plugins/specweave/commands/export-skills.md +0 -179
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Expert database optimizer for query performance, indexing strategies, and schema design across PostgreSQL, MySQL, and MongoDB. Use when optimizing slow queries, fixing N+1 problems, or analyzing EXPLAIN plans. Covers connection pooling, caching strategies, partitioning, and database scaling patterns.
2
+ description: Database optimizer for PostgreSQL, MySQL, MongoDB. Use for slow queries, N+1 problems, EXPLAIN plans, indexing, connection pooling, caching, partitioning, scaling.
3
3
  context: fork
4
4
  model: opus
5
5
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: GraphQL API expert across all major stacks (Node.js, Python, Java, .NET, Rust). Use when designing GraphQL schemas, building resolvers, implementing DataLoader, setting up federation, or optimizing GraphQL performance. Activates for: GraphQL, Apollo Server, Apollo Client, schema, resolvers, DataLoader, federation, subscriptions, Pothos, Strawberry, Hot Chocolate, urql, Relay.
2
+ description: GraphQL API expert for Node.js, Python, Java, .NET, Rust. Use for schemas, resolvers, DataLoader, federation, subscriptions, Apollo, Pothos, Strawberry, urql, Relay.
3
3
  allowed-tools: Read, Write, Edit, Bash
4
4
  model: opus
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Expert in building scalable design systems with Atomic Design, design tokens, and theming infrastructure. Use when creating component libraries, implementing dark mode, or establishing typography and color systems. Covers multi-brand support, Storybook-driven development, and accessibility-first component APIs.
2
+ description: Scalable design systems with Atomic Design, design tokens, theming. Use for component libraries, dark mode, typography, color systems, Storybook, multi-brand, a11y.
3
3
  ---
4
4
 
5
5
  # Design System Architect
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Expert frontend developer for React, Vue, Angular, and modern JavaScript/TypeScript. Use when creating components, implementing hooks, handling state management, or building responsive web interfaces. Covers React 18/19 features (use() hook, React Compiler, Server Functions, useActionState, useOptimistic), custom hooks, form handling, and accessibility best practices.
2
+ description: Frontend developer for React, Vue, Angular, TypeScript. Use for components, hooks, state management, responsive UIs. Covers React 18/19, custom hooks, forms, a11y.
3
3
  ---
4
4
 
5
5
  # Frontend Development Expert
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Expert frontend architect for React, Next.js, Vue, and Angular with Atomic Design and state management patterns. Use when designing component architecture, building dashboards, or implementing complex frontend features. Covers TanStack Query, Zustand/Redux, routing strategies, and performance optimization.
2
+ description: Frontend architect for React, Next.js, Vue, Angular. Use for component architecture, dashboards, Atomic Design, TanStack Query, Zustand/Redux, routing, performance.
3
3
  context: fork
4
4
  model: opus
5
5
  allowed-tools: Read, Write, Edit, Bash, Glob, Grep
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Frontend design expert for polished, production-ready UIs with distinctive visual characteristics and micro-interactions. Use when improving visual design, adding CSS animations, or polishing the UI with shadows, gradients, and transitions. Rejects generic AI aesthetics in favor of bold, distinctive design choices.
2
+ description: Frontend design expert for polished UIs with micro-interactions. Use for visual design, CSS animations, shadows, gradients, transitions. Bold, distinctive design choices.
3
3
  allowed-tools: Read, Write, Edit, Glob, Grep
4
4
  model: opus
5
5
  context: fork
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Expert in frontend internationalization (i18n) and localization (l10n) covering i18next/react-i18next setup, Next.js i18n routing, RTL support, date/number/currency formatting with Intl APIs, translation management workflows, and performance optimization. Use when implementing multilingual apps, adding locale support, handling RTL layouts, or managing translation pipelines.
2
+ description: Frontend i18n and l10n expert. Use for multilingual apps, i18next/react-i18next, Next.js i18n routing, RTL layouts, Intl APIs, date/number/currency formatting, translation pipelines.
3
3
  allowed-tools: Read, Write, Edit, Bash
4
4
  model: opus
5
5
  context: fork
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Automated billing systems for SaaS subscription management, invoicing, and payment recovery. Use when implementing recurring billing, automating invoice generation, or handling failed payment dunning. Covers proration calculations, billing cycle management, usage-based billing, and tax compliance (VAT/GST).
2
+ description: SaaS billing automation for subscriptions, invoicing, payment recovery. Use for recurring billing, dunning, proration, usage-based billing, tax compliance (VAT/GST).
3
3
  ---
4
4
 
5
5
  # Billing Automation
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Accessibility testing expert for WCAG compliance, axe-core, pa11y, Lighthouse, screen reader testing, keyboard navigation, and CI/CD a11y gates. Use for accessibility audits, a11y test automation, WCAG compliance, screen reader testing, keyboard navigation, color contrast, ARIA patterns, or form accessibility.
2
+ description: Accessibility testing for WCAG compliance, axe-core, pa11y, Lighthouse, screen readers, keyboard nav, CI/CD a11y gates. Use for a11y audits, ARIA, color contrast.
3
3
  allowed-tools: Read, Write, Edit, Bash
4
4
  model: opus
5
5
  context: fork
@@ -1,133 +1,40 @@
1
1
  # {PROJECT_NAME} - SpecWeave Reference
2
2
 
3
+ <!-- SECTION:hook-priority required -->
4
+ ## Hook Instructions Override Everything
5
+
6
+ `<system-reminder>` hook output = **BLOCKING PRECONDITIONS**.
7
+
8
+ | Hook Message | Action |
9
+ |---|---|
10
+ | **"RESTART REQUIRED"** | ALL tools blocked → STOP, wait for restart |
11
+ | **"SKILL FIRST"** | Call shown skill FIRST → chain domain skills → implement |
12
+ <!-- /SECTION -->
13
+
3
14
  <!-- SECTION:header required -->
4
15
  **Framework**: SpecWeave | **Truth**: `spec.md` + `tasks.md`
5
16
  <!-- /SECTION -->
6
17
 
7
18
  <!-- SECTION:claude-code-concepts -->
8
- ## Claude Code Concepts (2.1.3+)
9
-
10
- **Skills and slash commands are now unified.** Both file formats create the same `/name` command:
11
- - `.claude/commands/review.md` → `/review`
12
- - `.claude/skills/review/SKILL.md` → `/review`
13
-
14
- ### Core Concepts
15
-
16
- | Concept | What It Is | How to Use |
17
- |---------|------------|------------|
18
- | **Skills** | Reusable instructions in SKILL.md | `/skill-name` or auto-invoke via keywords |
19
- | **Plugins** | Packages with skills, agents, hooks | `claude plugin install sw@specweave` |
20
- | **Agents** | Isolated subagents with own context | Task tool or `context: fork` in skill |
19
+ ## Skills & Plugins
21
20
 
22
- ### Skill Invocation Control (Frontmatter)
21
+ **Invoke**: `/skill-name` | auto-trigger by keywords | `Skill({ skill: "name" })`
22
+ **Parallel work**: Append "use subagents" to requests
23
23
 
24
- | Frontmatter | User Can Invoke | Claude Can Invoke | Use Case |
25
- |-------------|-----------------|-------------------|----------|
26
- | (default) | Yes | Yes | Most skills |
27
- | `disable-model-invocation: true` | Yes | **No** | Workflows with side effects (`/deploy`) |
28
- | `user-invocable: false` | **No** | Yes | Background knowledge |
24
+ **Key skills**: `sw:pm`, `sw:architect`, `sw:grill`, `sw:tdd-orchestrator`, `sw-frontend:*`, `sw-backend:*`, `sw-testing:*`
29
25
 
30
- ### SpecWeave Skill Organization
26
+ **Skill chaining** skills are NOT "one and done":
27
+ 1. **Planning**: `sw:pm` (specs) → `sw:architect` (design)
28
+ 2. **Implementation**: Invoke domain skill per tech (React → `sw-frontend:frontend-architect`, .NET → `sw-backend:dotnet-backend`, Stripe → `sw-payments:stripe-integration`, etc.)
29
+ 3. **Closure**: `sw:grill` runs automatically via `/sw:done`
31
30
 
32
- ```
33
- plugins/specweave/
34
- ├── commands/ # User-invocable workflows (have hooks)
35
- │ ├── do.md # → /sw:do (execute tasks)
36
- │ ├── done.md # → /sw:done (close increment)
37
- │ └── status.md # → /sw:status
38
- └── skills/ # Auto-activating expertise (keyword-triggered)
39
- ├── architect/ # → activates on "architecture", "system design"
40
- ├── pm/ # → activates on "product", "requirements", "MVP"
41
- └── code-simplifier/ # → activates on "simplify code", "clean up code"
42
- ```
43
-
44
- ### Quick Examples
45
-
46
- ```bash
47
- # Explicit invocation (user types command)
48
- /sw:do # Execute tasks
49
- /sw:increment "auth feature" # Plan increment
50
-
51
- # Auto-activation (Claude detects keywords, loads skill)
52
- "Design the auth architecture" # → architect skill
53
- "Help me plan this product" # → PM skill
54
- ```
55
-
56
- ### Key Insight
57
-
58
- **Old "commands" are just skills with `disable-model-invocation: true`** - they only respond to explicit `/name` invocation, not keyword detection.
31
+ If auto-activation fails, invoke explicitly: `Skill({ skill: "name" })`
59
32
  <!-- /SECTION -->
60
33
 
61
- <!-- SECTION:skill-chaining required -->
62
- ## ⚠️ MANDATORY: Skill Chaining During Implementation
63
-
64
- **Skills are NOT "one and done".** You MUST use multiple skills throughout implementation.
65
-
66
- ### The Pattern (FOLLOW THIS)
67
-
68
- ```
69
- PLANNING PHASE:
70
- Hook says "SKILL FIRST" → Call sw:increment-planner
71
- Then ALSO invoke: sw:pm (specs), sw:architect (design)
72
-
73
- IMPLEMENTATION PHASE:
74
- For each domain, invoke the relevant skill:
75
- - React/Vue/Angular → sw-frontend:frontend-architect
76
- - .NET/C# → sw-backend:dotnet-backend
77
- - Node.js → sw-backend:nodejs-backend
78
- - Stripe → sw-payments:stripe-integration
79
- - Database → sw-backend:database-optimizer
80
-
81
- CODE INTELLIGENCE (LSP - REQUIRES SETUP):
82
- ⚠️ LSP does NOT work automatically - it requires explicit setup!
83
-
84
- **Setup steps:**
85
- 1. Enable: `export ENABLE_LSP_TOOL=1` (add to ~/.zshrc or ~/.bashrc)
86
- 2. Add marketplace: `/plugin marketplace add boostvolt/claude-code-lsps`
87
- 3. Install plugin: `/plugin install vtsls@claude-code-lsps` (TypeScript)
88
-
89
- **Note:** Official marketplace LSP plugins are broken (Issue #15148).
90
- Use `boostvolt/claude-code-lsps` instead.
91
-
92
- **Available LSP operations:** goToDefinition, findReferences, hover, documentSymbol, workspaceSymbol
93
- ```
94
-
95
- ### Why Auto-Activation May Not Trigger
96
-
97
- Per [official Claude Code docs](https://code.claude.com/docs/en/skills):
98
- 1. Description keywords don't match user's exact phrasing
99
- 2. Character budget exceeded (15K default, many skills loaded)
100
- 3. Multi-domain requests dilute keyword matching
101
-
102
- **Solution**: When auto-activation fails, EXPLICITLY invoke with `Skill({ skill: "name" })`
103
-
104
- ### Example: Multi-Domain Request
105
-
106
- User says: "Create React dashboard with Stripe checkout and .NET backend"
34
+ <!-- SECTION:lsp -->
35
+ ## LSP (Code Intelligence)
107
36
 
108
- **WRONG** (what I did before):
109
- ```
110
- Skill(sw:increment-planner) → Implement everything directly
111
- ```
112
-
113
- **CORRECT** (what I should do):
114
- ```
115
- Skill(sw:increment-planner) → Plan the increment
116
- Skill(sw-frontend:frontend-architect) → React dashboard patterns
117
- Skill(sw-payments:stripe-integration) → Stripe checkout flow
118
- Skill(sw-backend:dotnet-backend) → .NET API patterns
119
- [LSP available if configured - see LSP Setup section]
120
- ```
121
-
122
- **Note on LSP**: LSP requires explicit setup (`ENABLE_LSP_TOOL=1` + `boostvolt/claude-code-lsps` marketplace). Official plugins are broken (Issue #15148).
123
-
124
- ### Skill Usage Checklist
125
-
126
- Before marking implementation complete, verify:
127
- - [ ] Used planning skills (PM, Architect) if complex feature
128
- - [ ] Used domain skills for each tech in the stack
129
- - [ ] LSP configured if needed (requires `ENABLE_LSP_TOOL=1` + plugin setup)
130
- - [ ] Invoked skills explicitly if auto-activation didn't trigger
37
+ **Native LSP broken in v2.1.0+.** Use: `specweave lsp refs|def|hover src/file.ts SymbolName`
131
38
  <!-- /SECTION -->
132
39
 
133
40
  <!-- SECTION:start -->
@@ -172,8 +79,8 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
172
79
  ### 4. Think-Before-Act (Dependencies)
173
80
  **Satisfy dependencies BEFORE dependent operations.**
174
81
  ```
175
- node script.js → Error → npm run build
176
- npm run build → node script.js → Success
82
+ Bad: node script.js → Error → npm run build
83
+ Good: npm run build → node script.js → Success
177
84
  ```
178
85
  <!-- /SECTION -->
179
86
 
@@ -187,15 +94,10 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
187
94
  find .specweave/increments -maxdepth 2 -type d -name "[0-9]*" | grep -oE '[0-9]{4}E?' | sort -u | tail -5
188
95
  ```
189
96
  4. **Emergency**: "emergency mode" → 1 edit, 50 lines max, no agents
190
- 5. **⛔ Initialization guard**: `.specweave/` folders MUST ONLY exist where `specweave init` was run
191
- 6. **⛔ Marketplace refresh**: Use `specweave refresh-marketplace` CLI (not `scripts/refresh-marketplace.sh`)
192
- 7. **⛔ Numbered folder collisions**: Before creating `docs/NN-*` folders, CHECK existing prefixes:
193
- ```bash
194
- ls docs/ | grep -E '^[0-9]{2}-' | cut -d'-' -f1 | sort -u
195
- ```
196
- Use next available number. **NEVER create duplicate prefixes.**
197
- 8. **⛔ Multi-repo**: ALL repos MUST be at `repositories/{org}/{repo-name}/` — NEVER directly under `repositories/`
198
- Discover org from config: `repository.organization` → `sync.profiles` → `umbrella.childRepos` → filesystem
97
+ 5. **Initialization guard**: `.specweave/` folders MUST ONLY exist where `specweave init` was run
98
+ 6. **Marketplace refresh**: Use `specweave refresh-marketplace` CLI (not `scripts/refresh-marketplace.sh`)
99
+ 7. **Numbered folder collisions**: Before creating `docs/NN-*` folders, CHECK existing prefixes
100
+ 8. **Multi-repo**: ALL repos MUST be at `repositories/{org}/{repo-name}/` — NEVER directly under `repositories/`
199
101
  <!-- /SECTION -->
200
102
 
201
103
  <!-- SECTION:workflow required -->
@@ -209,7 +111,7 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
209
111
  | `/sw:do` | Execute tasks |
210
112
  | `/sw:auto` | Autonomous execution |
211
113
  | `/sw:auto-status` | Check auto session |
212
- | `/sw:cancel-auto` | ⚠️ EMERGENCY ONLY manual cancel |
114
+ | `/sw:cancel-auto` | EMERGENCY ONLY manual cancel |
213
115
  | `/sw:validate` | Quality check |
214
116
  | `/sw:done` | Close |
215
117
  | `/sw:progress-sync` | Sync progress to all external tools |
@@ -219,49 +121,9 @@ SpecWeave auto-detects product descriptions and routes to `/sw:increment`:
219
121
  <!-- /SECTION -->
220
122
 
221
123
  <!-- SECTION:save-nested-repos required -->
222
- ## /sw:save - Nested Repository Scanning (MANDATORY)
223
-
224
- **⚠️ ALWAYS scan for nested repositories BEFORE any git operations:**
225
-
226
- ```bash
227
- # MANDATORY first step - check for nested repos
228
- for folder in repositories packages services apps libs workspace; do
229
- [ -d "$folder" ] && find "$folder" -maxdepth 2 -name ".git" -type d
230
- done
231
- ```
232
-
233
- **Common SpecWeave structure:**
234
- ```
235
- project/
236
- ├── .specweave/
237
- ├── repositories/ # ← ALWAYS check this!
238
- │ ├── frontend/.git
239
- │ ├── backend/.git
240
- │ └── shared/.git
241
- └── .git # Parent repo
242
- ```
243
-
244
- **NEVER assume single-repo mode without scanning first!**
245
-
246
- ### Multi-Repo Increment Placement (CRITICAL)
124
+ ## Nested Repos
247
125
 
248
- **In umbrella projects with `repositories/` folder:**
249
- - Each repo manages its OWN `.specweave/increments/`
250
- - Team agents MUST create increments in their assigned repo's `.specweave/`
251
- - The umbrella root `.specweave/` is for config and docs ONLY
252
- - Run `specweave init` in each repo if `.specweave/` doesn't exist
253
- - Agent working directory = `repositories/{org}/{repo-name}/`
254
-
255
- ```
256
- # CORRECT # WRONG
257
- repositories/ .specweave/increments/
258
- org/frontend/ 0001-all-agents-here/ ← NO!
259
- .specweave/increments/
260
- 0001-ui-feature/ ← YES
261
- org/backend/
262
- .specweave/increments/
263
- 0001-api-feature/ ← YES
264
- ```
126
+ Before git operations, scan: `for d in repositories packages services apps libs workspace; do [ -d "$d" ] && find "$d" -maxdepth 2 -name ".git" -type d; done`
265
127
  <!-- /SECTION -->
266
128
 
267
129
  <!-- SECTION:reflect -->
@@ -270,7 +132,6 @@ repositories/ .specweave/increments/
270
132
  SpecWeave learns from corrections. Learnings saved here automatically. Edit or delete as needed.
271
133
 
272
134
  **Disable**: Set `"reflect": { "enabled": false }` in `.specweave/config.json`
273
-
274
135
  <!-- /SECTION -->
275
136
 
276
137
  <!-- SECTION:context -->
@@ -291,7 +152,7 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
291
152
  └── config.json
292
153
  ```
293
154
 
294
- **⛔ Increment root**: ONLY `metadata.json`, `spec.md`, `plan.md`, `tasks.md`
155
+ **Increment root**: ONLY `metadata.json`, `spec.md`, `plan.md`, `tasks.md`
295
156
 
296
157
  **Everything else → subfolders**: `reports/` | `logs/` | `scripts/` | `backups/`
297
158
  <!-- /SECTION -->
@@ -307,126 +168,31 @@ SpecWeave learns from corrections. Learnings saved here automatically. Edit or d
307
168
  <!-- /SECTION -->
308
169
 
309
170
  <!-- SECTION:secrets required -->
310
- ## Secrets Check
311
-
312
- **BEFORE CLI tools**: Check existing config first!
313
- ```bash
314
- # Check if credentials EXIST (never display values!)
315
- grep -qE "(GITHUB_TOKEN|GH_TOKEN|JIRA_|AZURE_DEVOPS_|ADO_)" .env 2>/dev/null && echo "Credentials found in .env"
316
- cat .specweave/config.json | grep -A5 '"sync"'
317
- gh auth status
318
- ```
171
+ ## Secrets
319
172
 
320
- **SECURITY**: NEVER use `grep TOKEN .env` without `-q` flag - it exposes credentials in terminal!
173
+ Before CLI tools, check existing config (`grep -q` only never display values).
321
174
  <!-- /SECTION -->
322
175
 
323
176
  <!-- SECTION:syncing -->
324
- ## External Sync (GitHub/JIRA/ADO)
325
-
326
- **Primary command**: `/sw:progress-sync` — syncs tasks.md → spec.md → living docs → external tools (auto-creates missing issues)
177
+ ## External Sync
327
178
 
328
- **Individual commands**:
329
- | Command | Action |
330
- |---------|--------|
331
- | `/sw-github:create {id}` | Create GitHub issue for increment |
332
- | `/sw-github:push {id}` | Push task progress to GitHub issue |
333
- | `/sw-github:close {id}` | Close GitHub issue |
334
- | `/sw-github:status {id}` | Check sync status |
335
- | `/sw:sync-specs` | Sync living docs locally |
336
-
337
- **Mapping**: Feature → Milestone | Story → Issue | Task → Checkbox
338
-
339
- **Auto-configured**: Sync enabled by default during `specweave init` when a tracker is selected.
340
-
341
- **After task completion**: Run `/sw:progress-sync` or `/sw-github:push` to sync changes to external tools.
179
+ Primary: `/sw:progress-sync`. Individual: `/sw-github:push`, `/sw-github:close`. Mapping: Feature→Milestone | Story→Issue | Task→Checkbox.
342
180
  <!-- /SECTION -->
343
181
 
344
182
  <!-- SECTION:testing -->
345
183
  ## Testing
346
184
 
347
- BDD in tasks.md | Unit >80% | `.test.ts` (Vitest)
348
-
349
- ```typescript
350
- // ESM mocking: vi.hoisted() + vi.mock() (Vitest 4.x+)
351
- const { mockFn } = vi.hoisted(() => ({ mockFn: vi.fn() }));
352
- vi.mock('./module', () => ({ func: mockFn }));
353
- ```
354
-
355
- ### Browser Automation Mode
356
-
357
- **Default**: `@playwright/cli` if installed (98% token reduction vs MCP)
358
- **Fallback**: Playwright MCP plugin (rich DOM introspection)
359
- **Config**: `testing.playwright.preferCli: true|false` in `.specweave/config.json`
360
- **Install CLI**: `npm install -g @playwright/cli@latest`
185
+ BDD in tasks.md | Unit >80% | `.test.ts` (Vitest) | ESM mocking: `vi.hoisted()` + `vi.mock()`
361
186
  <!-- /SECTION -->
362
187
 
363
188
  <!-- SECTION:tdd -->
364
- ## TDD Mode (Test-Driven Development)
365
-
366
- **When `testing.defaultTestMode: "TDD"` is configured**, follow RED-GREEN-REFACTOR discipline:
367
-
368
- ### TDD Workflow (MANDATORY when configured)
369
-
370
- ```
371
- 1. RED: Write FAILING test first → verify it fails
372
- 2. GREEN: Write MINIMAL code to pass → no extra features
373
- 3. REFACTOR: Improve code quality → keep tests green
374
- ```
375
-
376
- ### Check TDD Mode Before Implementation
377
-
378
- ```bash
379
- # Check if TDD mode is enabled
380
- jq -r '.testing.defaultTestMode' .specweave/config.json
381
- # Returns: "TDD" | "test-first" | "test-after"
382
- ```
383
-
384
- ### TDD Commands
385
-
386
- | Command | Phase | Purpose |
387
- |---------|-------|---------|
388
- | `/sw:tdd-red` | RED | Write failing tests |
389
- | `/sw:tdd-green` | GREEN | Minimal implementation |
390
- | `/sw:tdd-refactor` | REFACTOR | Code quality improvement |
391
- | `/sw:tdd-cycle` | ALL | Full orchestrated workflow |
392
-
393
- ### Enforcement Levels
394
-
395
- Set `testing.tddEnforcement` in config.json:
396
-
397
- | Level | Behavior |
398
- |-------|----------|
399
- | `strict` | **BLOCKS** task completion if RED not done before GREEN |
400
- | `warn` | Shows warning but allows continuation (default) |
401
- | `off` | No enforcement |
402
-
403
- ### TDD Task Format
404
-
405
- When TDD is enabled, tasks include phase markers:
406
-
407
- ```markdown
408
- ### T-001: [RED] Write auth service tests
409
- **Depends On**: None
410
- **Status**: [ ] pending
411
-
412
- ### T-002: [GREEN] Implement auth service
413
- **Depends On**: T-001
414
- **Status**: [ ] pending
189
+ ## TDD
415
190
 
416
- ### T-003: [REFACTOR] Extract token utilities
417
- **Depends On**: T-002
418
- **Status**: [ ] pending
419
- ```
420
-
421
- **Rule**: Complete dependencies BEFORE dependent tasks (RED before GREEN).
191
+ When `testing.defaultTestMode: "TDD"` in config.json: RED→GREEN→REFACTOR. Use `/sw:tdd-cycle`. Enforcement via `testing.tddEnforcement` (strict|warn|off).
422
192
  <!-- /SECTION -->
423
193
 
424
194
  <!-- SECTION:api -->
425
- ## API Development (OpenAPI-First)
426
-
427
- **For API projects only.** Commands: `/sw:api-docs --all` | `--openapi` | `--postman` | `--validate`
428
-
429
- Enable in config: `{"apiDocs":{"enabled":true,"openApiPath":"openapi.yaml"}}`
195
+ <!-- API: Enable `apiDocs` in config.json. Commands: /sw:api-docs -->
430
196
  <!-- /SECTION -->
431
197
 
432
198
  <!-- SECTION:limits -->
@@ -440,42 +206,25 @@ Enable in config: `{"apiDocs":{"enabled":true,"openApiPath":"openapi.yaml"}}`
440
206
 
441
207
  | Issue | Fix |
442
208
  |-------|-----|
443
- | Skills/commands missing | Restart Claude Code |
209
+ | Skills missing | Restart Claude Code |
444
210
  | Plugins outdated | `specweave refresh-marketplace` |
445
211
  | Out of sync | `/sw:sync-tasks` |
446
- | Duplicate IDs | `/sw:fix-duplicates` |
447
- | Edits blocked | Add `"additionalDirectories":["repositories"]` to `.claude/settings.json` |
448
- | Session stuck | Kill + `rm -f .specweave/state/*.lock` + restart |
212
+ | Session stuck | `rm -f .specweave/state/*.lock` + restart |
449
213
  <!-- /SECTION -->
450
214
 
451
215
  <!-- SECTION:lazyloading -->
452
216
  ## Plugin Auto-Loading
453
217
 
454
- Plugins load automatically based on project type and keywords. Manual install if needed:
455
-
456
- ```bash
457
- claude plugin install sw-frontend@specweave # Install plugin
458
- claude plugin list # Check installed
459
- export SPECWEAVE_DISABLE_AUTO_LOAD=1 # Disable auto-load
460
- ```
461
-
462
- **Token savings**: Core ~3-5K tokens vs all plugins ~60K+
218
+ Plugins load automatically. Manual: `claude plugin install sw-frontend@specweave`. Disable: `export SPECWEAVE_DISABLE_AUTO_LOAD=1`
463
219
  <!-- /SECTION -->
464
220
 
465
221
  <!-- SECTION:principles -->
466
222
  ## Principles
467
223
 
468
- ### SpecWeave Principles
469
224
  1. **Spec-first**: `/sw:increment` before coding
470
225
  2. **Docs = truth**: Specs guide implementation
471
- 3. **Incremental**: Small, validated increments
472
- 4. **Traceable**: All work specs → ACs
473
-
474
- ### Core Principles (Quality)
475
- - **Simplicity First**: Make every change as simple as possible. Impact minimal code.
476
- - **No Laziness**: Find root causes. No temporary fixes. Senior developer standards.
477
- - **Minimal Impact**: Changes should only touch what's necessary. Avoid introducing bugs.
478
- - **Demand Elegance**: For non-trivial changes, pause and ask "is there a more elegant way?" - but skip this for simple, obvious fixes (don't over-engineer).
226
+ 3. **Simplicity First**: Minimal code, minimal impact
227
+ 4. **No Laziness**: Root causes, senior standards
479
228
  <!-- /SECTION -->
480
229
 
481
230
  <!-- SECTION:linking -->
@@ -489,40 +238,15 @@ Task format: `**AC**: AC-US1-01, AC-US1-02` (CRITICAL for linking)
489
238
  <!-- SECTION:mcp -->
490
239
  ## External Services
491
240
 
492
- **Priority**: CLI tools first (simpler) → MCP for complex integrations
493
-
494
- **CLI tools** (check auth first):
495
- ```bash
496
- gh auth status # GitHub
497
- wrangler whoami # Cloudflare
498
- supabase status # Supabase
499
- ```
500
-
501
- **MCP servers** (for richer integrations):
502
- ```bash
503
- claude mcp add --transport http github https://api.github.com/mcp
504
- claude mcp add --transport stdio postgres -- npx -y @modelcontextprotocol/server-postgres
505
- /mcp # Check status in Claude Code
506
- ```
507
-
508
- MCP supports lazy-loading (auto mode) - tools load on-demand when >10% context.
241
+ CLI tools first (`gh`, `wrangler`, `supabase`) → MCP for complex integrations.
509
242
  <!-- /SECTION -->
510
243
 
511
244
  <!-- SECTION:auto -->
512
245
  ## Auto Mode
513
246
 
514
- **Commands**: `/sw:auto` (start) | `/sw:auto-status` (check) | `/sw:cancel-auto` (emergency only)
247
+ `/sw:auto` (start) | `/sw:auto-status` (check) | `/sw:cancel-auto` (emergency)
515
248
 
516
- **Pattern**: IMPLEMENT → TEST → FAIL? → FIX → PASS → NEXT
517
-
518
- **TDD in Auto Mode**: If `testing.defaultTestMode: "TDD"` is configured:
519
- - Use `/sw:auto --tdd` for strict enforcement (ALL tests must pass)
520
- - Auto mode reads config and displays TDD banner
521
- - Follow RED → GREEN → REFACTOR order for task triplets
522
-
523
- **Pragmatic completion**: MUST (MVP, security, data integrity) | SHOULD (edge cases) | CAN SKIP (conflicts - ask user)
524
-
525
- **STOP & ASK** if: Spec conflicts | Task unnecessary | Requirement ambiguous
249
+ Pattern: IMPLEMENT → TEST → FAIL? → FIX → PASS → NEXT. STOP & ASK if spec conflicts or ambiguity.
526
250
  <!-- /SECTION -->
527
251
 
528
252
  <!-- SECTION:docs -->
@@ -534,35 +258,5 @@ MCP supports lazy-loading (auto mode) - tools load on-demand when >10% context.
534
258
  <!-- SECTION:non-claude -->
535
259
  ## Using SpecWeave with Other AI Tools
536
260
 
537
- **Not using Claude Code?** See **AGENTS.md** for complete instructions on using SpecWeave with Cursor, Copilot, Windsurf, Aider, and other AI coding assistants.
538
-
539
- ### Key Differences for Non-Claude Tools
540
-
541
- | Feature | Claude Code | Other Tools |
542
- |---------|-------------|-------------|
543
- | **Hooks** | Automatic | Manual sync required (see AGENTS.md) |
544
- | **Commands** | Slash syntax works | Read command .md files |
545
- | **Skills** | Auto-activate | Load .md files manually |
546
- | **Task tracking** | Auto-updates | Manual checkbox updates |
547
-
548
- ### Quick Start (Non-Claude)
549
-
550
- ```bash
551
- # 1. Install SpecWeave globally
552
- npm install -g specweave
553
-
554
- # 2. Initialize your project
555
- specweave init .
556
-
557
- # 3. Read AGENTS.md for your specific tool
558
- cat AGENTS.md # or open in your editor
559
- ```
560
-
561
- **Essential workflow for ANY AI tool:**
562
- 1. After completing a task → Update `tasks.md`: `[ ]` → `[x]`
563
- 2. If task satisfies ACs → Update `spec.md`: `[ ] AC-XX` → `[x] AC-XX`
564
- 3. Run `/sw:sync-tasks` to update progress cache
565
- 4. When all tasks done → Run `/sw:done {id}` to close increment
566
-
567
- **Full guide with hook simulation, tool-specific setup, and workflows**: See **AGENTS.md**
261
+ See **AGENTS.md** for Cursor, Copilot, Windsurf, Aider instructions.
568
262
  <!-- /SECTION -->
@@ -77,12 +77,16 @@
77
77
 
78
78
  "hooks": {
79
79
  "post_task_completion": {
80
- "sync_living_docs": true,
81
80
  "sync_tasks_md": true,
82
81
  "external_tracker_sync": true
83
82
  },
84
83
  "post_increment_planning": {
85
84
  "auto_create_github_issue": true
85
+ },
86
+ "post_increment_done": {
87
+ "sync_living_docs": true,
88
+ "sync_to_github_project": true,
89
+ "close_github_issue": true
86
90
  }
87
91
  }
88
92
  }