specweave 0.32.3 → 0.32.5

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 (62) hide show
  1. package/CLAUDE.md +12 -9
  2. package/dist/src/cli/commands/init-multiproject.js +1 -1
  3. package/dist/src/cli/commands/init-multiproject.js.map +1 -1
  4. package/dist/src/cli/commands/migrate-to-multiproject.js +2 -2
  5. package/dist/src/cli/commands/migrate-to-multiproject.js.map +1 -1
  6. package/dist/src/core/living-docs/cross-project-sync.d.ts +97 -0
  7. package/dist/src/core/living-docs/cross-project-sync.d.ts.map +1 -0
  8. package/dist/src/core/living-docs/cross-project-sync.js +135 -0
  9. package/dist/src/core/living-docs/cross-project-sync.js.map +1 -0
  10. package/dist/src/core/living-docs/external-sync-orchestrator.d.ts +106 -0
  11. package/dist/src/core/living-docs/external-sync-orchestrator.d.ts.map +1 -0
  12. package/dist/src/core/living-docs/external-sync-orchestrator.js +146 -0
  13. package/dist/src/core/living-docs/external-sync-orchestrator.js.map +1 -0
  14. package/dist/src/core/living-docs/living-docs-sync.d.ts +1 -0
  15. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  16. package/dist/src/core/living-docs/living-docs-sync.js +77 -2
  17. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  18. package/dist/src/core/living-docs/sync-helpers/generators.d.ts +8 -1
  19. package/dist/src/core/living-docs/sync-helpers/generators.d.ts.map +1 -1
  20. package/dist/src/core/living-docs/sync-helpers/generators.js +18 -1
  21. package/dist/src/core/living-docs/sync-helpers/generators.js.map +1 -1
  22. package/dist/src/core/living-docs/sync-helpers/index.d.ts +1 -1
  23. package/dist/src/core/living-docs/sync-helpers/index.d.ts.map +1 -1
  24. package/dist/src/core/living-docs/sync-helpers/index.js.map +1 -1
  25. package/dist/src/core/living-docs/sync-helpers/parsers.d.ts +3 -1
  26. package/dist/src/core/living-docs/sync-helpers/parsers.d.ts.map +1 -1
  27. package/dist/src/core/living-docs/sync-helpers/parsers.js +24 -2
  28. package/dist/src/core/living-docs/sync-helpers/parsers.js.map +1 -1
  29. package/dist/src/core/living-docs/types.d.ts +6 -0
  30. package/dist/src/core/living-docs/types.d.ts.map +1 -1
  31. package/dist/src/core/living-docs/validators/index.d.ts +7 -0
  32. package/dist/src/core/living-docs/validators/index.d.ts.map +1 -0
  33. package/dist/src/core/living-docs/validators/index.js +7 -0
  34. package/dist/src/core/living-docs/validators/index.js.map +1 -0
  35. package/dist/src/core/living-docs/validators/project-validator.d.ts +92 -0
  36. package/dist/src/core/living-docs/validators/project-validator.d.ts.map +1 -0
  37. package/dist/src/core/living-docs/validators/project-validator.js +142 -0
  38. package/dist/src/core/living-docs/validators/project-validator.js.map +1 -0
  39. package/dist/src/core/project/project-manager.d.ts.map +1 -1
  40. package/dist/src/core/project/project-manager.js +19 -17
  41. package/dist/src/core/project/project-manager.js.map +1 -1
  42. package/dist/src/core/types/config.d.ts +4 -2
  43. package/dist/src/core/types/config.d.ts.map +1 -1
  44. package/dist/src/core/types/config.js.map +1 -1
  45. package/dist/src/core/types/increment-metadata.d.ts +34 -0
  46. package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
  47. package/dist/src/utils/cross-cutting-detector.d.ts +66 -0
  48. package/dist/src/utils/cross-cutting-detector.d.ts.map +1 -0
  49. package/dist/src/utils/cross-cutting-detector.js +179 -0
  50. package/dist/src/utils/cross-cutting-detector.js.map +1 -0
  51. package/dist/src/utils/project-detection.d.ts +12 -8
  52. package/dist/src/utils/project-detection.d.ts.map +1 -1
  53. package/dist/src/utils/project-detection.js +13 -19
  54. package/dist/src/utils/project-detection.js.map +1 -1
  55. package/package.json +1 -1
  56. package/plugins/specweave/commands/specweave-status.md +64 -0
  57. package/plugins/specweave/hooks/hooks.json +1 -1
  58. package/plugins/specweave/hooks/spec-project-validator.sh +2 -1
  59. package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +34 -0
  60. package/plugins/specweave/skills/increment-planner/SKILL.md +77 -2
  61. package/plugins/specweave/skills/spec-generator/SKILL.md +78 -7
  62. package/plugins/specweave/commands/specweave-switch-project.md +0 -168
@@ -66,18 +66,53 @@ board: my-board # REQUIRED for 2-level structures (ADO area paths,
66
66
  ## User Stories & Acceptance Criteria
67
67
 
68
68
  <!--
69
- ⚠️ MULTI-PROJECT MODE: If umbrella.enabled=true in config.json,
70
- user stories MUST be project-scoped! See section below.
69
+ ⚠️ PER-US PROJECT TARGETING (v0.33.0+):
70
+ Each user story MUST have **Project**: (and **Board**: for 2-level) fields.
71
+ The LLM MUST resolve these from context - see RULE 0 in increment-planner.
71
72
  -->
72
73
 
73
74
  ### US-001: [Title]
75
+ **Project**: [resolved-from-context] <!-- REQUIRED - actual project ID from config/folders -->
76
+ **Board**: [resolved-from-context] <!-- REQUIRED for 2-level structures -->
77
+
74
78
  **As a** [user type]
75
79
  **I want** [goal]
76
80
  **So that** [benefit]
77
81
 
78
82
  **Acceptance Criteria**:
79
- - [Criterion 1]
80
- - [Criterion 2]
83
+ - [ ] **AC-US1-01**: [Criterion 1]
84
+ - [ ] **AC-US1-02**: [Criterion 2]
85
+
86
+ ---
87
+
88
+ ### Per-US Project Resolution (v0.33.0+ MANDATORY)
89
+
90
+ **🧠 USE ALL AVAILABLE CONTEXT TO RESOLVE PROJECT/BOARD:**
91
+
92
+ Before generating spec.md, analyze:
93
+ 1. **Living docs folders**: `ls .specweave/docs/internal/specs/` → actual project IDs
94
+ 2. **Recent increment patterns**: `grep "**Project**:" .specweave/increments/*/spec.md`
95
+ 3. **Config projectMappings**: Exact project IDs from config
96
+ 4. **Feature keywords**: Map to actual projects (not generic terms)
97
+
98
+ **Resolution Example:**
99
+ ```
100
+ Feature: "Add OAuth login to React frontend"
101
+ Detected: "React", "frontend", "login"
102
+
103
+ Step 1: Check living docs → folders: frontend-app/, backend-api/, shared/
104
+ Step 2: "frontend" keyword → matches "frontend-app" folder
105
+ Step 3: Assign **Project**: frontend-app (NOT "frontend"!)
106
+
107
+ If cross-cutting ("OAuth" = both frontend + backend):
108
+ US-001 (Login UI) → **Project**: frontend-app
109
+ US-002 (Auth API) → **Project**: backend-api
110
+ ```
111
+
112
+ **NEVER:**
113
+ - ❌ Use generic keywords as project names ("frontend", "backend")
114
+ - ❌ Ask user when context provides the answer
115
+ - ❌ Leave `{{PROJECT_ID}}` placeholders
81
116
 
82
117
  ## Success Metrics
83
118
  [How we'll measure success]
@@ -392,9 +427,45 @@ spec_generator:
392
427
  - Multiple project folders exist in `specs/` (e.g., `sw-app-fe/`, `sw-app-be/`, `sw-app-shared/`)
393
428
  - User prompt mentions: "3 repos", "frontend repo", "backend API", "shared library"
394
429
 
395
- ### Project-Scoped User Story Format (MANDATORY in Multi-Project Mode)
430
+ ### Per-User-Story Project Targeting (v0.33.0+ PREFERRED)
431
+
432
+ **v0.33.0+ introduces per-US project targeting** - each user story specifies its target project inline:
433
+
434
+ ```markdown
435
+ ## User Stories
436
+
437
+ ### US-001: Thumbnail Upload & Comparison (P1)
438
+ **Project**: frontend-app
439
+ **Board**: ui-team <!-- 2-level structures only -->
440
+ **As a** content creator
441
+ **I want** to upload multiple thumbnail variants
442
+ **So that** I can visually evaluate my options
443
+
444
+ **Acceptance Criteria**:
445
+ - [ ] **AC-US1-01**: User can drag-and-drop up to 5 images
446
+
447
+ ---
448
+
449
+ ### US-002: CTR Prediction API (P1)
450
+ **Project**: backend-api
451
+ **Board**: ml-team <!-- 2-level structures only -->
452
+ **As a** frontend application
453
+ **I want** to call POST /predict-ctr endpoint
454
+ **So that** I can get AI-powered predictions
455
+
456
+ **Acceptance Criteria**:
457
+ - [ ] **AC-US2-01**: POST /predict-ctr accepts thumbnail image
458
+ ```
459
+
460
+ **Benefits of per-US targeting:**
461
+ - Each US syncs to correct project/repo
462
+ - Single increment can span multiple projects
463
+ - Living docs auto-grouped by project
464
+ - External tools (GitHub/JIRA/ADO) receive issues in correct project
465
+
466
+ ### Legacy Project-Scoped User Story Format (Pre-v0.33.0)
396
467
 
397
- **❌ WRONG (Single-Project Format - DO NOT USE in multi-project!):**
468
+ **❌ LEGACY (Project prefixes - still works but per-US targeting preferred):**
398
469
  ```markdown
399
470
  ## User Stories
400
471
 
@@ -405,7 +476,7 @@ As a content creator, I want to upload thumbnails...
405
476
  As a system, I want to predict click-through rates...
406
477
  ```
407
478
 
408
- **✅ CORRECT (Multi-Project Format - ALWAYS USE when umbrella detected!):**
479
+ **✅ LEGACY (Multi-Project Format with prefixes - use per-US targeting instead):**
409
480
  ```markdown
410
481
  ## User Stories by Project
411
482
 
@@ -1,168 +0,0 @@
1
- ---
2
- name: specweave:switch-project
3
- description: Switch active project for increment planning. Future increments will use the selected project's specs, modules, and team folders.
4
- ---
5
-
6
- # Switch Active Project
7
-
8
- Switch the active project. Future increments will use the selected project's specs folder.
9
-
10
- ## Usage
11
-
12
- ```bash
13
- /specweave:switch-project <project-id>
14
- ```
15
-
16
- ## Examples
17
-
18
- ### Example 1: Switch to Specific Project
19
-
20
- ```bash
21
- /specweave:switch-project web-app
22
-
23
- # Result:
24
- # ✅ Switched to project: Web Application (web-app)
25
- # ℹ️ Future increments will use:
26
- # - projects/web-app/specs/
27
- # - projects/web-app/modules/
28
- # - projects/web-app/team/
29
- ```
30
-
31
- ### Example 2: List Available Projects
32
-
33
- ```bash
34
- /specweave:switch-project
35
-
36
- # If no project ID provided, shows list of projects:
37
- #
38
- # 📋 Available Projects:
39
- #
40
- # default - Default Project
41
- # Team: Engineering Team
42
- #
43
- # → web-app - Web Application
44
- # Team: Frontend Team
45
- # Tech: React, TypeScript, Node.js
46
- #
47
- # mobile-app - Mobile Application
48
- # Team: Mobile Team
49
- # Tech: React Native, Firebase
50
- #
51
- # Active project: web-app (→)
52
- #
53
- # Usage: /specweave:switch-project <project-id>
54
- ```
55
-
56
- ## What Happens
57
-
58
- 1. **Updates config** - Sets `multiProject.activeProject` in `.specweave/config.json`
59
- 2. **Clears cache** - Forces reload of project context
60
- 3. **Future operations** use new project:
61
- - `/specweave:increment` creates specs in new project's `specs/` folder
62
- - Module docs go to new project's `modules/` folder
63
- - Team docs go to new project's `team/` folder
64
-
65
- ## Requirements
66
-
67
- - Multi-project mode must be enabled
68
- - Project ID must exist in config
69
-
70
- ## Error Cases
71
-
72
- ### Multi-Project Not Enabled
73
-
74
- ```bash
75
- /specweave:switch-project web-app
76
-
77
- # Error:
78
- # ❌ Multi-project mode not enabled
79
- # Run /specweave:init-multiproject first
80
- ```
81
-
82
- ### Project Not Found
83
-
84
- ```bash
85
- /specweave:switch-project nonexistent
86
-
87
- # Error:
88
- # ❌ Project 'nonexistent' not found
89
- # Available projects: default, web-app, mobile-app
90
- ```
91
-
92
- ## Integration with Increments
93
-
94
- When you create an increment, it uses the active project:
95
-
96
- ```bash
97
- # Switch to web-app
98
- /specweave:switch-project web-app
99
-
100
- # Create increment
101
- /specweave:increment "Add user authentication"
102
-
103
- # Result:
104
- # Spec created in: projects/web-app/specs/spec-001-user-auth.md
105
- # Increment: .specweave/increments/0013-user-auth/
106
- # Linked to project: web-app
107
- ```
108
-
109
- ## Integration with External Sync
110
-
111
- Each project can have its own sync profiles:
112
-
113
- ```json
114
- {
115
- "multiProject": {
116
- "projects": [{
117
- "id": "web-app",
118
- "syncProfiles": ["web-app-github", "web-app-jira"]
119
- }]
120
- }
121
- }
122
- ```
123
-
124
- When you switch projects, the relevant sync profiles become active.
125
-
126
- ## Checking Current Project
127
-
128
- ```bash
129
- # List all projects (shows active with →)
130
- /specweave:switch-project
131
-
132
- # Or check config directly
133
- cat .specweave/config.json | grep activeProject
134
- ```
135
-
136
- ## Use Cases
137
-
138
- ### Multi-Team Organization
139
- ```bash
140
- # Morning: Work on web app
141
- /specweave:switch-project web-app
142
- /specweave:increment "Add payment integration"
143
-
144
- # Afternoon: Work on mobile app
145
- /specweave:switch-project mobile-app
146
- /specweave:increment "Add push notifications"
147
- ```
148
-
149
- ### Platform Engineering
150
- ```bash
151
- # Manage infrastructure project
152
- /specweave:switch-project platform-infra
153
- /specweave:increment "Upgrade Kubernetes cluster"
154
-
155
- # Then switch to application project
156
- /specweave:switch-project backend-api
157
- /specweave:increment "Add rate limiting"
158
- ```
159
-
160
- ## See Also
161
-
162
- - `/specweave:init-multiproject` - Enable multi-project mode
163
- - `/specweave:increment` - Create increments (uses active project)
164
- - [Multi-Project Guide](https://docs.spec-weave.com/guides/multi-project-setup)
165
-
166
- ---
167
-
168
- **Implementation**: `src/cli/commands/switch-project.ts`