specweave 0.16.5 → 0.17.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.
@@ -0,0 +1,541 @@
1
+ ---
2
+ name: ado-multi-project
3
+ description: Expert at organizing specs and splitting tasks across multiple Azure DevOps projects. Handles project-per-team, area-path-based, and team-based architectures. Intelligently maps increments and specs to correct projects based on content analysis. Activates for multi-project Azure DevOps setups, task splitting, spec organization, team allocation, cross-project coordination.
4
+ allowed-tools: Read, Write, Edit, Glob
5
+ ---
6
+
7
+ # Azure DevOps Multi-Project Skill
8
+
9
+ **Purpose**: Organize specs and increments across multiple Azure DevOps projects with intelligent mapping and folder organization.
10
+
11
+ ## What This Skill Does
12
+
13
+ This skill handles complex multi-project Azure DevOps organizations by:
14
+
15
+ 1. **Analyzing increment content** to determine which project it belongs to
16
+ 2. **Creating project-specific folder structures** in `.specweave/docs/internal/specs/`
17
+ 3. **Mapping user stories to correct projects** based on keywords and context
18
+ 4. **Splitting tasks across projects** when increments span multiple teams
19
+ 5. **Maintaining bidirectional sync** between local specs and Azure DevOps work items
20
+
21
+ ## Supported Architectures
22
+
23
+ ### 1. Project-per-team (Recommended for Microservices)
24
+
25
+ ```
26
+ Organization: mycompany
27
+ ├── AuthService (Project)
28
+ ├── UserService (Project)
29
+ ├── PaymentService (Project)
30
+ └── NotificationService (Project)
31
+
32
+ Local Structure:
33
+ .specweave/docs/internal/specs/
34
+ ├── AuthService/
35
+ ├── UserService/
36
+ ├── PaymentService/
37
+ └── NotificationService/
38
+ ```
39
+
40
+ ### 2. Area-path-based (Monolithic Applications)
41
+
42
+ ```
43
+ Organization: enterprise
44
+ └── ERP (Project)
45
+ ├── Finance (Area Path)
46
+ ├── HR (Area Path)
47
+ ├── Inventory (Area Path)
48
+ └── Sales (Area Path)
49
+
50
+ Local Structure:
51
+ .specweave/docs/internal/specs/ERP/
52
+ ├── Finance/
53
+ ├── HR/
54
+ ├── Inventory/
55
+ └── Sales/
56
+ ```
57
+
58
+ ### 3. Team-based (Small Organizations)
59
+
60
+ ```
61
+ Organization: startup
62
+ └── Platform (Project)
63
+ ├── Alpha Team
64
+ ├── Beta Team
65
+ └── Gamma Team
66
+
67
+ Local Structure:
68
+ .specweave/docs/internal/specs/Platform/
69
+ ├── AlphaTeam/
70
+ ├── BetaTeam/
71
+ └── GammaTeam/
72
+ ```
73
+
74
+ ## Intelligent Project Detection
75
+
76
+ The skill analyzes increment content to determine the correct project:
77
+
78
+ ### Detection Patterns
79
+
80
+ ```typescript
81
+ const projectPatterns = {
82
+ 'AuthService': {
83
+ keywords: ['authentication', 'login', 'oauth', 'jwt', 'session', 'password'],
84
+ filePatterns: ['auth/', 'login/', 'security/'],
85
+ confidence: 0.0
86
+ },
87
+ 'UserService': {
88
+ keywords: ['user', 'profile', 'account', 'registration', 'preferences'],
89
+ filePatterns: ['users/', 'profiles/', 'accounts/'],
90
+ confidence: 0.0
91
+ },
92
+ 'PaymentService': {
93
+ keywords: ['payment', 'stripe', 'billing', 'invoice', 'subscription'],
94
+ filePatterns: ['payment/', 'billing/', 'checkout/'],
95
+ confidence: 0.0
96
+ }
97
+ };
98
+
99
+ // Analyze spec content
100
+ const spec = readSpec(incrementId);
101
+ for (const [project, pattern] of Object.entries(projectPatterns)) {
102
+ pattern.confidence = calculateConfidence(spec, pattern);
103
+ }
104
+
105
+ // Select project with highest confidence
106
+ const selectedProject = Object.entries(projectPatterns)
107
+ .sort((a, b) => b[1].confidence - a[1].confidence)[0][0];
108
+ ```
109
+
110
+ ### Confidence Calculation
111
+
112
+ - **Keyword match**: +0.2 per keyword found
113
+ - **File pattern match**: +0.3 per pattern
114
+ - **Explicit mention**: +1.0 if project name in spec
115
+ - **Team mention**: +0.5 if team name matches
116
+
117
+ **Threshold**: Confidence > 0.7 = auto-assign, otherwise prompt user
118
+
119
+ ## Usage Examples
120
+
121
+ ### Example 1: Single-Project Increment
122
+
123
+ **Scenario**: Authentication feature for AuthService
124
+
125
+ **Spec Analysis**:
126
+ ```
127
+ Title: "Add OAuth 2.0 authentication"
128
+ Keywords found: authentication, oauth, jwt
129
+ File patterns: src/auth/oauth-provider.ts
130
+ Confidence: AuthService = 0.9 ✅
131
+ ```
132
+
133
+ **Action**:
134
+ ```bash
135
+ # Auto-creates folder structure
136
+ .specweave/docs/internal/specs/AuthService/
137
+ └── spec-001-oauth-authentication.md
138
+
139
+ # Maps to Azure DevOps
140
+ Project: AuthService
141
+ Work Item: Epic "OAuth 2.0 Authentication"
142
+ ```
143
+
144
+ ### Example 2: Multi-Project Increment
145
+
146
+ **Scenario**: Checkout flow spanning multiple services
147
+
148
+ **Spec Analysis**:
149
+ ```
150
+ Title: "Implement checkout flow with payment processing"
151
+ Keywords found: user, cart, payment, stripe, notification
152
+ Confidence:
153
+ - UserService = 0.6
154
+ - PaymentService = 0.8 ✅
155
+ - NotificationService = 0.5
156
+ ```
157
+
158
+ **Action**:
159
+ ```bash
160
+ # Creates multi-project structure
161
+ .specweave/docs/internal/specs/
162
+ ├── PaymentService/
163
+ │ └── spec-002-checkout-payment.md (primary)
164
+ ├── UserService/
165
+ │ └── spec-002-checkout-user.md (linked)
166
+ └── NotificationService/
167
+ └── spec-002-checkout-notifications.md (linked)
168
+
169
+ # Creates linked work items in Azure DevOps
170
+ PaymentService: Epic "Checkout Payment Processing" (primary)
171
+ UserService: Feature "User Cart Management" (links to primary)
172
+ NotificationService: Feature "Order Notifications" (links to primary)
173
+ ```
174
+
175
+ ### Example 3: Area Path Organization
176
+
177
+ **Scenario**: ERP system with module-based organization
178
+
179
+ **Configuration**:
180
+ ```bash
181
+ AZURE_DEVOPS_STRATEGY=area-path-based
182
+ AZURE_DEVOPS_PROJECT=ERP
183
+ AZURE_DEVOPS_AREA_PATHS=Finance,HR,Inventory
184
+ ```
185
+
186
+ **Spec Analysis**:
187
+ ```
188
+ Title: "Add payroll calculation engine"
189
+ Keywords found: payroll, salary, tax, employee
190
+ Area match: HR (confidence = 0.85)
191
+ ```
192
+
193
+ **Action**:
194
+ ```bash
195
+ # Creates area-based structure
196
+ .specweave/docs/internal/specs/ERP/HR/
197
+ └── spec-003-payroll-engine.md
198
+
199
+ # Maps to Azure DevOps
200
+ Project: ERP
201
+ Area Path: ERP\HR
202
+ Work Item: Epic "Payroll Calculation Engine"
203
+ ```
204
+
205
+ ## Task Splitting Across Projects
206
+
207
+ When an increment spans multiple projects, tasks are intelligently split:
208
+
209
+ ### Input: Unified tasks.md
210
+ ```markdown
211
+ # Tasks for Checkout Flow
212
+
213
+ - T-001: Create shopping cart API (UserService)
214
+ - T-002: Implement Stripe integration (PaymentService)
215
+ - T-003: Add order confirmation email (NotificationService)
216
+ - T-004: Update user order history (UserService)
217
+ - T-005: Process payment webhook (PaymentService)
218
+ ```
219
+
220
+ ### Output: Project-specific work items
221
+
222
+ **UserService** (2 tasks):
223
+ - Task: Create shopping cart API
224
+ - Task: Update user order history
225
+
226
+ **PaymentService** (2 tasks):
227
+ - Task: Implement Stripe integration
228
+ - Task: Process payment webhook
229
+
230
+ **NotificationService** (1 task):
231
+ - Task: Add order confirmation email
232
+
233
+ ## Folder Structure Creation
234
+
235
+ The skill automatically creates and maintains folder structure:
236
+
237
+ ### On Increment Creation
238
+
239
+ ```typescript
240
+ async function createProjectFolders(increment: Increment) {
241
+ const projects = detectProjects(increment);
242
+
243
+ for (const project of projects) {
244
+ const specPath = `.specweave/docs/internal/specs/${project}/`;
245
+ await ensureDir(specPath);
246
+
247
+ // Create project-specific spec
248
+ const spec = extractProjectSpec(increment, project);
249
+ await writeSpec(`${specPath}/spec-${increment.number}-${increment.name}.md`, spec);
250
+
251
+ // Create README if first spec in project
252
+ if (isFirstSpec(project)) {
253
+ await createProjectReadme(project);
254
+ }
255
+ }
256
+ }
257
+ ```
258
+
259
+ ### Project README Template
260
+
261
+ ```markdown
262
+ # {Project} Specifications
263
+
264
+ ## Overview
265
+ This folder contains specifications for the {Project} project.
266
+
267
+ ## Architecture
268
+ {Brief description of project architecture}
269
+
270
+ ## Team
271
+ - Team Lead: {name}
272
+ - Developers: {list}
273
+
274
+ ## Specifications
275
+ - [spec-001-feature.md](spec-001-feature.md) - {description}
276
+
277
+ ## External Links
278
+ - Azure DevOps: https://dev.azure.com/{org}/{project}
279
+ - Repository: {git-url}
280
+ ```
281
+
282
+ ## Sync Commands
283
+
284
+ ### Sync Increment to Projects
285
+
286
+ ```bash
287
+ /specweave-ado:sync-increment 0014
288
+
289
+ # Detects projects from spec
290
+ # Creates work items in each project
291
+ # Links work items together
292
+ ```
293
+
294
+ ### Sync Spec to Project
295
+
296
+ ```bash
297
+ /specweave-ado:sync-spec AuthService/spec-001
298
+
299
+ # Syncs single spec to specific project
300
+ # Updates existing work item or creates new
301
+ ```
302
+
303
+ ### Sync All Specs
304
+
305
+ ```bash
306
+ /specweave-ado:sync-all
307
+
308
+ # Syncs all specs across all projects
309
+ # Maintains relationships
310
+ # Updates bidirectionally
311
+ ```
312
+
313
+ ## Project Mapping Configuration
314
+
315
+ ### Manual Mapping (config.json)
316
+
317
+ ```json
318
+ {
319
+ "ado": {
320
+ "projectMappings": {
321
+ "auth-.*": "AuthService",
322
+ "user-.*": "UserService",
323
+ "payment-.*": "PaymentService",
324
+ "notification-.*": "NotificationService"
325
+ },
326
+ "defaultProject": "Platform",
327
+ "crossProjectLinking": true
328
+ }
329
+ }
330
+ ```
331
+
332
+ ### Auto-Detection Rules
333
+
334
+ ```typescript
335
+ const autoDetectionRules = [
336
+ {
337
+ pattern: /auth|login|oauth|security/i,
338
+ project: "AuthService"
339
+ },
340
+ {
341
+ pattern: /user|profile|account/i,
342
+ project: "UserService"
343
+ },
344
+ {
345
+ pattern: /payment|billing|stripe/i,
346
+ project: "PaymentService"
347
+ }
348
+ ];
349
+ ```
350
+
351
+ ## Cross-Project Coordination
352
+
353
+ ### Dependency Management
354
+
355
+ When increments span projects, dependencies are tracked:
356
+
357
+ ```yaml
358
+ # .specweave/increments/0014-checkout-flow/metadata.yml
359
+ projects:
360
+ primary: PaymentService
361
+ dependencies:
362
+ - UserService: [T-001, T-004]
363
+ - NotificationService: [T-003]
364
+
365
+ ado_mappings:
366
+ PaymentService:
367
+ epic: 12345
368
+ work_items: [12346, 12347]
369
+ UserService:
370
+ feature: 12348
371
+ work_items: [12349, 12350]
372
+ NotificationService:
373
+ feature: 12351
374
+ work_items: [12352]
375
+ ```
376
+
377
+ ### Cross-Project Queries
378
+
379
+ ```typescript
380
+ // Find all work items for an increment across projects
381
+ async function getIncrementWorkItems(incrementId: string) {
382
+ const metadata = await readMetadata(incrementId);
383
+ const workItems = [];
384
+
385
+ for (const [project, mapping] of Object.entries(metadata.ado_mappings)) {
386
+ const items = await adoClient.getWorkItems(project, mapping.work_items);
387
+ workItems.push(...items);
388
+ }
389
+
390
+ return workItems;
391
+ }
392
+ ```
393
+
394
+ ## Best Practices
395
+
396
+ ### 1. Consistent Naming
397
+
398
+ Use consistent naming across projects:
399
+ ```
400
+ spec-001-oauth-authentication.md # Good
401
+ spec-001-auth.md # Too vague
402
+ SPEC_001_OAuth.md # Inconsistent format
403
+ ```
404
+
405
+ ### 2. Clear Project Boundaries
406
+
407
+ Define clear boundaries between projects:
408
+ ```yaml
409
+ AuthService:
410
+ owns: [authentication, authorization, sessions]
411
+ not: [user profiles, user preferences]
412
+
413
+ UserService:
414
+ owns: [profiles, preferences, user data]
415
+ not: [authentication, passwords]
416
+ ```
417
+
418
+ ### 3. Link Related Specs
419
+
420
+ Link specs that span projects:
421
+ ```markdown
422
+ # spec-002-checkout-payment.md
423
+
424
+ Related Specs:
425
+ - [User Cart](../UserService/spec-002-checkout-user.md)
426
+ - [Notifications](../NotificationService/spec-002-checkout-notifications.md)
427
+ ```
428
+
429
+ ### 4. Use Project Prefixes
430
+
431
+ Prefix increment names with primary project:
432
+ ```bash
433
+ /specweave:increment "payment-stripe-integration"
434
+ /specweave:increment "auth-oauth-provider"
435
+ /specweave:increment "user-profile-redesign"
436
+ ```
437
+
438
+ ## Error Handling
439
+
440
+ ### Project Not Found
441
+
442
+ ```
443
+ ❌ Project "AuthService" not found in Azure DevOps
444
+
445
+ Options:
446
+ 1. Create project "AuthService"
447
+ 2. Map to existing project
448
+ 3. Skip this project
449
+
450
+ Your choice [1]:
451
+ ```
452
+
453
+ ### Ambiguous Project Detection
454
+
455
+ ```
456
+ ⚠️ Cannot determine project for increment 0014
457
+
458
+ Multiple projects detected:
459
+ - UserService (confidence: 0.6)
460
+ - PaymentService (confidence: 0.6)
461
+
462
+ Please select primary project:
463
+ 1. UserService
464
+ 2. PaymentService
465
+ 3. Both (multi-project)
466
+
467
+ Your choice [3]:
468
+ ```
469
+
470
+ ### Sync Conflicts
471
+
472
+ ```
473
+ ⚠️ Sync conflict detected
474
+
475
+ Local: spec-001 updated 2 hours ago
476
+ Azure DevOps: Work item updated 1 hour ago
477
+
478
+ Options:
479
+ 1. Use local version
480
+ 2. Use Azure DevOps version
481
+ 3. Merge changes
482
+ 4. View diff
483
+
484
+ Your choice [3]:
485
+ ```
486
+
487
+ ## Integration with CI/CD
488
+
489
+ ### Auto-sync on Commit
490
+
491
+ ```yaml
492
+ # .github/workflows/specweave-sync.yml
493
+ on:
494
+ push:
495
+ paths:
496
+ - '.specweave/docs/internal/specs/**'
497
+
498
+ jobs:
499
+ sync:
500
+ runs-on: ubuntu-latest
501
+ steps:
502
+ - uses: actions/checkout@v2
503
+ - run: npx specweave ado-sync-all
504
+ env:
505
+ AZURE_DEVOPS_PAT: ${{ secrets.ADO_PAT }}
506
+ ```
507
+
508
+ ### Project-specific Pipelines
509
+
510
+ ```yaml
511
+ # azure-pipelines.yml
512
+ trigger:
513
+ paths:
514
+ include:
515
+ - .specweave/docs/internal/specs/$(System.TeamProject)/**
516
+
517
+ variables:
518
+ - name: project
519
+ value: $(System.TeamProject)
520
+
521
+ steps:
522
+ - script: npx specweave ado-sync-project $(project)
523
+ ```
524
+
525
+ ## Summary
526
+
527
+ This skill enables sophisticated multi-project Azure DevOps organizations by:
528
+
529
+ 1. ✅ **Intelligent project detection** from spec content
530
+ 2. ✅ **Automatic folder organization** by project/area/team
531
+ 3. ✅ **Task splitting** across multiple projects
532
+ 4. ✅ **Cross-project linking** and dependency tracking
533
+ 5. ✅ **Bidirectional sync** with Azure DevOps work items
534
+
535
+ **Result**: Seamless multi-project coordination with zero manual overhead!
536
+
537
+ ---
538
+
539
+ **Skill Version**: 1.0.0
540
+ **Introduced**: SpecWeave v0.17.0
541
+ **Last Updated**: 2025-11-11