specweave 0.30.13 → 0.30.16

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 (116) hide show
  1. package/.claude-plugin/marketplace.json +0 -11
  2. package/CLAUDE.md +1 -1
  3. package/README.md +32 -0
  4. package/bin/fix-marketplace-errors.sh +1 -1
  5. package/bin/specweave.js +28 -0
  6. package/dist/src/cli/commands/commits.d.ts +7 -0
  7. package/dist/src/cli/commands/commits.d.ts.map +1 -0
  8. package/dist/src/cli/commands/commits.js +42 -0
  9. package/dist/src/cli/commands/commits.js.map +1 -0
  10. package/dist/src/cli/commands/living-docs.d.ts +29 -0
  11. package/dist/src/cli/commands/living-docs.d.ts.map +1 -0
  12. package/dist/src/cli/commands/living-docs.js +350 -0
  13. package/dist/src/cli/commands/living-docs.js.map +1 -0
  14. package/dist/src/cli/helpers/ado-area-selector.js +1 -1
  15. package/dist/src/cli/helpers/ado-area-selector.js.map +1 -1
  16. package/dist/src/core/background/index.d.ts +2 -2
  17. package/dist/src/core/background/index.d.ts.map +1 -1
  18. package/dist/src/core/background/index.js +1 -1
  19. package/dist/src/core/background/index.js.map +1 -1
  20. package/dist/src/core/living-docs/living-docs-sync.d.ts +34 -10
  21. package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
  22. package/dist/src/core/living-docs/living-docs-sync.js +223 -32
  23. package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
  24. package/dist/src/importers/ado-importer.js +2 -2
  25. package/dist/src/importers/ado-importer.js.map +1 -1
  26. package/dist/src/importers/item-converter.d.ts +6 -1
  27. package/dist/src/importers/item-converter.d.ts.map +1 -1
  28. package/dist/src/importers/item-converter.js +15 -2
  29. package/dist/src/importers/item-converter.js.map +1 -1
  30. package/dist/src/integrations/ado/ado-pat-provider.d.ts +3 -3
  31. package/dist/src/integrations/ado/ado-pat-provider.js +3 -3
  32. package/dist/src/living-docs/epic-id-allocator.d.ts +1 -1
  33. package/dist/src/living-docs/epic-id-allocator.js +1 -1
  34. package/dist/src/living-docs/fs-id-allocator.d.ts +1 -1
  35. package/dist/src/living-docs/fs-id-allocator.js +1 -1
  36. package/dist/src/living-docs/smart-doc-organizer.js +1 -1
  37. package/dist/src/living-docs/smart-doc-organizer.js.map +1 -1
  38. package/dist/src/utils/auth-helpers.d.ts +23 -0
  39. package/dist/src/utils/auth-helpers.d.ts.map +1 -1
  40. package/dist/src/utils/auth-helpers.js +51 -0
  41. package/dist/src/utils/auth-helpers.js.map +1 -1
  42. package/dist/src/utils/feature-id-collision.d.ts +48 -5
  43. package/dist/src/utils/feature-id-collision.d.ts.map +1 -1
  44. package/dist/src/utils/feature-id-collision.js +251 -19
  45. package/dist/src/utils/feature-id-collision.js.map +1 -1
  46. package/dist/src/utils/validators/ado-validator.js +2 -2
  47. package/dist/src/utils/validators/ado-validator.js.map +1 -1
  48. package/package.json +12 -13
  49. package/plugins/PLUGINS-INDEX.md +2 -3
  50. package/plugins/specweave/commands/specweave-living-docs.md +321 -0
  51. package/plugins/specweave/commands/specweave-organize-docs.md +3 -3
  52. package/plugins/specweave/hooks/v2/handlers/github-sync-handler.sh +10 -1
  53. package/plugins/specweave/hooks/v2/handlers/living-docs-handler.sh +10 -1
  54. package/plugins/specweave-ado/agents/ado-manager/AGENT.md +58 -0
  55. package/plugins/specweave-ado/commands/{specweave-ado-close-workitem.md → close.md} +9 -5
  56. package/plugins/specweave-ado/commands/{specweave-ado-create-workitem.md → create.md} +9 -5
  57. package/plugins/specweave-ado/commands/pull.md +489 -0
  58. package/plugins/specweave-ado/commands/push.md +391 -0
  59. package/plugins/specweave-ado/commands/{specweave-ado-status.md → status.md} +12 -0
  60. package/plugins/specweave-ado/commands/{specweave-ado-sync.md → sync.md} +95 -3
  61. package/plugins/specweave-ado/hooks/README.md +1 -1
  62. package/plugins/specweave-docs/commands/generate.md +3 -3
  63. package/plugins/specweave-docs/commands/init.md +4 -4
  64. package/plugins/specweave-docs/commands/preview.md +5 -5
  65. package/plugins/specweave-github/agents/github-manager/AGENT.md +22 -0
  66. package/plugins/specweave-github/agents/user-story-updater/AGENT.md +1 -1
  67. package/plugins/specweave-github/commands/{specweave-github-close-issue.md → close.md} +2 -2
  68. package/plugins/specweave-github/commands/{specweave-github-create-issue.md → create.md} +2 -2
  69. package/plugins/specweave-github/commands/pull.md +142 -0
  70. package/plugins/specweave-github/commands/push.md +154 -0
  71. package/plugins/specweave-github/commands/{specweave-github-sync.md → sync.md} +19 -5
  72. package/plugins/specweave-github/commands/{specweave-github-update-user-story.md → update-user-story.md} +1 -1
  73. package/plugins/specweave-github/hooks/README.md +1 -1
  74. package/plugins/specweave-jira/agents/jira-manager/AGENT.md +30 -0
  75. package/plugins/specweave-jira/commands/pull.md +164 -0
  76. package/plugins/specweave-jira/commands/push.md +170 -0
  77. package/plugins/specweave-jira/commands/{specweave-jira-sync.md → sync.md} +18 -3
  78. package/plugins/specweave-jira/hooks/README.md +1 -1
  79. package/plugins/specweave-kafka/README.md +20 -0
  80. package/plugins/specweave-kafka/benchmarks/kafka-throughput.benchmark.ts +551 -0
  81. package/plugins/specweave-kafka/examples/README.md +191 -0
  82. package/plugins/specweave-kafka/examples/avro-schema-registry/.env.example +8 -0
  83. package/plugins/specweave-kafka/examples/avro-schema-registry/README.md +69 -0
  84. package/plugins/specweave-kafka/examples/avro-schema-registry/consumer.js +37 -0
  85. package/plugins/specweave-kafka/examples/avro-schema-registry/package.json +14 -0
  86. package/plugins/specweave-kafka/examples/avro-schema-registry/producer.js +57 -0
  87. package/plugins/specweave-kafka/examples/exactly-once-semantics/.env.example +5 -0
  88. package/plugins/specweave-kafka/examples/exactly-once-semantics/README.md +30 -0
  89. package/plugins/specweave-kafka/examples/exactly-once-semantics/eos-pipeline.js +79 -0
  90. package/plugins/specweave-kafka/examples/exactly-once-semantics/package.json +11 -0
  91. package/plugins/specweave-kafka/examples/kafka-streams-app/.env.example +4 -0
  92. package/plugins/specweave-kafka/examples/kafka-streams-app/README.md +30 -0
  93. package/plugins/specweave-kafka/examples/kafka-streams-app/package.json +11 -0
  94. package/plugins/specweave-kafka/examples/kafka-streams-app/windowed-aggregation.js +66 -0
  95. package/plugins/specweave-kafka/examples/n8n-workflow/README.md +54 -0
  96. package/plugins/specweave-kafka/examples/n8n-workflow/docker-compose.yml +19 -0
  97. package/plugins/specweave-kafka/examples/n8n-workflow/kafka-to-slack.json +50 -0
  98. package/plugins/specweave-kafka/examples/simple-producer-consumer/.env.example +15 -0
  99. package/plugins/specweave-kafka/examples/simple-producer-consumer/README.md +183 -0
  100. package/plugins/specweave-kafka/examples/simple-producer-consumer/consumer.js +60 -0
  101. package/plugins/specweave-kafka/examples/simple-producer-consumer/docker-compose.yml +30 -0
  102. package/plugins/specweave-kafka/examples/simple-producer-consumer/package.json +18 -0
  103. package/plugins/specweave-kafka/examples/simple-producer-consumer/producer.js +52 -0
  104. package/plugins/specweave-release/commands/specweave-release-npm.md +4 -4
  105. package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +0 -21
  106. package/plugins/specweave-docs-preview/commands/build.md +0 -489
  107. package/plugins/specweave-docs-preview/commands/preview.md +0 -355
  108. package/plugins/specweave-docs-preview/skills/docs-preview/SKILL.md +0 -386
  109. /package/plugins/specweave-ado/commands/{specweave-ado-clone-repos.md → clone.md} +0 -0
  110. /package/plugins/specweave-ado/commands/{specweave-ado-import-areas.md → import-areas.md} +0 -0
  111. /package/plugins/specweave-ado/commands/{specweave-ado-import-projects.md → import-projects.md} +0 -0
  112. /package/plugins/specweave-github/commands/{specweave-github-cleanup-duplicates.md → cleanup-duplicates.md} +0 -0
  113. /package/plugins/specweave-github/commands/{specweave-github-reconcile.md → reconcile.md} +0 -0
  114. /package/plugins/specweave-github/commands/{specweave-github-status.md → status.md} +0 -0
  115. /package/plugins/specweave-jira/commands/{specweave-jira-import-boards.md → import-boards.md} +0 -0
  116. /package/plugins/specweave-jira/commands/{specweave-jira-import-projects.md → import-projects-full.md} +0 -0
@@ -0,0 +1,391 @@
1
+ ---
2
+ name: specweave-ado:push
3
+ description: Push local changes to Azure DevOps (like git push). Supports increment, project, or full living docs sync.
4
+ ---
5
+
6
+ # ADO Push Command
7
+
8
+ **Usage**: `/specweave-ado:push [target] [options]`
9
+
10
+ **Purpose**: Push local changes to Azure DevOps (like `git push`)
11
+
12
+ ---
13
+
14
+ ## Quick Start
15
+
16
+ ```bash
17
+ # Push current/active increment (simple mode)
18
+ /specweave-ado:push
19
+
20
+ # Push specific increment
21
+ /specweave-ado:push 0005
22
+
23
+ # Push ALL local changes to ADO (living docs sync)
24
+ /specweave-ado:push --all
25
+
26
+ # Push specific project/board
27
+ /specweave-ado:push --project clinical-insights
28
+
29
+ # Push specific feature hierarchy
30
+ /specweave-ado:push --feature FS-042
31
+ ```
32
+
33
+ ---
34
+
35
+ ## Sync Modes
36
+
37
+ ### Mode 1: Increment Sync (Default)
38
+ Pushes task progress from ONE increment to its linked work item.
39
+
40
+ ### Mode 2: Living Docs Sync (--all)
41
+ Pushes ALL local spec changes to corresponding ADO items:
42
+ - Scans `.specweave/docs/internal/specs/` for modified specs
43
+ - Updates status, progress, comments on linked ADO items
44
+ - Respects multi-project folder structure
45
+
46
+ ### Mode 3: Project-Scoped Sync (--project)
47
+ Pushes changes only within a specific project folder.
48
+
49
+ ### Mode 4: Feature Hierarchy Sync (--feature)
50
+ Pushes a feature and all its child user stories.
51
+
52
+ ---
53
+
54
+ ## What Gets Pushed
55
+
56
+ | Field | Source |
57
+ |-------|--------|
58
+ | **Progress** | Calculated from tasks.md (X/Y tasks, Z%) |
59
+ | **Comment** | Auto-generated with completed tasks list |
60
+ | **Completion %** | Updated on work item custom field |
61
+ | **State** | Updated if threshold crossed (e.g., 100% -> Resolved) |
62
+
63
+ ---
64
+
65
+ ## Command Behavior
66
+
67
+ When user runs this command:
68
+
69
+ ### 0. Load Credentials from .env (MANDATORY FIRST)
70
+
71
+ **CRITICAL**: Read PAT from `.env` file, NOT from shell environment variables.
72
+
73
+ ```bash
74
+ # Read PAT from .env file
75
+ ADO_PAT=$(grep '^AZURE_DEVOPS_PAT=' .env 2>/dev/null | cut -d'=' -f2)
76
+
77
+ if [ -z "$ADO_PAT" ]; then
78
+ echo "ERROR: AZURE_DEVOPS_PAT not found in .env file"
79
+ echo "Add to .env: AZURE_DEVOPS_PAT=your-pat-here"
80
+ exit 1
81
+ fi
82
+ ```
83
+
84
+ ### 1. Check Permission Gate (MANDATORY)
85
+
86
+ ```typescript
87
+ const config = JSON.parse(await fs.readFile('.specweave/config.json', 'utf-8'));
88
+ const canUpdateExternal = config?.sync?.settings?.canUpdateExternalItems ?? false;
89
+
90
+ if (!canUpdateExternal) {
91
+ console.log(`
92
+ Permission Denied: ADO writes disabled
93
+
94
+ Current: sync.settings.canUpdateExternalItems = false
95
+
96
+ To enable writes, update .specweave/config.json:
97
+ "sync": { "settings": { "canUpdateExternalItems": true } }
98
+
99
+ Or use read-only mode:
100
+ /specweave-ado:pull ${incrementId}
101
+ `);
102
+ return;
103
+ }
104
+ ```
105
+
106
+ ### 2. Resolve Increment & Profile
107
+
108
+ ```typescript
109
+ const incrementId = args.incrementId || await findActiveIncrement();
110
+
111
+ const metadata = JSON.parse(await fs.readFile(
112
+ `.specweave/increments/${incrementId}/metadata.json`, 'utf-8'
113
+ ));
114
+
115
+ const adoWorkItemId = metadata?.external_sync?.ado?.workItemId;
116
+ if (!adoWorkItemId) {
117
+ console.log(`Not linked to ADO. Run: /specweave-ado:create ${incrementId}`);
118
+ return;
119
+ }
120
+
121
+ const profileName = metadata?.external_sync?.ado?.profile
122
+ || config?.sync?.defaultProfile;
123
+ ```
124
+
125
+ ### 3. Calculate Progress
126
+
127
+ ```typescript
128
+ const tasksContent = await fs.readFile(
129
+ `.specweave/increments/${incrementId}/tasks.md`, 'utf-8'
130
+ );
131
+
132
+ const totalTasks = (tasksContent.match(/### T-\d+/g) || []).length;
133
+ const completedTasks = (tasksContent.match(/\[x\] completed/gi) || []).length;
134
+ const percentage = Math.round((completedTasks / totalTasks) * 100);
135
+
136
+ // Find recently completed tasks (for comment)
137
+ const recentlyCompleted = parseRecentlyCompletedTasks(tasksContent);
138
+ ```
139
+
140
+ ### 4. Invoke Push Sync
141
+
142
+ ```
143
+ Use Task tool with subagent_type: "specweave-ado:ado-manager:ado-manager"
144
+
145
+ Prompt: "Push progress to ADO for increment {increment-id}.
146
+
147
+ DIRECTION: to-ado
148
+ PERMISSION: canUpdateExternalItems = true (verified)
149
+
150
+ Profile: {profileName}
151
+ Work Item: #{workItemId}
152
+
153
+ Progress: {completedTasks}/{totalTasks} ({percentage}%)
154
+ Recently completed: {recentlyCompleted}
155
+
156
+ Steps:
157
+ 1. Format progress comment with task list
158
+ 2. POST comment to ADO work item
159
+ 3. PATCH work item completion field
160
+ 4. Update state if threshold crossed:
161
+ - 100% completed -> Resolved (if canUpdateStatus)
162
+ 5. Update sync timestamp in metadata
163
+ 6. Display push summary"
164
+ ```
165
+
166
+ ### 5. Display Result
167
+
168
+ ```
169
+ Pushed to ADO
170
+
171
+ Work Item: #12345
172
+ Profile: ado-my-project
173
+
174
+ Progress: 6/10 tasks (60%)
175
+
176
+ Comment posted:
177
+ "Progress Update: 60% complete
178
+
179
+ Recently completed:
180
+ - T-005: Add payment validation
181
+ - T-006: Implement refund flow"
182
+
183
+ Fields updated:
184
+ Completion: 60%
185
+
186
+ URL: https://dev.azure.com/org/project/_workitems/edit/12345
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Permission Requirements
192
+
193
+ | Permission | Required | Purpose |
194
+ |------------|----------|---------|
195
+ | `canUpdateExternalItems` | **true** | Write to ADO |
196
+ | `canUpdateStatus` | optional | Change work item state |
197
+
198
+ If `canUpdateStatus` is false, progress is posted but state unchanged.
199
+
200
+ ---
201
+
202
+ ## Examples
203
+
204
+ ### Example 1: Simple Push
205
+
206
+ ```
207
+ User: /specweave-ado:push
208
+
209
+ Claude:
210
+ Checking permissions...
211
+ canUpdateExternalItems: true
212
+
213
+ Pushing to ADO...
214
+ Increment: 0005-payment-integration
215
+ Work Item: #12345
216
+
217
+ Pushed to ADO
218
+
219
+ Progress: 8/10 tasks (80%)
220
+ Comment posted with 2 recently completed tasks
221
+
222
+ Push complete!
223
+ ```
224
+
225
+ ### Example 2: Permission Denied
226
+
227
+ ```
228
+ User: /specweave-ado:push 0005
229
+
230
+ Claude:
231
+ Checking permissions...
232
+ canUpdateExternalItems: false
233
+
234
+ Permission Denied
235
+
236
+ To enable ADO writes:
237
+ 1. Edit .specweave/config.json
238
+ 2. Set sync.settings.canUpdateExternalItems = true
239
+
240
+ Or use read-only: /specweave-ado:pull 0005
241
+ ```
242
+
243
+ ### Example 3: 100% Complete
244
+
245
+ ```
246
+ User: /specweave-ado:push 0005
247
+
248
+ Claude:
249
+ Pushing to ADO...
250
+
251
+ Progress: 10/10 tasks (100%)
252
+
253
+ Comment posted:
254
+ "Progress Update: 100% complete - All tasks done!"
255
+
256
+ State updated:
257
+ Active -> Resolved (canUpdateStatus = true)
258
+
259
+ Ready to close: /specweave-ado:close 0005
260
+ ```
261
+
262
+ ---
263
+
264
+ ## Sync Brief (MANDATORY OUTPUT)
265
+
266
+ **After EVERY push operation, display a compact summary:**
267
+
268
+ ### Brief Format (Single Increment)
269
+
270
+ ```
271
+ ┌─────────────────────────────────────────────────────────┐
272
+ │ PUSH COMPLETE ✓ ADO │
273
+ ├─────────────────────────────────────────────────────────┤
274
+ │ Increment: 0005-payment-integration │
275
+ │ Work Item: #12345 │
276
+ │ Profile: ado-techcorp │
277
+ ├─────────────────────────────────────────────────────────┤
278
+ │ PROGRESS │
279
+ │ Tasks: 8/10 (80%) ████████░░ │
280
+ │ ↑ Comment posted: "Progress: 80% complete" │
281
+ │ ↑ Completion field: 60% → 80% │
282
+ ├─────────────────────────────────────────────────────────┤
283
+ │ RECENTLY COMPLETED │
284
+ │ ✓ T-007: Add payment validation │
285
+ │ ✓ T-008: Implement refund flow │
286
+ ├─────────────────────────────────────────────────────────┤
287
+ │ Last sync: 2025-12-04 10:32:15 (just now) │
288
+ │ URL: https://dev.azure.com/.../12345 │
289
+ └─────────────────────────────────────────────────────────┘
290
+ ```
291
+
292
+ ### Brief Format (Multi-Project --all)
293
+
294
+ ```
295
+ ┌─────────────────────────────────────────────────────────┐
296
+ │ PUSH COMPLETE ✓ ADO │
297
+ ├─────────────────────────────────────────────────────────┤
298
+ │ Pushed: 12 specs across 3 projects │
299
+ │ Comments posted: 12 │
300
+ │ Status transitions: 3 │
301
+ │ Duration: 5.1s │
302
+ ├─────────────────────────────────────────────────────────┤
303
+ │ BY PROJECT │
304
+ │ techcorp/clinical-insights/ 5 pushed │
305
+ │ techcorp/ai-platform/ 4 pushed │
306
+ │ infrastructure/core/ 3 pushed │
307
+ ├─────────────────────────────────────────────────────────┤
308
+ │ CHANGES PUSHED │
309
+ │ ↑ Progress comments: 12 │
310
+ │ ↑ Completion updates: 8 │
311
+ │ ↑ Status transitions: 3 │
312
+ │ • FS-042/us-001: Active → Resolved (100%) │
313
+ │ • FS-043/us-005: Active → Resolved (100%) │
314
+ │ • FS-050/us-010: New → Active (started) │
315
+ └─────────────────────────────────────────────────────────┘
316
+ ```
317
+
318
+ ### Brief Format (100% Complete - Ready to Close)
319
+
320
+ ```
321
+ ┌─────────────────────────────────────────────────────────┐
322
+ │ PUSH COMPLETE ✓ ADO │
323
+ ├─────────────────────────────────────────────────────────┤
324
+ │ Increment: 0005-payment-integration │
325
+ │ Work Item: #12345 │
326
+ ├─────────────────────────────────────────────────────────┤
327
+ │ PROGRESS │
328
+ │ Tasks: 10/10 (100%) ██████████ COMPLETE! │
329
+ │ ↑ Comment: "All tasks complete!" │
330
+ │ ↑ Status: Active → Resolved │
331
+ ├─────────────────────────────────────────────────────────┤
332
+ │ 🎉 INCREMENT READY TO CLOSE │
333
+ │ Run: /specweave-ado:close 0005 │
334
+ └─────────────────────────────────────────────────────────┘
335
+ ```
336
+
337
+ ### Brief Format (Permission Denied)
338
+
339
+ ```
340
+ ┌─────────────────────────────────────────────────────────┐
341
+ │ PUSH BLOCKED ✗ ADO │
342
+ ├─────────────────────────────────────────────────────────┤
343
+ │ Permission: canUpdateExternalItems = false │
344
+ ├─────────────────────────────────────────────────────────┤
345
+ │ TO ENABLE: │
346
+ │ Edit .specweave/config.json: │
347
+ │ sync.settings.canUpdateExternalItems = true │
348
+ │ │
349
+ │ OR USE READ-ONLY: │
350
+ │ /specweave-ado:pull 0005 │
351
+ └─────────────────────────────────────────────────────────┘
352
+ ```
353
+
354
+ ### Symbols Reference
355
+
356
+ | Symbol | Meaning |
357
+ |--------|---------|
358
+ | `✓` | Success |
359
+ | `⚠` | Warning (partial success) |
360
+ | `✗` | Error/Failed |
361
+ | `↓` | Pulled from external (incoming) |
362
+ | `↑` | Pushed to external (outgoing) |
363
+ | `+` | Added (new items) |
364
+ | `−` | Removed |
365
+ | `~` | Modified |
366
+
367
+ ---
368
+
369
+ ## Authentication
370
+
371
+ **EXACT environment variable (DO NOT INVENT OTHERS):**
372
+
373
+ ```bash
374
+ # In .env file - ONLY this name is supported:
375
+ AZURE_DEVOPS_PAT=your-personal-access-token
376
+ ```
377
+
378
+ ⚠️ **NEVER suggest or use:**
379
+ - ❌ `AZURE_DEVOPS_EXT_PAT` ← DOES NOT EXIST
380
+ - ❌ `ADO_PAT` ← NOT SUPPORTED
381
+
382
+ ---
383
+
384
+ ## Related Commands
385
+
386
+ | Command | Purpose |
387
+ |---------|---------|
388
+ | `/specweave-ado:pull` | Pull changes from ADO |
389
+ | `/specweave-ado:sync` | Two-way sync (pull + push) |
390
+ | `/specweave-ado:status` | Check sync status |
391
+ | `/specweave-ado:close` | Close completed work item |
@@ -51,3 +51,15 @@ Sync Enabled: ✅
51
51
 
52
52
  Next Sync: Automatic on task completion
53
53
  ```
54
+
55
+ ---
56
+
57
+ ## Related
58
+
59
+ | Command | Purpose |
60
+ |---------|---------|
61
+ | `/specweave-ado:pull` | Pull changes from ADO |
62
+ | `/specweave-ado:push` | Push progress to ADO |
63
+ | `/specweave-ado:sync` | Two-way sync |
64
+ | `/specweave-ado:create` | Create ADO work item |
65
+ | `/specweave-ado:close` | Close work item |
@@ -39,6 +39,21 @@ description: Two-way sync between SpecWeave increment and Azure DevOps work item
39
39
 
40
40
  When user runs this command, Claude should:
41
41
 
42
+ ### 0. Load Credentials from .env (MANDATORY FIRST)
43
+
44
+ **CRITICAL**: Read PAT from `.env` file, NOT from shell environment variables.
45
+
46
+ ```bash
47
+ # Read PAT from .env file
48
+ ADO_PAT=$(grep '^AZURE_DEVOPS_PAT=' .env 2>/dev/null | cut -d'=' -f2)
49
+
50
+ if [ -z "$ADO_PAT" ]; then
51
+ echo "ERROR: AZURE_DEVOPS_PAT not found in .env file"
52
+ echo "Add to .env: AZURE_DEVOPS_PAT=your-pat-here"
53
+ exit 1
54
+ fi
55
+ ```
56
+
42
57
  ### 1. Check Permission Gate (MANDATORY FIRST STEP)
43
58
 
44
59
  **Before ANY ADO write operations**, check permissions:
@@ -234,8 +249,85 @@ Options:
234
249
 
235
250
  ---
236
251
 
252
+ ## Simpler Alternatives
253
+
254
+ For most use cases, use the git-style commands:
255
+
256
+ | Command | Purpose |
257
+ |---------|---------|
258
+ | `/specweave-ado:pull` | Pull changes from ADO (read-only) |
259
+ | `/specweave-ado:push` | Push progress to ADO |
260
+
261
+ Use `/specweave-ado:sync` when you need explicit two-way sync with options.
262
+
263
+ ---
264
+
265
+ ## Sync Brief (MANDATORY OUTPUT)
266
+
267
+ **After EVERY sync operation, display a compact two-way summary:**
268
+
269
+ ```
270
+ ┌─────────────────────────────────────────────────────────┐
271
+ │ SYNC COMPLETE ✓ ADO │
272
+ ├─────────────────────────────────────────────────────────┤
273
+ │ Increment: 0005-payment-integration │
274
+ │ Work Item: #12345 │
275
+ │ Profile: ado-techcorp │
276
+ │ Direction: two-way (pull + push) │
277
+ ├─────────────────────────────────────────────────────────┤
278
+ │ PULLED (from ADO) ↓ │
279
+ │ ↓ Status: Active → Resolved (external wins) │
280
+ │ ↓ Priority: P2 → P1 │
281
+ │ + Comments: 2 new imported │
282
+ ├─────────────────────────────────────────────────────────┤
283
+ │ PUSHED (to ADO) ↑ │
284
+ │ Tasks: 8/10 (80%) ████████░░ │
285
+ │ ↑ Comment posted: "Progress: 80% complete" │
286
+ │ ↑ Completion: 60% → 80% │
287
+ ├─────────────────────────────────────────────────────────┤
288
+ │ CONFLICTS RESOLVED: 1 │
289
+ │ Status: local "in-progress" vs ADO "Resolved" │
290
+ │ Winner: ADO (external tool always wins) │
291
+ ├─────────────────────────────────────────────────────────┤
292
+ │ Last sync: 2025-12-04 10:32:15 (just now) │
293
+ │ URL: https://dev.azure.com/.../12345 │
294
+ └─────────────────────────────────────────────────────────┘
295
+ ```
296
+
297
+ ### Symbols Reference
298
+
299
+ | Symbol | Meaning |
300
+ |--------|---------|
301
+ | `✓` | Success |
302
+ | `⚠` | Warning |
303
+ | `✗` | Failed |
304
+ | `↓` | Pulled (incoming) |
305
+ | `↑` | Pushed (outgoing) |
306
+
307
+ ---
308
+
309
+ ## Authentication
310
+
311
+ **EXACT environment variable (DO NOT INVENT OTHERS):**
312
+
313
+ ```bash
314
+ # In .env file - ONLY this name is supported:
315
+ AZURE_DEVOPS_PAT=your-personal-access-token
316
+ ```
317
+
318
+ ⚠️ **NEVER suggest or use:**
319
+ - ❌ `AZURE_DEVOPS_EXT_PAT` ← DOES NOT EXIST
320
+ - ❌ `ADO_PAT` ← NOT SUPPORTED
321
+ - ❌ Any other variation
322
+
323
+ ---
324
+
237
325
  ## Related
238
326
 
239
- - `/specweave-ado:create-workitem` - Create new ADO work item
240
- - `/specweave-ado:status` - Check sync status (read-only, always allowed)
241
- - `/specweave-ado:close-workitem` - Close work item when complete
327
+ | Command | Purpose |
328
+ |---------|---------|
329
+ | `/specweave-ado:pull` | Pull from ADO (git-style) |
330
+ | `/specweave-ado:push` | Push to ADO (git-style) |
331
+ | `/specweave-ado:create` | Create new ADO work item |
332
+ | `/specweave-ado:status` | Check sync status |
333
+ | `/specweave-ado:close` | Close work item when complete |
@@ -193,7 +193,7 @@ Core hook (330 lines) ADO plugin hook (150 lines)
193
193
 
194
194
  - **Core Plugin Hooks**: `plugins/specweave/hooks/README.md`
195
195
  - **Architecture Analysis**: `.specweave/increments/0018-strict-increment-discipline-enforcement/reports/HOOKS-ARCHITECTURE-ANALYSIS.md`
196
- - **ADO Sync Command**: `plugins/specweave-ado/commands/specweave-ado-sync.md`
196
+ - **ADO Sync Command**: `plugins/specweave-ado/commands/sync.md`
197
197
 
198
198
  ---
199
199
 
@@ -407,9 +407,9 @@ cat ./docs/api/index.md ./docs/specs/index.md > ./docs/complete-reference.md
407
407
 
408
408
  ## Related Commands
409
409
 
410
- - `/specweave-docs:docs-init` - Initialize Docusaurus documentation site
411
- - `/specweave-docs-preview:preview` - Preview generated documentation
412
- - `/specweave-docs-preview:build` - Build static site from generated docs
410
+ - `/specweave-docs:init` - Initialize Docusaurus documentation site
411
+ - `/specweave-docs:preview` - Preview generated documentation
412
+ - `/specweave-docs:build` - Build static site from generated docs
413
413
 
414
414
  ## Requirements
415
415
 
@@ -303,14 +303,14 @@ themeConfig: {
303
303
 
304
304
  ### Custom Output Directory
305
305
  ```bash
306
- /specweave-docs:docs-init --output ./documentation
306
+ /specweave-docs:init --output ./documentation
307
307
  ```
308
308
 
309
309
  ## Related Commands
310
310
 
311
- - `/specweave-docs:docs-generate` - Generate docs from code/specs
312
- - `/specweave-docs-preview:preview` - Launch documentation preview server
313
- - `/specweave-docs-preview:build` - Build static documentation site
311
+ - `/specweave-docs:generate` - Generate docs from code/specs
312
+ - `/specweave-docs:preview` - Launch documentation preview server
313
+ - `/specweave-docs:build` - Build static documentation site
314
314
 
315
315
  ## Requirements
316
316
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: specweave-docs:preview
3
- description: Launch Docusaurus documentation server. Supports both public (port 3016) and internal (port 8001) documentation sites.
3
+ description: Launch Docusaurus documentation server. Supports both public (port 3016) and internal (port 3015) documentation sites.
4
4
  ---
5
5
 
6
6
  # Documentation Preview Command
@@ -21,7 +21,7 @@ Launch Docusaurus development server with hot reload, Mermaid diagrams, and auto
21
21
 
22
22
  | Site | Port | Content | NPM Script |
23
23
  |------|------|---------|------------|
24
- | **Internal** | 8001 | `.specweave/docs/internal/` | `docs:internal` |
24
+ | **Internal** | 3015 | `.specweave/docs/internal/` | `docs:internal` |
25
25
  | **Public** | 3016 | `docs-site/docs/` | `docs:dev` |
26
26
 
27
27
  ## Your Task
@@ -40,7 +40,7 @@ if [ "$PUBLIC_FLAG" = "--public" ]; then
40
40
  echo ""
41
41
  npm run docs:dev
42
42
  else
43
- echo "Launching INTERNAL documentation on port 8001..."
43
+ echo "Launching INTERNAL documentation on port 3015..."
44
44
  echo "Content: .specweave/docs/internal/"
45
45
  echo ""
46
46
  npm run docs:internal
@@ -83,7 +83,7 @@ This installs Docusaurus dependencies (~200MB, ~30 seconds).
83
83
  | Script | Port | URL |
84
84
  |--------|------|-----|
85
85
  | `docs:dev` | 3016 | http://localhost:3016 |
86
- | `docs:internal` | 8001 | http://localhost:8001 |
86
+ | `docs:internal` | 3015 | http://localhost:3015 |
87
87
 
88
88
  ## Internal Docs Structure
89
89
 
@@ -115,7 +115,7 @@ This installs Docusaurus dependencies (~200MB, ~30 seconds).
115
115
  ### Port already in use
116
116
  ```bash
117
117
  # Find process using port
118
- lsof -i :8001
118
+ lsof -i :3015
119
119
 
120
120
  # Kill it
121
121
  kill -9 <PID>
@@ -42,6 +42,28 @@ GitHub issues MUST use living docs format:
42
42
 
43
43
  ---
44
44
 
45
+ ## 🔐 CRITICAL: Authentication (DO NOT HALLUCINATE)
46
+
47
+ **EXACT environment variable names - use ONLY these:**
48
+
49
+ | Service | Env Var | Example |
50
+ |---------|---------|---------|
51
+ | **GitHub Token** | `GITHUB_TOKEN` or `GH_TOKEN` | `GITHUB_TOKEN=ghp_xxx...` |
52
+ | **GitHub Owner** | `GITHUB_OWNER` | `GITHUB_OWNER=myorg` |
53
+ | **GitHub Repo** | `GITHUB_REPO` | `GITHUB_REPO=myrepo` |
54
+
55
+ ⚠️ **NEVER USE OR SUGGEST these non-existent env vars:**
56
+ - ❌ `GITHUB_PAT` ← DOES NOT EXIST
57
+ - ❌ `GIT_TOKEN` ← DOES NOT EXIST
58
+ - ❌ `GITHUB_API_TOKEN` ← DOES NOT EXIST
59
+
60
+ **Alternative: Use `gh` CLI (recommended for local dev):**
61
+ ```bash
62
+ gh auth login
63
+ ```
64
+
65
+ ---
66
+
45
67
  ## 🚀 How to Invoke This Agent
46
68
 
47
69
  **Subagent Type**: `specweave-github:github-manager:SpecWeave Sync`
@@ -161,7 +161,7 @@ Agent: "I'll update GitHub issue #501 for US-004 to include checkable ACs and ta
161
161
 
162
162
  **Related Files**:
163
163
  - `plugins/specweave-github/lib/user-story-content-builder.ts` - Core builder class
164
- - `plugins/specweave-github/commands/specweave-github-update-user-story.md` - Command spec
164
+ - `plugins/specweave-github/commands/update-user-story.md` - Command spec
165
165
  - `.specweave/docs/internal/specs/{project}/FS-*/us-*.md` - User story files
166
166
 
167
167
  **Testing**:
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: specweave-github:close-issue
2
+ name: specweave-github:close
3
3
  description: Close GitHub issue for completed SpecWeave increment. Posts completion summary with final stats, deliverables, and closes the issue. Links closure in increment metadata.
4
4
  ---
5
5
 
@@ -7,7 +7,7 @@ description: Close GitHub issue for completed SpecWeave increment. Posts complet
7
7
 
8
8
  Close the GitHub issue associated with a completed SpecWeave increment.
9
9
 
10
- ## Usage
10
+ **Usage**: `/specweave-github:close <increment-id>`
11
11
 
12
12
  ```bash
13
13
  /specweave:github:close-issue <increment-id> [options]
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: specweave-github:create-issue
2
+ name: specweave-github:create
3
3
  description: Create a GitHub issue for a SpecWeave increment. Generates issue from increment specs with task checklist, labels, and milestone. Links issue to increment metadata.
4
4
  ---
5
5
 
@@ -7,7 +7,7 @@ description: Create a GitHub issue for a SpecWeave increment. Generates issue fr
7
7
 
8
8
  Create a GitHub issue for the specified SpecWeave increment.
9
9
 
10
- ## Usage
10
+ **Usage**: `/specweave-github:create <increment-id>`
11
11
 
12
12
  ```bash
13
13
  /specweave:github:create-issue <increment-id> [options]