specweave 0.23.8 → 0.23.12

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 (130) hide show
  1. package/.claude-plugin/marketplace.json +7 -7
  2. package/CLAUDE.md +391 -1338
  3. package/dist/src/cli/commands/cleanup-cache.d.ts +14 -0
  4. package/dist/src/cli/commands/cleanup-cache.d.ts.map +1 -0
  5. package/dist/src/cli/commands/cleanup-cache.js +63 -0
  6. package/dist/src/cli/commands/cleanup-cache.js.map +1 -0
  7. package/dist/src/cli/commands/init.js +40 -0
  8. package/dist/src/cli/commands/init.js.map +1 -1
  9. package/dist/src/cli/commands/migrate-config.d.ts +22 -0
  10. package/dist/src/cli/commands/migrate-config.d.ts.map +1 -0
  11. package/dist/src/cli/commands/migrate-config.js +149 -0
  12. package/dist/src/cli/commands/migrate-config.js.map +1 -0
  13. package/dist/src/cli/helpers/async-project-loader.d.ts +148 -0
  14. package/dist/src/cli/helpers/async-project-loader.d.ts.map +1 -0
  15. package/dist/src/cli/helpers/async-project-loader.js +351 -0
  16. package/dist/src/cli/helpers/async-project-loader.js.map +1 -0
  17. package/dist/src/cli/helpers/cancelation-handler.d.ts +123 -0
  18. package/dist/src/cli/helpers/cancelation-handler.d.ts.map +1 -0
  19. package/dist/src/cli/helpers/cancelation-handler.js +187 -0
  20. package/dist/src/cli/helpers/cancelation-handler.js.map +1 -0
  21. package/dist/src/cli/helpers/import-strategy-prompter.d.ts +43 -0
  22. package/dist/src/cli/helpers/import-strategy-prompter.d.ts.map +1 -0
  23. package/dist/src/cli/helpers/import-strategy-prompter.js +136 -0
  24. package/dist/src/cli/helpers/import-strategy-prompter.js.map +1 -0
  25. package/dist/src/cli/helpers/issue-tracker/ado.d.ts +5 -2
  26. package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
  27. package/dist/src/cli/helpers/issue-tracker/ado.js +90 -40
  28. package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
  29. package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
  30. package/dist/src/cli/helpers/issue-tracker/index.js +112 -60
  31. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  32. package/dist/src/cli/helpers/issue-tracker/jira.d.ts +26 -2
  33. package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -1
  34. package/dist/src/cli/helpers/issue-tracker/jira.js +197 -132
  35. package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -1
  36. package/dist/src/cli/helpers/progress-tracker.d.ts +121 -0
  37. package/dist/src/cli/helpers/progress-tracker.d.ts.map +1 -0
  38. package/dist/src/cli/helpers/progress-tracker.js +202 -0
  39. package/dist/src/cli/helpers/progress-tracker.js.map +1 -0
  40. package/dist/src/cli/helpers/project-count-fetcher.d.ts +69 -0
  41. package/dist/src/cli/helpers/project-count-fetcher.d.ts.map +1 -0
  42. package/dist/src/cli/helpers/project-count-fetcher.js +173 -0
  43. package/dist/src/cli/helpers/project-count-fetcher.js.map +1 -0
  44. package/dist/src/config/types.d.ts +14 -14
  45. package/dist/src/core/cache/cache-manager.d.ts +119 -0
  46. package/dist/src/core/cache/cache-manager.d.ts.map +1 -0
  47. package/dist/src/core/cache/cache-manager.js +304 -0
  48. package/dist/src/core/cache/cache-manager.js.map +1 -0
  49. package/dist/src/core/cache/rate-limit-checker.d.ts +92 -0
  50. package/dist/src/core/cache/rate-limit-checker.d.ts.map +1 -0
  51. package/dist/src/core/cache/rate-limit-checker.js +160 -0
  52. package/dist/src/core/cache/rate-limit-checker.js.map +1 -0
  53. package/dist/src/core/config/config-manager.d.ts +135 -0
  54. package/dist/src/core/config/config-manager.d.ts.map +1 -0
  55. package/dist/src/core/config/config-manager.js +341 -0
  56. package/dist/src/core/config/config-manager.js.map +1 -0
  57. package/dist/src/core/config/config-migrator.d.ts +102 -0
  58. package/dist/src/core/config/config-migrator.d.ts.map +1 -0
  59. package/dist/src/core/config/config-migrator.js +367 -0
  60. package/dist/src/core/config/config-migrator.js.map +1 -0
  61. package/dist/src/core/config/index.d.ts +10 -0
  62. package/dist/src/core/config/index.d.ts.map +1 -0
  63. package/dist/src/core/config/index.js +10 -0
  64. package/dist/src/core/config/index.js.map +1 -0
  65. package/dist/src/core/config/types.d.ts +216 -0
  66. package/dist/src/core/config/types.d.ts.map +1 -0
  67. package/dist/src/core/config/types.js +32 -0
  68. package/dist/src/core/config/types.js.map +1 -0
  69. package/dist/src/core/progress/cancelation-handler.d.ts +79 -0
  70. package/dist/src/core/progress/cancelation-handler.d.ts.map +1 -0
  71. package/dist/src/core/progress/cancelation-handler.js +111 -0
  72. package/dist/src/core/progress/cancelation-handler.js.map +1 -0
  73. package/dist/src/core/progress/import-state.d.ts +71 -0
  74. package/dist/src/core/progress/import-state.d.ts.map +1 -0
  75. package/dist/src/core/progress/import-state.js +96 -0
  76. package/dist/src/core/progress/import-state.js.map +1 -0
  77. package/dist/src/core/progress/progress-tracker.d.ts +139 -0
  78. package/dist/src/core/progress/progress-tracker.d.ts.map +1 -0
  79. package/dist/src/core/progress/progress-tracker.js +223 -0
  80. package/dist/src/core/progress/progress-tracker.js.map +1 -0
  81. package/dist/src/init/architecture/types.d.ts +6 -6
  82. package/dist/src/integrations/ado/ado-client.d.ts +25 -0
  83. package/dist/src/integrations/ado/ado-client.d.ts.map +1 -1
  84. package/dist/src/integrations/ado/ado-client.js +67 -0
  85. package/dist/src/integrations/ado/ado-client.js.map +1 -1
  86. package/dist/src/integrations/ado/ado-dependency-loader.d.ts +99 -0
  87. package/dist/src/integrations/ado/ado-dependency-loader.d.ts.map +1 -0
  88. package/dist/src/integrations/ado/ado-dependency-loader.js +207 -0
  89. package/dist/src/integrations/ado/ado-dependency-loader.js.map +1 -0
  90. package/dist/src/integrations/jira/jira-client.d.ts +32 -0
  91. package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
  92. package/dist/src/integrations/jira/jira-client.js +81 -0
  93. package/dist/src/integrations/jira/jira-client.js.map +1 -1
  94. package/dist/src/integrations/jira/jira-dependency-loader.d.ts +101 -0
  95. package/dist/src/integrations/jira/jira-dependency-loader.d.ts.map +1 -0
  96. package/dist/src/integrations/jira/jira-dependency-loader.js +200 -0
  97. package/dist/src/integrations/jira/jira-dependency-loader.js.map +1 -0
  98. package/dist/src/integrations/jira/jira-hierarchy-mapper.d.ts +104 -0
  99. package/dist/src/integrations/jira/jira-hierarchy-mapper.d.ts.map +1 -0
  100. package/dist/src/integrations/jira/jira-hierarchy-mapper.js +178 -0
  101. package/dist/src/integrations/jira/jira-hierarchy-mapper.js.map +1 -0
  102. package/package.json +1 -1
  103. package/plugins/specweave/.claude-plugin/plugin.json +20 -0
  104. package/plugins/specweave/agents/architect/AGENT.md +100 -602
  105. package/plugins/specweave/agents/pm/AGENT.md +96 -597
  106. package/plugins/specweave/agents/pm/AGENT.md.bak +1893 -0
  107. package/plugins/specweave/agents/pm/AGENT.md.bak2 +1754 -0
  108. package/plugins/specweave/commands/check-hooks.md +257 -0
  109. package/plugins/specweave/commands/migrate-config.md +104 -0
  110. package/plugins/specweave/hooks/post-edit-spec.sh +202 -31
  111. package/plugins/specweave/hooks/post-task-completion.sh +225 -228
  112. package/plugins/specweave/hooks/post-write-spec.sh +207 -31
  113. package/plugins/specweave/hooks/pre-edit-spec.sh +151 -0
  114. package/plugins/specweave/hooks/pre-task-completion.sh +5 -7
  115. package/plugins/specweave/hooks/pre-write-spec.sh +151 -0
  116. package/plugins/specweave/hooks/test-pretooluse-env.sh +72 -0
  117. package/plugins/specweave/skills/compliance-architecture/SKILL.md +374 -0
  118. package/plugins/specweave/skills/external-sync-wizard/SKILL.md +610 -0
  119. package/plugins/specweave/skills/pm-closure-validation/SKILL.md +541 -0
  120. package/plugins/specweave/skills/roadmap-planner/SKILL.md +473 -0
  121. package/plugins/specweave-ado/commands/refresh-cache.js +25 -0
  122. package/plugins/specweave-ado/commands/refresh-cache.ts +40 -0
  123. package/plugins/specweave-ado/hooks/post-task-completion.sh +1 -1
  124. package/plugins/specweave-github/hooks/post-task-completion.sh +1 -1
  125. package/plugins/specweave-jira/commands/refresh-cache.js +25 -0
  126. package/plugins/specweave-jira/commands/refresh-cache.ts +40 -0
  127. package/plugins/specweave-jira/hooks/post-task-completion.sh +1 -1
  128. package/plugins/specweave-kafka-streams/commands/topology.md +437 -0
  129. package/plugins/specweave-n8n/commands/workflow-template.md +262 -0
  130. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +228 -6333
@@ -0,0 +1,610 @@
1
+ ---
2
+ name: external-sync-wizard
3
+ description: Expert guide for setting up bidirectional synchronization between SpecWeave and external tools (GitHub Issues, Jira Epics, Azure DevOps Work Items). Provides interactive setup wizards with sync direction options (bidirectional, export-only, import-only, manual). Activates for GitHub sync, Jira integration, Azure DevOps, ADO, external tool setup, issue tracking sync, sync configuration, bidirectional sync, import issues, export increments, sync direction, GitHub issues, Jira epics, work items, project management tools.
4
+ ---
5
+
6
+ # External Sync Wizard Expert
7
+
8
+ I'm a specialist in configuring synchronization between SpecWeave (your local source of truth) and external project management tools like GitHub Issues, Jira, and Azure DevOps.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Ask me when you need help with:
13
+ - **Setting up GitHub Issues sync** with SpecWeave increments
14
+ - **Configuring Jira Epic** integration
15
+ - **Azure DevOps Work Items** synchronization
16
+ - **Choosing sync direction** (bidirectional, export, import, manual)
17
+ - **Understanding sync architecture** and source of truth principles
18
+ - **Troubleshooting sync issues** or conflicts
19
+ - **Migrating from external tools** to SpecWeave
20
+
21
+ ## My Expertise
22
+
23
+ ### SpecWeave's Sync Architecture
24
+
25
+ **Critical Understanding**: `.specweave/docs/specs/` is the **permanent, local source of truth**. External tools (GitHub, Jira, ADO) are **MIRRORS** of this truth.
26
+
27
+ #### Correct Sync Direction
28
+
29
+ ```
30
+ ✅ CORRECT Architecture:
31
+ .specweave/docs/specs/ ↔ GitHub Issues
32
+ .specweave/docs/specs/ ↔ Jira Epics
33
+ .specweave/docs/specs/ ↔ Azure DevOps Work Items
34
+
35
+ ❌ WRONG (External-to-External):
36
+ GitHub PRs ↔ Jira
37
+ GitHub Issues ↔ Jira Epics
38
+ ```
39
+
40
+ **The Hub is LOCAL**, not external!
41
+
42
+ ### Sync Direction Options
43
+
44
+ When setting up sync, users choose from 4 options:
45
+
46
+ | Option | Direction | Description | Use Case |
47
+ |--------|-----------|-------------|----------|
48
+ | **Bidirectional** | Local ↔ External | Changes sync **both ways** | Team collaboration (recommended) |
49
+ | **Export only** | Local → External | Push **from Local to External** | SpecWeave is source of truth |
50
+ | **Import only** | External → Local | Pull **from External to Local** | Onboarding existing projects |
51
+ | **Manual sync** | On-demand | No auto-sync, use commands manually | Testing, one-off syncs |
52
+
53
+ **Default recommendation**: **Bidirectional** (most useful for teams)
54
+
55
+ ---
56
+
57
+ ## Interactive Setup Wizards
58
+
59
+ ### GitHub Sync Setup
60
+
61
+ #### Step 1: Authentication
62
+
63
+ **Question**: "Do you want to sync increments to GitHub Issues?"
64
+
65
+ **If YES** → Proceed to authentication setup:
66
+ - Install GitHub CLI: `brew install gh` (macOS) or equivalent
67
+ - Authenticate: `gh auth login`
68
+ - Select repository: `gh repo set-default`
69
+
70
+ **If NO** → Skip GitHub sync setup
71
+
72
+ #### Step 2: Sync Direction
73
+
74
+ **CRITICAL**: The prompt MUST say "between local increments and GitHub", NOT "between GitHub and Jira"!
75
+
76
+ **Question**:
77
+ ```
78
+ "What should be the sync behavior between local increments (.specweave/) and GitHub Issues?"
79
+ ```
80
+
81
+ **Options**:
82
+
83
+ **1. Bidirectional sync (Recommended)**
84
+ ```
85
+ Local increments ↔ GitHub Issues
86
+
87
+ Features:
88
+ - Changes sync both ways automatically (on task completion)
89
+ - Conflicts: You will be prompted to resolve when both sides change
90
+ - Scope: Active increments only (completed/abandoned not auto-synced)
91
+ - Example: Complete task in SpecWeave → GitHub issue updates with progress
92
+
93
+ Best for: Teams using both SpecWeave and GitHub for project tracking
94
+ ```
95
+
96
+ **2. Export only (Local → GitHub)**
97
+ ```
98
+ Local increments → GitHub Issues
99
+
100
+ Features:
101
+ - SpecWeave is source of truth, GitHub is read-only mirror
102
+ - Changes push from local to GitHub only
103
+ - GitHub changes are ignored (must update locally)
104
+ - Example: Create increment in SpecWeave → GitHub issue created automatically
105
+
106
+ Best for: Solo developers who prefer SpecWeave but want GitHub visibility
107
+ ```
108
+
109
+ **3. Import only (GitHub → Local)**
110
+ ```
111
+ GitHub Issues → Local increments
112
+
113
+ Features:
114
+ - GitHub is source of truth, local workspace mirrors it
115
+ - Changes pull from GitHub to local only
116
+ - Good for: Onboarding existing GitHub projects
117
+ - Example: Close GitHub issue → Local increment status updates
118
+
119
+ Best for: Migrating from GitHub-first workflow to SpecWeave
120
+ ```
121
+
122
+ **4. Manual sync only**
123
+ ```
124
+ Use /specweave-github:sync command when needed
125
+
126
+ Features:
127
+ - No automatic sync via hooks
128
+ - Full control over when sync happens
129
+ - Good for: Testing, one-off syncs, experimental increments
130
+
131
+ Best for: Advanced users who want explicit control
132
+ ```
133
+
134
+ **Visual Aid** (include in prompt):
135
+ ```
136
+ ✅ CORRECT Architecture:
137
+ Local (.specweave/) ↔ GitHub Issues
138
+
139
+ ❌ WRONG:
140
+ GitHub ↔ Jira
141
+ ```
142
+
143
+ #### Step 3: Auto-Create Issues
144
+
145
+ **Question**: "Should SpecWeave auto-create GitHub issues when planning increments?"
146
+
147
+ **Options**:
148
+
149
+ **1. Yes, auto-create (Recommended)**
150
+ ```
151
+ Every /specweave:increment creates a GitHub issue automatically
152
+
153
+ Benefits:
154
+ - Immediate team visibility
155
+ - Bidirectional sync works from day 1
156
+ - Zero manual work
157
+ - Links: spec.md, plan.md, tasks.md included in issue
158
+
159
+ Best for: Teams that want automatic GitHub integration
160
+ ```
161
+
162
+ **2. No, manual creation**
163
+ ```
164
+ Use /specweave-github:create-issue manually when needed
165
+
166
+ Benefits:
167
+ - Create issues only for important increments
168
+ - More control over what goes to GitHub
169
+ - Good for: Experimental/internal increments
170
+
171
+ Best for: Solo developers or selective GitHub usage
172
+ ```
173
+
174
+ ---
175
+
176
+ ### Jira Sync Setup
177
+
178
+ #### Step 1: Authentication
179
+
180
+ **Question**: "Do you want to sync increments to Jira Epics?"
181
+
182
+ **If YES** → Proceed to authentication setup:
183
+ - Jira domain: `your-company.atlassian.net`
184
+ - API token: Generate from Jira settings
185
+ - Email: Your Jira account email
186
+ - Project key: `PROJ` (e.g., `AUTH`, `PAY`, `INFRA`)
187
+
188
+ **If NO** → Skip Jira sync setup
189
+
190
+ #### Step 2: Sync Direction
191
+
192
+ **Question**:
193
+ ```
194
+ "What should be the sync behavior between local increments (.specweave/) and Jira Epics?"
195
+ ```
196
+
197
+ **Options**:
198
+
199
+ **1. Bidirectional sync (Recommended)**
200
+ ```
201
+ Local increments ↔ Jira Epics
202
+
203
+ Features:
204
+ - Changes sync both ways automatically (on task completion)
205
+ - Conflicts: You will be prompted to resolve when both sides change
206
+ - Scope: Active increments only
207
+ - Example: Complete task in SpecWeave → Jira epic status updates
208
+
209
+ Best for: Teams using both SpecWeave and Jira for project management
210
+ ```
211
+
212
+ **2. Export only (Local → Jira)**
213
+ ```
214
+ Local increments → Jira Epics
215
+
216
+ Features:
217
+ - SpecWeave is source of truth, Jira is read-only mirror
218
+ - Changes push from local to Jira only
219
+ - Jira changes are ignored (must update locally)
220
+ - Example: Create increment in SpecWeave → Jira epic created automatically
221
+
222
+ Best for: Developers who prefer SpecWeave but need Jira reporting
223
+ ```
224
+
225
+ **3. Import only (Jira → Local)**
226
+ ```
227
+ Jira Epics → Local increments
228
+
229
+ Features:
230
+ - Jira is source of truth, local workspace mirrors it
231
+ - Changes pull from Jira to local only
232
+ - Good for: Onboarding existing Jira projects
233
+ - Example: Update Jira epic → Local increment syncs
234
+
235
+ Best for: Migrating from Jira-first workflow to SpecWeave
236
+ ```
237
+
238
+ **4. Manual sync only**
239
+ ```
240
+ Use /specweave-jira:sync command when needed
241
+
242
+ Features:
243
+ - No automatic sync via hooks
244
+ - Full control over when sync happens
245
+
246
+ Best for: Advanced users or testing scenarios
247
+ ```
248
+
249
+ ---
250
+
251
+ ### Azure DevOps Sync Setup
252
+
253
+ #### Step 1: Authentication
254
+
255
+ **Question**: "Do you want to sync increments to Azure DevOps work items?"
256
+
257
+ **If YES** → Proceed to authentication setup:
258
+ - Organization URL: `https://dev.azure.com/your-org`
259
+ - Personal Access Token (PAT): Generate from ADO settings
260
+ - Project name: `MyProject`
261
+ - Area path: (optional) for multi-team organizations
262
+
263
+ **If NO** → Skip ADO sync setup
264
+
265
+ #### Step 2: Sync Direction
266
+
267
+ **Question**:
268
+ ```
269
+ "What should be the sync behavior between local increments (.specweave/) and Azure DevOps work items?"
270
+ ```
271
+
272
+ **Options**:
273
+
274
+ **1. Bidirectional sync (Recommended)**
275
+ ```
276
+ Local increments ↔ ADO Work Items
277
+
278
+ Features:
279
+ - Changes sync both ways automatically (on task completion)
280
+ - Conflicts: You will be prompted to resolve when both sides change
281
+ - Scope: Active increments only
282
+ - Example: Complete task in SpecWeave → ADO work item updates
283
+
284
+ Best for: Enterprise teams using Azure DevOps
285
+ ```
286
+
287
+ **2. Export only (Local → ADO)**
288
+ ```
289
+ Local increments → ADO Work Items
290
+
291
+ Features:
292
+ - SpecWeave is source of truth, ADO is read-only mirror
293
+ - Changes push from local to ADO only
294
+ - ADO changes are ignored (must update locally)
295
+ - Example: Create increment in SpecWeave → ADO work item created automatically
296
+
297
+ Best for: Developers who prefer SpecWeave with ADO visibility
298
+ ```
299
+
300
+ **3. Import only (ADO → Local)**
301
+ ```
302
+ ADO Work Items → Local increments
303
+
304
+ Features:
305
+ - ADO is source of truth, local workspace mirrors it
306
+ - Changes pull from ADO to local only
307
+ - Good for: Onboarding existing ADO projects
308
+ - Example: Update ADO work item → Local increment syncs
309
+
310
+ Best for: Migrating from ADO-first workflow to SpecWeave
311
+ ```
312
+
313
+ **4. Manual sync only**
314
+ ```
315
+ Use /specweave-ado:sync command when needed
316
+
317
+ Features:
318
+ - No automatic sync via hooks
319
+ - Full control over when sync happens
320
+
321
+ Best for: Advanced users or selective sync scenarios
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Implementation Notes
327
+
328
+ ### When Generating Increment Planning Wizard
329
+
330
+ 1. ✅ Check `config.plugins.enabled` array
331
+ 2. ✅ ONLY ask about enabled plugins (GitHub/Jira/ADO)
332
+ 3. ✅ For each enabled plugin, ask: "Local ↔ [Provider]" sync direction
333
+ 4. ❌ NEVER ask about external-to-external sync (e.g., "GitHub ↔ Jira")
334
+
335
+ ### Configuration Storage
336
+
337
+ **Secrets** (`.env` - gitignored):
338
+ ```bash
339
+ # GitHub
340
+ GITHUB_TOKEN=ghp_xxx
341
+
342
+ # Jira
343
+ JIRA_API_TOKEN=xxx
344
+ JIRA_EMAIL=user@example.com
345
+
346
+ # Azure DevOps
347
+ ADO_PAT=xxx
348
+ ```
349
+
350
+ **Configuration** (`.specweave/config.json` - committed to git):
351
+ ```json
352
+ {
353
+ "plugins": {
354
+ "enabled": ["github", "jira", "ado"]
355
+ },
356
+ "sync": {
357
+ "github": {
358
+ "enabled": true,
359
+ "direction": "bidirectional",
360
+ "autoCreateIssue": true,
361
+ "repo": "owner/repo"
362
+ },
363
+ "jira": {
364
+ "enabled": true,
365
+ "direction": "bidirectional",
366
+ "domain": "company.atlassian.net",
367
+ "projectKey": "PROJ"
368
+ },
369
+ "ado": {
370
+ "enabled": true,
371
+ "direction": "export-only",
372
+ "organization": "your-org",
373
+ "project": "MyProject"
374
+ }
375
+ }
376
+ }
377
+ ```
378
+
379
+ ---
380
+
381
+ ## Sync Workflows
382
+
383
+ ### Bidirectional Sync (Automatic)
384
+
385
+ **Trigger**: Task completion hook (`post-task-completion.sh`)
386
+
387
+ **Flow**:
388
+ 1. User completes task in SpecWeave → `tasks.md` updated
389
+ 2. Hook detects change → Reads increment metadata
390
+ 3. If GitHub enabled → Updates GitHub issue with progress
391
+ 4. If Jira enabled → Updates Jira epic status
392
+ 5. If ADO enabled → Updates ADO work item
393
+
394
+ **Conflict Resolution**:
395
+ - If both local and external changed → Prompt user to resolve
396
+ - Show diff: Local changes vs External changes
397
+ - User chooses: Keep local, Keep external, or Merge
398
+
399
+ ### Export-Only Sync
400
+
401
+ **Trigger**: Task completion hook
402
+
403
+ **Flow**:
404
+ 1. User completes task in SpecWeave
405
+ 2. Hook pushes changes to external tool
406
+ 3. External tool changes are ignored (one-way flow)
407
+
408
+ **Use Case**: SpecWeave is the authoritative source, external tools are read-only mirrors
409
+
410
+ ### Import-Only Sync
411
+
412
+ **Trigger**: Manual `/specweave-[tool]:sync` command
413
+
414
+ **Flow**:
415
+ 1. User runs sync command
416
+ 2. Fetch changes from external tool
417
+ 3. Update local increments with external data
418
+ 4. Local changes are NOT pushed (one-way flow)
419
+
420
+ **Use Case**: Onboarding existing projects from external tools
421
+
422
+ ### Manual Sync
423
+
424
+ **Trigger**: Explicit command
425
+
426
+ **Flow**:
427
+ 1. User runs `/specweave-github:sync [increment-id]`
428
+ 2. Choose direction: pull, push, or bidirectional
429
+ 3. Execute sync operation
430
+ 4. Report results to user
431
+
432
+ **Use Case**: Testing, one-off syncs, advanced control
433
+
434
+ ---
435
+
436
+ ## Common Questions
437
+
438
+ ### Q: What happens if I have GitHub and Jira both enabled?
439
+
440
+ **A**: SpecWeave syncs to BOTH independently:
441
+ ```
442
+ .specweave/docs/specs/ ↔ GitHub Issues
443
+ .specweave/docs/specs/ ↔ Jira Epics
444
+ ```
445
+
446
+ GitHub and Jira do NOT sync with each other. SpecWeave is the hub.
447
+
448
+ ### Q: Can I change sync direction later?
449
+
450
+ **A**: Yes! Edit `.specweave/config.json`:
451
+ ```json
452
+ {
453
+ "sync": {
454
+ "github": {
455
+ "direction": "export-only" // Change from bidirectional
456
+ }
457
+ }
458
+ }
459
+ ```
460
+
461
+ ### Q: What if I delete a GitHub issue manually?
462
+
463
+ **A**: Depends on sync direction:
464
+ - **Bidirectional**: SpecWeave increment marked as deleted (soft delete)
465
+ - **Export-only**: GitHub issue recreated on next sync
466
+ - **Import-only**: Local increment deleted
467
+ - **Manual**: No effect until manual sync
468
+
469
+ ### Q: How do I onboard an existing GitHub project?
470
+
471
+ **A**:
472
+ 1. Set sync direction: **Import-only**
473
+ 2. Run: `/specweave-github:import-all`
474
+ 3. SpecWeave creates increments from GitHub issues
475
+ 4. Review and adjust as needed
476
+ 5. Switch to **Bidirectional** when ready
477
+
478
+ ### Q: Can I sync only specific increments?
479
+
480
+ **A**: Yes! Use manual sync:
481
+ ```bash
482
+ /specweave-github:sync 0042-auth-feature # Sync specific increment
483
+ ```
484
+
485
+ Auto-sync only affects **active** increments (not completed/abandoned).
486
+
487
+ ---
488
+
489
+ ## Troubleshooting
490
+
491
+ ### Issue: GitHub issue not created after `/specweave:increment`
492
+
493
+ **Diagnosis**:
494
+ 1. Check GitHub CLI: `gh auth status`
495
+ 2. Check config: `.specweave/config.json` → `sync.github.autoCreateIssue: true`
496
+ 3. Check metadata: `.specweave/increments/####/metadata.json` has `github` section
497
+
498
+ **Fix**:
499
+ ```bash
500
+ # Manual creation
501
+ /specweave-github:create-issue 0042-auth-feature
502
+ ```
503
+
504
+ ### Issue: Jira epic not updating
505
+
506
+ **Diagnosis**:
507
+ 1. Check Jira credentials in `.env`
508
+ 2. Check Jira domain and project key in `config.json`
509
+ 3. Check sync direction (must be bidirectional or export-only)
510
+ 4. Check hook logs: `.specweave/logs/sync-*.log`
511
+
512
+ **Fix**:
513
+ ```bash
514
+ # Manual sync
515
+ /specweave-jira:sync 0042-auth-feature --force
516
+ ```
517
+
518
+ ### Issue: Conflict during bidirectional sync
519
+
520
+ **Diagnosis**:
521
+ - Both local and external modified the same field (e.g., status)
522
+
523
+ **Resolution Options**:
524
+ 1. **Keep local**: Local changes overwrite external
525
+ 2. **Keep external**: External changes overwrite local
526
+ 3. **Merge**: Apply both changes (manual resolution)
527
+
528
+ **Example**:
529
+ ```
530
+ ⚠️ Conflict detected for increment 0042-auth-feature
531
+
532
+ Field: status
533
+ Local value: in-progress
534
+ GitHub value: completed
535
+
536
+ Choose resolution:
537
+ 1. Keep local (in-progress)
538
+ 2. Keep external (completed)
539
+ 3. Merge manually
540
+
541
+ Your choice:
542
+ ```
543
+
544
+ ---
545
+
546
+ ## Best Practices
547
+
548
+ ### 1. Start with Bidirectional
549
+
550
+ Most teams benefit from bidirectional sync:
551
+ - Developers update in SpecWeave
552
+ - PMs/stakeholders track progress in GitHub/Jira
553
+ - Changes sync automatically
554
+
555
+ ### 2. Use Export-Only for Solo Projects
556
+
557
+ If you're working alone and just need GitHub visibility:
558
+ - Set direction: export-only
559
+ - SpecWeave is your source of truth
560
+ - GitHub is a read-only mirror
561
+
562
+ ### 3. Import-Only for Onboarding
563
+
564
+ When migrating from GitHub/Jira to SpecWeave:
565
+ 1. Start with import-only
566
+ 2. Pull all existing work into SpecWeave
567
+ 3. Review and clean up
568
+ 4. Switch to bidirectional once confident
569
+
570
+ ### 4. Manual Sync for Testing
571
+
572
+ When experimenting or testing:
573
+ - Disable auto-sync
574
+ - Use manual commands
575
+ - Verify behavior before enabling auto-sync
576
+
577
+ ### 5. One Source of Truth
578
+
579
+ **Golden Rule**: Never manually edit the same field in both SpecWeave and external tool simultaneously.
580
+
581
+ **Example**:
582
+ - ❌ WRONG: Update task status in SpecWeave AND GitHub manually
583
+ - ✅ CORRECT: Update in SpecWeave, let sync propagate to GitHub
584
+
585
+ ---
586
+
587
+ ## Related Slash Commands
588
+
589
+ ### GitHub
590
+ - `/specweave-github:sync [increment-id]` - Manual sync
591
+ - `/specweave-github:create-issue [increment-id]` - Create issue
592
+ - `/specweave-github:close-issue [increment-id]` - Close issue
593
+ - `/specweave-github:import-all` - Import all GitHub issues
594
+ - `/specweave-github:status [increment-id]` - Check sync status
595
+
596
+ ### Jira
597
+ - `/specweave-jira:sync [increment-id]` - Manual sync
598
+ - `/specweave-jira:create-epic [increment-id]` - Create epic
599
+ - `/specweave-jira:import-all` - Import all Jira epics
600
+ - `/specweave-jira:status [increment-id]` - Check sync status
601
+
602
+ ### Azure DevOps
603
+ - `/specweave-ado:sync [increment-id]` - Manual sync
604
+ - `/specweave-ado:create-workitem [increment-id]` - Create work item
605
+ - `/specweave-ado:import-all` - Import all ADO work items
606
+ - `/specweave-ado:status [increment-id]` - Check sync status
607
+
608
+ ---
609
+
610
+ **Remember**: SpecWeave is your local source of truth. External tools are mirrors. Sync is about keeping mirrors up-to-date, not managing dual sources of truth.