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.
- package/CLAUDE.md +56 -221
- package/README.md +31 -0
- package/bin/specweave.js +17 -0
- package/dist/src/adapters/README.md +4 -4
- package/dist/src/adapters/agents-md-generator.d.ts.map +1 -1
- package/dist/src/adapters/agents-md-generator.js +0 -2
- package/dist/src/adapters/agents-md-generator.js.map +1 -1
- package/dist/src/adapters/claude/README.md +3 -3
- package/dist/src/adapters/claude/adapter.js +3 -3
- package/dist/src/adapters/claude-md-generator.js +1 -1
- package/dist/src/adapters/claude-md-generator.js.map +1 -1
- package/dist/src/adapters/registry.yaml +1 -1
- package/dist/src/cli/commands/create-increment.d.ts +24 -0
- package/dist/src/cli/commands/create-increment.d.ts.map +1 -0
- package/dist/src/cli/commands/create-increment.js +53 -0
- package/dist/src/cli/commands/create-increment.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +48 -31
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/update.d.ts.map +1 -1
- package/dist/src/cli/commands/update.js +36 -0
- package/dist/src/cli/commands/update.js.map +1 -1
- package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/directory-structure.js +13 -1
- package/dist/src/cli/helpers/init/directory-structure.js.map +1 -1
- package/dist/src/cli/helpers/init/summary-banner.d.ts +11 -0
- package/dist/src/cli/helpers/init/summary-banner.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/summary-banner.js +49 -3
- package/dist/src/cli/helpers/init/summary-banner.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +0 -1
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js +6 -2
- package/dist/src/cli/helpers/issue-tracker/sync-config-writer.js.map +1 -1
- package/dist/src/core/ac-progress-sync.d.ts +13 -0
- package/dist/src/core/ac-progress-sync.d.ts.map +1 -1
- package/dist/src/core/ac-progress-sync.js +28 -0
- package/dist/src/core/ac-progress-sync.js.map +1 -1
- package/dist/src/core/config/types.d.ts +24 -1
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js +6 -1
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/doctor/checkers/project-structure-checker.d.ts +1 -0
- package/dist/src/core/doctor/checkers/project-structure-checker.d.ts.map +1 -1
- package/dist/src/core/doctor/checkers/project-structure-checker.js +53 -3
- package/dist/src/core/doctor/checkers/project-structure-checker.js.map +1 -1
- package/dist/src/core/fabric/security-scanner.d.ts.map +1 -1
- package/dist/src/core/fabric/security-scanner.js +70 -9
- package/dist/src/core/fabric/security-scanner.js.map +1 -1
- package/dist/src/core/increment/increment-utils.d.ts +6 -0
- package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
- package/dist/src/core/increment/increment-utils.js +5 -0
- package/dist/src/core/increment/increment-utils.js.map +1 -1
- package/dist/src/core/living-docs/discovery.d.ts +2 -0
- package/dist/src/core/living-docs/discovery.d.ts.map +1 -1
- package/dist/src/core/living-docs/discovery.js +91 -17
- package/dist/src/core/living-docs/discovery.js.map +1 -1
- package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts +5 -0
- package/dist/src/core/living-docs/intelligent-analyzer/index.d.ts.map +1 -1
- package/dist/src/core/living-docs/intelligent-analyzer/index.js +3 -3
- package/dist/src/core/living-docs/intelligent-analyzer/index.js.map +1 -1
- package/dist/src/core/living-docs/lsp-bootstrapper.d.ts +64 -0
- package/dist/src/core/living-docs/lsp-bootstrapper.d.ts.map +1 -0
- package/dist/src/core/living-docs/lsp-bootstrapper.js +118 -0
- package/dist/src/core/living-docs/lsp-bootstrapper.js.map +1 -0
- package/dist/src/core/project/project-service.d.ts +10 -1
- package/dist/src/core/project/project-service.d.ts.map +1 -1
- package/dist/src/core/project/project-service.js +37 -2
- package/dist/src/core/project/project-service.js.map +1 -1
- package/dist/src/core/universal-auto-create.d.ts +64 -0
- package/dist/src/core/universal-auto-create.d.ts.map +1 -0
- package/dist/src/core/universal-auto-create.js +228 -0
- package/dist/src/core/universal-auto-create.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/PLUGIN.md +0 -3
- package/plugins/specweave/commands/living-docs.md +0 -2
- package/plugins/specweave/hooks/stop-sync.sh +34 -5
- package/plugins/specweave/hooks/user-prompt-submit.sh +115 -326
- package/plugins/specweave/hooks/v2/dispatchers/post-tool-use.sh +19 -5
- package/plugins/specweave/hooks/v2/handlers/ac-sync-dispatcher.sh +14 -4
- package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +181 -0
- package/plugins/specweave/lib/hooks/sync-living-docs.js +4 -2
- package/plugins/specweave/scripts/skill-context.sh +160 -0
- package/plugins/specweave/skills/architect/SKILL.md +1 -1
- package/plugins/specweave/skills/archive-increments/SKILL.md +13 -3
- package/plugins/specweave/skills/auto/SKILL.md +92 -1038
- package/plugins/specweave/skills/do/SKILL.md +66 -1106
- package/plugins/specweave/skills/docs/SKILL.md +124 -56
- package/plugins/specweave/skills/done/SKILL.md +76 -1406
- package/plugins/specweave/skills/framework/SKILL.md +1 -1
- package/plugins/specweave/skills/increment/SKILL.md +1 -1
- package/plugins/specweave/skills/increment-planner/SKILL.md +29 -19
- package/plugins/specweave/skills/jobs/SKILL.md +52 -0
- package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +1 -1
- package/plugins/specweave/skills/save/SKILL.md +51 -1372
- package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +1 -1
- package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +1 -1
- package/plugins/specweave/skills/validate/SKILL.md +65 -848
- package/plugins/specweave-backend/skills/database-optimizer/SKILL.md +1 -1
- package/plugins/specweave-backend/skills/graphql/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/frontend-architect/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/frontend-design/SKILL.md +1 -1
- package/plugins/specweave-frontend/skills/i18n-expert/SKILL.md +1 -1
- package/plugins/specweave-payments/skills/billing-automation/SKILL.md +1 -1
- package/plugins/specweave-testing/skills/accessibility-testing/SKILL.md +1 -1
- package/src/templates/CLAUDE.md.template +50 -356
- package/src/templates/config.json.template +5 -1
- package/plugins/specweave/commands/brownfield-analyzer.md +0 -408
- package/plugins/specweave/commands/brownfield-onboarder.md +0 -837
- package/plugins/specweave/commands/export-skills.md +0 -179
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
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:
|
|
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:
|
|
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
|
|
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
|
-
##
|
|
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
|
-
|
|
21
|
+
**Invoke**: `/skill-name` | auto-trigger by keywords | `Skill({ skill: "name" })`
|
|
22
|
+
**Parallel work**: Append "use subagents" to requests
|
|
23
23
|
|
|
24
|
-
|
|
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
|
-
|
|
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:
|
|
62
|
-
##
|
|
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
|
-
**
|
|
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
|
-
|
|
176
|
-
|
|
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.
|
|
191
|
-
6.
|
|
192
|
-
7.
|
|
193
|
-
|
|
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` |
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
209
|
+
| Skills missing | Restart Claude Code |
|
|
444
210
|
| Plugins outdated | `specweave refresh-marketplace` |
|
|
445
211
|
| Out of sync | `/sw:sync-tasks` |
|
|
446
|
-
|
|
|
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
|
|
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. **
|
|
472
|
-
4. **
|
|
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
|
-
|
|
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
|
-
|
|
247
|
+
`/sw:auto` (start) | `/sw:auto-status` (check) | `/sw:cancel-auto` (emergency)
|
|
515
248
|
|
|
516
|
-
|
|
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
|
-
|
|
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
|
}
|