specweave 0.26.10 → 0.26.13

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 (33) hide show
  1. package/CLAUDE.md +95 -520
  2. package/dist/plugins/specweave-github/lib/completion-calculator.d.ts +4 -1
  3. package/dist/plugins/specweave-github/lib/completion-calculator.d.ts.map +1 -1
  4. package/dist/plugins/specweave-github/lib/completion-calculator.js +49 -29
  5. package/dist/plugins/specweave-github/lib/completion-calculator.js.map +1 -1
  6. package/dist/src/cli/commands/init.js +2 -2
  7. package/dist/src/cli/commands/init.js.map +1 -1
  8. package/dist/src/core/increment/increment-archiver.d.ts +3 -0
  9. package/dist/src/core/increment/increment-archiver.d.ts.map +1 -1
  10. package/dist/src/core/increment/increment-archiver.js +35 -4
  11. package/dist/src/core/increment/increment-archiver.js.map +1 -1
  12. package/dist/src/core/living-docs/feature-archiver.d.ts +5 -0
  13. package/dist/src/core/living-docs/feature-archiver.d.ts.map +1 -1
  14. package/dist/src/core/living-docs/feature-archiver.js +66 -18
  15. package/dist/src/core/living-docs/feature-archiver.js.map +1 -1
  16. package/package.json +1 -1
  17. package/plugins/specweave/commands/specweave-archive.md +10 -1
  18. package/plugins/specweave/hooks/hooks.json +10 -0
  19. package/plugins/specweave/hooks/lib/update-active-increment.sh +96 -0
  20. package/plugins/specweave/hooks/lib/update-status-line.sh +153 -189
  21. package/plugins/specweave/hooks/post-edit-write-consolidated.sh +6 -0
  22. package/plugins/specweave/hooks/post-metadata-change.sh +9 -0
  23. package/plugins/specweave/hooks/post-task-completion.sh +8 -0
  24. package/plugins/specweave/hooks/post-task-edit.sh +37 -0
  25. package/plugins/specweave/hooks/pre-command-deduplication.sh +43 -53
  26. package/plugins/specweave/hooks/pre-tool-use.sh +5 -0
  27. package/plugins/specweave/hooks/user-prompt-submit.sh +143 -289
  28. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +18 -0
  29. package/plugins/specweave-github/lib/completion-calculator.js +34 -16
  30. package/plugins/specweave-github/lib/completion-calculator.ts +54 -32
  31. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +27 -0
  32. package/src/templates/AGENTS.md.template +301 -2452
  33. package/src/templates/CLAUDE.md.template +99 -667
@@ -1,2619 +1,468 @@
1
1
  # {PROJECT_NAME}
2
2
 
3
3
  **Framework**: SpecWeave - Specification-First Development
4
- **Standard**: This file follows [agents.md](https://agents.md/) for universal AI compatibility
4
+ **Standard**: [agents.md](https://agents.md/) for universal AI compatibility
5
5
 
6
6
  ---
7
7
 
8
- ## 🎯 Getting Started
8
+ ## Section Index (Use Ctrl+F to Navigate)
9
9
 
10
- **Initial Increment Created**: `0001-project-setup` (`.specweave/increments/0001-project-setup/`)
11
-
12
- This increment was auto-generated by `specweave init` to give you a starting point.
13
-
14
- **Your Options**:
15
- 1. **Start Fresh** (Recommended): Delete it and create your first real feature
16
- - Delete the increment folder manually
17
- - Ask user to run `/specweave:increment "your-feature-name"` (if in Claude Code) or create new increment via this file's commands
18
- 2. **Customize It**: Edit the spec.md in the increment folder and use it for initial setup tasks
19
-
20
- **Note**: SpecWeave works best when each increment represents a single, focused feature or bugfix.
21
-
22
- ---
23
-
24
- ## 🚨 CRITICAL: How to Use This File (Non-Claude Code Tools)
25
-
26
- **You're using Cursor, GitHub Copilot, or another AI tool - NOT Claude Code.**
27
-
28
- This means you **DO NOT have progressive disclosure** - this ENTIRE file (2000+ lines) is loaded into your context right now.
29
-
30
- **BUT** - you don't need to process everything at once!
31
-
32
- ### Think of This File as a REFERENCE MANUAL
33
-
34
- - 📖 **Skim section headers** at session start (don't read all details)
35
- - 🔍 **Search for sections** when needed (use Ctrl+F / Command+F)
36
- - ✅ **Process ONLY relevant section** for current task
37
- - ♻️ **Ignore irrelevant sections** (don't waste tokens processing them)
38
-
39
- ### Navigation Pattern
40
-
41
- **When user requests a task**:
42
- 1. Search for relevant section (use Section Index below)
43
- 2. Example: "sync to GitHub" → Search for `#workflow-github-sync`
44
- 3. Read ONLY that section (50-100 lines)
45
- 4. Execute workflow from that section
46
- 5. Ignore other 1900+ lines (not needed right now!)
47
-
48
- ### Example Workflow
49
-
50
- ```
51
- User says: "Create new increment for user auth"
52
-
53
- You search: "increment" or "#command-increment"
54
-
55
- You find: ## Command: /specweave:increment {#command-increment}
56
-
57
- You read: That section ONLY (workflow, parameters, examples)
58
-
59
- You execute: Follow workflow from that section
60
-
61
- Done! (Ignored 95% of file - that's good!)
62
- ```
63
-
64
- **This simulates progressive disclosure without tool support!**
65
-
66
- ---
67
-
68
- ## 📑 SECTION INDEX (Your Navigation Menu)
69
-
70
- **Use Ctrl+F / Command+F to jump to sections instantly!**
71
-
72
- ### 🎯 Essential (Read First - Always)
73
- - [Essential Knowledge](#essential-knowledge) ← **START HERE** every session
74
- - [Quick Reference Cards](#quick-reference-cards) ← Common commands
75
- - [Critical Rules](#critical-rules) ← Never violate these
76
- - [File Organization](#file-organization) ← Where files go
77
-
78
- ### 🚀 Commands (When User Requests Action)
79
- Search pattern: `#command-{name}`
80
-
81
- **Core Commands**:
82
- - [/specweave:increment](#command-increment) - Plan new feature
83
- - [/specweave:do](#command-do) - Execute tasks
84
- - [/specweave:done](#command-done) - Close increment
85
- - [/specweave:progress](#command-progress) - Check status
86
- - [/specweave:validate](#command-validate) - Quality check
87
- - [/specweave:sync-docs](#command-sync-docs) - Sync living docs
88
- - [/specweave:sync-tasks](#command-sync-tasks) - Sync task status
89
- - [/specweave:next](#command-next) - Smart transition
90
- - [/specweave:costs](#command-costs) - AI cost dashboard
91
-
92
- **Plugin Commands** (if installed):
93
- - [/specweave:github:sync](#command-github-sync) - Sync to GitHub
94
- - [/specweave:jira:sync](#command-jira-sync) - Sync to Jira
95
- - [/specweave:ado:sync](#command-ado-sync) - Sync to Azure DevOps
96
-
97
- ### 🎓 Skills (When You Need Specific Capability)
98
- Search pattern: `#skill-{name}`
99
-
100
- **Core Skills**:
101
- - [increment-planner](#skill-increment-planner) - Plan features
102
- - [spec-generator](#skill-spec-generator) - Generate specs
103
- - [context-loader](#skill-context-loader) - Token optimization
104
- - [brownfield-analyzer](#skill-brownfield-analyzer) - Analyze existing projects
105
-
106
- **Integration Skills**:
107
- - [github-sync](#skill-github-sync) - GitHub integration
108
- - [jira-sync](#skill-jira-sync) - Jira integration
109
- - [ado-sync](#skill-ado-sync) - Azure DevOps integration
110
-
111
- **Tech Stack Skills**:
112
- - [frontend](#skill-frontend) - React/Next.js/Vue
113
- - [backend](#skill-backend) - Node.js/Python/.NET
114
- - [infrastructure](#skill-infrastructure) - DevOps/Cloud
115
-
116
- ### 👔 Agents (When You Need Role Perspective)
117
- Search pattern: `#agent-{name}`
118
-
119
- **Core Agents**:
120
- - [PM (Product Manager)](#agent-pm) - Requirements, user stories
121
- - [Architect](#agent-architect) - System design, technical planning
122
- - [Tech Lead](#agent-tech-lead) - Code review, best practices
123
- - [DevOps](#agent-devops) - Infrastructure, deployment
124
- - [QA Lead](#agent-qa-lead) - Testing strategy, quality gates
125
- - [Security](#agent-security) - Threat modeling, compliance
126
-
127
- ### 📖 Workflows (Step-by-Step Procedures)
128
- Search pattern: `#workflow-{name}`
129
-
130
- **Daily Workflows**:
131
- - [Daily Development Workflow](#workflow-daily-development)
132
- - [Feature Increment Lifecycle](#workflow-increment-lifecycle)
133
- - [Task Completion Workflow](#workflow-task-completion)
134
-
135
- **Sync Workflows**:
136
- - [Living Docs Sync](#workflow-living-docs-sync)
137
- - [GitHub Sync](#workflow-github-sync)
138
- - [Jira Sync](#workflow-jira-sync)
139
- - [External Tracker Sync](#workflow-external-sync)
140
-
141
- **Advanced Workflows**:
142
- - [Multi-Project Setup](#workflow-multi-project)
143
- - [Increment Closure](#workflow-increment-closure)
144
- - [Documentation Updates](#workflow-documentation-updates)
145
-
146
- ### 🆘 Common Issues (When Stuck)
147
- Search pattern: `#troubleshoot-{topic}`
148
-
149
- - [Skills Not Working](#troubleshoot-skills)
150
- - [Commands Not Found](#troubleshoot-commands)
151
- - [Sync Issues](#troubleshoot-sync)
152
- - [Root Folder Polluted](#troubleshoot-root-pollution)
153
- - [Duplicate Increments](#troubleshoot-duplicates)
154
- - [More Troubleshooting →](#troubleshooting)
155
-
156
- ### 🔍 Search Patterns Reference
157
-
158
- | What You Need | Search For | Example |
159
- |---------------|------------|---------|
160
- | Command workflow | `#command-{name}` | "github sync" → `#command-github-sync` |
161
- | Skill capability | `#skill-{name}` | "planning" → `#skill-increment-planner` |
162
- | Agent role | `#agent-{name}` | "architect" → `#agent-architect` |
163
- | Procedure | `#workflow-{name}` | "daily work" → `#workflow-daily-development` |
164
- | Problem solving | `#troubleshoot-{topic}` | "sync broken" → `#troubleshoot-sync` |
165
-
166
- **Remember**: You have access to ALL knowledge - use search to find it efficiently!
10
+ | Section | Search For | Purpose |
11
+ |---------|------------|---------|
12
+ | Rules | `#essential-rules` | Critical rules, file organization |
13
+ | Commands | `#commands` | All SpecWeave commands |
14
+ | **Hooks** | `#non-claude-tools` | **CRITICAL: Hook behavior to mimic** |
15
+ | Sync | `#sync-workflow` | When/how to sync |
16
+ | Context | `#context-loading` | Token savings (70%+) |
17
+ | Troubleshoot | `#troubleshooting` | Common issues |
167
18
 
168
19
  ---
169
20
 
170
- ## Project Overview
171
-
172
- This is a **SpecWeave project** where specifications and documentation are the source of truth.
173
-
174
- ### Core Principle
175
- **Specification Before Implementation** - Define WHAT and WHY before HOW
176
-
177
- ### Key Concepts
178
- - **Increments**: Feature units with spec.md (WHAT/WHY), plan.md (HOW), tasks.md (checklist)
179
- - **Context Manifests**: Load only relevant files (70%+ token reduction)
180
- - **Living Documentation**: Specs evolve with code, never diverge
181
- - **Role-Based Development**: PM defines requirements, Architect designs, DevOps deploys
182
- - **Bidirectional Linking**: Tasks automatically link to user stories (and vice versa)
183
-
184
- ### Bidirectional Task ↔ User Story Linking
185
-
186
- **AUTOMATIC FEATURE**: When increment completes (`/specweave:done`), SpecWeave creates bidirectional links.
187
-
188
- **How It Works**:
189
- 1. User stories extracted to `.specweave/docs/internal/specs/{project}/`
190
- 2. Tasks.md automatically updated with links back to user stories
191
- 3. Complete bidirectional navigation created!
192
-
193
- **Requirements**:
194
- - Tasks MUST have **AC**: field with AC-IDs (e.g., `AC-US1-01, AC-US1-02`)
195
- - AC-IDs map to user stories: `AC-US1-01` → `US-001`
196
-
197
- **Example Task** (WITH bidirectional link):
198
- ```markdown
199
- ### T-001: Implement User Login
200
-
201
- **User Story**: [US-001: User Authentication](../../docs/internal/specs/default/auth-service/us-001-user-authentication.md)
202
-
203
- **AC**: AC-US1-01, AC-US1-02, AC-US1-03
21
+ ## Quick Start
204
22
 
205
- **Test Plan** (BDD):
206
- - **Given** valid credentials → **When** login → **Then** receive JWT token
207
- ```
23
+ **Initial Increment**: `0001-project-setup` (`.specweave/increments/0001-project-setup/`)
208
24
 
209
- **Benefits**:
210
- - Navigate both directions (Tasks User Stories → Tasks)
211
- - ✅ Automatic (no manual linking)
212
- - ✅ Multi-project aware (works with backend, frontend, mobile, etc.)
25
+ 1. **Start Fresh**: Delete it, run `/specweave:increment "your-feature"`
26
+ 2. **Customize**: Edit spec.md in the increment folder
213
27
 
214
28
  ---
215
29
 
216
- ## 📋 Quick Reference Cards {#quick-reference-cards}
217
-
218
- ### 🎯 Essential Knowledge {#essential-knowledge}
219
-
220
- **Read this EVERY session start!**
30
+ ## Essential Rules {#essential-rules}
221
31
 
222
- #### Critical Rules {#critical-rules}
223
32
  ```
224
- NEVER pollute project root with .md files!
225
- Increment IDs must be unique (0001-9999)!
226
- ONLY 3 files in increment root: spec.md, plan.md, tasks.md
227
- All reports/scripts/logs go in increment subfolders!
228
- Always check: git status (before committing)!
33
+ 1. NEVER pollute project root with .md files
34
+ 2. Increment IDs unique (0001-9999)
35
+ 3. ONLY 3 files in increment root: spec.md, plan.md, tasks.md
36
+ 4. All reports/scripts/logs increment subfolders
37
+ 5. Read context-manifest.yaml first (70%+ token savings)
38
+ 6. tasks.md + spec.md = SOURCE OF TRUTH (update after every task!)
229
39
  ```
230
40
 
231
- #### File Organization {#file-organization}
232
-
233
- **Increment Structure (MANDATORY)**:
41
+ **File Organization**:
234
42
  ```
235
43
  .specweave/increments/0001-feature/
236
- ├── spec.md # ⚠️ ONLY THESE 3 FILES in root!
237
- ├── plan.md
238
- ├── tasks.md
239
- ├── reports/ # ALL REPORTS HERE
240
- │ ├── SESSION-*.md
241
- │ ├── QUICK-START.md
242
- │ ├── ULTRATHINK-*.md
243
- │ └── ANALYSIS-*.md
244
- ├── scripts/ # ✅ ALL SCRIPTS HERE
245
- │ └── *.{py,sh,ts}
246
- └── logs/ # ✅ ALL LOGS HERE
247
- └── *.log
248
- ```
249
-
250
- **File Placement Rules**:
251
- ```
252
- ┌────────────────────────────────────────────────────────────┐
253
- │ NEVER in Root ↔ ALWAYS in Increment Folder │
254
- ├────────────────────────────────────────────────────────────┤
255
- │ ❌ QUICK-START.md ↔ ✅ .../0001/reports/QUICK-START │
256
- │ ❌ analysis.md ↔ ✅ .../0001/reports/analysis.md │
257
- │ ❌ migration.py ↔ ✅ .../0001/scripts/migration.py │
258
- │ ❌ execution.log ↔ ✅ .../0001/logs/execution.log │
259
- │ ❌ session-notes.md ↔ ✅ .../0001/reports/session.md │
260
- └────────────────────────────────────────────────────────────┘
261
- ```
262
-
263
- ### Daily Workflow
264
- ```
265
- ┌────────────────────────────────────────────────────────────┐
266
- │ TASK → COMMAND │
267
- ├────────────────────────────────────────────────────────────┤
268
- │ Plan new feature → /specweave:increment "feature" │
269
- │ Execute tasks → /specweave:do │
270
- │ Check progress → /specweave:progress │
271
- │ Validate quality → /specweave:validate 0001 │
272
- │ Close increment → /specweave:done 0001 │
273
- └────────────────────────────────────────────────────────────┘
274
- ```
275
-
276
- ### After EVERY Task Completion (CRITICAL!)
277
- ```
278
- ⚠️ Non-Claude tools do NOT have automatic hooks!
279
-
280
- After completing EACH task, you MUST run:
281
-
282
- 1. /specweave:sync-tasks # Update tasks.md
283
- 2. /specweave:sync-docs update # Sync living docs
284
- 3. /specweave:github:sync <increment-id> # Sync to GitHub (if enabled)
285
-
286
- Without these, your work won't be tracked properly!
44
+ ├── spec.md, plan.md, tasks.md # ONLY these in root
45
+ ├── reports/ # SESSION-*.md, analysis, etc.
46
+ ├── scripts/ # Helper scripts
47
+ └── logs/ # Execution logs
287
48
  ```
288
49
 
289
- ### When to Use Which Command
290
-
291
- | User Says... | Use Command |
292
- |---------------------------|------------------------------------|
293
- | "Let's build X" | `/specweave:increment "X"` |
294
- | "Start implementing" | `/specweave:do` |
295
- | "What's the status?" | `/specweave:progress` |
296
- | "Is this ready?" | `/specweave:validate 0001` |
297
- | "We're done" | `/specweave:done 0001` |
298
- | "Sync to GitHub" | `/specweave:github:sync` |
299
- | "Sync to Jira" | `/specweave:jira:sync` |
300
- | "Update docs" | `/specweave:sync-docs update` |
301
-
302
50
  ---
303
51
 
304
- ## Project Structure
305
-
306
- **IMPORTANT**: This project uses {MONOREPO_OR_SINGLE} mode.
307
-
308
- {#IF_SINGLE_PROJECT}
309
- ### Single Project Structure
310
-
311
- ```
312
- .specweave/
313
- ├── increments/ # Feature increments (auto-numbered)
314
- │ └── 0001-feature-name/
315
- │ ├── spec.md # WHAT & WHY (business requirements)
316
- │ ├── plan.md # HOW (technical implementation)
317
- │ ├── tasks.md # Tasks with embedded test plans (BDD format)
318
- │ ├── context-manifest.yaml # Selective loading (token savings!)
319
- │ ├── logs/ # Execution logs, errors
320
- │ ├── scripts/ # Helper scripts
321
- │ └── reports/ # Analysis, completion reports
322
- ├── docs/internal/
323
- │ ├── strategy/ # Business specs (WHAT, WHY)
324
- │ ├── specs/ # Feature specifications (living docs)
325
- │ │ └── default/ # ✅ All specs in default project
326
- │ ├── architecture/ # Technical design (HOW)
327
- │ ├── delivery/ # Roadmap, CI/CD, guides
328
- │ ├── operations/ # Runbooks, SLOs
329
- │ └── governance/ # Security, compliance
330
-
331
- .claude/ # Claude Code components (if using Claude)
332
- ├── agents/ # Specialized roles (PM, Architect, DevOps, etc.)
333
- ├── skills/ # Capabilities (increment-planner, context-loader, etc.)
334
- └── commands/ # Slash commands (/specweave:increment, /specweave:do, /specweave:done)
335
-
336
- plugins/ # Optional plugins (extended capabilities)
337
- └── specweave-{name}/
338
- ├── .claude-plugin/ # Plugin manifest (Claude native format)
339
- │ └── plugin.json
340
- ├── skills/ # Plugin-specific skills
341
- ├── agents/ # Plugin-specific agents
342
- └── commands/ # Plugin-specific commands
343
- ```
344
- {#ENDIF}
345
-
346
- {#IF_MULTI_PROJECT}
347
- ### Multi-Project Structure (v0.16.11+ Flattened)
348
-
349
- **CRITICAL**: Specs are organized by project with FLATTENED structure (v0.16.11+).
350
-
351
- ```
352
- .specweave/
353
- ├── docs/internal/
354
- │ ├── strategy/ # Cross-project strategy
355
- │ ├── specs/ # ✅ FLATTENED structure (v0.16.11+)
356
- │ │ ├── backend/ # Backend project specs
357
- │ │ │ ├── spec-001-api-auth.md
358
- │ │ │ └── spec-002-data-layer.md
359
- │ │ ├── frontend/ # Frontend project specs
360
- │ │ │ ├── spec-001-user-dashboard.md
361
- │ │ │ └── spec-002-dark-mode.md
362
- │ │ ├── mobile/ # Mobile project specs (if applicable)
363
- │ │ │ └── spec-001-push-notifications.md
364
- │ │ └── _parent/ # Parent repo specs (multi-repo only)
365
- │ │ └── spec-001-system-architecture.md
366
- │ ├── architecture/ # System-wide technical design
367
- │ ├── delivery/ # Cross-project delivery
368
- │ ├── operations/ # Cross-project operations
369
- │ └── governance/ # Cross-project governance
370
- ├── increments/
371
- │ ├── 0001-backend-auth/ # Backend increment
372
- │ ├── 0002-frontend-ui/ # Frontend increment
373
- │ └── 0003-mobile-push/ # Mobile increment
374
- └── ...
375
- ```
52
+ ## Commands Reference {#commands}
376
53
 
377
- **Living Docs Path Format**:
378
- - ✅ **CORRECT** (v0.16.11+): `.specweave/docs/internal/specs/{project-id}/spec-NNN-name.md`
379
- - ❌ **OLD** (v0.8.0-v0.16.10): `.specweave/docs/internal/projects/{project-id}/specs/...` (DEPRECATED)
54
+ ### Core Commands
380
55
 
381
- **Project Detection** (automatic):
382
- - **From increment name**: `0001-backend-auth` → project: `backend`
383
- - **From tech stack**: React/Next.js `frontend`, ASP.NET/Node.js → `backend`
384
- - **From config**: `multiProject.activeProject` in `.specweave/config.json`
385
- - **Fallback**: Uses `default` project
56
+ | Command | Purpose |
57
+ |---------|---------|
58
+ | `/specweave:increment "name"` | Plan new feature (PM-led) |
59
+ | `/specweave:do` | Execute tasks from active increment |
60
+ | `/specweave:done 0001` | Close increment (validates gates) |
61
+ | `/specweave:progress` | Show task completion status |
62
+ | `/specweave:validate 0001` | Quality check before closing |
63
+ | `/specweave:sync-tasks` | Sync tasks.md with reality |
64
+ | `/specweave:sync-docs update` | Sync to living docs |
386
65
 
387
- **When creating living docs specs**:
388
- 1. Detect project from increment name or tech stack
389
- 2. Use flattened path: `specs/{project-id}/spec-NNN-name.md`
390
- 3. Never use old nested structure: `projects/{project-id}/specs/...`
391
- {#ENDIF}
66
+ ### Plugin Commands (when installed)
392
67
 
393
- **CRITICAL**: Always read `context-manifest.yaml` first! Only load files listed there.
68
+ | Command | Purpose |
69
+ |---------|---------|
70
+ | `/specweave-github:sync 0001` | Sync increment to GitHub issue |
71
+ | `/specweave-jira:sync 0001` | Sync to Jira |
72
+ | `/specweave-ado:sync 0001` | Sync to Azure DevOps |
394
73
 
395
74
  ---
396
75
 
397
- ## 🔌 Plugin Architecture (IMPORTANT FOR NON-CLAUDE TOOLS)
398
-
399
- ### For Claude Code Users
400
-
401
- Plugins work automatically via marketplace:
402
- ```bash
403
- /plugin install github
404
- ```
405
-
406
- Skills, agents, and commands are immediately available. **Skip this section if using Claude Code.**
407
-
408
- ### For Other Tools (Cursor, Copilot, ChatGPT, etc.)
76
+ ## Non-Claude Tools (Cursor, Copilot, etc.) {#non-claude-tools}
409
77
 
410
- **⚠️ CRITICAL**: Claude Code has native plugin support. **Other tools DO NOT.**
78
+ **CRITICAL**: Claude Code has automatic hooks. Other tools DO NOT.
411
79
 
412
- You MUST manually discover and load plugins at the start of each session:
80
+ ### What's Different
413
81
 
414
- #### Step 1: Check for Plugins
82
+ | Feature | Claude Code | Cursor/Copilot |
83
+ |---------|-------------|----------------|
84
+ | Commands | Slash syntax works | Manual workflow |
85
+ | Hooks | Auto-run on events | **YOU must mimic** |
86
+ | Task sync | Automatic | Manual |
87
+ | GitHub/Jira sync | Automatic | Manual |
88
+ | Living docs | Auto-updated | Manual |
415
89
 
416
- ```bash
417
- # Check if project uses plugins
418
- ls plugins/
419
-
420
- # Example output:
421
- # specweave-github/
422
- # specweave-jira/
423
- ```
424
-
425
- If `plugins/` folder exists, proceed to Step 2.
90
+ ### Hook Behavior You Must Mimic
426
91
 
427
- #### Step 2: Load Plugin Components
428
-
429
- **For EACH plugin, load its components BEFORE starting work:**
92
+ **Claude Code hooks do these automatically. YOU must do them manually:**
430
93
 
94
+ #### 1. After EVERY Task Completion
431
95
  ```bash
432
- # Example: Loading GitHub plugin
433
-
434
- # 1. Check plugin structure
435
- ls plugins/specweave-github/
96
+ # Claude hook: PostTaskCompletion
97
+ # You must run these commands:
436
98
 
437
- # 2. Load ALL plugin skills (like core skills)
438
- cat plugins/specweave-github/skills/github-sync/SKILL.md
439
- cat plugins/specweave-github/skills/github-issue-tracker/SKILL.md
99
+ # Step 1: Update tasks.md (source of truth)
100
+ # Change: **Status**: [ ] pending → **Status**: [x] completed
440
101
 
441
- # 3. Load plugin agents (if any)
442
- cat plugins/specweave-github/agents/github-manager/AGENT.md
102
+ # Step 2: Update spec.md ACs (if task satisfies any)
103
+ # Change: - [ ] AC-US1-01 → - [x] AC-US1-01
443
104
 
444
- # 4. Note available commands (load on-demand when user requests)
445
- ls plugins/specweave-github/commands/
446
- # github-create-issue.md, github-sync.md, github-status.md
105
+ # Step 3: Sync to external tools (if configured)
106
+ /specweave:sync-tasks
107
+ /specweave-github:sync <increment-id> # If GitHub enabled
108
+ /specweave-jira:sync <increment-id> # If Jira enabled
447
109
  ```
448
110
 
449
- #### Step 3: Make Plugin Capabilities Available
450
-
451
- Treat plugin components like core components:
452
-
453
- **Plugin Skills**:
454
- - Same activation pattern as core skills
455
- - Check "Activates for" keywords in SKILL.md
456
- - Follow workflow when relevant
457
-
458
- **Plugin Agents**:
459
- - Adopt role when needed (like core agents)
460
- - Example: "Adopting github-manager agent role..."
461
-
462
- **Plugin Commands**:
463
- - Load command file when user requests action
464
- - Example: User says "sync to GitHub" → Load `plugins/specweave-github/commands/github-sync.md`
465
-
466
- #### Step 4: Document Loaded Plugins
111
+ #### 2. After User Story Completion (all ACs satisfied)
112
+ ```bash
113
+ # Claude hook: PostUserStoryCompletion
114
+ # When ALL acceptance criteria for a user story are [x] checked:
467
115
 
468
- At session start, note which plugins are active:
116
+ # Step 1: Sync to living docs
117
+ /specweave:sync-docs update
469
118
 
470
- ```markdown
471
- # Session Context
472
- - Core skills: ✅ Loaded from .claude/skills/
473
- - Core agents: ✅ Loaded from .claude/agents/
474
- - Plugins detected:
475
- - specweave-github: ✅ Loaded (2 skills, 1 agent, 4 commands)
476
- - specweave-jira: ✅ Loaded (1 skill, 1 agent, 2 commands)
119
+ # Step 2: Update GitHub/Jira issue status
120
+ /specweave-github:sync <increment-id>
477
121
  ```
478
122
 
479
- ### Why Manual Loading Is Required
480
-
481
- **Claude Code**: Has native plugin marketplace, auto-loads plugins, manages dependencies.
482
-
483
- **Other Tools**: No plugin system, so you must:
484
- - ✅ Discover plugins in `plugins/` folder
485
- - ✅ Read plugin skills/agents/commands manually
486
- - ✅ Make them available in your context
487
- - ✅ Use them like core components
488
-
489
- **This is NOT optional** - plugins extend SpecWeave capabilities. Without loading them, you're missing critical functionality (GitHub sync, Jira integration, tech-specific skills, etc.).
490
-
491
- ### Example: Session Start Routine (Non-Claude Tools)
492
-
123
+ #### 3. After Increment Completion
493
124
  ```bash
494
- # 1. Load core components
495
- cat .claude/skills/SKILLS-INDEX.md # Core skills index
496
- cat AGENTS.md # This file
497
-
498
- # 2. Check for plugins
499
- if [ -d "plugins" ]; then
500
- # 3. For each plugin, load components
501
- for plugin in plugins/*/; do
502
- echo "Loading plugin: $(basename $plugin)"
125
+ # Claude hook: PostIncrementDone
126
+ # When running /specweave:done:
503
127
 
504
- # Load all skills
505
- find "$plugin/skills" -name "SKILL.md" -exec cat {} \;
128
+ # Step 1: Validate all tasks complete
129
+ /specweave:validate <increment-id>
506
130
 
507
- # Load all agents
508
- find "$plugin/agents" -name "AGENT.md" -exec cat {} \;
509
-
510
- # Note available commands
511
- ls "$plugin/commands/"
512
- done
513
- fi
131
+ # Step 2: Sync living docs
132
+ /specweave:sync-docs update
514
133
 
515
- # 4. Now ready to work with full SpecWeave capabilities
134
+ # Step 3: Close external issues
135
+ /specweave-github:close-issue <increment-id>
516
136
  ```
517
137
 
518
- ### Plugin Naming Convention
519
-
520
- Plugin commands use namespace pattern:
521
-
522
- **Core commands** (no namespace):
523
- - `/specweave:increment` → Core framework
524
- - `/specweave:do` → Core framework
525
- - `/specweave:progress` → Core framework
526
-
527
- **Plugin commands** (with namespace):
528
- - `/specweave:github:sync` → GitHub plugin
529
- - `/specweave:github:create-issue` → GitHub plugin
530
- - `/specweave:jira:sync` → Jira plugin
531
- - `/specweave:jira:create-ticket` → Jira plugin
532
-
533
- **In non-Claude tools**: Read the command file when user requests the action:
138
+ #### 4. After Writing to spec.md or tasks.md
534
139
  ```bash
535
- # User: "Sync this increment to GitHub"
536
- # You: Load and execute command
537
- cat plugins/specweave-github/commands/github-sync.md
538
- # Then follow the instructions in that file
539
- ```
540
-
541
- ---
140
+ # Claude hook: PostToolUse (Write/Edit to spec/tasks files)
141
+ # After any edit to spec.md or tasks.md:
542
142
 
543
- ## 🚀 SpecWeave Commands (Executable Workflows)
544
-
545
- **⚡ CRITICAL FOR NON-CLAUDE TOOLS**: Commands are NOT automatic in GitHub Copilot, Cursor, or other tools. You MUST manually discover and execute them.
546
-
547
- ### What Are Commands?
548
-
549
- Commands are **executable workflows** defined as `.md` files in `plugins/specweave/commands/`. Each file contains:
550
- - Command name (from filename, e.g., `specweave-increment.md` → `/specweave:increment`)
551
- - Complete workflow instructions
552
- - Parameters and usage examples
553
- - Step-by-step execution guide
554
-
555
- **Think of them as runnable scripts** - when user requests a command, you read the file and execute the workflow.
556
-
557
- ### Command Discovery (MANDATORY!)
558
-
559
- **At the start of EVERY session**, discover available commands:
560
-
561
- ```bash
562
- # List all core commands
563
- ls plugins/specweave/commands/
143
+ # Sync status line cache
144
+ /specweave:sync-tasks
564
145
 
565
- # Common output:
566
- # specweave-increment.md - Plan new increment (/specweave:increment "feature")
567
- # specweave-do.md - Execute implementation (/specweave:do)
568
- # specweave-done.md - Close increment (/specweave:done 0001)
569
- # specweave-validate.md - Validate increment (/specweave:validate 0001)
570
- # specweave-progress.md - Check status (/specweave:progress)
571
- # specweave-sync-docs.md - Sync living docs (/specweave:sync-docs)
572
- # specweave-next.md - Smart increment transition (/specweave:next)
573
- # specweave-costs.md - Display AI cost dashboard (/specweave:costs)
574
- # specweave-translate.md - Translate content (/specweave:translate)
575
- # tdd-*.md - TDD workflow commands
576
- # ... (17 commands total)
146
+ # If external tools configured, sync progress
147
+ /specweave-github:sync <increment-id>
577
148
  ```
578
149
 
579
- **For plugin commands** (if plugins/ folder exists):
150
+ ### How to Check if External Tools Configured
580
151
 
581
152
  ```bash
582
- # List plugin commands
583
- ls plugins/specweave-github/commands/
584
-
585
- # Example output:
586
- # github-create-issue.md
587
- # github-sync.md
588
- # github-close-issue.md
589
- # github-status.md
590
- ```
591
-
592
- ### How to Execute Commands (Step-by-Step)
593
-
594
- **When user says**: "create new increment for user auth" or "run /specweave:increment user auth"
595
-
596
- **You should**:
597
-
598
- 1. **Identify the command**:
599
- - Keywords match: "create increment" → `specweave-increment.md`
600
- - Explicit slash: "/specweave:increment" → `specweave-increment.md`
601
- - Map request to command file
153
+ # Check increment metadata for external tool config
154
+ cat .specweave/increments/<id>/metadata.json
602
155
 
603
- 2. **Read the command file**:
604
- ```bash
605
- cat plugins/specweave/commands/specweave-increment.md
606
- ```
607
-
608
- 3. **Parse the workflow**:
609
- - Read YAML frontmatter for metadata
610
- - Read markdown body for steps
611
- - Note required parameters
612
- - Understand expected output
613
-
614
- 4. **Execute the workflow**:
615
- - Follow instructions EXACTLY as written
616
- - Use parameters from user request
617
- - Reference related files (spec templates, etc.)
618
- - Show progress as you work
619
-
620
- 5. **Provide output**:
621
- - Confirm completion
622
- - Show created files
623
- - Suggest next steps
624
-
625
- ### Example: Executing /specweave:increment Command
156
+ # Look for these fields:
157
+ # "github": { "issue": 123 } → GitHub enabled
158
+ # "jira": { "issue": "PROJ-123" } → Jira enabled
159
+ # "ado": { "item": 456 } → Azure DevOps enabled
160
+ ```
626
161
 
627
- **User says**: "create new increment for user authentication"
162
+ ### Manual Command Execution
628
163
 
629
- **Your workflow**:
164
+ In non-Claude tools, commands are markdown workflows:
630
165
 
631
166
  ```bash
632
- # Step 1: Identify command
633
- # "create increment" → specweave-increment.md
634
-
635
- # Step 2: Read command file
167
+ # Find and read command file
636
168
  cat plugins/specweave/commands/specweave-increment.md
169
+ # Follow the workflow steps manually
637
170
  ```
638
171
 
639
- **After reading specweave-increment.md, you learn**:
640
- - This is PM-led increment planning
641
- - Requires: feature description
642
- - Creates: spec.md, plan.md, tasks.md, tests.md
643
- - Location: `.specweave/increments/####-feature-name/`
172
+ ### Quick Reference: After EVERY Task
644
173
 
645
- **Step 3: Execute workflow from inc.md**:
646
-
647
- ```markdown
648
- # You see these instructions in inc.md:
649
-
650
- 1. **Detect tech stack** (TypeScript, Python, Go, etc.)
651
- 2. **PM-led planning**:
652
- - Market research
653
- - Create spec.md (WHAT & WHY)
654
- - Create plan.md (HOW)
655
- - Auto-generate tasks.md from plan
656
- - Create tests.md (test strategy)
657
- 3. **Strategic agent review**:
658
- - Architect designs system
659
- - Security reviews threats
660
- - QA defines test strategy
661
- 4. **User review checkpoint**
662
- 5. **Ready to build**
663
174
  ```
664
-
665
- **Step 4: Execute those steps**:
666
-
175
+ ┌─────────────────────────────────────────────────────────────┐
176
+ AFTER COMPLETING ANY TASK (MANDATORY FOR NON-CLAUDE TOOLS) │
177
+ ├─────────────────────────────────────────────────────────────┤
178
+ │ 1. Update tasks.md: [ ] → [x] │
179
+ │ 2. Update spec.md ACs if satisfied: [ ] → [x] │
180
+ │ 3. Run: /specweave:sync-tasks │
181
+ │ 4. Run: /specweave-github:sync <id> (if GitHub configured) │
182
+ │ 5. If all ACs for US done: /specweave:sync-docs update │
183
+ └─────────────────────────────────────────────────────────────┘
667
184
  ```
668
- 📂 Creating increment 0001-user-authentication...
669
-
670
- 🔍 Tech stack detected: TypeScript + Node.js + PostgreSQL
671
-
672
- 👔 Adopting PM role to create spec.md...
673
- ✓ Market research: Auth requirements
674
- ✓ User stories: Login, Register, Password Reset
675
- ✓ Acceptance criteria: TC-0001 to TC-0015
676
- ✓ Created spec.md (WHAT & WHY, technology-agnostic)
677
185
 
678
- 🏗️ Adopting Architect role to create plan.md...
679
- ✓ Architecture: JWT + bcrypt + Prisma
680
- ✓ API contracts: POST /auth/login, /auth/register
681
- ✓ Data model: User table schema
682
- ✓ Created plan.md (HOW, technology-specific)
186
+ **Without these manual steps, your work won't be tracked!**
683
187
 
684
- 📋 Auto-generating tasks.md from plan.md...
685
- ✓ Generated 42 tasks with model hints
686
- ✓ Estimated: 3-4 weeks
687
-
688
- 🧪 Creating tests.md (QA strategy)...
689
- ✓ 12 test cases, 85% coverage target
690
-
691
- ✅ Increment 0001-user-authentication ready!
188
+ ---
692
189
 
693
- Next: /specweave:do (execute implementation)
694
- ```
190
+ ## Sync Workflow {#sync-workflow}
695
191
 
696
- **Step 5: Confirm completion**:
192
+ ### Source of Truth Hierarchy
697
193
 
698
194
  ```
699
- ✅ Created increment 0001-user-authentication
700
-
701
- Files:
702
- .specweave/increments/0001-user-authentication/spec.md
703
- • .specweave/increments/0001-user-authentication/plan.md
704
- .specweave/increments/0001-user-authentication/tasks.md
705
- .specweave/increments/0001-user-authentication/tests.md
706
-
707
- Next steps:
708
- 1. Review generated files
709
- 2. Run: /specweave:do (execute implementation)
195
+ ┌─────────────────────────────────────────────────────────────┐
196
+ │ SOURCE OF TRUTH (edit here first!) │
197
+ │ ├── tasks.md: Task completion status │
198
+ └── spec.md: Acceptance criteria checkboxes │
199
+ ├─────────────────────────────────────────────────────────────┤
200
+ DERIVED (auto-updated via sync commands) │
201
+ └── .specweave/docs/internal/specs/: Living documentation │
202
+ ├─────────────────────────────────────────────────────────────┤
203
+ MIRROR (synced to external tools) │
204
+ ├── GitHub Issues: Task checklist, AC progress │
205
+ ├── Jira Stories: Status, story points, completion │
206
+ │ └── Azure DevOps: Work item state, task list │
207
+ └─────────────────────────────────────────────────────────────┘
710
208
  ```
711
209
 
712
- ### Core Command Reference
713
-
714
- **Most Common** (use these daily):
715
-
716
- | Command | File | Purpose | Example |
717
- |---------|------|---------|---------|
718
- | `/specweave:increment` | `specweave-increment.md` | Plan new increment | `/specweave:increment "user auth"` |
719
- | `/specweave:do` | `specweave-do.md` | Execute implementation | `/specweave:do` |
720
- | `/specweave:done` | `specweave-done.md` | Close increment | `/specweave:done 0001` |
721
- | `/specweave:validate` | `specweave-validate.md` | Validate quality | `/specweave:validate 0001` |
722
- | `/specweave:progress` | `specweave-progress.md` | Check status | `/specweave:progress` |
723
-
724
- **Specialized** (use when needed):
725
-
726
- | Command | File | Purpose | Example |
727
- |---------|------|---------|---------|
728
- | `/specweave:sync-docs` | `specweave-sync-docs.md` | Sync living docs | `/specweave:sync-docs update` |
729
- | `/specweave:next` | `specweave-next.md` | Smart increment transition | `/specweave:next` |
730
- | `/specweave:costs` | `specweave-costs.md` | AI cost dashboard | `/specweave:costs 0001` |
731
- | `/specweave:translate` | `specweave-translate.md` | Translate content | `/specweave:translate ru` |
732
- | `/specweave:tdd-cycle` | `specweave-tdd-cycle.md` | TDD workflow | `/specweave:tdd-cycle` |
733
-
734
- **Plugin Commands** (when plugins installed):
735
-
736
- | Command | File | Purpose | Plugin |
737
- |---------|------|---------|--------|
738
- | `/github:sync` | `plugins/specweave-github/commands/github-sync.md` | Sync to GitHub | specweave-github |
739
- | `/github:create-issue` | `plugins/specweave-github/commands/github-create-issue.md` | Create GitHub issue | specweave-github |
740
- | `/sync-tasks` | `commands/sync-tasks.md` | Sync tasks.md status | specweave (core) |
741
-
742
- ---
743
-
744
- ### 🚨 CRITICAL: Task Completion Tracking
745
-
746
- **Problem**: Commands like `/progress`, `/validate`, `/done` rely on `tasks.md` status being accurate.
747
- If tasks.md shows "1/24 complete" but you've actually finished 24 tasks, everything breaks!
748
-
749
- **Solution**: Update `tasks.md` after EACH task completes.
750
-
751
- #### For Claude Code Users (Automatic ✅)
752
-
753
- **Good news**: This happens automatically via `post-task-completion.sh` hook!
754
-
755
- When you complete a task (mark todo as done), the hook:
756
- 1. ✅ Detects completion
757
- 2. ✅ Updates corresponding task in tasks.md
758
- 3. ✅ Recalculates progress %
759
- 4. ✅ Syncs to GitHub issue (if enabled)
760
-
761
- **You don't need to do anything manually!**
762
-
763
- #### For Other AI Tools (Manual ⚠️)
764
-
765
- **⚠️ IMPORTANT**: After completing EACH task, run these slash commands to keep everything in sync:
766
-
767
- **Quick Commands** (copy-paste friendly):
768
-
769
- ```bash
770
- # After completing a task, run these three commands:
771
-
772
- /specweave:sync-tasks # 1. Update tasks.md completion status
773
- /specweave:sync-docs update # 2. Sync to living docs (THIS IS CRITICAL!)
774
- /specweave-github:sync <increment-id> # 3. Sync to GitHub (replace <increment-id> with your increment, e.g., 0007)
775
- ```
210
+ **Update Order**: ALWAYS tasks.md/spec.md FIRST → sync-tasks → sync-docs → external tools
776
211
 
777
- **🔥 CRITICAL: Living Docs Sync (`/specweave:sync-docs`)**
212
+ ### Sync Commands Reference
778
213
 
779
- The `/specweave:sync-docs` command is one of the MOST IMPORTANT commands in SpecWeave. It ensures your increment work gets properly archived in the living documentation.
214
+ | Command | What It Does | When to Run |
215
+ |---------|--------------|-------------|
216
+ | `/specweave:sync-tasks` | Recalculates progress from tasks.md | After editing tasks.md |
217
+ | `/specweave:sync-docs update` | Updates living docs from increment | After US complete |
218
+ | `/specweave-github:sync <id>` | Syncs progress to GitHub issue | After each task |
219
+ | `/specweave-github:close-issue <id>` | Closes GitHub issue | On increment done |
220
+ | `/specweave-jira:sync <id>` | Syncs progress to Jira story | After each task |
221
+ | `/specweave-ado:sync <id>` | Syncs to Azure DevOps work item | After each task |
780
222
 
781
- **How to call it** (for non-Claude tools):
223
+ ### Complete Sync Flow (Non-Claude Tools)
782
224
 
783
- ```bash
784
- # Read the command file
785
- cat plugins/specweave/commands/specweave-sync-docs.md
786
-
787
- # Then execute the workflow described in that file
788
- # The command will:
789
- # 1. Extract user stories from spec.md
790
- # 2. Distribute them to .specweave/docs/internal/specs/{project}/
791
- # 3. Create bidirectional links (Tasks ↔ User Stories)
792
- # 4. Update epic folders (FS-*) with latest content
793
- # 5. Generate proper Docusaurus frontmatter
794
225
  ```
795
-
796
- **When to run it**:
797
- - ✅ After completing an increment (`/specweave:done`)
798
- - ✅ After making significant spec changes
799
- - After implementing multiple user stories
800
- - Before creating a PR/merge request
801
- - ❌ NOT after every single task (too frequent)
802
-
803
- **Two modes**:
804
- - `review` mode: Review strategic docs BEFORE implementation starts
805
- - `update` mode: Sync living docs AFTER implementation completes
806
-
807
- **Example workflow**:
808
-
809
- ```bash
810
- # Complete increment
811
- /specweave:done 0031
812
-
813
- # Sync to living docs (MANDATORY!)
814
- /specweave:sync-docs update 0031
815
-
816
- # Result: All user stories from increment 0031 are now in:
817
- # .specweave/docs/internal/specs/{project}/FS-031-feature-name/
818
- # ├── README.md (epic overview)
819
- # ├── us-001-story-title.md (user story)
820
- # ├── us-002-story-title.md
821
- # └── ... (all user stories)
226
+ TASK COMPLETED
227
+
228
+
229
+ ┌─────────────────────────────┐
230
+ 1. Edit tasks.md │
231
+ │ [ ] pending [x] done │
232
+ └─────────────────────────────┘
233
+
234
+
235
+ ┌─────────────────────────────┐
236
+ 2. Edit spec.md ACs │
237
+ │ [ ] AC → [x] AC │
238
+ └─────────────────────────────┘
239
+
240
+
241
+ ┌─────────────────────────────┐
242
+ │ 3. /specweave:sync-tasks │
243
+ │ Updates progress cache │
244
+ └─────────────────────────────┘
245
+
246
+
247
+ ┌─────────────────────────────┐
248
+ 4. /specweave-github:sync │
249
+ │ Updates GitHub issue │
250
+ └─────────────────────────────┘
251
+
252
+ (if all ACs for US done)
253
+ ┌─────────────────────────────┐
254
+ │ 5. /specweave:sync-docs │
255
+ │ Updates living docs │
256
+ └─────────────────────────────┘
822
257
  ```
823
258
 
824
- **Why this matters**:
825
- - ✅ Permanent archive of all user stories (never lost)
826
- - ✅ Bidirectional links created automatically
827
- - ✅ Epic folders organized hierarchically
828
- - ✅ Docusaurus-ready frontmatter generated
829
- - ✅ Complete traceability (increment → living docs)
830
-
831
- Without running this command, your increment work stays isolated in the increment folder and NEVER makes it to the permanent living documentation!
832
-
833
- **Alternative: Manual Update** (if slash commands unavailable):
259
+ ### Claude Code Hooks (Automatic)
834
260
 
835
- ```bash
836
- # Example: You just completed T-001
837
-
838
- # 1. Open tasks.md
839
- vim .specweave/increments/0007-feature-name/tasks.md
840
-
841
- # 2. Find the task you completed
842
- #### T-001: Implement authentication service
843
-
844
- # 3. Change status from pending to completed
845
- **Status**: [ ] pending
846
- # ↓ Change to ↓
847
- **Status**: [x] completed
261
+ | Hook | Trigger | What It Does |
262
+ |------|---------|--------------|
263
+ | `UserPromptSubmit` | Every prompt | WIP limits, discipline checks |
264
+ | `PostToolUse` | File write/edit | Detects task completion, syncs |
265
+ | `PostTaskCompletion` | Task done | Updates GitHub/Jira progress |
266
+ | `PostIncrementDone` | Increment closed | Closes issues, syncs all docs |
848
267
 
849
- # 4. Update progress counters at the top
850
- **Completed**: 0 # ← Increment this (0 → 1)
851
- **Progress**: 0% # ← Recalculate (1/24 = 4%)
268
+ **Non-Claude tools**: NO HOOKS EXIST. See "Hook Behavior You Must Mimic" section above.
852
269
 
853
- # 5. Save and commit
854
- git add .specweave/increments/0007-feature-name/tasks.md
855
- git commit -m "chore: mark T-001 as complete"
856
- ```
857
-
858
- **Why This Matters**:
859
- - `/progress` shows accurate completion % ✅
860
- - `/validate` checks pass ✅
861
- - `/done` can close the increment ✅
862
- - Team knows real status ✅
863
-
864
- **Validation Check**:
865
- ```bash
866
- # Verify tasks.md is in sync
867
- /sync-tasks --validate
270
+ ---
868
271
 
869
- # If out of sync:
870
- /sync-tasks # Auto-fix from GitHub or git history
871
- ```
272
+ ## Context Loading {#context-loading}
872
273
 
873
- **Quick Reference Card** (print and keep handy):
274
+ ### Why Context Manifests Matter
874
275
 
875
276
  ```
876
- ┌────────────────────────────────────────────────┐
877
- │ AFTER EACH TASK: Update tasks.md Status │
878
- ├────────────────────────────────────────────────┤
879
- │ 1. Open: .specweave/increments/XXXX/tasks.md │
880
- │ 2. Find: #### T-XXX │
881
- │ 3. Change: [ ] pending → [x] completed │
882
- │ 4. Update: Completed count & Progress % │
883
- │ 5. Commit: git commit -m "chore: mark done" │
884
- └────────────────────────────────────────────────┘
277
+ Without manifest: Load all docs (50k tokens) → Crash risk
278
+ With manifest: Load relevant files (5k tokens) → 90% savings
885
279
  ```
886
280
 
887
- ---
888
-
889
- ### Command Execution Pattern (Template)
281
+ ### Using context-manifest.yaml
890
282
 
891
- Use this pattern for ANY command execution:
892
-
893
- ```bash
894
- # 1. User request
895
- # User: "sync to GitHub"
896
-
897
- # 2. Identify command
898
- # Keywords: "sync", "GitHub" → github-sync.md
899
-
900
- # 3. Read command file
901
- cat plugins/specweave-github/commands/github-sync.md
902
-
903
- # 4. Parse workflow
904
- # - Requires: increment ID, GitHub token
905
- # - Creates: GitHub issue
906
- # - Syncs: tasks, progress, labels
907
-
908
- # 5. Execute workflow
909
- # Follow steps in github-sync.md:
910
- # - Load increment
911
- # - Create/update GitHub issue
912
- # - Sync task checklist
913
- # - Add labels and milestone
914
- # - Post comment with summary
915
-
916
- # 6. Confirm completion
917
- # "✅ Synced increment 0001 to GitHub issue #42"
283
+ ```yaml
284
+ # .specweave/increments/0001-feature/context-manifest.yaml
285
+ spec_sections:
286
+ - .specweave/docs/internal/strategy/prd.md
287
+ - .specweave/docs/internal/architecture/hld.md
288
+ documentation:
289
+ - .specweave/docs/internal/specs/default/relevant-spec.md
290
+ max_context_tokens: 10000
918
291
  ```
919
292
 
920
- ### Why This Matters (Claude Code vs Other Tools)
921
-
922
- **Claude Code** (automatic):
923
- - Commands work via native slash syntax: `/inc "feature"`
924
- - No manual reading needed
925
- - Commands execute automatically
926
-
927
- **Other Tools** (manual):
928
- - ❌ No native command support
929
- - ✅ **Solution**: Read command .md file and execute workflow
930
- - Commands become "pseudo-executable" via this pattern
931
- - Same workflows, just manual discovery
293
+ **Rule**: Read context-manifest.yaml FIRST. Only load files listed there.
932
294
 
933
- **GitHub Copilot Example**:
934
-
935
- ```
936
- User: "create increment for payments"
295
+ ---
937
296
 
938
- Copilot (you):
939
- 1. Recognize command request: "create increment" → /inc
940
- 2. Read: cat plugins/specweave/commands/inc.md
941
- 3. Execute: Follow PM-led workflow from inc.md
942
- 4. Create: spec.md, plan.md, tasks.md in .specweave/increments/0002-payments/
943
- 5. Confirm: "✅ Increment 0002-payments created"
297
+ ## Project Structure
944
298
 
945
- User gets SAME result as Claude Code, just via manual execution!
946
299
  ```
947
-
948
- ### Command Discovery Checklist (Session Start)
949
-
950
- **MANDATORY for non-Claude tools**:
951
-
952
- ```bash
953
- # 1. Discover core commands
954
- ls plugins/specweave/commands/
955
- # Note: 17 commands available (inc, do, done, validate, etc.)
956
-
957
- # 2. Check for plugin commands
958
- if [ -d "plugins/specweave-github" ]; then
959
- ls plugins/specweave-github/commands/
960
- # Note: 4 GitHub commands available
961
- fi
962
-
963
- # 3. Document available commands
964
- echo "Session Context:
965
- - Core commands: 17 available (inc, do, done, validate, ...)
966
- - Plugin commands: 4 GitHub commands (if plugin installed)
967
- - Command execution: Read .md file → Execute workflow
968
- "
969
-
970
- # 4. Ready to execute commands when requested
300
+ .specweave/
301
+ ├── increments/ # Feature increments (0001-9999)
302
+ │ └── 0001-feature/
303
+ │ ├── spec.md # WHAT & WHY (user stories, ACs)
304
+ │ ├── plan.md # HOW (architecture, APIs)
305
+ │ ├── tasks.md # Task checklist with test plans
306
+ │ └── context-manifest.yaml # Files to load
307
+ ├── docs/internal/
308
+ │ ├── strategy/ # PRD, business requirements
309
+ │ ├── specs/ # Living docs (extracted user stories)
310
+ │ │ └── {project}/ # Per-project specs
311
+ │ ├── architecture/ # HLD, ADRs, technical design
312
+ │ └── delivery/ # CI/CD, deployment guides
313
+ └── state/ # Runtime state (active increment, caches)
971
314
  ```
972
315
 
973
- ### Advanced: Batch Command Execution
974
-
975
- Some workflows require multiple commands:
976
-
977
- **Example**: Complete increment lifecycle
316
+ ---
978
317
 
979
- ```bash
980
- # User: "Plan, build, and close user auth feature"
318
+ ## Agents (Roles)
981
319
 
982
- # Step 1: Execute /inc
983
- cat plugins/specweave/commands/inc.md
984
- # → Create spec.md, plan.md, tasks.md
320
+ {AGENTS_SECTION}
985
321
 
986
- # Step 2: Execute /do
987
- cat plugins/specweave/commands/do.md
988
- # → Execute all 42 tasks
322
+ **Usage**: Adopt role perspective when working on related tasks.
989
323
 
990
- # Step 3: Execute /validate
991
- cat plugins/specweave/commands/validate.md
992
- # → Quality checks
324
+ ---
993
325
 
994
- # Step 4: Execute /done
995
- cat plugins/specweave/commands/done.md
996
- # → PM validation and closure
997
- ```
326
+ ## Skills (Capabilities)
998
327
 
999
- ### Troubleshooting
328
+ {SKILLS_SECTION}
1000
329
 
1001
- **Command file not found?**
330
+ **Usage**: Check SKILLS-INDEX.md, match task to skill, follow workflow.
1002
331
 
1003
- ```bash
1004
- # Check if command exists
1005
- ls plugins/specweave/commands/ | grep inc
1006
- # If not found, command doesn't exist
332
+ ---
1007
333
 
1008
- # Check plugin commands
1009
- ls plugins/specweave-*/commands/
1010
- ```
334
+ ## Task Format
1011
335
 
1012
- **Command syntax unclear?**
336
+ ```markdown
337
+ ### T-001: Task Title
338
+ **User Story**: US-001
339
+ **Satisfies ACs**: AC-US1-01, AC-US1-02
340
+ **Status**: [ ] pending / [x] completed
1013
341
 
1014
- ```bash
1015
- # Read command README
1016
- cat plugins/specweave/commands/README.md
1017
- # Contains overview of all commands
342
+ **Test Plan** (BDD):
343
+ - Given [context] → When [action] → Then [result]
1018
344
  ```
1019
345
 
1020
- **Command fails during execution?**
1021
-
1022
- - Re-read command file for missed steps
1023
- - Check required files exist (spec.md, plan.md, etc.)
1024
- - Verify parameters are correct
1025
- - Check error messages for hints
1026
-
1027
- ### Summary: Making Commands Work Without Claude Code
1028
-
1029
- **The Key Insight**: Commands are just markdown files with workflows!
1030
-
1031
- 1. **Discover**: `ls plugins/specweave/commands/`
1032
- 2. **Read**: `cat plugins/specweave/commands/{command}.md`
1033
- 3. **Execute**: Follow the workflow in the file
1034
- 4. **Confirm**: Show completion and next steps
1035
-
1036
- **Result**: GitHub Copilot, Cursor, and other tools get the SAME SpecWeave command capabilities as Claude Code, just via manual execution instead of slash syntax.
1037
-
1038
- **This is CRITICAL** - without command execution, you're missing 90% of SpecWeave's automation!
1039
-
1040
346
  ---
1041
347
 
1042
- ## Available Agents (Specialized Roles)
348
+ ## Workflows
1043
349
 
1044
- SpecWeave uses role-based development. When working on tasks, adopt the appropriate role:
350
+ ### Creating Increment
351
+ 1. `mkdir -p .specweave/increments/0001-feature`
352
+ 2. Create `spec.md` (WHAT/WHY, user stories, ACs)
353
+ 3. Create `plan.md` (HOW, architecture, APIs)
354
+ 4. Create `tasks.md` (task checklist with tests)
355
+ 5. Create `context-manifest.yaml` (selective loading)
1045
356
 
1046
- {AGENTS_SECTION}
1047
-
1048
- ### How to Use Agents
357
+ ### Completing Tasks
358
+ 1. Implement the task
359
+ 2. Update `tasks.md`: `[ ] pending` → `[x] completed`
360
+ 3. Update `spec.md`: Check off satisfied ACs
361
+ 4. Sync to external trackers if enabled
1049
362
 
1050
- **In Claude Code** (automatic):
1051
- - Agents activate automatically when needed
1052
- - Separate context windows for each role
1053
-
1054
- **In other tools** (manual):
1055
- - Read the agent file: `.claude/agents/{agent-name}/AGENT.md`
1056
- - Adopt that role's perspective and responsibilities
1057
- - Example: "Adopting PM role to create spec.md..."
363
+ ### Closing Increment
364
+ 1. Run `/specweave:done 0001`
365
+ 2. PM validates 3 gates (tasks, tests, docs)
366
+ 3. Living docs synced automatically
367
+ 4. GitHub issue closed (if enabled)
1058
368
 
1059
369
  ---
1060
370
 
1061
- ## 🎯 CRITICAL: Skills Are Your Expert Manuals (Read First!)
1062
-
1063
- **MANDATORY**: Before starting ANY implementation task, check for relevant skills.
371
+ ## Plugin Commands
1064
372
 
1065
- ### What Are Skills?
373
+ | Command | Plugin |
374
+ |---------|--------|
375
+ | `/specweave-github:sync` | GitHub sync |
376
+ | `/specweave-jira:sync` | Jira sync |
377
+ | `/specweave-ado:sync` | Azure DevOps |
1066
378
 
1067
- Skills are **specialized expert manuals** that contain:
1068
- - Proven workflows for specific tasks
1069
- - SpecWeave conventions and best practices
1070
- - Required files to read and tools to use
1071
- - Step-by-step instructions
1072
- - Examples and test cases
1073
-
1074
- **There are 34+ skills available** organized into categories:
1075
- - **Framework Core**: increment-planner, context-loader, context-optimizer
1076
- - **External Integrations**: jira-sync, ado-sync, github-sync
1077
- - **Architecture & Design**: diagrams-architect, design-system-architect
1078
- - **Development**: frontend, nodejs-backend, python-backend, nextjs, dotnet-backend
1079
- - **Quality & Testing**: increment-quality-judge, e2e-playwright
1080
- - **Infrastructure**: hetzner-provisioner, cost-optimizer
1081
- - **Documentation**: docusaurus, figma-to-code, figma-designer
1082
- - **Orchestration**: role-orchestrator, skill-router, spec-driven-brainstorming
379
+ ---
1083
380
 
1084
- ### Progressive Disclosure Pattern (How to Use Skills)
381
+ ## Troubleshooting {#troubleshooting}
1085
382
 
1086
- **STEP 1: Discovery (Always Start Here)**
383
+ ### Commands Not Working
1087
384
 
1088
- Before starting ANY task, read the skills index:
385
+ **Non-Claude tools**: Commands are markdown workflows, not slash syntax.
1089
386
 
1090
387
  ```bash
1091
- cat .claude/skills/SKILLS-INDEX.md
388
+ # Find and read the command file
389
+ ls plugins/specweave/commands/
390
+ cat plugins/specweave/commands/specweave-increment.md
391
+ # Follow the workflow steps manually
1092
392
  ```
1093
393
 
1094
- This single file contains ALL available skills with their activation keywords. **This is your first stop for every task.**
1095
-
1096
- **STEP 2: Matching**
1097
-
1098
- Look for skills whose "Activates for" keywords match your current task:
1099
-
1100
- | Your Task | Relevant Skill | Keywords |
1101
- |-----------|---------------|----------|
1102
- | "Plan a new feature for user auth" | `increment-planner` | "feature planning", "create increment" |
1103
- | "Sync this to JIRA" | `jira-sync` | "JIRA sync", "create JIRA issue" |
1104
- | "Create architecture diagram" | `diagrams-architect` | "architecture diagram", "C4 diagram" |
1105
- | "Implement React component" | `frontend` | "React", "components", "UI" |
1106
- | "Deploy to cloud" | `hetzner-provisioner` or `cost-optimizer` | "deploy", "hosting", "infrastructure" |
1107
- | "Quality check" | `increment-quality-judge` | "validate quality", "quality check" |
1108
- | "E2E test" | `e2e-playwright` | "E2E test", "browser automation" |
1109
- | "Generate docs site" | `docusaurus` | "documentation site", "docs" |
394
+ ### Sync Issues
1110
395
 
1111
- **STEP 3: Load Full Skill**
1112
-
1113
- Once you've identified 1-3 relevant skills, load their full documentation:
396
+ **Symptoms**: GitHub/Jira not updating, living docs stale
1114
397
 
398
+ **Solution** (run after EVERY task in non-Claude tools):
1115
399
  ```bash
1116
- cat .claude/skills/{skill-name}/SKILL.md
400
+ /specweave:sync-tasks # Update tasks.md
401
+ /specweave:sync-docs update # Sync living docs
402
+ /specweave-github:sync <increment-id> # Sync to GitHub
1117
403
  ```
1118
404
 
1119
- **STEP 4: Execute Workflow**
1120
-
1121
- Follow the skill's instructions precisely:
1122
- - Read required files listed in skill
1123
- - Use recommended tools
1124
- - Follow step-by-step workflow
1125
- - Apply SpecWeave best practices
1126
-
1127
- ### Why This Matters (Token Savings + Quality)
1128
-
1129
- **Scenario**: User asks to plan a new feature
405
+ ### Root Folder Polluted
1130
406
 
1131
- **Without skills** (bad):
1132
- ```
1133
- ❌ Read entire .specweave/docs/ folder (50k tokens)
1134
- ❌ Guess at SpecWeave conventions
1135
- ❌ Create inconsistent increment structure
1136
- ❌ Miss context-manifest.yaml (no token savings)
1137
- ❌ Reinvent workflow from scratch
1138
- Result: High token cost, inconsistent output
1139
- ```
407
+ **Symptoms**: `git status` shows .md files in project root
1140
408
 
1141
- **With skills** (good):
1142
- ```
1143
- Read SKILLS-INDEX.md (2k tokens)
1144
- Match "plan feature" → increment-planner skill
1145
- ✅ Load increment-planner SKILL.md (3k tokens)
1146
- ✅ Follow proven workflow with templates
1147
- ✅ Create proper context-manifest.yaml (70% token savings)
1148
- Result: 5k tokens vs 50k = 90% savings + higher quality
409
+ **Fix**:
410
+ ```bash
411
+ CURRENT=$(ls -t .specweave/increments/ | head -1)
412
+ mv *.md .specweave/increments/$CURRENT/reports/
1149
413
  ```
1150
414
 
1151
- ### Skills vs Agents (What's the Difference?)
415
+ ### Tasks Out of Sync
1152
416
 
1153
- **Skills = Capabilities (WHAT you can do)**
1154
- - increment-planner: Creates feature plans
1155
- - jira-sync: Syncs with external tools
1156
- - diagrams-architect: Creates diagrams
1157
- - **Use skills for workflows and procedures**
417
+ **Symptoms**: Progress shows wrong completion %
1158
418
 
1159
- **Agents = Roles (WHO you become)**
1160
- - PM: Product manager perspective
1161
- - Architect: Technical design perspective
1162
- - DevOps: Infrastructure perspective
1163
- - **Use agents when you need to adopt a specific role/perspective**
1164
-
1165
- ### For Non-Claude Code Users
1166
-
1167
- **GitHub Copilot, Cursor, Windsurf, etc.:**
1168
-
1169
- Since these tools don't have native skill support, you MUST:
1170
-
1171
- 1. **At session start**: Always read `SKILLS-INDEX.md` first
1172
- 2. **Before each task**: Check if relevant skills exist
1173
- 3. **During execution**: Follow skill workflows precisely
1174
- 4. **When stuck**: Re-read the relevant SKILL.md
1175
-
1176
- **Treat this as mandatory**, not optional. Skills are the difference between:
1177
- - Inconsistent ad-hoc work ❌
1178
- - Professional SpecWeave-compliant output ✅
1179
-
1180
- ---
1181
-
1182
- ## Available Skills (Specialized Capabilities)
1183
-
1184
- SpecWeave has specialized capabilities for different tasks:
419
+ **Fix**: Update tasks.md manually:
420
+ ```markdown
421
+ **Status**: [ ] pending → **Status**: [x] completed
422
+ ```
1185
423
 
1186
- {SKILLS_SECTION}
424
+ Or run: `/specweave:sync-tasks`
1187
425
 
1188
- ### How to Use Skills
426
+ ### Context Explosion / Crashes
1189
427
 
1190
- **In Claude Code** (automatic):
1191
- - Skills activate based on keywords in your request
1192
- - No manual invocation needed
1193
- - Claude reads SKILLS-INDEX.md at startup
1194
- - Full SKILL.md loaded when relevant
428
+ **Symptoms**: Tool crashes 10-50s after start
1195
429
 
1196
- **In other tools** (manual):
1197
- - Read `.claude/skills/SKILLS-INDEX.md` first (mandatory)
1198
- - Match task to activation keywords
1199
- - Load full skill: `.claude/skills/{skill-name}/SKILL.md`
1200
- - Follow the workflow precisely
1201
- - Example: "Following increment-planner skill workflow..."
430
+ **Causes**: Loading too many files, no context manifest
1202
431
 
1203
- ---
432
+ **Fix**:
433
+ 1. Create `context-manifest.yaml` in increment folder
434
+ 2. List only files needed for current task
435
+ 3. Never load entire `.specweave/docs/` folder
1204
436
 
1205
- ## Common Workflows
437
+ ### Skills/Agents Not Activating
1206
438
 
1207
- ### Creating a Feature Increment
439
+ **Non-Claude tools**: Skills don't auto-activate.
1208
440
 
1209
- **Step 1: Create Increment Folder**
441
+ **Manual activation**:
1210
442
  ```bash
1211
- mkdir -p .specweave/increments/0001-feature-name
1212
- cd .specweave/increments/0001-feature-name
1213
- ```
443
+ # 1. Check skills index
444
+ cat .claude/skills/SKILLS-INDEX.md
1214
445
 
1215
- **Step 2: Create spec.md (Adopt PM Role)**
1216
- - Focus on WHAT and WHY (not HOW)
1217
- - Technology-agnostic requirements
1218
- - User stories with acceptance criteria
446
+ # 2. Match your task to a skill
447
+ # 3. Load the skill manually
448
+ cat .claude/skills/increment-planner/SKILL.md
1219
449
 
1220
- Template:
1221
- ```markdown
1222
- ---
1223
- increment: 0001-feature-name
1224
- title: "Feature Title"
1225
- priority: P1
1226
- status: planned
1227
- ---
1228
-
1229
- # Increment 0001: Feature Name
1230
-
1231
- ## Overview
1232
- [Problem statement and solution]
1233
-
1234
- ## User Stories
1235
-
1236
- ### US-001: User Story Title
1237
- **As a** [role]
1238
- **I want to** [action]
1239
- **So that** [benefit]
1240
-
1241
- **Acceptance Criteria**:
1242
- - [ ] TC-0001: [testable condition]
1243
- - [ ] TC-0002: [testable condition]
1244
- ```
1245
-
1246
- **Step 3: Create plan.md (Adopt Architect Role)**
1247
- - Focus on HOW (technical implementation)
1248
- - Technology-specific details
1249
- - Component design, data models, APIs
1250
-
1251
- Template:
1252
- ```markdown
1253
- # Technical Plan: Feature Name
1254
-
1255
- ## Architecture
1256
- [Component design]
1257
-
1258
- ## Data Model
1259
- [Database schema]
1260
-
1261
- ## API Contracts
1262
- [Endpoints, request/response]
1263
-
1264
- ## Implementation Strategy
1265
- [Step-by-step approach]
1266
- ```
1267
-
1268
- **Step 4: Create tasks.md (with embedded tests)**
1269
- ```markdown
1270
- ---
1271
- increment: 0001-feature-name
1272
- total_tasks: 10
1273
- completed_tasks: 0
1274
- ---
1275
-
1276
- # Implementation Tasks
1277
-
1278
- ## T-001: Task description
1279
-
1280
- **AC**: AC-US1-01, AC-US1-02
1281
-
1282
- **Test Plan** (BDD):
1283
- - **Given** [context] → **When** [action] → **Then** [expected result]
1284
-
1285
- **Test Cases**:
1286
- - Unit (`*.test.ts`): testCase1, testCase2 → 90% coverage
1287
- - Integration (`*.spec.ts`): integrationTest → 85% coverage
1288
-
1289
- **Implementation**: [Technical details]
1290
- ```
1291
-
1292
- **Step 5: Create context-manifest.yaml (CRITICAL)**
1293
- ```yaml
1294
- spec_sections:
1295
- - .specweave/docs/internal/strategy/relevant-spec.md
1296
- documentation:
1297
- - .specweave/docs/internal/architecture/relevant-design.md
1298
- max_context_tokens: 10000
1299
- ```
1300
-
1301
- ### Context Loading (70%+ Token Savings)
1302
-
1303
- **CRITICAL RULE**: Always read `context-manifest.yaml` first!
1304
-
1305
- **Why?**
1306
- - Full specs: 500+ pages (50k tokens) ❌
1307
- - Manifest files: 50 pages (5k tokens) ✅
1308
- - **Savings: 90% = 45k tokens saved!**
1309
-
1310
- **How:**
1311
- 1. Navigate to increment folder
1312
- 2. Read `context-manifest.yaml`
1313
- 3. Load ONLY files listed in manifest
1314
- 4. Do NOT load entire `.specweave/docs/` folder
1315
-
1316
- ### Working with Slash Commands (Claude Code)
1317
-
1318
- If using Claude Code, these slash commands are available:
1319
-
1320
- **Core Commands** (always available):
1321
- | Command | Purpose | Example |
1322
- |---------|---------|---------|
1323
- | `/specweave:increment` | Create new increment | `/specweave:increment "user authentication"` |
1324
- | `/specweave:do` | Execute implementation | `/specweave:do` |
1325
- | `/specweave:progress` | Check status | `/specweave:progress` |
1326
- | `/specweave:done` | Close increment | `/specweave:done 0001` |
1327
- | `/specweave:validate` | Validate quality | `/specweave:validate 0001 --quality` |
1328
-
1329
- ### 🚨 MANDATORY: Increment Closure Workflow
1330
-
1331
- **For ALL tools (Claude Code + non-Claude)**:
1332
-
1333
- When closing an increment with `/specweave:done`, the following MUST happen to maintain source of truth integrity:
1334
-
1335
- ```
1336
- 1. PM validates 3 gates (tasks, tests, docs)
1337
- 2. Increment marked as complete
1338
- 3. Living docs spec MUST be synced ← MANDATORY!
1339
- 4. GitHub Project MUST be synced ← MANDATORY!
1340
- 5. GitHub Issue closed (optional)
1341
- ```
1342
-
1343
- **For Claude Code** (automated via hooks):
1344
- - ✅ Steps 3-5 happen AUTOMATICALLY via `post-increment-done` hook
1345
- - No manual action needed!
1346
-
1347
- **For non-Claude tools** (manual workflow):
1348
-
1349
- After `/specweave:done 0001` completes, **YOU MUST manually run**:
1350
-
1351
- ```bash
1352
- # Step 1: Close increment (PM agent validates)
1353
- /specweave:done 0001
1354
-
1355
- # Step 2: Sync living docs spec to GitHub Project (MANDATORY!)
1356
- # Find the spec file first:
1357
- SPEC_FILE=$(find .specweave/docs/internal/specs/ -name "spec-0001*.md" | head -1)
1358
-
1359
- # Then sync to GitHub Project:
1360
- /specweave-github:sync-spec "$SPEC_FILE"
1361
-
1362
- # Step 3: Close GitHub Issue (optional)
1363
- /specweave-github:close-issue 0001
1364
- ```
1365
-
1366
- **Why MANDATORY?**
1367
- - Living docs specs (`.specweave/docs/internal/specs/`) = Permanent source of truth
1368
- - GitHub Projects = External mirror of source of truth
1369
- - Without sync, GitHub Projects become stale and unreliable!
1370
-
1371
- **Plugin Commands** (when plugin installed):
1372
- | Command | Purpose | Plugin |
1373
- |---------|---------|--------|
1374
- | `/specweave:github:sync` | Sync to GitHub | specweave-github |
1375
- | `/specweave:github:create-issue` | Create GitHub issue | specweave-github |
1376
- | `/specweave:jira:sync` | Sync to Jira | specweave-jira |
1377
- | `/specweave:jira:create-ticket` | Create Jira ticket | specweave-jira |
1378
-
1379
- **For non-Claude tools**: Read the command file when user requests the action:
1380
- ```bash
1381
- # User: "Sync to GitHub"
1382
- cat plugins/specweave-github/commands/github-sync.md
1383
- # Then follow instructions in that file
1384
- ```
1385
-
1386
- ---
1387
-
1388
- ## 📖 Documentation Preview with Docusaurus (Port 3016)
1389
-
1390
- **IMPORTANT**: SpecWeave supports beautiful documentation preview using Docusaurus. This is NOT just for Claude Code - it works for ALL tools!
1391
-
1392
- ### Overview
1393
-
1394
- The `/specweave-docs-preview:preview` command launches an interactive Docusaurus development server to preview your living documentation at **http://localhost:3016** (NOT port 3000!).
1395
-
1396
- **Why Port 3016?**
1397
- - Port 3000 is commonly used by other development servers (React, Next.js, etc.)
1398
- - Port 3016 avoids conflicts with client projects
1399
- - This is the default for ALL SpecWeave documentation preview
1400
-
1401
- ### Quick Start
1402
-
1403
- **For Claude Code** (slash command):
1404
- ```bash
1405
- /specweave-docs-preview:preview
1406
- ```
1407
-
1408
- **For Other Tools** (manual execution):
1409
- ```bash
1410
- # 1. Read the command file
1411
- cat plugins/specweave-docs-preview/commands/preview.md
1412
-
1413
- # 2. Execute the workflow manually (follow the instructions in preview.md)
1414
- # The command will:
1415
- # - Install Docusaurus (~30 seconds first time)
1416
- # - Generate configuration
1417
- # - Create sidebar from folder structure
1418
- # - Start server on http://localhost:3016
1419
- # - Open browser automatically
1420
-
1421
- # 3. Access the documentation
1422
- # Open browser to: http://localhost:3016
1423
- ```
1424
-
1425
- ### Common MDX Compilation Errors (MUST READ!)
1426
-
1427
- **Problem**: Docusaurus uses MDX (Markdown + JSX) which has stricter parsing rules than regular Markdown. Files with certain patterns may cause compilation errors like:
1428
-
1429
- ```
1430
- Error: MDX compilation failed for file ".../adr-001-signalr-vs-websockets.md"
1431
- Cause: Unexpected character `1` (U+0031) before name
1432
- ```
1433
-
1434
- **Solutions** (in order of preference):
1435
-
1436
- #### Solution 1: Use Frontmatter for Problematic Files
1437
-
1438
- Add YAML frontmatter to files with numeric prefixes or special characters:
1439
-
1440
- ```markdown
1441
- ---
1442
- id: adr-001-signalr-vs-websockets
1443
- title: ADR 001: SignalR vs WebSockets
1444
- sidebar_label: SignalR vs WebSockets
1445
- ---
1446
-
1447
- # ADR 001: SignalR vs WebSockets
1448
-
1449
- [Rest of content...]
1450
- ```
1451
-
1452
- #### Solution 2: Exclude Problematic Files
1453
-
1454
- If certain files can't be fixed, exclude them from the build:
1455
-
1456
- **Edit `.specweave/config.json`:**
1457
- ```json
1458
- {
1459
- "documentation": {
1460
- "preview": {
1461
- "enabled": true,
1462
- "port": 3016,
1463
- "excludeFolders": ["legacy", "node_modules", "problematic-folder"]
1464
- }
1465
- }
1466
- }
1467
- ```
1468
-
1469
- #### Solution 3: Use MDX1 Compatibility Mode
1470
-
1471
- The config generator already adds MDX1 compatibility mode to handle most common issues:
1472
-
1473
- ```javascript
1474
- // This is already in the generated docusaurus.config.js
1475
- markdown: {
1476
- mermaid: true,
1477
- format: 'mdx',
1478
- mdx1Compat: {
1479
- comments: true,
1480
- admonitions: true,
1481
- headingIds: true,
1482
- },
1483
- }
1484
- ```
1485
-
1486
- #### Solution 4: Fix Special Characters in Content
1487
-
1488
- MDX interprets `<`, `>`, `{`, `}` as JSX. Escape them in your markdown:
1489
-
1490
- **Bad** (causes MDX errors):
1491
- ```markdown
1492
- Use <Component> to render the UI
1493
- Configure {apiKey} in the settings
1494
- ```
1495
-
1496
- **Good** (works):
1497
- ```markdown
1498
- Use `<Component>` to render the UI
1499
- Configure `{apiKey}` in the settings
1500
- ```
1501
-
1502
- Or use code blocks:
1503
- ```markdown
1504
- ```
1505
- Use <Component> to render the UI
1506
- ```
1507
-
1508
- ### Configuration Reference
1509
-
1510
- **Default Configuration** (`.specweave/config.json`):
1511
- ```json
1512
- {
1513
- "documentation": {
1514
- "preview": {
1515
- "enabled": true,
1516
- "autoInstall": true,
1517
- "port": 3016,
1518
- "openBrowser": true,
1519
- "theme": "default",
1520
- "excludeFolders": ["legacy", "node_modules"]
1521
- }
1522
- }
1523
- }
1524
- ```
1525
-
1526
- **Configuration Options**:
1527
- - `enabled`: Enable/disable docs preview (default: true)
1528
- - `autoInstall`: Auto-install Docusaurus on first run (default: true)
1529
- - `port`: Port for dev server (default: 3016, NEVER use 3000!)
1530
- - `openBrowser`: Auto-open browser (default: true)
1531
- - `theme`: Theme variant ("default", "classic", "dark")
1532
- - `excludeFolders`: Folders to exclude from build (array)
1533
-
1534
- ### Features
1535
-
1536
- **What You Get**:
1537
- - ✅ Auto-generated navigation from folder structure
1538
- - ✅ Search functionality (instant local search)
1539
- - ✅ Beautiful theming (light/dark mode)
1540
- - ✅ Mermaid diagram rendering
1541
- - ✅ Hot reload (edit markdown, see changes instantly)
1542
- - ✅ Professional typography and layout
1543
- - ✅ Mobile responsive design
1544
-
1545
- **Hot Reload**:
1546
- - Edit any file in `.specweave/docs/internal/`
1547
- - Save the file
1548
- - Browser refreshes automatically
1549
- - No need to restart server!
1550
-
1551
- ### Troubleshooting
1552
-
1553
- **Port Already in Use:**
1554
- ```bash
1555
- # Error: Port 3016 is already in use
1556
- # Solution 1: Change port in config
1557
- vim .specweave/config.json
1558
- # Change "port": 3016 to "port": 3017
1559
-
1560
- # Solution 2: Stop the service
1561
- lsof -i :3016 # Find PID
1562
- kill -9 <PID> # Kill the process
1563
- ```
1564
-
1565
- **Build Fails with MDX Errors:**
1566
- ```bash
1567
- # Check which files are causing errors
1568
- # Look for files with:
1569
- # - Numeric prefixes (adr-001-, spec-123-)
1570
- # - Special characters in content (<, >, {, })
1571
- # - JSX-like syntax
1572
-
1573
- # Fix using Solution 1-4 above (add frontmatter, exclude files, etc.)
1574
- ```
1575
-
1576
- **Node.js Version:**
1577
- ```bash
1578
- # Error: Node.js 18+ required
1579
- # Solution: Update Node.js
1580
- nvm install 20 # Using nvm
1581
- # Or download from nodejs.org
1582
- node --version # Verify
450
+ # 4. Follow the skill's workflow
1583
451
  ```
1584
452
 
1585
- ### Best Practices
1586
-
1587
- **1. Always Use Port 3016** (NOT 3000):
1588
- ```json
1589
- // ✅ CORRECT
1590
- {"documentation": {"preview": {"port": 3016}}}
1591
-
1592
- // ❌ WRONG
1593
- {"documentation": {"preview": {"port": 3000}}}
1594
- ```
1595
-
1596
- **2. Add Frontmatter to ADRs/Specs:**
1597
- ```markdown
1598
- ---
1599
- id: unique-identifier
1600
- title: Human-Readable Title
1601
- sidebar_label: Short Label
1602
- ---
1603
-
1604
- # Your content here
1605
- ```
1606
-
1607
- **3. Escape Special Characters:**
1608
- ```markdown
1609
- Use backticks: `<Component>`, `{variable}`
1610
- Or code blocks for multiline
1611
- ```
1612
-
1613
- **4. Test Before Committing:**
1614
- ```bash
1615
- # Start preview locally
1616
- /specweave-docs-preview:preview
1617
-
1618
- # Check for errors in console
1619
- # Fix any MDX compilation errors
1620
- # Then commit
1621
- ```
1622
-
1623
- ### Integration with SpecWeave Workflow
1624
-
1625
- **After Creating Increment:**
1626
- ```bash
1627
- /specweave:increment "User Authentication"
1628
- # → Creates spec.md, plan.md, tasks.md
1629
-
1630
- /specweave-docs-preview:preview
1631
- # → Preview shows new spec in sidebar
1632
- ```
1633
-
1634
- **After Completing Increment:**
1635
- ```bash
1636
- /specweave:done 0008
1637
- # → Syncs spec.md to .specweave/docs/internal/specs/
1638
-
1639
- # Hot reload automatically shows the new spec!
1640
- # No need to restart preview server
1641
- ```
1642
-
1643
- ### For Non-Claude Tools: Manual Execution
1644
-
1645
- **Step-by-Step Workflow:**
1646
-
1647
- ```bash
1648
- # 1. Load the command
1649
- cat plugins/specweave-docs-preview/commands/preview.md
1650
-
1651
- # 2. Create or verify config
1652
- vim .specweave/config.json
1653
- # Ensure "documentation.preview.enabled" is true
1654
- # Ensure "documentation.preview.port" is 3016
1655
-
1656
- # 3. Run the preview (follow instructions from preview.md)
1657
- # The command will guide you through:
1658
- # - Installing Docusaurus (first time only)
1659
- # - Generating config and sidebar
1660
- # - Starting server on port 3016
1661
- # - Opening browser
1662
-
1663
- # 4. Access documentation
1664
- # Open: http://localhost:3016
1665
-
1666
- # 5. Edit docs and see changes live
1667
- # Edit any file in .specweave/docs/internal/
1668
- # Browser refreshes automatically!
1669
-
1670
- # 6. Stop server when done
1671
- # Press Ctrl+C in terminal
1672
- ```
1673
-
1674
- ### Summary
1675
-
1676
- - 🌐 **Default Port**: 3016 (NOT 3000!)
1677
- - 📁 **Source**: `.specweave/docs/internal/`
1678
- - 🔧 **Config**: `.specweave/config.json`
1679
- - 🔄 **Hot Reload**: Automatic
1680
- - ⚠️ **MDX Errors**: Add frontmatter or escape special chars
1681
- - ✅ **Works for ALL tools** (Claude Code, Cursor, Copilot, etc.)
1682
-
1683
- ---
1684
-
1685
- ## Build & Test Commands
1686
-
1687
- ```bash
1688
- # Install dependencies
1689
- npm install
1690
-
1691
- # Build project
1692
- npm run build
1693
-
1694
- # Run tests
1695
- npm test
1696
-
1697
- # Run E2E tests (if applicable)
1698
- npm run test:e2e
1699
-
1700
- # Type check
1701
- npm run type-check
1702
-
1703
- # Lint
1704
- npm run lint
1705
- ```
1706
-
1707
- ---
1708
-
1709
- ## Code Style Guidelines
1710
-
1711
- ### Specification Files
1712
-
1713
- **spec.md** (Technology-Agnostic):
1714
- - Focus on WHAT and WHY, not HOW
1715
- - Use user stories (US-001, US-002, ...)
1716
- - Use acceptance criteria (TC-0001, TC-0002, ...)
1717
- - No technology-specific details
1718
-
1719
- **plan.md** (Technology-Specific):
1720
- - Focus on HOW to implement
1721
- - Include component designs, data models, APIs
1722
- - Reference ADRs (Architecture Decision Records)
1723
- - Technology stack details
1724
-
1725
- ### Code Organization
1726
-
1727
- **ALL supporting files belong to an increment:**
1728
- - Logs → `.specweave/increments/{id}/logs/`
1729
- - Scripts → `.specweave/increments/{id}/scripts/`
1730
- - Reports → `.specweave/increments/{id}/reports/`
1731
- - NEVER create supporting files in project root
1732
-
1733
- **Benefits:**
1734
- - Complete traceability (know which increment created which files)
1735
- - Easy cleanup (delete increment folder = delete all related files)
1736
- - Clear context (all files for a feature in one place)
1737
-
1738
- ---
1739
-
1740
- ## Testing Strategy
1741
-
1742
- **Four Levels of Test Cases**:
1743
-
1744
- 1. **Specification** (`.specweave/docs/internal/strategy/`) - AC-IDs (AC-US1-01, etc.)
1745
- 2. **Feature** (`.specweave/increments/####/tasks.md`) - Test plans embedded in tasks (BDD format)
1746
- 3. **Skill** (`src/skills/{name}/test-cases/`) - YAML test cases (if creating skills)
1747
- 4. **Code** (`tests/`) - Automated tests (Unit, Integration, E2E)
1748
-
1749
- **Test-Aware Planning**: Tests are embedded directly in tasks.md using BDD format (Given/When/Then), with AC-ID traceability (mapping to spec.md acceptance criteria) and realistic coverage targets (80-90%).
1750
-
1751
- **Requirements:**
1752
- - E2E tests (Playwright/Cypress) when UI exists
1753
- - >80% coverage for critical paths
1754
- - Tests MUST tell the truth (no false positives)
1755
-
1756
- ---
1757
-
1758
- ## 📝 Documentation Updates (CRITICAL FOR NON-CLAUDE TOOLS)
1759
-
1760
- **IMPORTANT**: Claude Code has automatic hooks that remind you to update documentation. **GitHub Copilot, Cursor, and other tools DO NOT have these hooks!**
1761
-
1762
- ### You MUST Manually Update Documentation After Every Task
1763
-
1764
- When you complete ANY task (implementation, bug fix, refactoring), you MUST update:
1765
-
1766
- #### 1. Living Docs (.specweave/docs/)
1767
-
1768
- After implementing features, update strategic documentation:
1769
-
1770
- **Strategy Docs** (`.specweave/docs/internal/strategy/`):
1771
- - Update PRDs when requirements change
1772
- - Add new user stories if scope expanded
1773
- - Document discovered requirements
1774
-
1775
- **Architecture Docs** (`.specweave/docs/internal/architecture/`):
1776
- - Update HLD (high-level design) when architecture changes
1777
- - Update LLD (low-level design) when components change
1778
- - Update ADRs from "Proposed" → "Accepted" after implementation
1779
- - Add new ADRs for significant decisions made during implementation
1780
-
1781
- **Delivery Docs** (`.specweave/docs/internal/delivery/`):
1782
- - Update deployment guides after infrastructure changes
1783
- - Update CI/CD docs after pipeline modifications
1784
-
1785
- **Operations Docs** (`.specweave/docs/internal/operations/`):
1786
- - Update runbooks after operational changes
1787
- - Update monitoring/alerting docs
1788
-
1789
- #### 2. Increment Documentation
1790
-
1791
- **Always update these files in `.specweave/increments/{increment-id}/`**:
1792
-
1793
- ```bash
1794
- # Update implementation status
1795
- vim .specweave/increments/0001-feature/plan.md
1796
- # Add: "## Implementation Notes" section with learnings
1797
-
1798
- # Update task checklist
1799
- vim .specweave/increments/0001-feature/tasks.md
1800
- # Mark completed: - [x] T001: Task description
1801
-
1802
- # Document completion
1803
- vim .specweave/increments/0001-feature/reports/completion-report.md
1804
- # Add: Summary of what was implemented, challenges, solutions
1805
- ```
1806
-
1807
- #### 3. Project Documentation
1808
-
1809
- **CLAUDE.md or AGENTS.md** (this file):
1810
- - Update when project structure changes
1811
- - Add new workflows or commands
1812
- - Update "Current Work" section
1813
-
1814
- **README.md** (user-facing):
1815
- - Update when features are added
1816
- - Update installation instructions if changed
1817
- - Update usage examples
1818
-
1819
- **CHANGELOG.md** (version history):
1820
- - Add entries for all user-facing changes
1821
- - Format: `## [version] - date` with bullet points
1822
-
1823
- #### 4. Code Documentation
1824
-
1825
- **Inline comments**:
1826
- - Add JSDoc/TSDoc for new functions
1827
- - Update existing comments if behavior changes
1828
- - Explain "why" not just "what"
1829
-
1830
- ### When to Update (Checklist)
1831
-
1832
- After you:
1833
- - ✅ Complete a task → Update increment tasks.md
1834
- - ✅ Implement a feature → Update living docs (architecture, strategy)
1835
- - ✅ Make architecture decision → Create or update ADR
1836
- - ✅ Change project structure → Update CLAUDE.md/AGENTS.md
1837
- - ✅ Add user-facing feature → Update README.md
1838
- - ✅ Fix a bug → Update CHANGELOG.md
1839
- - ✅ Change API → Update API documentation
1840
- - ✅ Modify deployment → Update deployment guide
1841
-
1842
- ### Example Workflow (GitHub Copilot/Cursor Users)
1843
-
1844
- ```markdown
1845
- # After completing "Implement user authentication" task:
1846
-
1847
- 1. Update living docs:
1848
- echo "## Implementation Notes
1849
- - Used JWT for stateless authentication
1850
- - Password hashing with bcrypt
1851
- - Session timeout: 24 hours
1852
- " >> .specweave/increments/0001-auth/plan.md
1853
-
1854
- 2. Update architecture:
1855
- vim .specweave/docs/internal/architecture/hld-system.md
1856
- # Add authentication component diagram
1857
-
1858
- 3. Create ADR:
1859
- vim .specweave/docs/internal/architecture/adr-003-jwt-authentication.md
1860
-
1861
- 4. Update README:
1862
- vim README.md
1863
- # Add authentication usage example
1864
-
1865
- 5. Update CHANGELOG:
1866
- echo "### Added
1867
- - User authentication with JWT
1868
- - Password reset flow
1869
- " >> CHANGELOG.md
1870
-
1871
- 6. Mark task complete:
1872
- vim .specweave/increments/0001-auth/tasks.md
1873
- # Change [ ] to [x] for completed tasks
1874
- ```
1875
-
1876
- ### Why This Matters
1877
-
1878
- **Without documentation updates**:
1879
- - ❌ Specs diverge from implementation (specs become useless)
1880
- - ❌ Team members don't know what changed
1881
- - ❌ Future AI sessions have outdated context
1882
- - ❌ SpecWeave's core principle (living documentation) breaks down
1883
-
1884
- **With documentation updates**:
1885
- - ✅ Specs stay synchronized with code
1886
- - ✅ Clear audit trail of changes
1887
- - ✅ AI agents have accurate context
1888
- - ✅ Team members stay informed
1889
- - ✅ SpecWeave philosophy is maintained
1890
-
1891
- ### Tools That Need Manual Updates
1892
-
1893
- These tools **DO NOT** have automatic documentation hooks:
1894
- - GitHub Copilot (all versions)
1895
- - Cursor
1896
- - Windsurf
1897
- - Gemini CLI
1898
- - Generic AI tools (ChatGPT, Claude web, etc.)
1899
-
1900
- Only **Claude Code** has automatic hooks that remind you to update docs.
1901
-
1902
- ---
1903
-
1904
- ## 🔗 External Tracker Sync (CRITICAL FOR NON-CLAUDE TOOLS)
1905
-
1906
- **IMPORTANT**: Claude Code has automatic hooks that sync to external trackers (GitHub Issues, Jira, Azure DevOps) after each task completion. **GitHub Copilot, Cursor, and other tools DO NOT have these hooks!**
1907
-
1908
- ### You MUST Manually Sync to External Trackers After Every Task
1909
-
1910
- When you complete ANY task, you MUST sync progress to external trackers if they are enabled for the project.
1911
-
1912
- #### Step 1: Detect Which Trackers Are Enabled
1913
-
1914
- Check the current increment's `metadata.json`:
1915
-
1916
- ```bash
1917
- # Find current increment (latest non-backlog increment)
1918
- CURRENT_INCREMENT=$(ls -t .specweave/increments/ 2>/dev/null | grep -v "_backlog" | head -1)
1919
-
1920
- # Check metadata
1921
- cat .specweave/increments/$CURRENT_INCREMENT/metadata.json
1922
- ```
1923
-
1924
- **Example metadata.json**:
1925
- ```json
1926
- {
1927
- "id": "0007-smart-increment-discipline",
1928
- "title": "Increment Management v2.0",
1929
- "status": "active",
1930
- "github": {
1931
- "issue": 4,
1932
- "url": "https://github.com/anton-abyzov/specweave/issues/4"
1933
- },
1934
- "jira": {
1935
- "issue": "PROJ-123",
1936
- "url": "https://company.atlassian.net/browse/PROJ-123"
1937
- },
1938
- "ado": {
1939
- "item": 456,
1940
- "url": "https://dev.azure.com/org/project/_workitems/edit/456"
1941
- }
1942
- }
1943
- ```
1944
-
1945
- #### Step 2: Sync to Each Enabled Tracker
1946
-
1947
- **For GitHub** (if `github.issue` exists):
1948
-
1949
- ```bash
1950
- # Get issue number
1951
- GITHUB_ISSUE=$(jq -r '.github.issue' .specweave/increments/$CURRENT_INCREMENT/metadata.json)
1952
-
1953
- # Post progress comment
1954
- gh issue comment "$GITHUB_ISSUE" --body "Progress update: Task T-XXX completed in increment $CURRENT_INCREMENT
1955
-
1956
- Details:
1957
- - Task: [Task description]
1958
- - Status: Completed
1959
- - Timestamp: $(date -u +"%Y-%m-%dT%H:%M:%SZ")
1960
-
1961
- Next: [Next task or completion status]
1962
- "
1963
- ```
1964
-
1965
- **For Jira** (if `jira.issue` exists):
1966
-
1967
- ```bash
1968
- # Get issue key
1969
- JIRA_ISSUE=$(jq -r '.jira.issue' .specweave/increments/$CURRENT_INCREMENT/metadata.json)
1970
-
1971
- # Add comment (requires jira CLI: https://github.com/ankitpokhrel/jira-cli)
1972
- jira issue comment add "$JIRA_ISSUE" "Progress update: Task T-XXX completed
1973
-
1974
- Details:
1975
- - Task: [Task description]
1976
- - Status: Completed
1977
- - Increment: $CURRENT_INCREMENT
1978
- "
1979
-
1980
- # Update status if task is major milestone
1981
- # jira issue move "$JIRA_ISSUE" "In Progress" / "Review" / "Done"
1982
- ```
1983
-
1984
- **For Azure DevOps** (if `ado.item` exists):
1985
-
1986
- ```bash
1987
- # Get work item ID
1988
- ADO_ITEM=$(jq -r '.ado.item' .specweave/increments/$CURRENT_INCREMENT/metadata.json)
1989
-
1990
- # Add comment (requires az CLI: https://aka.ms/azure-cli)
1991
- az boards work-item update --id "$ADO_ITEM" --discussion "Progress update: Task T-XXX completed
1992
-
1993
- Details:
1994
- - Task: [Task description]
1995
- - Status: Completed
1996
- - Increment: $CURRENT_INCREMENT
1997
- "
1998
- ```
1999
-
2000
- #### Step 3: When to Sync
2001
-
2002
- **After EVERY task completion**, sync to all enabled trackers:
2003
-
2004
- ```bash
2005
- # Example workflow after completing T-003:
2006
-
2007
- # 1. Mark task complete in tasks.md
2008
- vim .specweave/increments/0007-feature/tasks.md
2009
- # Change: - [ ] T003: Task → - [x] T003: Task ✅
2010
-
2011
- # 2. Update increment documentation (plan.md, etc.)
2012
- # [See "Documentation Updates" section above]
2013
-
2014
- # 3. Sync to external trackers
2015
- gh issue comment 4 --body "✅ T-003 Complete: Create test-aware-planner structure
2016
-
2017
- Directory structure created at plugins/specweave/agents/test-aware-planner/
2018
-
2019
- Next: T-004 - Write test-aware-planner AGENT.md prompt
2020
- "
2021
-
2022
- # 4. Continue to next task
2023
- ```
2024
-
2025
- #### Step 4: Update Task Checklist in GitHub/Jira
2026
-
2027
- **For GitHub Issues with task checklists**:
2028
-
2029
- The issue body likely contains a task checklist:
2030
-
2031
- ```markdown
2032
- ## Tasks
2033
- - [x] T-001: Update plan.md
2034
- - [x] T-002: Add auto-sync hook
2035
- - [ ] T-003: Create test-aware-planner structure
2036
- - [ ] T-004: Write AGENT.md prompt
2037
- ```
2038
-
2039
- **Update the checklist** after each task:
2040
-
2041
- ```bash
2042
- # Get current issue body
2043
- gh issue view 4 --json body -q .body > issue-body.md
2044
-
2045
- # Edit the checklist (mark T-003 as done)
2046
- vim issue-body.md
2047
- # Change: - [ ] T-003 → - [x] T-003
2048
-
2049
- # Update issue
2050
- gh issue edit 4 --body-file issue-body.md
2051
- ```
2052
-
2053
- **For Jira** (subtasks):
2054
-
2055
- If tasks are represented as subtasks:
2056
-
2057
- ```bash
2058
- # List subtasks
2059
- jira issue list --parent PROJ-123
2060
-
2061
- # Update subtask status
2062
- jira issue move PROJ-123-SUB1 "Done"
2063
- ```
2064
-
2065
- #### Step 5: Sync Increment Status Changes
2066
-
2067
- When increment status changes (active → paused → completed), sync that too:
2068
-
2069
- ```bash
2070
- # Example: Increment completed
2071
- gh issue comment 4 --body "🎉 INCREMENT COMPLETED!
2072
-
2073
- All 24 tasks finished. Increment 0007-smart-increment-discipline is now complete.
2074
-
2075
- See completion report: .specweave/increments/0007-smart-increment-discipline/reports/COMPLETION-SUMMARY.md
2076
- "
2077
-
2078
- # Close the issue
2079
- gh issue close 4 --comment "Increment completed and merged to main branch."
2080
- ```
2081
-
2082
- ### Why This Matters
2083
-
2084
- **Without external tracker sync**:
2085
- - ❌ Stakeholders don't see progress
2086
- - ❌ Team members work in isolation
2087
- - ❌ No audit trail of work done
2088
- - ❌ GitHub/Jira becomes stale and useless
2089
-
2090
- **With external tracker sync**:
2091
- - ✅ Real-time visibility into progress
2092
- - ✅ Team stays informed
2093
- - ✅ Stakeholders can track without asking
2094
- - ✅ Complete audit trail
2095
- - ✅ GitHub/Jira remains the source of truth
2096
-
2097
- ### Tools That Need Manual Sync
2098
-
2099
- These tools **DO NOT** have automatic external tracker sync:
2100
- - GitHub Copilot (all versions)
2101
- - Cursor
2102
- - Windsurf
2103
- - Gemini CLI
2104
- - Generic AI tools (ChatGPT, Claude web, etc.)
2105
-
2106
- Only **Claude Code** has automatic hooks (via `post-task-completion.sh`) that sync to external trackers.
2107
-
2108
- ### Summary Checklist (After Every Task)
2109
-
2110
- When you complete a task in non-Claude tools, **run these slash commands**:
2111
-
2112
- #### Quick Sync (After Each Task Completion)
2113
-
2114
- ```bash
2115
- # 1. Sync tasks.md with completion status
2116
- /specweave:sync-tasks
2117
-
2118
- # 2. Update living docs from completed work
2119
- /specweave:sync-docs update
2120
- ```
2121
-
2122
- #### External Tracker Sync (If Enabled)
2123
-
2124
- ```bash
2125
- # 3. Sync to external tracker (choose one based on your setup):
2126
-
2127
- # GitHub Issues:
2128
- /specweave-github:sync <increment-id>
2129
-
2130
- # Jira:
2131
- /specweave-jira:sync <increment-id>
2132
-
2133
- # Azure DevOps:
2134
- /specweave-ado:sync <increment-id>
2135
- ```
2136
-
2137
- #### Example Full Workflow
2138
-
2139
- ```bash
2140
- # After completing a task in your current increment:
2141
-
2142
- # Step 1: Update tasks.md
2143
- /specweave:sync-tasks
2144
-
2145
- # Step 2: Sync living docs
2146
- /specweave:sync-docs update
2147
-
2148
- # Step 3: Sync to GitHub (if using GitHub tracking)
2149
- /specweave-github:sync <increment-id> # e.g., /specweave-github:sync 0016
2150
-
2151
- # Done! Continue to next task.
2152
- ```
2153
-
2154
- **Remember**: In Claude Code, all of this happens **automatically via hooks**. In other tools (Cursor, Copilot, ChatGPT), **YOU must run these commands manually** after each task!
2155
-
2156
- ---
2157
-
2158
- ## Security Considerations
2159
-
2160
- - Never commit secrets (use `.env` files, gitignored)
2161
- - Follow principle of least privilege
2162
- - Review security implications in ADRs
2163
- - Use the `security` agent role for security reviews
2164
-
2165
- ---
2166
-
2167
- ## Finding the Right Agent or Skill
2168
-
2169
- When you encounter a new task:
2170
-
2171
- **Finding Skills:**
2172
- 1. Check this file (Available Skills section above)
2173
- 2. Browse: `ls .claude/skills/`
2174
- 3. Read: `.claude/skills/{skill-name}/SKILL.md`
2175
- 4. Follow the workflow
2176
-
2177
- **Finding Agents:**
2178
- 1. Check this file (Available Agents section above)
2179
- 2. Browse: `ls .claude/agents/`
2180
- 3. Read: `.claude/agents/{agent-name}/AGENT.md`
2181
- 4. Adopt the role
2182
-
2183
- **Pro Tips:**
2184
- - Skills are capabilities (what you CAN do)
2185
- - Agents are roles (who you BECOME to do it)
2186
- - When stuck, ask: "Which SpecWeave skill or agent helps with [task]?"
2187
-
2188
- ---
2189
-
2190
- ## Important Reminders
2191
-
2192
- 1. ✅ **Always read context-manifest.yaml first** (70%+ token savings)
2193
- 2. ✅ **Load only files listed in manifest** (not entire docs folder)
2194
- 3. ✅ **Adopt role when acting as agent** (PM, Architect, DevOps, etc.)
2195
- 4. ✅ **Technology-agnostic in spec.md** (WHAT/WHY only)
2196
- 5. ✅ **Technology-specific in plan.md** (HOW with details)
2197
- 6. ✅ **Use checkboxes in tasks.md** for tracking
2198
- 7. ✅ **All supporting files in increment folders** (never in root)
2199
- 8. 🔴 **UPDATE DOCUMENTATION AFTER EVERY TASK** (see "Documentation Updates" section above - CRITICAL for non-Claude tools!)
2200
-
2201
- ---
2202
-
2203
- ## 🆘 Troubleshooting {#troubleshooting}
2204
-
2205
- **Use Ctrl+F / Command+F with the search patterns below to jump to specific issues!**
2206
-
2207
- ### Skills Not Working {#troubleshoot-skills}
2208
-
2209
- **Symptoms**: Expected skill didn't activate or can't find skill
2210
-
2211
- **Solutions (Non-Claude Tools)**:
2212
- 1. **Skills don't auto-activate in Cursor/Copilot** - This is normal!
2213
- - You must manually discover skills from Section Index above
2214
- - Search for relevant skill: `#skill-{name}`
2215
- - Read that section and follow the workflow
2216
-
2217
- 2. **Can't find the right skill**:
2218
- ```bash
2219
- # Check Section Index above for skill list
2220
- # Search this file for: #skill-increment-planner, #skill-github-sync, etc.
2221
- ```
2222
-
2223
- 3. **Skill workflow unclear**:
2224
- - Each skill section has "How It Works" and "Workflow" subsections
2225
- - Follow step-by-step instructions
2226
- - Check examples provided
2227
-
2228
- **Remember**: In non-Claude tools, YOU control skill discovery (search this file), not automatic activation!
2229
-
2230
- ---
2231
-
2232
- ### Commands Not Found {#troubleshoot-commands}
2233
-
2234
- **Symptoms**: `/specweave:increment` or other commands don't work
2235
-
2236
- **Solutions (Non-Claude Tools)**:
2237
- 1. **Commands are NOT slash commands in Cursor/Copilot** - They're workflows!
2238
- - Search this file for: `#command-increment`, `#command-do`, etc.
2239
- - Read the workflow from that section
2240
- - Execute manually (step by step)
2241
-
2242
- 2. **Example**: User says "create increment"
2243
- ```
2244
- You search: "#command-increment"
2245
- You find: ## Command: /specweave:increment {#command-increment}
2246
- You read: Workflow section (PM-led planning, spec creation, etc.)
2247
- You execute: Follow those steps manually
2248
- ```
2249
-
2250
- 3. **Command workflow unclear**:
2251
- - Each command section has detailed workflow
2252
- - Check "When to use", "Parameters", "Workflow", "Example"
2253
- - Follow step-by-step
2254
-
2255
- **Remember**: In non-Claude tools, commands are manual workflows, not automatic slash commands!
2256
-
2257
- ---
2258
-
2259
- ### Sync Issues {#troubleshoot-sync}
2260
-
2261
- **Symptoms**: GitHub/Jira not updating, living docs not syncing
2262
-
2263
- **Solutions (Non-Claude Tools)**:
2264
- 1. **No automatic hooks** - You must manually sync:
2265
- ```bash
2266
- # After EACH task completion:
2267
- /specweave:sync-tasks # Update tasks.md
2268
- /specweave:sync-docs update # Sync living docs
2269
- /specweave:github:sync <increment-id> # Sync to GitHub
2270
- ```
2271
-
2272
- 2. **Living docs sync not working**:
2273
- - Search for: `#workflow-living-docs-sync`
2274
- - Follow manual workflow from that section
2275
- - Check: `.specweave/docs/internal/specs/{project}/` for output
2276
-
2277
- 3. **GitHub sync not working**:
2278
- - Search for: `#workflow-github-sync`
2279
- - Verify credentials: `gh auth status`
2280
- - Check metadata: `cat .specweave/increments/0001/metadata.json`
2281
- - Manual sync: Follow workflow from `#command-github-sync`
2282
-
2283
- 4. **Jira sync not working**:
2284
- - Search for: `#workflow-jira-sync`
2285
- - Verify credentials: `jira config list`
2286
- - Manual sync: Follow workflow from `#command-jira-sync`
2287
-
2288
- **Remember**: Automatic sync ONLY works in Claude Code. In other tools, you must manually run sync commands!
2289
-
2290
- ---
2291
-
2292
- ### Root Folder Polluted {#troubleshoot-root-pollution}
2293
-
2294
- **Symptoms**: `git status` shows `.md` files in project root
2295
-
2296
- **Solutions**:
2297
- 1. **Immediate fix** - Move files to increment folder:
2298
- ```bash
2299
- # Find current increment
2300
- CURRENT=$(ls -t .specweave/increments/ | grep -v "_backlog" | head -1)
2301
-
2302
- # Move files
2303
- mv SESSION-NOTES.md .specweave/increments/$CURRENT/reports/
2304
- mv analysis.md .specweave/increments/$CURRENT/reports/
2305
- mv migration.py .specweave/increments/$CURRENT/scripts/
2306
- mv execution.log .specweave/increments/$CURRENT/logs/
2307
- ```
2308
-
2309
- 2. **Update .gitignore** if needed:
2310
- ```bash
2311
- echo "/*.md" >> .gitignore # Ignore all root .md files except CLAUDE.md
2312
- echo "!CLAUDE.md" >> .gitignore
2313
- echo "!README.md" >> .gitignore
2314
- ```
2315
-
2316
- 3. **Commit cleaned structure**:
2317
- ```bash
2318
- git add .
2319
- git commit -m "fix: move reports/scripts/logs to increment folders"
2320
- ```
2321
-
2322
- **Prevention**: Always create files in increment folders (reports/, scripts/, logs/), NEVER in root!
2323
-
2324
- ---
2325
-
2326
- ### Duplicate Increments {#troubleshoot-duplicates}
2327
-
2328
- **Symptoms**: Multiple increments with same number (0001, 0001, etc.)
2329
-
2330
- **Solutions**:
2331
- 1. **Check for duplicates**:
2332
- ```bash
2333
- ls -1 .specweave/increments/ | grep -E "^[0-9]{4}-" | sort
2334
- # Look for duplicate numbers
2335
- ```
2336
-
2337
- 2. **Find next available number**:
2338
- ```bash
2339
- ls -1 .specweave/increments/ | grep -E "^[0-9]{4}-" | sort | tail -1
2340
- # Increment the number by 1
2341
- ```
2342
-
2343
- 3. **Fix duplicates** (if they exist):
2344
- - Search for: `#command-fix-duplicates`
2345
- - Follow manual workflow to resolve
2346
-
2347
- **Prevention**: Always check existing increments before creating new ones!
2348
-
2349
- ---
2350
-
2351
- ### Tasks.md Out of Sync {#troubleshoot-tasks-out-of-sync}
2352
-
2353
- **Symptoms**: Progress shows 0/24 but many tasks actually done
2354
-
2355
- **Solutions**:
2356
- 1. **Auto-sync from reality**:
2357
- - Search for: `#command-sync-tasks`
2358
- - Follow workflow to sync tasks.md with actual status
2359
-
2360
- 2. **Manual update**:
2361
- ```bash
2362
- # Open tasks.md
2363
- vim .specweave/increments/0001/tasks.md
2364
-
2365
- # Change completed tasks:
2366
- **Status**: [ ] pending → **Status**: [x] completed
2367
-
2368
- # Update progress counters:
2369
- **Completed**: 0 → **Completed**: 15
2370
- **Progress**: 0% → **Progress**: 62% (15/24 = 62%)
2371
- ```
2372
-
2373
- 3. **Verify sync**:
2374
- - Search for: `#command-progress`
2375
- - Run progress check to verify correct counts
2376
-
2377
- **Prevention**: In non-Claude tools, manually update tasks.md after EACH task completion!
2378
-
2379
- ---
2380
-
2381
- ### Can't Find Current Increment {#troubleshoot-find-increment}
2382
-
2383
- **Symptoms**: Don't know which increment is active
2384
-
2385
- **Solutions**:
2386
- 1. **Check active increment**:
2387
- ```bash
2388
- cat .specweave/state/active-increment.json
2389
- ```
2390
-
2391
- 2. **List all increments with status**:
2392
- - Search for: `#command-status`
2393
- - Follow workflow to see all increments and their states
2394
-
2395
- 3. **Check progress**:
2396
- - Search for: `#command-progress`
2397
- - Shows active increment and completion %
2398
-
2399
- ---
2400
-
2401
- ### Commands Taking Too Long {#troubleshoot-slow-commands}
2402
-
2403
- **Symptoms**: Command workflows seem to take forever
2404
-
2405
- **Solutions**:
2406
- 1. **Loading entire AGENTS.md** - This is normal!
2407
- - File is 2000+ lines (comprehensive)
2408
- - Use search (Ctrl+F) to jump to relevant sections
2409
- - Don't read everything - only what you need
2410
-
2411
- 2. **Too much context loaded**:
2412
- - Check for `context-manifest.yaml` in increment folder
2413
- - Load ONLY files listed there
2414
- - Don't load entire `.specweave/docs/` folder
2415
-
2416
- 3. **Workflow unclear**:
2417
- - Each section has step-by-step workflow
2418
- - Follow instructions precisely
2419
- - Check examples
2420
-
2421
- **Optimization**: Use Section Index above to quickly find and jump to relevant sections!
2422
-
2423
- ---
2424
-
2425
- ### Living Docs Not Updating {#troubleshoot-living-docs}
2426
-
2427
- **Symptoms**: `.specweave/docs/internal/specs/` not showing new user stories
2428
-
2429
- **Solutions**:
2430
- 1. **Manual sync required** (non-Claude tools):
2431
- - Search for: `#command-sync-docs`
2432
- - Follow workflow to sync increment → living docs
2433
-
2434
- 2. **Check spec distribution**:
2435
- ```bash
2436
- # After sync, verify files exist:
2437
- ls -la .specweave/docs/internal/specs/{project}/
2438
- # Should show FS-XXX folders with us-XXX.md files
2439
- ```
2440
-
2441
- 3. **Verify project detection**:
2442
- ```bash
2443
- # Check increment name for project hint:
2444
- ls .specweave/increments/
2445
- # Example: 0001-backend-auth → project: backend
2446
- # 0002-frontend-ui → project: frontend
2447
- ```
2448
-
2449
- **Prevention**: Run `/specweave:sync-docs update` after completing increments!
2450
-
2451
- ---
2452
-
2453
- ### External Tracker Credentials {#troubleshoot-credentials}
2454
-
2455
- **Symptoms**: GitHub/Jira sync fails with auth errors
2456
-
2457
- **Solutions**:
2458
-
2459
- **For GitHub**:
2460
- ```bash
2461
- # Check auth status
2462
- gh auth status
2463
-
2464
- # Re-authenticate if needed
2465
- gh auth login
2466
-
2467
- # Test access
2468
- gh repo view
2469
- ```
2470
-
2471
- **For Jira**:
2472
- ```bash
2473
- # Check config
2474
- jira config list
2475
-
2476
- # Set up credentials
2477
- jira init
2478
-
2479
- # Test access
2480
- jira issue list --project PROJ
2481
- ```
2482
-
2483
- **For Azure DevOps**:
2484
- ```bash
2485
- # Check auth
2486
- az account show
2487
-
2488
- # Login if needed
2489
- az login
2490
-
2491
- # Set default org/project
2492
- az devops configure --defaults organization=https://dev.azure.com/YOUR_ORG project=YOUR_PROJECT
2493
- ```
2494
-
2495
- ---
2496
-
2497
- ### Context Manifest Not Working {#troubleshoot-context-manifest}
2498
-
2499
- **Symptoms**: Loading too many files, high token usage
2500
-
2501
- **Solutions**:
2502
- 1. **Check for context-manifest.yaml**:
2503
- ```bash
2504
- ls .specweave/increments/0001/context-manifest.yaml
2505
- ```
2506
-
2507
- 2. **If missing, create one**:
2508
- ```yaml
2509
- # .specweave/increments/0001/context-manifest.yaml
2510
- spec_sections:
2511
- - .specweave/docs/internal/strategy/relevant-spec.md
2512
- documentation:
2513
- - .specweave/docs/internal/architecture/relevant-design.md
2514
- max_context_tokens: 10000
2515
- ```
2516
-
2517
- 3. **Load ONLY files listed**:
2518
- - Read context-manifest.yaml first
2519
- - Load files from `spec_sections` and `documentation`
2520
- - Don't load entire `.specweave/docs/` folder
2521
-
2522
- **Token Savings**: 70%+ reduction when using context manifests!
2523
-
2524
- ---
2525
-
2526
- ### Version Conflicts {#troubleshoot-version-conflicts}
2527
-
2528
- **Symptoms**: SpecWeave commands fail with unexpected errors, missing files, or format incompatibilities
2529
-
2530
- **Solutions**:
2531
- 1. **Check SpecWeave version**:
2532
- ```bash
2533
- specweave --version
2534
- # Compare with project requirements
2535
- ```
2536
-
2537
- 2. **Update SpecWeave CLI**:
2538
- ```bash
2539
- npm install -g specweave@latest
2540
- # Or for local project:
2541
- npm install specweave@latest
2542
- ```
2543
-
2544
- 3. **Check project `.specweave/config.json`**:
2545
- ```bash
2546
- cat .specweave/config.json | grep version
2547
- # Verify compatible with CLI version
2548
- ```
2549
-
2550
- 4. **Migrate if needed**:
2551
- - Check CHANGELOG.md for breaking changes
2552
- - Follow migration guide for your version
2553
- - Update templates and plugins
2554
-
2555
- **Prevention**: Pin SpecWeave version in package.json and update intentionally
2556
-
2557
- ---
2558
-
2559
- ### Multi-Tool Confusion {#troubleshoot-multi-tool}
2560
-
2561
- **Symptoms**: Instructions mention Claude Code but I'm using Cursor/Copilot
2562
-
2563
- **Solutions**:
2564
- 1. **Look for multi-tool callouts**:
2565
- ```markdown
2566
- **For Claude Code**: ✅ Automatic via hooks
2567
- **For Other Tools**: ⚠️ manual sync required
2568
- ```
2569
-
2570
- 2. **If instruction says "automatic"**:
2571
- - In Claude Code: It's automatic
2572
- - In other tools: Find manual workflow section
2573
-
2574
- 3. **General pattern**:
2575
- - Claude Code: Commands via slash syntax, hooks automatic
2576
- - Other tools: Commands via manual workflows, sync manual
2577
-
2578
- **This file (AGENTS.md) is optimized for non-Claude tools!** Follow the manual workflows.
2579
-
2580
- ---
2581
-
2582
- ### More Help {#more-help}
2583
-
2584
- **Documentation**:
2585
- - Official docs: https://spec-weave.com/docs
2586
- - Troubleshooting guide: https://spec-weave.com/docs/troubleshooting
2587
- - Multi-tool guide: https://spec-weave.com/docs/multi-tool-support
2588
-
2589
- **Community**:
2590
- - GitHub Issues: https://github.com/anton-abyzov/specweave/issues
2591
- - Discussions: https://github.com/anton-abyzov/specweave/discussions
2592
- - Discord: https://discord.gg/specweave (if available)
2593
-
2594
- **Quick Reference**:
2595
- - Section Index: See top of this file
2596
- - Search patterns: `#command-*`, `#skill-*`, `#agent-*`, `#workflow-*`
2597
- - Quick reference cards: See `#quick-reference-cards` above
2598
-
2599
- **When reporting issues**:
2600
- 1. Tool used (Cursor, Copilot, ChatGPT, etc.)
2601
- 2. SpecWeave version: `specweave --version`
2602
- 3. Command/workflow attempted
2603
- 4. Error message or unexpected behavior
2604
- 5. Relevant files (metadata.json, config.json)
2605
-
2606
453
  ---
2607
454
 
2608
455
  ## Documentation
2609
456
 
2610
- - **CLAUDE.md**: Quick reference for Claude Code users
2611
- - **SPECWEAVE.md**: Complete framework documentation (if exists)
2612
- - **spec-weave.com**: Official website
2613
- - **.specweave/docs/**: Project-specific documentation
457
+ | Resource | Purpose |
458
+ |----------|---------|
459
+ | CLAUDE.md | Quick reference (Claude Code) |
460
+ | AGENTS.md | This file (non-Claude tools) |
461
+ | spec-weave.com | Official documentation |
462
+ | .specweave/docs/ | Project-specific docs |
2614
463
 
2615
464
  ---
2616
465
 
2617
- **Generated by SpecWeave** - Specification-first AI development framework
2618
- **Compatible with**: Claude Code, Cursor, Gemini CLI, Codex, GitHub Copilot, and more
466
+ **Generated by SpecWeave** - Specification-first AI development
467
+ **Compatible with**: Claude Code, Cursor, Copilot, Gemini CLI, ChatGPT, and more
2619
468
  **Last Updated**: {TIMESTAMP}