specweave 1.0.326 → 1.0.327

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.
@@ -1,269 +1,74 @@
1
1
  # {PROJECT_NAME}
2
2
 
3
3
  **Framework**: SpecWeave - Specification-First Development
4
- **Standard**: [agents.md](https://agents.md/) for universal AI compatibility
5
-
6
- ---
7
-
8
- > ⛔ **NON-CLAUDE TOOLS (Cursor, Copilot, etc.): READ THIS FIRST!**
9
- >
10
- > Before creating ANY increment, you MUST run: `specweave context projects`
11
- >
12
- > Then add `**Project**: <value>` to EVERY User Story in spec.md.
13
- > For 2-level structures, also add `**Board**: <value>`.
14
- >
15
- > **Missing this = increment creation will FAIL!**
16
- > See [#user-story-format](#user-story-format) for details.
17
-
18
- ---
19
-
20
- <!-- SECTION:index -->
21
- ## Section Index (Use Ctrl+F to Navigate)
22
-
23
- | Section | Search For | Purpose |
24
- |---------|------------|---------|
25
- | Rules | `#essential-rules` | Critical rules, file organization |
26
- | **Orchestration** | `#workflow-orchestration` | **Plan Mode, Subagents, Verification** |
27
- | **Principles** | `#core-principles` | **Quality: Simplicity, No Laziness** |
28
- | Commands | `#commands` | All SpecWeave commands |
29
- | **Hooks** | `#non-claude-tools` | **CRITICAL: Hook behavior to mimic** |
30
- | **User Story** | `#user-story-format` | **CRITICAL: Project/Board fields** |
31
- | Sync | `#sync-workflow` | When/how to sync |
32
- | Context | `#context-loading` | Efficient context loading |
33
- | Troubleshoot | `#troubleshooting` | Common issues |
34
- <!-- /SECTION -->
35
-
36
- ---
37
-
38
- <!-- SECTION:quickstart required -->
39
- ## Quick Start
40
-
41
- 1. **Get Project Context FIRST**: `specweave context projects` (save the output!)
42
- 2. **Create Your First Increment**: `/sw:increment "your-feature"`
43
- 3. **Customize**: Edit spec.md - **EVERY User Story needs `**Project**:` field!**
44
- 4. **Execute**: `/sw:do` to start implementation
45
- <!-- /SECTION -->
46
4
 
47
5
  ---
48
6
 
49
7
  <!-- SECTION:rules required -->
50
- ## Essential Rules {#essential-rules}
8
+ ## Essential Rules
51
9
 
52
10
  ```
53
11
  1. NEVER pollute project root with .md files
54
12
  2. Increment IDs unique (0001-9999)
55
- 3. ONLY 4 files in increment root: metadata.json, spec.md, plan.md, tasks.md
56
- 4. ALL reports/scripts/logs → increment subfolders (NEVER at root!)
13
+ 3. ONLY 4 files in increment root: metadata.json, spec.md, plan.md, tasks.md
14
+ 4. ALL reports/scripts/logs → increment subfolders (NEVER at root!)
57
15
  5. metadata.json MUST exist BEFORE spec.md can be created
58
16
  6. tasks.md + spec.md = SOURCE OF TRUTH (update after every task!)
59
- 7. EVERY User Story MUST have **Project**: field
60
- 8. For 2-level structures: EVERY US also needs **Board**: field
17
+ 7. EVERY User Story MUST have **Project**: field
18
+ 8. For 2-level structures: EVERY US also needs **Board**: field
61
19
  ```
62
20
 
63
- ### INCREMENT FOLDER CLEANLINESS (CRITICAL!)
21
+ ### Increment Folder Structure
64
22
 
65
- **Increment folders MUST stay organized. NEVER create random files at increment root!**
66
-
67
- | File Type | Correct Location |
68
- |-----------|-----------------|
69
- | Reports, summaries, analysis (*.md) | `reports/` |
70
- | Validation/QA/completion reports | `reports/` |
71
- | Auto-session summaries | `reports/` |
72
- | Logs, execution output | `logs/{YYYY-MM-DD}/` |
73
- | Helper scripts | `scripts/` |
74
- | Domain docs | `docs/domain/` |
75
-
76
- **File Organization**:
77
23
  ```
78
- # ✅ CORRECT - clean increment structure
79
24
  .specweave/increments/0001-feature/
80
25
  ├── metadata.json # REQUIRED - create FIRST
81
26
  ├── spec.md # WHAT & WHY
82
27
  ├── plan.md # HOW (optional)
83
28
  ├── tasks.md # Task checklist
84
29
  ├── reports/ # ALL other .md files go here!
85
- │ ├── validation-report.md
86
- │ ├── completion-report.md
87
- │ └── auto-session-summary.md
88
30
  ├── scripts/ # Helper scripts
89
31
  └── logs/ # Execution logs
90
32
  └── 2026-01-04/
91
-
92
- # ❌ WRONG - polluted increment folder!
93
- .specweave/increments/0001-feature/
94
- ├── metadata.json
95
- ├── spec.md
96
- ├── tasks.md
97
- ├── completion-report.md # WRONG! Move to reports/
98
- ├── auto-session-summary.md # WRONG! Move to reports/
99
- └── some-analysis.md # WRONG! Move to reports/
100
33
  ```
101
34
  <!-- /SECTION -->
102
35
 
103
36
  ---
104
37
 
105
38
  <!-- SECTION:orchestration required -->
106
- ## Workflow Orchestration {#workflow-orchestration}
107
-
108
- **Claude Code has built-in orchestration features. Non-Claude tools must implement these manually.**
39
+ ## Workflow Orchestration
109
40
 
110
- ### 1. Plan Mode Default (Use SpecWeave Increments!)
41
+ ### 1. Plan Before Code
111
42
 
112
- **Claude Code**: Has `EnterPlanMode` tool → triggers `/sw:increment` workflow automatically.
113
-
114
- **Non-Claude Tools - Use SpecWeave Increment Structure:**
115
- ```
116
43
  BEFORE implementing ANY non-trivial task (3+ steps):
44
+ 1. Create increment: spec.md (WHAT/WHY) + plan.md (HOW) + tasks.md (checklist)
45
+ 2. Get user approval before implementing
46
+ 3. If something goes sideways → STOP and re-plan
117
47
 
118
- 1. STOP - Don't start coding immediately
119
- 2. Create increment folder: `.specweave/increments/XXXX-feature/`
120
- 3. Create the 3 required files:
121
- - spec.md → WHAT & WHY (user stories, acceptance criteria)
122
- - plan.md → HOW (architecture, approach, risks)
123
- - tasks.md → Task checklist with test plans
124
- 4. GET USER APPROVAL before implementing
125
-
126
- If something goes sideways during implementation:
127
- → STOP and re-plan (don't keep pushing)
128
- → Update spec.md/plan.md with revised approach
129
- → Get approval again if scope changed
130
- ```
131
-
132
- **SpecWeave Planning Files:**
133
-
134
- **spec.md** (WHAT & WHY):
135
- ```markdown
136
- ---
137
- increment: 0001-feature-name
138
- title: "Feature Title"
139
- ---
140
-
141
- ### US-001: User Story Title
142
- **Project**: my-app # ← MANDATORY! Get from: specweave context projects
143
-
144
- **As a** [user type]
145
- **I want** [goal]
146
- **So that** [benefit]
147
-
148
- **Acceptance Criteria**:
149
- - [ ] **AC-US1-01**: [Criterion 1]
150
- - [ ] **AC-US1-02**: [Criterion 2]
151
- ```
152
-
153
- **plan.md** (HOW):
154
- ```markdown
155
- # Plan: Feature Name
156
-
157
- ## Approach
158
- [High-level architecture/approach]
159
-
160
- ## Risks & Decisions
161
- - [ ] Decision: [question needing user input]
162
- - Risk: [potential issue and mitigation]
163
- ```
164
-
165
- **tasks.md** (Checklist):
166
- ```markdown
167
- ### T-001: Task Title
168
- **User Story**: US-001
169
- **Satisfies ACs**: AC-US1-01
170
- **Status**: [ ] pending
171
-
172
- **Test Plan** (BDD):
173
- - Given [context] → When [action] → Then [result]
174
- ```
175
-
176
- ### 2. Subagent Strategy (Parallel Execution)
177
-
178
- **Claude Code**: Can spawn subagents with `Task` tool for parallel work.
179
-
180
- **Non-Claude Tools - Manual Parallelization:**
181
- ```
182
- For large exploration/analysis tasks:
183
-
184
- Option A: Sequential Breakdown
185
- 1. Split work into independent chunks
186
- 2. Process one chunk at a time
187
- 3. Aggregate results
188
-
189
- Option B: Parallel Prompts (Cursor/Copilot)
190
- 1. Open multiple chat sessions
191
- 2. Give each session one focused task
192
- 3. Combine outputs manually
193
-
194
- Best practices:
195
- - One task per "subagent" (focused execution)
196
- - Keep analysis/exploration separate from implementation
197
- - Use checklists to track parallel workstreams
198
- ```
199
-
200
- **When to use parallel approach:**
201
- - Codebase exploration (search multiple areas)
202
- - Multi-file analysis (review patterns across modules)
203
- - Batch validation (check multiple files for issues)
204
- - Large-scale refactoring analysis
205
-
206
- ### 3. Verification Before Done
207
-
208
- **Claude Code**: PostToolUse hooks validate completion automatically.
209
-
210
- **Non-Claude Tools - Manual Verification Checklist:**
211
- ```
212
- ⛔ NEVER mark a task complete without proving it works!
213
-
214
- Before marking ANY task as [x] completed:
215
-
216
- □ Code compiles/builds successfully
217
- □ Tests pass (run: npm test, pytest, etc.)
218
- □ Manual verification performed (if applicable)
219
- □ Acceptance criteria actually satisfied (re-read AC)
220
- □ No console errors in browser (for frontend)
221
- □ API returns expected responses (for backend)
48
+ See **Task Format** and **User Story Format** sections for templates.
222
49
 
223
- Ask yourself: "Would a staff engineer approve this?"
50
+ ### 2. Verify Before Done
224
51
 
225
- If answer is NO task is NOT complete
226
- ```
227
-
228
- **Verification Commands by Stack:**
229
- ```bash
230
- # JavaScript/TypeScript
231
- npm run build && npm test
232
-
233
- # Python
234
- pytest && mypy .
52
+ Never mark a task complete without proving it works:
53
+ - Code compiles/builds successfully
54
+ - Tests pass
55
+ - Acceptance criteria actually satisfied
56
+ - Ask: "Would a staff engineer approve this?"
235
57
 
236
- # .NET
237
- dotnet build && dotnet test
58
+ ### 3. Dependencies First
238
59
 
239
- # General
240
- git diff # Review what actually changed
241
- ```
242
-
243
- ### 4. Think-Before-Act (Dependencies)
244
-
245
- **Satisfy dependencies BEFORE dependent operations.**
60
+ Satisfy dependencies BEFORE dependent operations.
246
61
 
247
62
  ```
248
- ❌ Wrong: node script.js → Error → npm run build
249
- ✅ Correct: npm run build → node script.js → Success
250
-
251
- ❌ Wrong: Import module → Error → Install package
252
- ✅ Correct: npm install package → Import module → Success
63
+ Bad: node script.js → Error → npm run build
64
+ Good: npm run build → node script.js → Success
253
65
  ```
254
-
255
- **Dependency Detection Questions:**
256
- 1. Does this require a build step first?
257
- 2. Are all imports/packages installed?
258
- 3. Does this depend on another file being created?
259
- 4. Is there a database migration needed?
260
- 5. Are environment variables configured?
261
66
  <!-- /SECTION -->
262
67
 
263
68
  ---
264
69
 
265
70
  <!-- SECTION:principles required -->
266
- ## Core Principles (Quality) {#core-principles}
71
+ ## Core Principles (Quality)
267
72
 
268
73
  ### Simplicity First
269
74
  - Write the simplest code that solves the problem
@@ -305,9 +110,7 @@ git diff # Review what actually changed
305
110
  ---
306
111
 
307
112
  <!-- SECTION:commands required -->
308
- ## Commands Reference {#commands}
309
-
310
- ### Core Commands
113
+ ## Commands Reference
311
114
 
312
115
  | Command | Purpose |
313
116
  |---------|---------|
@@ -318,11 +121,6 @@ git diff # Review what actually changed
318
121
  | `/sw:validate 0001` | Quality check before closing |
319
122
  | `/sw:progress-sync` | Sync tasks.md with reality |
320
123
  | `/sw:sync-docs update` | Sync to living docs |
321
-
322
- ### Plugin Commands (when installed)
323
-
324
- | Command | Purpose |
325
- |---------|---------|
326
124
  | `/sw-github:sync 0001` | Sync increment to GitHub issue |
327
125
  | `/sw-jira:sync 0001` | Sync to Jira |
328
126
  | `/sw-ado:sync 0001` | Sync to Azure DevOps |
@@ -331,356 +129,76 @@ git diff # Review what actually changed
331
129
  ---
332
130
 
333
131
  <!-- SECTION:nonclaudetools required -->
334
- ## Non-Claude Tools (Cursor, Copilot, etc.) {#non-claude-tools}
335
-
336
- **CRITICAL**: Claude Code has automatic hooks and orchestration. Other tools DO NOT.
132
+ ## Non-Claude Tools (Cursor, Copilot, etc.)
337
133
 
338
- > **See also**: [Workflow Orchestration](#workflow-orchestration) for Plan Mode, Subagent Strategy, and Verification protocols.
134
+ Claude Code has automatic hooks and orchestration. Other tools must do these manually.
339
135
 
340
- ### Built-in vs Manual - Complete Comparison
136
+ ### Capability Comparison
341
137
 
342
138
  | Capability | Claude Code | Non-Claude Tools |
343
139
  |------------|-------------|------------------|
344
140
  | **Plan Mode** | `EnterPlanMode` → `/sw:increment` | Manual: Create spec.md + plan.md + tasks.md |
345
- | **Subagents** | `Task` tool spawns parallel agents | Manual: Split work, parallel prompts |
346
- | **Verification** | PostToolUse hooks validate | Manual: Run tests, check AC checklist |
141
+ | **Subagents** | `Task` tool for parallel work | Split into multiple chat sessions |
142
+ | **Verification** | PostToolUse hooks auto-validate | Manual: Run tests, check ACs |
347
143
  | **Hooks** | Auto-run on events | YOU must mimic (see below) |
348
144
  | **Task sync** | Automatic AC updates | Manual: Edit tasks.md + spec.md |
349
- | **Commands** | Slash syntax works | Read command .md, follow manually |
350
- | **Skills** | Auto-activate on keywords | Read SKILL.md, follow workflow |
351
-
352
- ### Latest Features
353
-
354
- SpecWeave v0.28+ introduces powerful automation that **works differently** in non-Claude tools:
355
-
356
- | Feature | Claude Code | Non-Claude Tools |
357
- |---------|-------------|------------------|
358
- | **Living Docs Builder** | Auto-runs after init | Use `specweave jobs --follow` to monitor |
359
- | **Bidirectional Sync** | Pull sync on session start | Run `specweave jobs` to check status |
360
- | **Background Jobs** | Automatic with hooks | Monitor with `specweave jobs` CLI |
361
- | **EDA Hooks** | Auto-detect task completion | Manually update tasks.md + spec.md |
362
-
363
- ### Background Jobs Workflow
364
- SpecWeave now runs heavy operations as **background jobs**:
365
-
366
- ```bash
367
- # Monitor all jobs
368
- specweave jobs
369
-
370
- # Follow a specific job
371
- specweave jobs --follow <job-id>
372
-
373
- # View job logs
374
- specweave jobs --logs <job-id>
375
-
376
- # Pause/resume long-running jobs
377
- specweave jobs --kill <job-id> # Pauses gracefully
378
- specweave jobs --resume <job-id> # Resumes from checkpoint
379
- ```
380
-
381
- **Job Types**:
382
- - `clone-repos` - Clone multiple repositories (ADO/GitHub)
383
- - `import-issues` - Import work items from external tools
384
- - `living-docs-builder` - Generate documentation from codebase
385
- - `sync-external` - Bidirectional sync with external tools
386
- - `brownfield-analysis` - Analyze existing/legacy codebases
387
- - `codebase-rescan` - Rescan codebase after increment closure
388
-
389
- **Job Dependencies**: The `living-docs-builder` waits for `clone-repos` and `import-issues` to complete before starting. This is automatic - just monitor with `specweave jobs`.
390
-
391
- ### Code-First Approach (MANDATORY for Non-Claude Tools)
392
-
393
- > **Engineering insight**: [Anthropic research](https://www.anthropic.com/engineering/code-execution-with-mcp) shows code execution achieves **98% token reduction** vs MCP tool calls.
394
- >
395
- > **For non-Claude tools, this is even MORE important** - MCP support varies, but `npx` works everywhere!
396
-
397
- **Rule**: Always prefer direct code execution over MCP:
398
-
399
- ```bash
400
- # ❌ DON'T: Use Playwright MCP for testing
401
- # ✅ DO: Write Playwright tests and run with npx
402
- npx playwright test
403
-
404
- # ❌ DON'T: Use Kafka MCP for messaging
405
- # ✅ DO: Write kafkajs code
406
- import { Kafka } from 'kafkajs';
407
- const kafka = new Kafka({ brokers: ['localhost:9092'] });
408
-
409
- # ❌ DON'T: Chain multiple MCP tool calls
410
- # ✅ DO: Write a script that does all the work
411
- npx ts-node scripts/process-data.ts
412
- ```
413
-
414
- **Why code is better**:
415
- | Aspect | MCP | Code (`npx`) |
416
- |--------|-----|--------------|
417
- | Token cost | High (tool defs + data duplication) | Low (only results) |
418
- | Reusability | Ephemeral | Committed to git |
419
- | CI/CD | Usually can't run | Native execution |
420
- | Debugging | Limited | Full stack traces |
421
- | Works with | Tools with MCP support | ANY tool |
422
-
423
- **Pattern for non-Claude tools**:
424
- ```
425
- 1. AI writes code (test, script, automation)
426
- 2. You run: npx <command>
427
- 3. AI analyzes output
428
- 4. Repeat
429
- ```
430
-
431
- This gives you the SAME experience as Claude Code with MCP, but deterministic and reusable!
432
-
433
- ### What's Different
434
-
435
- | Feature | Claude Code | Cursor/Copilot |
436
- |---------|-------------|----------------|
437
- | Commands | Slash syntax works | Manual workflow |
438
- | Hooks | Auto-run on events | **YOU must mimic** |
439
- | Task sync | Automatic | Manual |
440
- | GitHub/Jira sync | Automatic | Manual |
441
- | Living docs | Auto-updated | Manual |
442
-
443
- ### Hook Behavior You Must Mimic
444
-
445
- **Claude Code hooks do these automatically. YOU must do them manually:**
446
-
447
- #### 1. After EVERY Task Completion
448
- ```bash
449
- # Claude Code: PostToolUse hook detects task completion automatically
450
- # You must run these commands:
451
-
452
- # Step 1: Update tasks.md (source of truth)
453
- # Change: **Status**: [ ] pending → **Status**: [x] completed
454
-
455
- # Step 2: Update spec.md ACs (if task satisfies any)
456
- # Change: - [ ] AC-US1-01 → - [x] AC-US1-01
457
-
458
- # Step 3: Sync to external tools (if configured)
459
- /sw:progress-sync
460
- /sw-github:sync <increment-id> # If GitHub enabled
461
- /sw-jira:sync <increment-id> # If Jira enabled
462
- ```
463
-
464
- #### 2. After User Story Completion (all ACs satisfied)
465
- ```bash
466
- # Claude Code: PostToolUse hook detects US completion via AC pattern matching
467
- # When ALL acceptance criteria for a user story are [x] checked:
468
-
469
- # Step 1: Sync to living docs
470
- /sw:sync-docs update
471
-
472
- # Step 2: Update GitHub/Jira issue status
473
- /sw-github:sync <increment-id>
474
- ```
475
-
476
- #### 3. After Increment Completion
477
- ```bash
478
- # Claude Code: /sw:done skill orchestrates closure automatically
479
- # When running /sw:done:
480
-
481
- # Step 1: Validate all tasks complete
482
- /sw:validate <increment-id>
483
-
484
- # Step 2: Sync living docs
485
- /sw:sync-docs update
486
-
487
- # Step 3: Close external issues
488
- /sw-github:close-issue <increment-id>
489
- ```
145
+ | **Skills** | Auto-activate on keywords | Read SKILL.md, follow manually |
490
146
 
491
- #### 4. After Writing to spec.md or tasks.md
492
- ```bash
493
- # Claude Code: PostToolUse hook auto-syncs on spec/tasks edits
494
- # After any edit to spec.md or tasks.md:
495
-
496
- # Sync status line cache
497
- /sw:progress-sync
498
-
499
- # If external tools configured, sync progress
500
- /sw-github:sync <increment-id>
501
- ```
502
-
503
- #### 5. Session Start - Check External Changes
504
- ```bash
505
- # Claude hook: SessionStart (runs automatically)
506
- # For non-Claude tools, check for external changes manually:
507
-
508
- # Check if any background sync jobs ran
509
- specweave jobs
510
-
511
- # Check progress to see current state
512
- /sw:progress
513
-
514
- # If external tools are configured, sync progress
515
- /sw-github:sync <increment-id>
516
- /sw-jira:sync <increment-id>
517
- ```
518
-
519
- #### 6. After Init on Brownfield Project
520
- ```bash
521
- # SpecWeave automatically launches living-docs-builder job after init
522
- # For non-Claude tools, monitor it manually:
523
-
524
- # Check job status
525
- specweave jobs
526
-
527
- # Follow the living-docs-builder progress
528
- specweave jobs --follow <job-id>
529
-
530
- # The job runs in 6 phases:
531
- # 1. waiting - Waits for clone/import jobs to complete
532
- # 2. discovery - Scans codebase structure (no LLM, fast)
533
- # 3. foundation - Generates overview.md, tech-stack.md (1-2 hours)
534
- # 4. integration - Matches work items to discovered modules
535
- # 5. deep-dive - Analyzes modules one at a time with checkpoints
536
- # 6. suggestions - Generates SUGGESTIONS.md with next steps
537
-
538
- # Output locations:
539
- # - .specweave/docs/internal/architecture/overview.md
540
- # - .specweave/docs/internal/architecture/tech-stack.md
541
- # - .specweave/docs/internal/strategy/modules-skeleton.md
542
- # - .specweave/docs/internal/SUGGESTIONS.md
543
- ```
544
-
545
- ### How to Check if External Tools Configured
546
-
547
- ```bash
548
- # Check increment metadata for external tool config
549
- cat .specweave/increments/<id>/metadata.json
550
-
551
- # Look for these fields:
552
- # "github": { "issue": 123 } → GitHub enabled
553
- # "jira": { "issue": "PROJ-123" } → Jira enabled
554
- # "ado": { "item": 456 } → Azure DevOps enabled
555
- ```
556
-
557
- ### Manual Command Execution
147
+ ### Manual Hook Checklist
558
148
 
559
- In non-Claude tools, commands are markdown workflows:
149
+ **After EVERY task completion:**
150
+ 1. Update tasks.md: `[ ] pending` → `[x] completed`
151
+ 2. Update spec.md ACs if satisfied: `[ ] AC` → `[x] AC`
152
+ 3. Run `/sw:progress-sync`
153
+ 4. Run `/sw-github:sync <id>` (if GitHub configured)
560
154
 
561
- ```bash
562
- # Find and read command file
563
- cat plugins/specweave/commands/increment.md
564
- # Follow the workflow steps manually
565
- ```
155
+ **After all ACs for a User Story are done:**
156
+ - Run `/sw:sync-docs update`
566
157
 
567
- ### Quick Reference: After EVERY Task
158
+ **After increment completion:**
159
+ 1. `/sw:validate <id>`
160
+ 2. `/sw:sync-docs update`
161
+ 3. `/sw-github:close-issue <id>`
568
162
 
569
- ```
570
- ┌─────────────────────────────────────────────────────────────┐
571
- AFTER COMPLETING ANY TASK (MANDATORY FOR NON-CLAUDE TOOLS)
572
- ├─────────────────────────────────────────────────────────────┤
573
- │ 1. Update tasks.md: [ ] → [x] │
574
- │ 2. Update spec.md ACs if satisfied: [ ] → [x] │
575
- │ 3. Run: /sw:progress-sync │
576
- │ 4. Run: /sw-github:sync <id> (if GitHub configured) │
577
- │ 5. If all ACs for US done: /sw:sync-docs update │
578
- └─────────────────────────────────────────────────────────────┘
579
- ```
163
+ **Session start:**
164
+ 1. `specweave jobs` (check background jobs)
165
+ 2. `/sw:progress` (check current state)
166
+ 3. `/sw:do` (continue work)
580
167
 
581
- ### Quick Reference: Session Start Routine
582
- ```
583
- ┌─────────────────────────────────────────────────────────────┐
584
- │ START OF EVERY SESSION (FOR NON-CLAUDE TOOLS) │
585
- ├─────────────────────────────────────────────────────────────┤
586
- │ 1. Check job status: specweave jobs │
587
- │ 2. Check progress: /sw:progress │
588
- │ 3. Continue work: /sw:do │
589
- └─────────────────────────────────────────────────────────────┘
590
- ```
591
-
592
- **Without these manual steps, your work won't be tracked!**
168
+ **Background jobs**: Monitor with `specweave jobs` (clone-repos, import-issues, living-docs-builder, sync-external).
593
169
  <!-- /SECTION -->
594
170
 
595
171
  ---
596
172
 
597
173
  <!-- SECTION:syncworkflow -->
598
- ## Sync Workflow {#sync-workflow}
599
-
600
- ### Source of Truth Hierarchy
601
-
602
- ```
603
- ┌─────────────────────────────────────────────────────────────┐
604
- │ SOURCE OF TRUTH (edit here first!) │
605
- │ ├── tasks.md: Task completion status │
606
- │ └── spec.md: Acceptance criteria checkboxes │
607
- ├─────────────────────────────────────────────────────────────┤
608
- │ DERIVED (auto-updated via sync commands) │
609
- │ └── .specweave/docs/internal/specs/: Living documentation │
610
- ├─────────────────────────────────────────────────────────────┤
611
- │ MIRROR (synced to external tools) │
612
- │ ├── GitHub Issues: Task checklist, AC progress │
613
- │ ├── Jira Stories: Status, story points, completion │
614
- │ └── Azure DevOps: Work item state, task list │
615
- └─────────────────────────────────────────────────────────────┘
616
- ```
174
+ ## Sync Workflow
617
175
 
618
- **Update Order**: ALWAYS tasks.md/spec.md FIRST → sync-tasks → sync-docs → external tools
176
+ ### Source of Truth
619
177
 
620
- ### Sync Commands Reference
178
+ | Level | Location | Update Method |
179
+ |-------|----------|---------------|
180
+ | **Source** | tasks.md + spec.md | Edit directly |
181
+ | **Derived** | .specweave/docs/internal/specs/ | `/sw:sync-docs update` |
182
+ | **Mirror** | GitHub/Jira/ADO | `/sw-github:sync`, `/sw-jira:sync`, `/sw-ado:sync` |
621
183
 
622
- | Command | What It Does | When to Run |
623
- |---------|--------------|-------------|
624
- | `/sw:progress-sync` | Recalculates progress from tasks.md | After editing tasks.md |
625
- | `/sw:sync-docs update` | Updates living docs from increment | After US complete |
626
- | `/sw-github:sync <id>` | Syncs progress to GitHub issue | After each task |
627
- | `/sw-github:close-issue <id>` | Closes GitHub issue | On increment done |
628
- | `/sw-jira:sync <id>` | Syncs progress to Jira story | After each task |
629
- | `/sw-ado:sync <id>` | Syncs to Azure DevOps work item | After each task |
184
+ **Update order**: ALWAYS tasks.md/spec.md FIRST progress-sync sync-docs external tools
630
185
 
631
- ### Complete Sync Flow (Non-Claude Tools)
186
+ ### Sync Commands
632
187
 
633
- ```
634
- TASK COMPLETED
635
-
636
-
637
- ┌─────────────────────────────┐
638
- 1. Edit tasks.md │
639
- │ [ ] pending [x] done │
640
- └─────────────────────────────┘
641
-
642
-
643
- ┌─────────────────────────────┐
644
- │ 2. Edit spec.md ACs │
645
- │ [ ] AC → [x] AC │
646
- └─────────────────────────────┘
647
-
648
-
649
- ┌─────────────────────────────┐
650
- │ 3. /sw:progress-sync │
651
- │ Updates progress cache │
652
- └─────────────────────────────┘
653
-
654
-
655
- ┌─────────────────────────────┐
656
- │ 4. /sw-github:sync │
657
- │ Updates GitHub issue │
658
- └─────────────────────────────┘
659
-
660
- ▼ (if all ACs for US done)
661
- ┌─────────────────────────────┐
662
- │ 5. /sw:sync-docs │
663
- │ Updates living docs │
664
- └─────────────────────────────┘
665
- ```
666
-
667
- ### Claude Code Hooks (Automatic)
668
-
669
- | Hook | Trigger | What It Does |
670
- |------|---------|--------------|
671
- | `SessionStart` | Session begins | Loads config, checks active increments |
672
- | `UserPromptSubmit` | Every prompt | WIP limits, discipline checks, intent detection |
673
- | `PreToolUse` | Before file write/edit | Validates spec constraints |
674
- | `PostToolUse` | After file write/edit | Detects task completion, syncs progress, updates GitHub/Jira |
675
- | `Stop` | Session ends | Cleanup, state persistence |
676
-
677
- **Non-Claude tools**: NO HOOKS EXIST. See "Hook Behavior You Must Mimic" section above.
188
+ | Command | When to Run |
189
+ |---------|-------------|
190
+ | `/sw:progress-sync` | After editing tasks.md |
191
+ | `/sw:sync-docs update` | After US complete |
192
+ | `/sw-github:sync <id>` | After each task |
193
+ | `/sw-github:close-issue <id>` | On increment done |
194
+ | `/sw-jira:sync <id>` | After each task |
195
+ | `/sw-ado:sync <id>` | After each task |
678
196
  <!-- /SECTION -->
679
197
 
680
198
  ---
681
199
 
682
200
  <!-- SECTION:contextloading -->
683
- ## Context Loading {#context-loading}
201
+ ## Context Loading
684
202
 
685
203
  ### Efficient Context Management
686
204
 
@@ -757,49 +275,13 @@ umbrella-project/
757
275
 
758
276
  {SKILLS_SECTION}
759
277
 
760
- **Usage for Claude Code**: Skills auto-activate based on keywords in your prompt.
761
-
762
- **Usage for Non-Claude Tools (Cursor, Copilot, etc.)**:
763
- Skills don't auto-activate. You must manually load them:
764
-
765
- ```bash
766
- # Step 1: Find relevant skill
767
- ls plugins/specweave*/skills/
768
-
769
- # Step 2: Read the skill file
770
- cat plugins/specweave/skills/increment/SKILL.md
771
-
772
- # Step 3: Tell AI to follow the skill's workflow
773
- "Follow the increment skill workflow to create my feature"
774
-
775
- # Step 4: AI reads skill content and follows instructions
776
- ```
777
-
778
- **Skill Simulation Pattern**:
779
- ```
780
- Non-Claude AI Tools simulate skills by:
781
- 1. Reading SKILL.md files from plugins/ folder
782
- 2. Following the workflow instructions inside
783
- 3. Using the patterns and templates provided
784
- 4. Running `npx` commands instead of MCP tools (code-first!)
785
- ```
278
+ **Claude Code**: Skills auto-activate based on keywords in your prompt.
786
279
 
787
- **Example** - Creating increment with Cursor:
788
- ```
789
- User: "Create an increment for user authentication"
790
-
791
- # STEP 0: AI MUST run this first!
792
- AI: [Runs: specweave context projects]
793
- AI: [Gets output: {"level":1,"projects":[{"id":"my-app"}]}]
794
- AI: [Stores: RESOLVED_PROJECT = "my-app"]
795
-
796
- # Then follow the skill workflow
797
- AI: [Reads plugins/specweave/skills/increment/SKILL.md]
798
- AI: [Follows PM workflow: research → spec → plan → tasks]
799
- AI: [Creates .specweave/increments/0001-auth/spec.md with **Project**: my-app per US!]
800
- ```
801
-
802
- **⛔ CRITICAL**: The AI MUST run `specweave context projects` BEFORE creating spec.md, and use the output values in every `**Project**:` field!
280
+ **Non-Claude Tools**: Skills don't auto-activate. Manually load them:
281
+ 1. Find: `ls plugins/specweave*/skills/`
282
+ 2. Read: `cat plugins/specweave/skills/<name>/SKILL.md`
283
+ 3. Follow the workflow instructions inside
284
+ 4. Run `specweave context projects` BEFORE creating any increment
803
285
  <!-- /SECTION -->
804
286
 
805
287
  ---
@@ -821,9 +303,9 @@ AI: [Creates .specweave/increments/0001-auth/spec.md with **Project**: my-app pe
821
303
  ---
822
304
 
823
305
  <!-- SECTION:usformat required -->
824
- ## User Story Format (CRITICAL for spec.md) {#user-story-format}
306
+ ## User Story Format (CRITICAL for spec.md)
825
307
 
826
- **⛔ MANDATORY: Every User Story MUST have `**Project**:` field!**
308
+ **MANDATORY: Every User Story MUST have `**Project**:` field!**
827
309
 
828
310
  ```markdown
829
311
  ### US-001: Feature Name
@@ -860,176 +342,39 @@ specweave context projects
860
342
  ## Workflows
861
343
 
862
344
  ### Creating Increment
863
-
864
- **⛔ STEP 0: Get Project Context FIRST (BLOCKING!)**
865
- ```bash
866
- # YOU CANNOT CREATE spec.md UNTIL YOU COMPLETE THIS STEP!
867
- specweave context projects
868
- # Store the output - you'll need project IDs for every User Story
869
- ```
870
-
871
- **Main Steps:**
872
- 1. `mkdir -p .specweave/increments/0001-feature`
873
- 2. Create `metadata.json` (increment metadata) - **MUST be FIRST**
874
- 3. Create `spec.md` (WHAT/WHY, user stories, ACs) - **EVERY US needs `**Project**:` field!**
875
- 4. Create `tasks.md` (task checklist with tests)
876
- 5. Optional: Create `plan.md` (HOW, architecture) for complex features
877
-
878
- **Example spec.md (CORRECT):**
879
- ```markdown
880
- ---
881
- increment: 0001-feature-name
882
- title: "Feature Title"
883
- ---
884
-
885
- ### US-001: Login Form
886
- **Project**: my-app # ← Value from step 0!
887
-
888
- **As a** user
889
- **I want** to log in
890
- **So that** I can access my account
891
-
892
- **Acceptance Criteria**:
893
- - [ ] **AC-US1-01**: Login form displays username/password fields
894
- ```
895
-
896
- **Example spec.md (WRONG - WILL FAIL!):**
897
- ```markdown
898
- ### US-001: Login Form
899
- **As a** user # ← Missing **Project**: = BLOCKED!
900
- **I want** to log in
901
- ```
345
+ 1. Run `specweave context projects` → store project IDs
346
+ 2. `mkdir -p .specweave/increments/XXXX-feature`
347
+ 3. Create `metadata.json` (MUST be FIRST)
348
+ 4. Create `spec.md` every US needs `**Project**:` field (see User Story Format)
349
+ 5. Create `tasks.md` (task checklist with BDD tests)
350
+ 6. Optional: `plan.md` for complex features
902
351
 
903
352
  ### Completing Tasks
904
353
  1. Implement the task
905
- 2. Update `tasks.md`: `[ ] pending` → `[x] completed`
906
- 3. Update `spec.md`: Check off satisfied ACs
354
+ 2. Update tasks.md: `[ ] pending` → `[x] completed`
355
+ 3. Update spec.md: check off satisfied ACs
907
356
  4. Sync to external trackers if enabled
908
357
 
909
358
  ### Closing Increment
910
- 1. Run `/sw:done 0001`
911
- 2. PM validates 3 gates (tasks, tests, docs)
912
- 3. Living docs synced automatically
913
- 4. GitHub issue closed (if enabled)
914
- <!-- /SECTION -->
915
-
916
- ---
917
-
918
- <!-- SECTION:plugincommands -->
919
- ## Plugin Commands
920
-
921
- | Command | Plugin |
922
- |---------|--------|
923
- | `/sw-github:sync` | GitHub sync |
924
- | `/sw-jira:sync` | Jira sync |
925
- | `/sw-ado:sync` | Azure DevOps |
359
+ 1. `/sw:done 0001` — PM validates 3 gates (tasks, tests, docs)
360
+ 2. Living docs synced automatically
361
+ 3. GitHub/Jira issue closed if enabled
926
362
  <!-- /SECTION -->
927
363
 
928
364
  ---
929
365
 
930
366
  <!-- SECTION:troubleshooting required -->
931
- ## Troubleshooting {#troubleshooting}
932
-
933
- ### Commands Not Working
934
-
935
- **Non-Claude tools**: Commands are markdown workflows, not slash syntax.
936
-
937
- ```bash
938
- # Find and read the command file
939
- ls plugins/specweave/commands/
940
- cat plugins/specweave/commands/increment.md
941
- # Follow the workflow steps manually
942
- ```
943
-
944
- ### Sync Issues
945
-
946
- **Symptoms**: GitHub/Jira not updating, living docs stale
947
-
948
- **Solution** (run after EVERY task in non-Claude tools):
949
- ```bash
950
- /sw:progress-sync # Update tasks.md
951
- /sw:sync-docs update # Sync living docs
952
- /sw-github:sync <increment-id> # Sync to GitHub
953
- ```
954
-
955
- ### Root Folder Polluted
956
-
957
- **Symptoms**: `git status` shows .md files in project root
958
-
959
- **Fix**:
960
- ```bash
961
- CURRENT=$(ls -t .specweave/increments/ | head -1)
962
- mv *.md .specweave/increments/$CURRENT/reports/
963
- ```
964
-
965
- ### Tasks Out of Sync
966
-
967
- **Symptoms**: Progress shows wrong completion %
968
-
969
- **Fix**: Update tasks.md manually:
970
- ```markdown
971
- **Status**: [ ] pending → **Status**: [x] completed
972
- ```
973
-
974
- Or run: `/sw:progress-sync`
975
-
976
- ### Context Explosion / Crashes
977
-
978
- **Symptoms**: Tool crashes 10-50s after start
979
-
980
- **Causes**: Loading too many files at once
981
-
982
- **Fix**:
983
- 1. Load only the active increment's spec.md and tasks.md
984
- 2. Reference living docs only when needed for specific tasks
985
- 3. Never load entire `.specweave/docs/` folder at once
986
-
987
- ### Increment Creation Fails / Missing **Project**: Field
988
-
989
- **Symptoms**: Increment creation blocked, validation errors about missing `**Project**:` field
990
-
991
- **Cause**: Every User Story in spec.md MUST have `**Project**:` (and `**Board**:` for 2-level structures)
992
-
993
- **Fix**:
994
- ```bash
995
- # 1. Get valid project IDs
996
- specweave context projects
997
-
998
- # 2. Add **Project**: to EVERY user story in spec.md
999
- ### US-001: Feature Name
1000
- **Project**: my-app # ← Add this line!
1001
- **As a** user...
1002
-
1003
- # 3. For 2-level structures, also add **Board**:
1004
- **Project**: corp
1005
- **Board**: digital-ops # ← Add for 2-level!
1006
- ```
1007
-
1008
- **Why this happens**: Non-Claude tools don't have hooks that auto-detect project context. You MUST run `specweave context projects` BEFORE creating any increment and use those values in every User Story.
1009
-
1010
- ### Skills/Agents Not Activating
1011
-
1012
- **Non-Claude tools**: Skills don't auto-activate. This is EXPECTED.
1013
-
1014
- **Manual activation (Cursor, Copilot, Windsurf, etc.)**:
1015
- ```bash
1016
- # 1. Find skills in plugins folder (NOT .claude/)
1017
- ls plugins/specweave*/skills/
1018
-
1019
- # 2. Read the skill file
1020
- cat plugins/specweave/skills/e2e-playwright/SKILL.md
1021
-
1022
- # 3. Tell AI to follow it
1023
- "Read the e2e-playwright skill and write tests for my login page"
1024
-
1025
- # 4. AI writes code, YOU run it (code-first!)
1026
- npx playwright test
1027
- ```
1028
-
1029
- **Remember**: Non-Claude tools get SAME functionality by:
1030
- - Reading skill files manually
1031
- - Following the workflows inside
1032
- - Running `npx` instead of MCP tools (better anyway!)
367
+ ## Troubleshooting
368
+
369
+ | Issue | Fix |
370
+ |-------|-----|
371
+ | Commands not working (non-Claude) | Read `plugins/specweave/commands/<name>.md`, follow manually |
372
+ | GitHub/Jira not updating | `/sw:progress-sync` → `/sw:sync-docs update` → `/sw-github:sync <id>` |
373
+ | .md files in project root | `mv *.md .specweave/increments/<current>/reports/` |
374
+ | Progress % wrong | Update tasks.md manually or `/sw:progress-sync` |
375
+ | Tool crashes on start | Load only active increment's spec.md + tasks.md, not entire docs/ |
376
+ | Missing **Project**: field | `specweave context projects`, add `**Project**:` to every US |
377
+ | Skills not activating (non-Claude) | Expected — read SKILL.md from `plugins/specweave*/skills/` |
1033
378
  <!-- /SECTION -->
1034
379
 
1035
380
  ---
@@ -1040,7 +385,7 @@ npx playwright test
1040
385
  | Resource | Purpose |
1041
386
  |----------|---------|
1042
387
  | CLAUDE.md | Quick reference (Claude Code) |
1043
- | AGENTS.md | This file (non-Claude tools) |
388
+ | AGENTS.md | This file (all AI tools) |
1044
389
  | spec-weave.com | Official documentation |
1045
390
  | .specweave/docs/ | Project-specific docs |
1046
391
  <!-- /SECTION -->