specweave 0.13.6 → 0.14.0

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 (35) hide show
  1. package/CLAUDE.md +189 -0
  2. package/dist/cli/commands/init.js +1 -1
  3. package/dist/cli/commands/init.js.map +1 -1
  4. package/dist/cli/commands/status-line.d.ts +14 -0
  5. package/dist/cli/commands/status-line.d.ts.map +1 -0
  6. package/dist/cli/commands/status-line.js +75 -0
  7. package/dist/cli/commands/status-line.js.map +1 -0
  8. package/dist/core/status-line/status-line-manager.d.ts +62 -0
  9. package/dist/core/status-line/status-line-manager.d.ts.map +1 -0
  10. package/dist/core/status-line/status-line-manager.js +169 -0
  11. package/dist/core/status-line/status-line-manager.js.map +1 -0
  12. package/dist/core/status-line/types.d.ts +50 -0
  13. package/dist/core/status-line/types.d.ts.map +1 -0
  14. package/dist/core/status-line/types.js +17 -0
  15. package/dist/core/status-line/types.js.map +1 -0
  16. package/dist/utils/project-mapper.d.ts +74 -0
  17. package/dist/utils/project-mapper.d.ts.map +1 -0
  18. package/dist/utils/project-mapper.js +273 -0
  19. package/dist/utils/project-mapper.js.map +1 -0
  20. package/dist/utils/spec-splitter.d.ts +68 -0
  21. package/dist/utils/spec-splitter.d.ts.map +1 -0
  22. package/dist/utils/spec-splitter.js +314 -0
  23. package/dist/utils/spec-splitter.js.map +1 -0
  24. package/package.json +1 -1
  25. package/plugins/specweave/hooks/lib/update-status-line.sh +138 -0
  26. package/plugins/specweave/hooks/post-task-completion.sh +10 -0
  27. package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +399 -0
  28. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +453 -0
  29. package/plugins/specweave-ado/lib/ado-multi-project-sync.ts +633 -0
  30. package/plugins/specweave-docs/skills/docusaurus/SKILL.md +17 -3
  31. package/plugins/specweave-docs-preview/commands/preview.md +29 -4
  32. package/plugins/specweave-github/lib/github-multi-project-sync.js +340 -0
  33. package/plugins/specweave-github/lib/github-multi-project-sync.ts +461 -0
  34. package/plugins/specweave-jira/lib/jira-multi-project-sync.js +244 -0
  35. package/plugins/specweave-jira/lib/jira-multi-project-sync.ts +358 -0
@@ -0,0 +1,399 @@
1
+ ---
2
+ name: multi-project-spec-mapper
3
+ description: Intelligent multi-project specification splitting and organization. Analyzes user stories to map them to correct projects (FE, BE, MOBILE, INFRA) based on content, tech stack, and component architecture. Creates project-specific folder structure and splits monolithic specs. Activates for multi-project JIRA/GitHub setups, brownfield projects with multiple teams, microservices architecture. Keywords: multi-project, project mapping, spec splitting, JIRA projects, multiple projects, microservices, FE/BE/MOBILE split, intelligent classification.
4
+ ---
5
+
6
+ # Multi-Project Spec Mapper - Intelligent Project Organization
7
+
8
+ **Purpose**: Automatically detect multiple projects in SpecWeave setup, analyze user stories to map them to the correct project (FE, BE, MOBILE, INFRA), and organize specs into project-specific folders with proper JIRA/GitHub sync.
9
+
10
+ **When to Use**:
11
+ - User has multiple JIRA projects configured (e.g., FE, BE, MOBILE)
12
+ - User has multiple GitHub repos to sync
13
+ - Brownfield projects with multiple teams/services
14
+ - Microservices architecture with separate frontend/backend/mobile codebases
15
+ - Need to split monolithic spec into project-specific specs
16
+
17
+ **Key Capabilities**:
18
+ 1. ✅ **Intelligent Project Detection** - Analyze config.json to detect multi-project setup
19
+ 2. ✅ **User Story Classification** - Map user stories to projects based on keywords, tech stack, components
20
+ 3. ✅ **Spec Splitting** - Split monolithic specs into project-specific files
21
+ 4. ✅ **Folder Organization** - Create `specs/FE/`, `specs/BE/`, `specs/MOBILE/` structure
22
+ 5. ✅ **JIRA Item Type Mapping** - Suggest Epic/Story/Task hierarchy based on scope
23
+ 6. ✅ **Bidirectional Sync** - Configure hooks for GitHub/JIRA sync per project
24
+
25
+ ---
26
+
27
+ ## How It Works
28
+
29
+ ### Step 1: Detect Multi-Project Setup
30
+
31
+ **Check config.json** for:
32
+ ```json
33
+ {
34
+ "sync": {
35
+ "profiles": {
36
+ "jira-default": {
37
+ "provider": "jira",
38
+ "config": {
39
+ "domain": "company.atlassian.net",
40
+ "projects": ["FE", "BE", "MOBILE"] // ← Multiple projects!
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+ ```
47
+
48
+ **If multiple projects found** → Activate multi-project mode
49
+
50
+ ---
51
+
52
+ ### Step 2: Analyze User Stories
53
+
54
+ For each user story, analyze:
55
+ - **Keywords**: "UI", "chart", "API", "mobile", "database", "deployment"
56
+ - **Tech Stack**: "React", "Node.js", "React Native", "PostgreSQL", "Kubernetes"
57
+ - **Components**: "component", "service", "screen", "controller", "pipeline"
58
+
59
+ **Example**:
60
+ ```
61
+ US-001: Log a Workout (Web UI)
62
+ → Keywords: "UI", "web", "chart"
63
+ → Tech: "React"
64
+ → Project: FE (90% confidence)
65
+
66
+ US-002: View Workout History (API)
67
+ → Keywords: "API", "endpoint", "database"
68
+ → Tech: "Node.js", "PostgreSQL"
69
+ → Project: BE (95% confidence)
70
+
71
+ US-005: Cross-Platform Data Sync (Mobile)
72
+ → Keywords: "mobile", "offline", "sync"
73
+ → Tech: "React Native"
74
+ → Project: MOBILE (100% confidence)
75
+ ```
76
+
77
+ ---
78
+
79
+ ### Step 3: Create Project-Specific Specs
80
+
81
+ **Folder Structure**:
82
+ ```
83
+ .specweave/docs/internal/specs/
84
+ ├── FE/
85
+ │ ├── spec-0001-fitness-tracker-web.md
86
+ │ └── README.md
87
+ ├── BE/
88
+ │ ├── spec-0001-fitness-tracker-api.md
89
+ │ └── README.md
90
+ ├── MOBILE/
91
+ │ ├── spec-0001-fitness-tracker-mobile.md
92
+ │ └── README.md
93
+ └── SHARED/
94
+ ├── spec-0001-fitness-tracker-shared.md (cross-cutting concerns)
95
+ └── README.md
96
+ ```
97
+
98
+ **Each spec contains**:
99
+ - Frontmatter with `project: FE` tag
100
+ - User stories mapped to that project
101
+ - Project-specific acceptance criteria
102
+ - Links to shared infrastructure/requirements
103
+
104
+ ---
105
+
106
+ ### Step 4: JIRA Sync with Project Mapping
107
+
108
+ **Hierarchical JIRA Structure**:
109
+ ```
110
+ JIRA Project: FE
111
+ ├── Epic: Fitness Tracker Web UI (SPEC-0001)
112
+ │ ├── Story: US-001: Log a Workout
113
+ │ │ ├── Task: T-001: Create Workout Form Component
114
+ │ │ ├── Task: T-002: Implement Exercise Search
115
+ │ │ └── Task: T-003: Add Set Logging UI
116
+ │ └── Story: US-004: Track Progress with Charts
117
+ │ ├── Task: T-010: Integrate Recharts Library
118
+ │ └── Task: T-011: Create Chart Components
119
+
120
+ JIRA Project: BE
121
+ ├── Epic: Fitness Tracker API Backend (SPEC-0001)
122
+ │ ├── Story: US-002: View Workout History (API)
123
+ │ │ ├── Task: T-004: Create GET /api/workouts Endpoint
124
+ │ │ ├── Task: T-005: Implement Filtering Logic
125
+ │ │ └── Task: T-006: Add Pagination
126
+ │ └── Story: US-003: Manage Exercise Library (API)
127
+ │ ├── Task: T-007: Create Exercise CRUD Endpoints
128
+ │ └── Task: T-008: Implement Search
129
+
130
+ JIRA Project: MOBILE
131
+ ├── Epic: Fitness Tracker Mobile App (SPEC-0001)
132
+ └── Story: US-005: Cross-Platform Data Sync
133
+ ├── Task: T-012: Implement Offline Mode (AsyncStorage)
134
+ ├── Task: T-013: Create Sync Queue
135
+ └── Task: T-014: Handle Conflict Resolution
136
+ ```
137
+
138
+ ---
139
+
140
+ ### Step 5: Configure Bidirectional Sync
141
+
142
+ **GitHub Hooks** (`.specweave/config.json`):
143
+ ```json
144
+ {
145
+ "hooks": {
146
+ "post_task_completion": {
147
+ "sync_living_docs": true,
148
+ "external_tracker_sync": true
149
+ }
150
+ },
151
+ "sync": {
152
+ "enabled": true,
153
+ "activeProfile": "jira-default",
154
+ "settings": {
155
+ "autoCreateIssue": true,
156
+ "syncDirection": "bidirectional",
157
+ "projectMapping": {
158
+ "FE": {
159
+ "jiraProject": "FE",
160
+ "jiraBoards": [123],
161
+ "githubRepo": "company/frontend-web"
162
+ },
163
+ "BE": {
164
+ "jiraProject": "BE",
165
+ "jiraBoards": [456],
166
+ "githubRepo": "company/backend-api"
167
+ },
168
+ "MOBILE": {
169
+ "jiraProject": "MOBILE",
170
+ "jiraBoards": [789],
171
+ "githubRepo": "company/mobile-app"
172
+ }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Project Mapping Rules
182
+
183
+ ### Frontend (FE)
184
+
185
+ **Keywords**:
186
+ - UI/UX: button, form, input, page, view, screen, modal, dropdown
187
+ - Visualization: chart, graph, dashboard, widget
188
+ - Styling: CSS, theme, dark mode, responsive
189
+ - State: Redux, Zustand, context, state management
190
+
191
+ **Tech Stack**:
192
+ - React, Vue, Angular, Next.js, Svelte
193
+ - TypeScript, JavaScript
194
+ - Tailwind, Material-UI, Chakra, Ant Design
195
+ - Recharts, D3, Chart.js
196
+
197
+ **Components**:
198
+ - Component, hook, context, provider, page, layout
199
+
200
+ **Confidence**: 30%+ for primary match
201
+
202
+ ---
203
+
204
+ ### Backend (BE)
205
+
206
+ **Keywords**:
207
+ - API: endpoint, REST, GraphQL, route
208
+ - Database: query, migration, schema, model
209
+ - Auth: authentication, JWT, session, token
210
+ - Processing: queue, job, worker, cron, batch
211
+
212
+ **Tech Stack**:
213
+ - Node.js (Express, Fastify, NestJS)
214
+ - Python (FastAPI, Django, Flask)
215
+ - Java (Spring Boot), .NET (ASP.NET)
216
+ - PostgreSQL, MySQL, MongoDB, Redis
217
+
218
+ **Components**:
219
+ - Controller, service, repository, middleware, handler
220
+
221
+ **Confidence**: 30%+ for primary match
222
+
223
+ ---
224
+
225
+ ### Mobile (MOBILE)
226
+
227
+ **Keywords**:
228
+ - Mobile: native, iOS, Android, cross-platform
229
+ - Device: camera, GPS, push notification, offline
230
+ - Navigation: tab bar, drawer, stack, screen transition
231
+ - Storage: AsyncStorage, local database
232
+
233
+ **Tech Stack**:
234
+ - React Native, Expo, Flutter
235
+ - Swift, Kotlin
236
+ - React Navigation
237
+
238
+ **Components**:
239
+ - Screen, navigator, bottom-sheet, drawer
240
+
241
+ **Exclude**: "web" keyword (penalty)
242
+
243
+ **Confidence**: 30%+ for primary match
244
+
245
+ ---
246
+
247
+ ### Infrastructure (INFRA)
248
+
249
+ **Keywords**:
250
+ - DevOps: deployment, CI/CD, Docker, Kubernetes
251
+ - Monitoring: logging, metrics, alerting, SLO
252
+ - Security: SSL, TLS, firewall, VPC
253
+ - Scalability: load balancing, CDN, backup
254
+
255
+ **Tech Stack**:
256
+ - AWS, Azure, GCP
257
+ - Kubernetes, Docker, Terraform
258
+ - Jenkins, GitHub Actions, GitLab CI
259
+ - Prometheus, Grafana, Datadog
260
+
261
+ **Components**:
262
+ - Pipeline, manifest, Helm chart, Terraform module
263
+
264
+ **Confidence**: 30%+ for primary match
265
+
266
+ ---
267
+
268
+ ## JIRA Item Type Hierarchy
269
+
270
+ **Epic** (> 13 story points):
271
+ - Large feature area spanning multiple stories
272
+ - Example: "Fitness Tracker MVP" (29 story points total)
273
+
274
+ **Story** (3-13 story points):
275
+ - Standard user story with clear value
276
+ - Example: "US-001: Log a Workout" (8 story points)
277
+
278
+ **Task** (1-2 story points):
279
+ - Small implementation task
280
+ - Example: "T-001: Create Workout Form Component" (2 story points)
281
+
282
+ **Subtask** (< 1 story point):
283
+ - Granular work item
284
+ - Example: "Create POST /api/workouts endpoint" (0.5 story points)
285
+
286
+ ---
287
+
288
+ ## Usage Examples
289
+
290
+ ### Example 1: Fitness Tracker (Multi-Project)
291
+
292
+ **Input**: Monolithic spec with 35 user stories
293
+
294
+ **Detection**:
295
+ ```
296
+ ✓ Multi-project setup detected:
297
+ - FE (Frontend Web)
298
+ - BE (Backend API)
299
+ - MOBILE (React Native)
300
+ ```
301
+
302
+ **Classification**:
303
+ ```
304
+ Analyzing 35 user stories...
305
+ ✓ US-001: Log a Workout → FE (90% confidence: React, UI, chart)
306
+ ✓ US-002: View Workout History → BE (95% confidence: API, database, query)
307
+ ✓ US-004: Track Progress with Charts → FE (100% confidence: Recharts, visualization)
308
+ ✓ US-005: Cross-Platform Data Sync → MOBILE (100% confidence: React Native, offline)
309
+
310
+ Project Distribution:
311
+ - FE: 12 user stories (34%)
312
+ - BE: 15 user stories (43%)
313
+ - MOBILE: 6 user stories (17%)
314
+ - SHARED: 2 user stories (6%)
315
+ ```
316
+
317
+ **Output**:
318
+ ```
319
+ Creating project-specific specs...
320
+ ✓ specs/FE/spec-0001-fitness-tracker-web.md (12 user stories)
321
+ ✓ specs/BE/spec-0001-fitness-tracker-api.md (15 user stories)
322
+ ✓ specs/MOBILE/spec-0001-fitness-tracker-mobile.md (6 user stories)
323
+ ✓ specs/SHARED/spec-0001-fitness-tracker-shared.md (2 user stories)
324
+
325
+ JIRA Sync Configuration:
326
+ ✓ FE → JIRA Project FE (Board 123)
327
+ ✓ BE → JIRA Project BE (Board 456)
328
+ ✓ MOBILE → JIRA Project MOBILE (Board 789)
329
+ ```
330
+
331
+ ---
332
+
333
+ ### Example 2: Microservices E-Commerce
334
+
335
+ **Input**: Spec for multi-service platform
336
+
337
+ **Detection**:
338
+ ```
339
+ ✓ Multi-project setup detected:
340
+ - FRONTEND (Web storefront)
341
+ - PRODUCT-SVC (Product service)
342
+ - ORDER-SVC (Order service)
343
+ - PAYMENT-SVC (Payment service)
344
+ - INFRA (Kubernetes + monitoring)
345
+ ```
346
+
347
+ **Classification**:
348
+ ```
349
+ Analyzing 50 user stories...
350
+ ✓ US-010: Product Catalog UI → FRONTEND (95%)
351
+ ✓ US-011: Product Search API → PRODUCT-SVC (100%)
352
+ ✓ US-020: Shopping Cart → ORDER-SVC (90%)
353
+ ✓ US-030: Stripe Integration → PAYMENT-SVC (100%)
354
+ ✓ US-040: Kubernetes Deployment → INFRA (100%)
355
+
356
+ Project Distribution:
357
+ - FRONTEND: 15 user stories
358
+ - PRODUCT-SVC: 12 user stories
359
+ - ORDER-SVC: 10 user stories
360
+ - PAYMENT-SVC: 8 user stories
361
+ - INFRA: 5 user stories
362
+ ```
363
+
364
+ ---
365
+
366
+ ## Configuration
367
+
368
+ **Enable Multi-Project Mode** in `.specweave/config.json`:
369
+ ```json
370
+ {
371
+ "multiProject": {
372
+ "enabled": true,
373
+ "autoDetect": true,
374
+ "customRules": {
375
+ "FE": {
376
+ "keywords": ["react", "ui", "chart"],
377
+ "techStack": ["react", "typescript", "recharts"],
378
+ "confidenceThreshold": 0.3
379
+ }
380
+ }
381
+ }
382
+ }
383
+ ```
384
+
385
+ ---
386
+
387
+ ## Related Skills
388
+
389
+ - **spec-generator**: Creates comprehensive specs (uses this skill for multi-project splitting)
390
+ - **increment-planner**: Plans increments (uses this skill to assign work to projects)
391
+ - **jira-sync**: Syncs to JIRA (uses project mappings from this skill)
392
+ - **github-sync**: Syncs to GitHub (uses project mappings from this skill)
393
+
394
+ ---
395
+
396
+ ## Version History
397
+
398
+ - **v1.0.0** (0.14.0): Initial release with intelligent project mapping
399
+ - Based on: Increment 0020-multi-project-intelligent-sync