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
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Purpose**: Lightweight plugin manifest for progressive disclosure. Load plugin content only when triggers match.
4
4
 
5
- **Total Plugins**: 27 | **Last Updated**: 2025-11-24
5
+ **Total Plugins**: 26 | **Last Updated**: 2025-12-04
6
6
 
7
7
  ---
8
8
 
@@ -71,8 +71,7 @@
71
71
 
72
72
  | Plugin | Triggers | Description |
73
73
  |--------|----------|-------------|
74
- | **specweave-docs** | documentation, README, API docs, technical writing | Documentation generation |
75
- | **specweave-docs-preview** | docs site, Docusaurus, preview, build docs | Documentation preview server |
74
+ | **specweave-docs** | documentation, README, API docs, technical writing, docs site, Docusaurus, preview, build docs | Documentation generation and preview |
76
75
  | **specweave-release** | release, version, npm publish, changelog, RC | Release management |
77
76
 
78
77
  ## Specialized Plugins
@@ -0,0 +1,321 @@
1
+ ---
2
+ name: specweave:living-docs
3
+ description: Launch or resume Living Docs Builder independently. Generates documentation from codebase analysis with AI-powered insights.
4
+ usage: /specweave:living-docs [--resume <jobId>] [--depth <level>] [--priority <modules>] [--sources <folders>] [--depends-on <jobIds>] [--foreground]
5
+ ---
6
+
7
+ # Living Docs Builder (Standalone)
8
+
9
+ **Usage**: `/specweave:living-docs [options]`
10
+
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Launch the Living Docs Builder independently of `specweave init`. This is essential for:
16
+ - **Resuming after crash** - Claude Code crashed after init, need to restart living docs
17
+ - **On-demand analysis** - Re-analyze codebase after major changes
18
+ - **Large brownfield projects** - Run targeted analysis on specific modules
19
+ - **CI/CD integration** - Automate documentation generation
20
+
21
+ ---
22
+
23
+ ## Command Options
24
+
25
+ | Option | Description |
26
+ |--------|-------------|
27
+ | (none) | Interactive mode - prompts for configuration |
28
+ | `--resume <jobId>` | Resume orphaned/paused living-docs job |
29
+ | `--depth <level>` | Analysis depth: `quick`, `standard`, `deep-native`, `deep-api` |
30
+ | `--priority <modules>` | Priority modules (comma-separated): `auth,payments,api` |
31
+ | `--sources <folders>` | Additional doc folders (comma-separated): `docs/,wiki/` |
32
+ | `--depends-on <jobIds>` | Wait for jobs before starting (comma-separated) |
33
+ | `--foreground` | Run in current session instead of background |
34
+
35
+ ---
36
+
37
+ ## Quick Start
38
+
39
+ ### Launch New Analysis (Interactive)
40
+
41
+ ```bash
42
+ /specweave:living-docs
43
+
44
+ # Prompts for:
45
+ # 1. Analysis depth (quick/standard/deep-native/deep-api)
46
+ # 2. Priority modules to focus on
47
+ # 3. Additional documentation sources
48
+ # 4. Confirmation to launch
49
+ ```
50
+
51
+ ### Resume After Crash
52
+
53
+ ```bash
54
+ # Check for orphaned jobs first
55
+ /specweave:jobs
56
+
57
+ # If you see an orphaned living-docs-builder job:
58
+ /specweave:living-docs --resume abc12345
59
+
60
+ # Or let it auto-detect:
61
+ /specweave:living-docs
62
+ # → "Found orphaned job abc12345. Resume? [Y/n]"
63
+ ```
64
+
65
+ ### Quick Analysis (Non-Interactive)
66
+
67
+ ```bash
68
+ # Quick scan - 5-10 minutes
69
+ /specweave:living-docs --depth quick
70
+
71
+ # Standard analysis - 15-30 minutes
72
+ /specweave:living-docs --depth standard --priority auth,payments
73
+
74
+ # AI-powered deep analysis (FREE with MAX subscription)
75
+ /specweave:living-docs --depth deep-native --priority core,api
76
+ ```
77
+
78
+ ---
79
+
80
+ ## Analysis Depths
81
+
82
+ | Depth | Duration | What It Does | Cost |
83
+ |-------|----------|--------------|------|
84
+ | `quick` | ~5-10 min | Structure scan, tech detection, imports map | Free |
85
+ | `standard` | ~15-30 min | Module analysis, exports, dependencies | Free |
86
+ | `deep-native` | Progress-based | AI analysis via Claude Code CLI | FREE (MAX) |
87
+ | `deep-api` | Progress-based | AI analysis via API key | API costs |
88
+
89
+ ### Deep-Native (Recommended for MAX Users)
90
+
91
+ Uses your Claude MAX subscription via `claude --print`:
92
+ - **No extra cost** - included in MAX
93
+ - Runs in **background** - survives terminal close
94
+ - **Checkpoint/resume** - can resume from any phase
95
+ - Uses **Opus 4.5** for best quality
96
+
97
+ ```bash
98
+ /specweave:living-docs --depth deep-native
99
+
100
+ # Monitor progress:
101
+ /specweave:jobs --follow <jobId>
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Implementation Steps
107
+
108
+ When this command is invoked:
109
+
110
+ ### Step 1: Check for Orphaned Jobs
111
+
112
+ ```typescript
113
+ import { getOrphanedJobs, getJobManager } from '../../../src/core/background/job-launcher.js';
114
+
115
+ const orphaned = getOrphanedJobs(projectPath).filter(j => j.type === 'living-docs-builder');
116
+ if (orphaned.length > 0) {
117
+ // Prompt: "Found orphaned job {id}. Resume? [Y/n]"
118
+ // If yes: resume job
119
+ // If no: ask if they want to start fresh
120
+ }
121
+ ```
122
+
123
+ ### Step 2: Collect Configuration (if not --resume)
124
+
125
+ If no `--resume` flag and no auto-resume:
126
+
127
+ ```typescript
128
+ import { collectLivingDocsInputs } from '../../../src/cli/helpers/init/living-docs-preflight.js';
129
+
130
+ const result = await collectLivingDocsInputs({
131
+ projectPath,
132
+ language: 'en',
133
+ isCi: hasFlags, // Skip prompts if flags provided
134
+ });
135
+ ```
136
+
137
+ Override with flags:
138
+ - `--depth` → `result.userInputs.analysisDepth`
139
+ - `--priority` → `result.userInputs.priorityAreas`
140
+ - `--sources` → `result.userInputs.additionalSources`
141
+
142
+ ### Step 3: Launch Job
143
+
144
+ ```typescript
145
+ import { launchLivingDocsJob } from '../../../src/core/background/job-launcher.js';
146
+
147
+ const { job, pid, isBackground } = await launchLivingDocsJob({
148
+ projectPath,
149
+ userInputs: result.userInputs,
150
+ dependsOn: dependsOnJobIds,
151
+ foreground: hasForegroundFlag,
152
+ });
153
+ ```
154
+
155
+ ### Step 4: Display Status
156
+
157
+ ```
158
+ ✅ Living Docs Builder launched!
159
+
160
+ Job ID: ldb-abc12345
161
+ Depth: deep-native (Claude Code Opus 4.5)
162
+ Priority: auth, payments, api
163
+ PID: 45678
164
+
165
+ Monitor: /specweave:jobs --follow ldb-abc12345
166
+ Logs: /specweave:jobs --logs ldb-abc12345
167
+
168
+ 💡 This job runs in background and survives terminal close.
169
+ Output will be saved to:
170
+ - .specweave/docs/SUGGESTIONS.md
171
+ - .specweave/docs/ENTERPRISE-HEALTH.md
172
+ ```
173
+
174
+ ---
175
+
176
+ ## Resume Behavior
177
+
178
+ When resuming a job:
179
+
180
+ 1. **Load checkpoint** from `.specweave/state/jobs/<jobId>/checkpoints/`
181
+ 2. **Skip completed phases**:
182
+ - `waiting` → dependency waiting
183
+ - `discovery` → codebase scanning
184
+ - `foundation` → high-level docs
185
+ - `integration` → work item matching
186
+ - `deep-dive` → module analysis (per-module checkpoints)
187
+ - `suggestions` → recommendations
188
+ - `enterprise` → health report
189
+ 3. **Continue from resume point**
190
+
191
+ ```bash
192
+ # Example: Job crashed during deep-dive phase
193
+ /specweave:living-docs --resume abc12345
194
+
195
+ # Output:
196
+ # Resuming from checkpoint: phase=deep-dive, module=auth (5/18)
197
+ # ✓ Skipping completed phases: waiting, discovery, foundation, integration
198
+ # → Continuing deep-dive from module: payments
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Waiting for Dependencies
204
+
205
+ For umbrella projects with clone/import jobs:
206
+
207
+ ```bash
208
+ # Launch after clone completes
209
+ /specweave:living-docs --depends-on clone-xyz123 --depth standard
210
+
211
+ # Launch after both clone and import complete
212
+ /specweave:living-docs --depends-on clone-xyz123,import-abc456
213
+ ```
214
+
215
+ The job will:
216
+ 1. Enter `waiting` phase
217
+ 2. Poll dependency status every 30 seconds
218
+ 3. Start analysis once all dependencies complete
219
+ 4. Warn if any dependency failed (proceeds with available data)
220
+
221
+ ---
222
+
223
+ ## Output Files
224
+
225
+ After completion:
226
+
227
+ | File | Description |
228
+ |------|-------------|
229
+ | `.specweave/docs/SUGGESTIONS.md` | Documentation recommendations by priority |
230
+ | `.specweave/docs/ENTERPRISE-HEALTH.md` | Health score, coverage, accuracy metrics |
231
+ | `.specweave/docs/overview/PROJECT-OVERVIEW.md` | Auto-generated project overview |
232
+ | `.specweave/docs/overview/TECH-STACK.md` | Detected technologies and frameworks |
233
+ | `.specweave/docs/modules/*.md` | Per-module documentation |
234
+
235
+ ---
236
+
237
+ ## Examples
238
+
239
+ ### Example 1: Post-Crash Resume
240
+
241
+ ```bash
242
+ # Claude crashed after init, living docs job orphaned
243
+
244
+ # Step 1: Check what's there
245
+ /specweave:jobs
246
+ # Shows: [ldb-abc123] living-docs-builder - ORPHANED (worker died)
247
+
248
+ # Step 2: Resume
249
+ /specweave:living-docs --resume ldb-abc123
250
+
251
+ # Output:
252
+ # ✅ Resuming Living Docs Builder (ldb-abc123)
253
+ # Last checkpoint: deep-dive phase, module 12/45
254
+ # Continuing from: payments-service
255
+ ```
256
+
257
+ ### Example 2: Large Brownfield (247 repos)
258
+
259
+ ```bash
260
+ # Focus on critical modules first
261
+ /specweave:living-docs --depth deep-native \
262
+ --priority auth,payments,billing,core \
263
+ --depends-on clone-main123
264
+
265
+ # Monitor in another terminal
266
+ /specweave:jobs --follow ldb-xyz789
267
+ ```
268
+
269
+ ### Example 3: CI/CD Integration
270
+
271
+ ```bash
272
+ # In CI pipeline (non-interactive)
273
+ specweave living-docs --depth quick --foreground
274
+
275
+ # Or background with polling
276
+ specweave living-docs --depth standard
277
+ specweave jobs --wait ldb-latest # Wait for completion
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Error Handling
283
+
284
+ ### Worker Crashed
285
+ ```
286
+ /specweave:jobs
287
+ # Shows: ORPHANED status
288
+
289
+ /specweave:living-docs --resume <jobId>
290
+ # Resumes from last checkpoint
291
+ ```
292
+
293
+ ### Dependency Failed
294
+ ```
295
+ ⚠️ Dependency clone-xyz123 failed
296
+ Reason: Network timeout
297
+
298
+ Proceeding with available data...
299
+ Some repositories may be missing from analysis.
300
+ ```
301
+
302
+ ### No Brownfield Detected
303
+ ```
304
+ ℹ️ No existing code detected (greenfield project)
305
+ Living docs will sync automatically as you create increments.
306
+
307
+ To force analysis anyway: /specweave:living-docs --force
308
+ ```
309
+
310
+ ---
311
+
312
+ ## See Also
313
+
314
+ - `/specweave:jobs` - Monitor all background jobs
315
+ - `/specweave:import-docs` - Import existing documentation
316
+ - `specweave:brownfield-analyzer` skill - Analyze doc gaps
317
+ - `specweave:brownfield-onboarder` skill - Merge existing docs
318
+
319
+ ---
320
+
321
+ **Implementation**: `src/cli/commands/living-docs.ts`
@@ -162,7 +162,7 @@ Uncategorized: 14 files
162
162
  After running this command, use:
163
163
 
164
164
  ```bash
165
- /specweave-docs-preview:preview
165
+ /specweave-docs:preview
166
166
  ```
167
167
 
168
168
  The generated indexes will appear in the sidebar:
@@ -180,6 +180,6 @@ The generated indexes will appear in the sidebar:
180
180
 
181
181
  ## Related Commands
182
182
 
183
- - `/specweave-docs-preview:preview` - Preview documentation with Docusaurus
184
- - `/specweave-docs-preview:build` - Build static documentation site
183
+ - `/specweave-docs:preview` - Preview documentation with Docusaurus
184
+ - `/specweave-docs:build` - Build static documentation site
185
185
  - Enterprise health report - Includes organization recommendations
@@ -26,15 +26,24 @@ GITHUB_ENABLED=$(grep -o '"enabled"[[:space:]]*:[[:space:]]*true' "$CONFIG_FILE"
26
26
 
27
27
  # Throttle: max once per 5 minutes per increment
28
28
  THROTTLE_FILE="$PROJECT_ROOT/.specweave/state/.github-sync-$INC_ID"
29
+ THROTTLE_LOG="$PROJECT_ROOT/.specweave/logs/throttle.log"
30
+ THROTTLE_WINDOW=300 # 5 minutes
31
+ mkdir -p "$(dirname "$THROTTLE_LOG")" 2>/dev/null
32
+
29
33
  if [[ -f "$THROTTLE_FILE" ]]; then
30
34
  if [[ "$(uname)" == "Darwin" ]]; then
31
35
  AGE=$(($(date +%s) - $(stat -f %m "$THROTTLE_FILE" 2>/dev/null || echo 0)))
32
36
  else
33
37
  AGE=$(($(date +%s) - $(stat -c %Y "$THROTTLE_FILE" 2>/dev/null || echo 0)))
34
38
  fi
35
- [[ $AGE -lt 300 ]] && exit 0
39
+ if [[ $AGE -lt $THROTTLE_WINDOW ]]; then
40
+ REMAINING=$((THROTTLE_WINDOW - AGE))
41
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] [github-sync] THROTTLED $INC_ID (wait ${REMAINING}s, use /specweave:sync-progress to bypass)" >> "$THROTTLE_LOG" 2>/dev/null
42
+ exit 0
43
+ fi
36
44
  fi
37
45
  touch "$THROTTLE_FILE"
46
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] [github-sync] EXECUTING $INC_ID" >> "$THROTTLE_LOG" 2>/dev/null
38
47
 
39
48
  # Cross-platform timeout wrapper
40
49
  run_with_timeout() {
@@ -19,15 +19,24 @@ done
19
19
 
20
20
  # Throttle: max once per minute per increment
21
21
  THROTTLE_FILE="$PROJECT_ROOT/.specweave/state/.living-docs-$INC_ID"
22
+ THROTTLE_LOG="$PROJECT_ROOT/.specweave/logs/throttle.log"
23
+ THROTTLE_WINDOW=60 # 1 minute
24
+ mkdir -p "$(dirname "$THROTTLE_LOG")" 2>/dev/null
25
+
22
26
  if [[ -f "$THROTTLE_FILE" ]]; then
23
27
  if [[ "$(uname)" == "Darwin" ]]; then
24
28
  AGE=$(($(date +%s) - $(stat -f %m "$THROTTLE_FILE" 2>/dev/null || echo 0)))
25
29
  else
26
30
  AGE=$(($(date +%s) - $(stat -c %Y "$THROTTLE_FILE" 2>/dev/null || echo 0)))
27
31
  fi
28
- [[ $AGE -lt 60 ]] && exit 0
32
+ if [[ $AGE -lt $THROTTLE_WINDOW ]]; then
33
+ REMAINING=$((THROTTLE_WINDOW - AGE))
34
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] [living-docs] THROTTLED $INC_ID (wait ${REMAINING}s)" >> "$THROTTLE_LOG" 2>/dev/null
35
+ exit 0
36
+ fi
29
37
  fi
30
38
  touch "$THROTTLE_FILE"
39
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] [living-docs] EXECUTING $INC_ID" >> "$THROTTLE_LOG" 2>/dev/null
31
40
 
32
41
  # Cross-platform timeout wrapper
33
42
  run_with_timeout() {
@@ -56,6 +56,64 @@ Task({
56
56
 
57
57
  ---
58
58
 
59
+ ## 🔐 CRITICAL: Authentication (DO NOT HALLUCINATE)
60
+
61
+ **EXACT environment variable names - use ONLY these, never invent variations:**
62
+
63
+ | Service | Env Var | Example |
64
+ |---------|---------|---------|
65
+ | **ADO PAT** | `AZURE_DEVOPS_PAT` | `AZURE_DEVOPS_PAT=abc123xyz...` |
66
+ | **ADO Org** | `AZURE_DEVOPS_ORG` | `AZURE_DEVOPS_ORG=mycompany` |
67
+ | **ADO Project** | `AZURE_DEVOPS_PROJECT` | `AZURE_DEVOPS_PROJECT=MyProject` |
68
+
69
+ ⚠️ **NEVER USE OR SUGGEST these non-existent env vars:**
70
+ - ❌ `AZURE_DEVOPS_EXT_PAT` ← DOES NOT EXIST
71
+ - ❌ `ADO_PAT` ← DEPRECATED, not supported
72
+ - ❌ `AZURE_PAT` ← DOES NOT EXIST
73
+ - ❌ `DEVOPS_PAT` ← DOES NOT EXIST
74
+
75
+ ### Loading Credentials (MANDATORY before API calls)
76
+
77
+ **ALWAYS read PAT from `.env` file before making API calls:**
78
+
79
+ ```bash
80
+ # Read PAT from .env file (REQUIRED - don't rely on shell environment)
81
+ ADO_PAT=$(grep '^AZURE_DEVOPS_PAT=' .env 2>/dev/null | cut -d'=' -f2)
82
+
83
+ # If PAT not found in .env, show error
84
+ if [ -z "$ADO_PAT" ]; then
85
+ echo "ERROR: AZURE_DEVOPS_PAT not found in .env file"
86
+ exit 1
87
+ fi
88
+ ```
89
+
90
+ **Use the PAT in API calls:**
91
+
92
+ ```bash
93
+ # Create auth header from PAT
94
+ AUTH_HEADER="Basic $(echo -n ":$ADO_PAT" | base64)"
95
+
96
+ # Use in curl
97
+ curl -H "Authorization: $AUTH_HEADER" ...
98
+ ```
99
+
100
+ **When auth fails (401 error), display this EXACT message:**
101
+ ```
102
+ ADO Authentication Required
103
+
104
+ Check your .env file contains:
105
+ AZURE_DEVOPS_PAT=your-personal-access-token
106
+
107
+ If PAT exists but still failing:
108
+ 1. PAT may have expired - regenerate at:
109
+ https://dev.azure.com/{organization}/_usersSettings/tokens
110
+ 2. Check PAT has required scopes:
111
+ • Work Items: Read (minimum)
112
+ • Work Items: Read & Write (for push/sync)
113
+ ```
114
+
115
+ ---
116
+
59
117
  ## 🚨 CRITICAL: Concept Mapping (MANDATORY)
60
118
 
61
119
  **BEFORE any sync operation, you MUST**:
@@ -1,11 +1,11 @@
1
1
  ---
2
- name: specweave-ado:close-workitem
2
+ name: specweave-ado:close
3
3
  description: Close Azure DevOps work item when increment complete
4
4
  ---
5
5
 
6
6
  # Close ADO Work Item Command
7
7
 
8
- **Usage**: `/specweave-ado:close-workitem <increment-id>`
8
+ **Usage**: `/specweave-ado:close <increment-id>`
9
9
 
10
10
  **Purpose**: Close ADO work item and add completion summary
11
11
 
@@ -232,6 +232,10 @@ Complete remaining tasks:
232
232
 
233
233
  ## Related
234
234
 
235
- - `/specweave-ado:create-workitem` - Create ADO work item
236
- - `/specweave-ado:sync` - Sync progress to ADO
237
- - `/specweave-ado:status` - Check sync status (read-only, always allowed)
235
+ | Command | Purpose |
236
+ |---------|---------|
237
+ | `/specweave-ado:pull` | Pull changes from ADO |
238
+ | `/specweave-ado:push` | Push progress to ADO |
239
+ | `/specweave-ado:sync` | Two-way sync |
240
+ | `/specweave-ado:create` | Create ADO work item |
241
+ | `/specweave-ado:status` | Check sync status |
@@ -1,11 +1,11 @@
1
1
  ---
2
- name: specweave-ado:create-workitem
2
+ name: specweave-ado:create
3
3
  description: Create Azure DevOps work item from SpecWeave increment
4
4
  ---
5
5
 
6
6
  # Create ADO Work Item Command
7
7
 
8
- **Usage**: `/specweave-ado:create-workitem <increment-id>`
8
+ **Usage**: `/specweave-ado:create <increment-id>`
9
9
 
10
10
  **Purpose**: Create an Epic, Feature, or User Story in Azure DevOps from a SpecWeave increment
11
11
 
@@ -172,6 +172,10 @@ Claude: Checking ADO permissions...
172
172
 
173
173
  ## Related
174
174
 
175
- - `/specweave-ado:sync` - Sync progress to existing work item
176
- - `/specweave-ado:status` - Check ADO sync status (read-only, always allowed)
177
- - `/specweave-ado:close-workitem` - Close work item when complete
175
+ | Command | Purpose |
176
+ |---------|---------|
177
+ | `/specweave-ado:pull` | Pull changes from ADO |
178
+ | `/specweave-ado:push` | Push progress to ADO |
179
+ | `/specweave-ado:sync` | Two-way sync |
180
+ | `/specweave-ado:status` | Check sync status |
181
+ | `/specweave-ado:close` | Close work item when complete |