specweave 1.0.261 → 1.0.263
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.
- package/.claude-plugin/README.md +0 -2
- package/CLAUDE.md +27 -27
- package/bin/specweave.js +14 -85
- package/dist/dashboard/assets/index-Cv1XUAKk.css +1 -0
- package/dist/dashboard/assets/index-DHOztQSu.js +11 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/src/adapters/README.md +1 -1
- package/dist/src/adapters/agents-md-generator.js +1 -1
- package/dist/src/adapters/agents-md-generator.js.map +1 -1
- package/dist/src/adapters/claude/README.md +8 -8
- package/dist/src/adapters/claude/adapter.js +2 -2
- package/dist/src/adapters/claude-md-generator.js +2 -2
- package/dist/src/adapters/claude-md-generator.js.map +1 -1
- package/dist/src/adapters/cursor/README.md +7 -7
- package/dist/src/adapters/generic/README.md +2 -2
- package/dist/src/cli/commands/create-increment.d.ts +1 -1
- package/dist/src/cli/commands/create-increment.js +1 -1
- package/dist/src/cli/commands/update.d.ts.map +1 -1
- package/dist/src/cli/commands/update.js +64 -1
- package/dist/src/cli/commands/update.js.map +1 -1
- package/dist/src/cli/helpers/init/api-docs-config.js +7 -7
- package/dist/src/cli/helpers/init/api-docs-config.js.map +1 -1
- package/dist/src/core/config/types.d.ts +18 -0
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js +4 -0
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/external-tools/external-items-display.d.ts.map +1 -1
- package/dist/src/core/external-tools/external-items-display.js +1 -11
- package/dist/src/core/external-tools/external-items-display.js.map +1 -1
- package/dist/src/core/increment/increment-archiver.js +1 -1
- package/dist/src/core/increment/increment-archiver.js.map +1 -1
- package/dist/src/core/increment/metadata-manager.js +2 -2
- package/dist/src/core/increment/metadata-manager.js.map +1 -1
- package/dist/src/core/increment/template-creator.d.ts +1 -1
- package/dist/src/core/increment/template-creator.js +4 -4
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts +2 -2
- package/dist/src/core/lazy-loading/llm-plugin-detector.d.ts.map +1 -1
- package/dist/src/core/lazy-loading/llm-plugin-detector.js +15 -5
- package/dist/src/core/lazy-loading/llm-plugin-detector.js.map +1 -1
- package/dist/src/core/living-docs/feature-consistency-validator.js +1 -1
- package/dist/src/core/living-docs/feature-consistency-validator.js.map +1 -1
- package/dist/src/core/living-docs/scaffolding/scaffold.js +3 -3
- package/dist/src/core/notifications/command-integration.d.ts.map +1 -1
- package/dist/src/core/notifications/command-integration.js +0 -1
- package/dist/src/core/notifications/command-integration.js.map +1 -1
- package/dist/src/core/reflection/reflect-handler.js +2 -2
- package/dist/src/core/reflection/reflect-handler.js.map +1 -1
- package/dist/src/core/validators/ac-presence-validator.d.ts +1 -1
- package/dist/src/core/validators/ac-presence-validator.js +3 -3
- package/dist/src/core/validators/ac-presence-validator.js.map +1 -1
- package/dist/src/dashboard/server/command-runner.d.ts.map +1 -1
- package/dist/src/dashboard/server/command-runner.js +2 -2
- package/dist/src/dashboard/server/command-runner.js.map +1 -1
- package/dist/src/dashboard/server/dashboard-server.d.ts.map +1 -1
- package/dist/src/dashboard/server/dashboard-server.js +22 -10
- package/dist/src/dashboard/server/dashboard-server.js.map +1 -1
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts +9 -1
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.d.ts.map +1 -1
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.js +140 -13
- package/dist/src/dashboard/server/data/dashboard-data-aggregator.js.map +1 -1
- package/dist/src/dashboard/server/data/plugin-scanner.d.ts +1 -1
- package/dist/src/dashboard/server/data/plugin-scanner.d.ts.map +1 -1
- package/dist/src/dashboard/server/data/plugin-scanner.js +2 -2
- package/dist/src/dashboard/server/data/plugin-scanner.js.map +1 -1
- package/dist/src/utils/agents-md-compiler.js +1 -1
- package/dist/src/utils/agents-md-compiler.js.map +1 -1
- package/dist/src/utils/find-project-root.d.ts +5 -4
- package/dist/src/utils/find-project-root.d.ts.map +1 -1
- package/dist/src/utils/find-project-root.js +8 -10
- package/dist/src/utils/find-project-root.js.map +1 -1
- package/dist/src/utils/generate-skills-index.js +3 -3
- package/dist/src/utils/notification-constants.js +1 -1
- package/dist/src/utils/notification-constants.js.map +1 -1
- package/package.json +1 -1
- package/plugins/FINAL-AUDIT-RECOMMENDATIONS.md +3 -3
- package/plugins/specweave/PLUGIN.md +0 -22
- package/plugins/specweave/commands/analytics.md +1 -1
- package/plugins/specweave/commands/discrepancies.md +0 -1
- package/plugins/specweave/commands/living-docs.md +0 -1
- package/plugins/specweave/commands/reconcile.md +1 -1
- package/plugins/specweave/hooks/hooks.json +19 -0
- package/plugins/specweave/hooks/pre-compact.sh +39 -0
- package/plugins/specweave/hooks/stop-sync.sh +23 -1
- package/plugins/specweave/hooks/universal/fail-fast-wrapper.sh +4 -0
- package/plugins/specweave/hooks/user-prompt-submit.sh +193 -59
- package/plugins/specweave/hooks/v2/dispatchers/post-tool-use-analytics.sh +83 -0
- package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +7 -0
- package/plugins/specweave/hooks/v2/guards/spec-template-enforcement-guard.sh +1 -1
- package/plugins/specweave/hooks/v2/handlers/ac-sync-dispatcher.sh +25 -6
- package/plugins/specweave/hooks/v2/handlers/universal-auto-create-dispatcher.sh +21 -3
- package/plugins/specweave/hooks/v2/lib/check-provider-enabled.sh +52 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +2 -2
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
- package/plugins/specweave/scripts/track-analytics.sh +4 -0
- package/plugins/specweave/skills/do/SKILL.md +1 -1
- package/plugins/specweave/skills/done/SKILL.md +1 -1
- package/plugins/specweave/skills/framework/SKILL.md +4 -4
- package/plugins/specweave/skills/increment/SKILL.md +192 -25
- package/plugins/specweave/skills/next/SKILL.md +36 -630
- package/plugins/specweave/skills/pm/phases/00-deep-interview.md +2 -2
- package/plugins/specweave/skills/progress-sync/SKILL.md +7 -25
- package/plugins/specweave/skills/spec-generator/SKILL.md +44 -626
- package/plugins/specweave/skills/tdd-green/SKILL.md +10 -798
- package/plugins/specweave/skills/tdd-red/SKILL.md +8 -136
- package/plugins/specweave/skills/tdd-refactor/SKILL.md +15 -147
- package/plugins/specweave-github/hooks/github-auto-create-handler.sh +23 -5
- package/src/templates/AGENTS.md.template +11 -11
- package/src/templates/CLAUDE.md.template +1 -1
- package/dist/dashboard/assets/index-CDl14O5G.css +0 -1
- package/dist/dashboard/assets/index-CmqBqnWd.js +0 -11
- package/plugins/specweave/commands/api-docs.md +0 -672
- package/plugins/specweave/commands/check-hooks.md +0 -241
- package/plugins/specweave/commands/embed-acs.md +0 -445
- package/plugins/specweave/commands/external.md +0 -145
- package/plugins/specweave/commands/import-docs.md +0 -212
- package/plugins/specweave/commands/migrate-config.md +0 -104
- package/plugins/specweave/commands/notifications.md +0 -94
- package/plugins/specweave/commands/plugin-validator.md +0 -429
- package/plugins/specweave/commands/revert-wip-limit.md +0 -82
- package/plugins/specweave/commands/sync-acs.md +0 -342
- package/plugins/specweave/commands/sync-specs.md +0 -339
- package/plugins/specweave/commands/sync-tasks.md +0 -255
- package/plugins/specweave/commands/update-scope.md +0 -351
- package/plugins/specweave/commands/validate-features.md +0 -207
- package/plugins/specweave/skills/archive-increments/SKILL.md +0 -209
- package/plugins/specweave/skills/code-review/SKILL.md +0 -598
- package/plugins/specweave/skills/increment-planner/SKILL.md +0 -238
- package/plugins/specweave/skills/increment-work-router/SKILL.md +0 -562
- package/plugins/specweave/skills/multi-project-spec-mapper/SKILL.md +0 -423
- package/plugins/specweave/skills/pm-closure-validation/SKILL.md +0 -542
- package/plugins/specweave/skills/smart-reopen-detector/SKILL.md +0 -245
- package/plugins/specweave/skills/tdd-orchestrator/SKILL.md +0 -228
- package/plugins/specweave/skills/umbrella-repo-detector/SKILL.md +0 -301
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Manually synchronize acceptance criteria (AC) checkbox status in spec.md based on task completion
|
|
3
|
-
disable-model-invocation: true
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Sync Acceptance Criteria Status
|
|
7
|
-
|
|
8
|
-
**Purpose**: Manually trigger AC checkbox synchronization to ensure spec.md acceptance criteria accurately reflect task completion status.
|
|
9
|
-
|
|
10
|
-
**Use When**:
|
|
11
|
-
- AC checkboxes in spec.md are out of sync with completed tasks
|
|
12
|
-
- After manually completing tasks without running the hook
|
|
13
|
-
- To verify AC status before closing an increment
|
|
14
|
-
- To resolve conflicts between manual AC edits and task completion
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## How It Works
|
|
19
|
-
|
|
20
|
-
1. **Detect Active Increment**
|
|
21
|
-
- Find increment in-progress
|
|
22
|
-
- Check if spec.md and tasks.md exist
|
|
23
|
-
|
|
24
|
-
2. **Parse Task Completion**
|
|
25
|
-
- Extract all tasks from tasks.md
|
|
26
|
-
- Map AC-IDs to completion status
|
|
27
|
-
- Calculate percentage complete per AC (# complete tasks / # total tasks)
|
|
28
|
-
|
|
29
|
-
3. **Parse AC Definitions**
|
|
30
|
-
- Extract all ACs from spec.md
|
|
31
|
-
- Track current checkbox state ([ ] or [x])
|
|
32
|
-
- Map line numbers for atomic updates
|
|
33
|
-
|
|
34
|
-
4. **Intelligent Sync Logic**
|
|
35
|
-
- **100% Complete**: Update [ ] → [x]
|
|
36
|
-
- **< 100% Complete**: Keep [ ] (partial work)
|
|
37
|
-
- **Conflict Detection**: AC is [x] but tasks incomplete → WARN
|
|
38
|
-
- **Orphaned ACs**: AC has no implementing tasks → WARN
|
|
39
|
-
|
|
40
|
-
5. **Atomic File Update**
|
|
41
|
-
- Update spec.md only if changes needed
|
|
42
|
-
- Preserve manual overrides (conflicts)
|
|
43
|
-
- Log all changes to metadata.json
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Usage
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
# Auto-detect and sync active increment
|
|
51
|
-
/sw:sync-acs
|
|
52
|
-
|
|
53
|
-
# Sync specific increment
|
|
54
|
-
/sw:sync-acs 0039
|
|
55
|
-
|
|
56
|
-
# Show what would change (dry run)
|
|
57
|
-
/sw:sync-acs --dry-run
|
|
58
|
-
|
|
59
|
-
# Force sync (ignore conflicts)
|
|
60
|
-
/sw:sync-acs --force
|
|
61
|
-
|
|
62
|
-
# Validate only (check for mismatches)
|
|
63
|
-
/sw:sync-acs --validate
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
## Implementation
|
|
69
|
-
|
|
70
|
-
The command uses **ACStatusManager** for sophisticated synchronization:
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
import { ACStatusManager } from '../../../../../src/core/increment/ac-status-manager';
|
|
74
|
-
|
|
75
|
-
const manager = new ACStatusManager(process.cwd());
|
|
76
|
-
const result = await manager.syncACStatus(incrementId);
|
|
77
|
-
|
|
78
|
-
// result.synced: true if sync was performed
|
|
79
|
-
// result.updated: string[] - AC-IDs updated to [x]
|
|
80
|
-
// result.conflicts: string[] - Conflicts detected
|
|
81
|
-
// result.warnings: string[] - Orphaned ACs, missing files
|
|
82
|
-
// result.changes: string[] - Human-readable diff
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Step 1: Find Active Increment
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
# Auto-detect active increment
|
|
89
|
-
ACTIVE_INCREMENT=$(ls -t .specweave/increments/ 2>/dev/null | grep -v "_backlog\|_archive" | head -1)
|
|
90
|
-
|
|
91
|
-
if [[ -z "$ACTIVE_INCREMENT" ]]; then
|
|
92
|
-
echo "❌ No active increment found"
|
|
93
|
-
exit 1
|
|
94
|
-
fi
|
|
95
|
-
|
|
96
|
-
echo "🔄 Syncing AC status for $ACTIVE_INCREMENT..."
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
### Step 2: Call ACStatusManager
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
# Use the update-ac-status.js hook script (already integrated)
|
|
103
|
-
node plugins/specweave/lib/hooks/update-ac-status.js "$ACTIVE_INCREMENT"
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Or invoke directly:
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
const result = await manager.syncACStatus(incrementId);
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Step 3: Display Results
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
# Updated ACs
|
|
116
|
-
if [[ -n "${result.updated}" ]]; then
|
|
117
|
-
echo "✅ Updated AC checkboxes:"
|
|
118
|
-
for acId in "${result.updated[@]}"; do
|
|
119
|
-
echo " $acId → [x]"
|
|
120
|
-
done
|
|
121
|
-
fi
|
|
122
|
-
|
|
123
|
-
# Conflicts
|
|
124
|
-
if [[ -n "${result.conflicts}" ]]; then
|
|
125
|
-
echo "⚠️ Conflicts detected:"
|
|
126
|
-
for conflict in "${result.conflicts[@]}"; do
|
|
127
|
-
echo " $conflict"
|
|
128
|
-
done
|
|
129
|
-
fi
|
|
130
|
-
|
|
131
|
-
# Warnings
|
|
132
|
-
if [[ -n "${result.warnings}" ]]; then
|
|
133
|
-
echo "⚠️ Warnings:"
|
|
134
|
-
for warning in "${result.warnings[@]}"; do
|
|
135
|
-
echo " $warning"
|
|
136
|
-
done
|
|
137
|
-
fi
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## Example Scenarios
|
|
143
|
-
|
|
144
|
-
### Scenario 1: Normal Sync (100% Complete AC)
|
|
145
|
-
|
|
146
|
-
**Before**:
|
|
147
|
-
```markdown
|
|
148
|
-
# spec.md
|
|
149
|
-
- [ ] AC-US1-01: User can login
|
|
150
|
-
- [ ] AC-US1-02: Session persists
|
|
151
|
-
|
|
152
|
-
# tasks.md
|
|
153
|
-
#### T-001: Implement login API
|
|
154
|
-
**AC**: AC-US1-01
|
|
155
|
-
**Status**: [x] (100% - Completed)
|
|
156
|
-
|
|
157
|
-
#### T-002: Add session storage
|
|
158
|
-
**AC**: AC-US1-01
|
|
159
|
-
**Status**: [x] (100% - Completed)
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
**After**:
|
|
163
|
-
```markdown
|
|
164
|
-
# spec.md
|
|
165
|
-
- [x] AC-US1-01: User can login ✓ UPDATED
|
|
166
|
-
- [ ] AC-US1-02: Session persists
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
**Output**:
|
|
170
|
-
```
|
|
171
|
-
🔄 Syncing AC status for increment 0039...
|
|
172
|
-
|
|
173
|
-
✅ Updated AC checkboxes:
|
|
174
|
-
AC-US1-01 → [x]
|
|
175
|
-
|
|
176
|
-
📝 Changes:
|
|
177
|
-
AC-US1-01: [ ] → [x] (2/2 tasks complete - 100%)
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
### Scenario 2: Partial Completion (No Update)
|
|
183
|
-
|
|
184
|
-
**Before**:
|
|
185
|
-
```markdown
|
|
186
|
-
# spec.md
|
|
187
|
-
- [ ] AC-US1-02: Session persists
|
|
188
|
-
|
|
189
|
-
# tasks.md
|
|
190
|
-
#### T-003: Add Redis session store
|
|
191
|
-
**AC**: AC-US1-02
|
|
192
|
-
**Status**: [x] (100% - Completed)
|
|
193
|
-
|
|
194
|
-
#### T-004: Test session expiry
|
|
195
|
-
**AC**: AC-US1-02
|
|
196
|
-
**Status**: [ ] (0% - Not started)
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
**After**:
|
|
200
|
-
```markdown
|
|
201
|
-
# spec.md
|
|
202
|
-
- [ ] AC-US1-02: Session persists (NO CHANGE - 50% complete)
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
**Output**:
|
|
206
|
-
```
|
|
207
|
-
🔄 Syncing AC status for increment 0039...
|
|
208
|
-
|
|
209
|
-
ℹ️ No AC updates needed
|
|
210
|
-
|
|
211
|
-
📊 Completion Status:
|
|
212
|
-
AC-US1-02: 1/2 tasks complete (50%) - threshold not met
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
### Scenario 3: Conflict Detection
|
|
218
|
-
|
|
219
|
-
**Before**:
|
|
220
|
-
```markdown
|
|
221
|
-
# spec.md
|
|
222
|
-
- [x] AC-US1-03: Data validated (manually checked)
|
|
223
|
-
|
|
224
|
-
# tasks.md
|
|
225
|
-
#### T-005: Add validation rules
|
|
226
|
-
**AC**: AC-US1-03
|
|
227
|
-
**Status**: [x] (100% - Completed)
|
|
228
|
-
|
|
229
|
-
#### T-006: Add error handling
|
|
230
|
-
**AC**: AC-US1-03
|
|
231
|
-
**Status**: [ ] (0% - Not started)
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
**After**:
|
|
235
|
-
```markdown
|
|
236
|
-
# spec.md
|
|
237
|
-
- [x] AC-US1-03: Data validated (PRESERVED - conflict detected)
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**Output**:
|
|
241
|
-
```
|
|
242
|
-
🔄 Syncing AC status for increment 0039...
|
|
243
|
-
|
|
244
|
-
⚠️ Conflicts detected:
|
|
245
|
-
AC-US1-03: Marked [x] but only 1/2 tasks complete (50%)
|
|
246
|
-
→ Manual override preserved (no change made)
|
|
247
|
-
|
|
248
|
-
💡 Tip: Review tasks for AC-US1-03 or uncheck manually if premature
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
### Scenario 4: Orphaned AC Warning
|
|
254
|
-
|
|
255
|
-
**Before**:
|
|
256
|
-
```markdown
|
|
257
|
-
# spec.md
|
|
258
|
-
- [ ] AC-US1-04: Performance optimized
|
|
259
|
-
- [ ] AC-US1-05: Security hardened
|
|
260
|
-
|
|
261
|
-
# tasks.md
|
|
262
|
-
#### T-007: Implement caching
|
|
263
|
-
**AC**: AC-US1-04
|
|
264
|
-
**Status**: [x] (100% - Completed)
|
|
265
|
-
|
|
266
|
-
(No tasks reference AC-US1-05)
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
**Output**:
|
|
270
|
-
```
|
|
271
|
-
🔄 Syncing AC status for increment 0039...
|
|
272
|
-
|
|
273
|
-
✅ Updated AC checkboxes:
|
|
274
|
-
AC-US1-04 → [x]
|
|
275
|
-
|
|
276
|
-
⚠️ Warnings:
|
|
277
|
-
AC-US1-05: No implementing tasks found (orphaned AC)
|
|
278
|
-
→ Add tasks or remove AC from spec.md
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## Integration with Hooks
|
|
284
|
-
|
|
285
|
-
### Automatic Sync (Post-Task-Completion Hook)
|
|
286
|
-
|
|
287
|
-
The hook automatically calls `ACStatusManager.syncACStatus()` after every task completion:
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
# plugins/specweave/hooks/post-task-completion.sh (lines 232-269)
|
|
291
|
-
if [ -n "$CURRENT_INCREMENT" ]; then
|
|
292
|
-
node plugins/specweave/lib/hooks/update-ac-status.js "$CURRENT_INCREMENT"
|
|
293
|
-
fi
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
**Disable automatic sync**:
|
|
297
|
-
```bash
|
|
298
|
-
export SKIP_AC_SYNC=true
|
|
299
|
-
# Now hooks won't sync ACs (useful for batch work)
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
---
|
|
303
|
-
|
|
304
|
-
## Integration with Other Commands
|
|
305
|
-
|
|
306
|
-
### /sw:validate
|
|
307
|
-
```bash
|
|
308
|
-
# Validate ACs before closing increment
|
|
309
|
-
/sw:sync-acs --validate
|
|
310
|
-
# Warns if ACs out of sync
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
### /sw:done
|
|
314
|
-
```bash
|
|
315
|
-
# Auto-sync ACs before closing
|
|
316
|
-
/sw:sync-acs
|
|
317
|
-
# Then proceed with increment closure
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
### /sw:progress
|
|
321
|
-
```bash
|
|
322
|
-
# Show AC completion alongside task progress
|
|
323
|
-
/sw:sync-acs --status
|
|
324
|
-
# Display: 8/10 ACs complete (80%)
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
## Success Criteria
|
|
330
|
-
|
|
331
|
-
- ✅ Syncs AC checkboxes based on task completion (100% threshold)
|
|
332
|
-
- ✅ Detects and preserves manual overrides (conflicts)
|
|
333
|
-
- ✅ Warns about orphaned ACs (no implementing tasks)
|
|
334
|
-
- ✅ Shows clear diff of changes before/after
|
|
335
|
-
- ✅ Atomic file writes (no corruption risk)
|
|
336
|
-
- ✅ Integrates with post-task-completion hook
|
|
337
|
-
- ✅ Supports dry-run mode
|
|
338
|
-
- ✅ Logs all changes to metadata.json
|
|
339
|
-
|
|
340
|
-
---
|
|
341
|
-
|
|
342
|
-
**This command ensures acceptance criteria accurately reflect implementation progress!**
|
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Sync ALL increment specifications to living docs structure by default. Creates FS-XXX folders for each increment. Use with increment ID to sync single increment.
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Sync Increment Specifications to Living Docs
|
|
6
|
-
|
|
7
|
-
**DEFAULT BEHAVIOR**: Syncs ALL increments to living docs (not just one!)
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## STEP 1: Parse Arguments & Determine Mode
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
Arguments provided: $ARGUMENTS
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
**Parse the input to determine sync mode**:
|
|
18
|
-
|
|
19
|
-
| Input | Mode | Action |
|
|
20
|
-
|-------|------|--------|
|
|
21
|
-
| `/sw:sync-specs` | **ALL** (default) | Sync ALL increments |
|
|
22
|
-
| `/sw:sync-specs --all` | **ALL** (explicit) | Sync ALL increments |
|
|
23
|
-
| `/sw:sync-specs 0106` | **SINGLE** | Sync only increment 0106 |
|
|
24
|
-
| `/sw:sync-specs 0106 --dry-run` | **SINGLE + DRY** | Preview sync for 0106 |
|
|
25
|
-
| `/sw:sync-specs --dry-run` | **ALL + DRY** | Preview sync for ALL |
|
|
26
|
-
|
|
27
|
-
**CRITICAL**: No increment ID = sync ALL increments (this is the DEFAULT!)
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## STEP 2: Execute Sync Based on Mode
|
|
32
|
-
|
|
33
|
-
### MODE A: Sync ALL Increments (Default)
|
|
34
|
-
|
|
35
|
-
**This is the DEFAULT when no increment ID is provided!**
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
# List ALL syncable increments (with spec.md)
|
|
39
|
-
ls -1 .specweave/increments/ | grep -E '^[0-9]{4}E?-' | sort
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
**Execute sync for EACH increment**:
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
🔄 Syncing ALL increments to living docs...
|
|
46
|
-
|
|
47
|
-
Found {N} increments with spec.md files.
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**For each increment**, call the sync logic:
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
import { LivingDocsSync } from './src/core/living-docs/living-docs-sync.js';
|
|
54
|
-
|
|
55
|
-
const sync = new LivingDocsSync(projectRoot);
|
|
56
|
-
|
|
57
|
-
// Get all increment folders
|
|
58
|
-
const incrementsDir = '.specweave/increments';
|
|
59
|
-
const entries = fs.readdirSync(incrementsDir);
|
|
60
|
-
const increments = entries.filter(e => /^\d{4}E?-/.test(e));
|
|
61
|
-
|
|
62
|
-
let successCount = 0;
|
|
63
|
-
let failCount = 0;
|
|
64
|
-
const results = [];
|
|
65
|
-
|
|
66
|
-
for (const incrementId of increments.sort()) {
|
|
67
|
-
// Check if spec.md exists
|
|
68
|
-
const specPath = path.join(incrementsDir, incrementId, 'spec.md');
|
|
69
|
-
if (!fs.existsSync(specPath)) {
|
|
70
|
-
console.log(` ⚠️ Skipping ${incrementId} (no spec.md)`);
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
try {
|
|
75
|
-
const result = await sync.syncIncrement(incrementId, { dryRun, force });
|
|
76
|
-
if (result.success) {
|
|
77
|
-
successCount++;
|
|
78
|
-
results.push({ id: incrementId, featureId: result.featureId, status: '✅' });
|
|
79
|
-
} else {
|
|
80
|
-
failCount++;
|
|
81
|
-
results.push({ id: incrementId, featureId: '', status: '❌', error: result.errors[0] });
|
|
82
|
-
}
|
|
83
|
-
} catch (error) {
|
|
84
|
-
failCount++;
|
|
85
|
-
results.push({ id: incrementId, featureId: '', status: '❌', error: error.message });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
**Output summary table**:
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
═══════════════════════════════════════════════════════
|
|
94
|
-
✅ BULK SYNC COMPLETE
|
|
95
|
-
═══════════════════════════════════════════════════════
|
|
96
|
-
|
|
97
|
-
| Increment | Feature ID | Status |
|
|
98
|
-
|-----------|------------|--------|
|
|
99
|
-
| 0093-ado-permission-profile-fixes | FS-093 | ✅ |
|
|
100
|
-
| 0094-unit-test-alignment | FS-094 | ✅ |
|
|
101
|
-
| 0095-per-project-epic-hierarchy | FS-095 | ✅ |
|
|
102
|
-
| ... | ... | ... |
|
|
103
|
-
|
|
104
|
-
───────────────────────────────────────────────────────
|
|
105
|
-
📊 SUMMARY
|
|
106
|
-
───────────────────────────────────────────────────────
|
|
107
|
-
|
|
108
|
-
Total increments: {N}
|
|
109
|
-
✅ Succeeded: {successCount}
|
|
110
|
-
❌ Failed: {failCount}
|
|
111
|
-
⏭️ Skipped: {skippedCount} (no spec.md)
|
|
112
|
-
|
|
113
|
-
═══════════════════════════════════════════════════════
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### MODE B: Sync SINGLE Increment
|
|
117
|
-
|
|
118
|
-
**Only when a specific increment ID is provided**:
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
🎯 Target increment: {increment_id}
|
|
122
|
-
📁 Increment path: .specweave/increments/{increment_id}
|
|
123
|
-
🔄 Mode: Single increment sync
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**Execute single sync**:
|
|
127
|
-
|
|
128
|
-
```typescript
|
|
129
|
-
const result = await sync.syncIncrement(incrementId, { dryRun, force });
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
**Output**:
|
|
133
|
-
```
|
|
134
|
-
═══════════════════════════════════════════════════════
|
|
135
|
-
✅ SINGLE INCREMENT SYNC COMPLETE
|
|
136
|
-
═══════════════════════════════════════════════════════
|
|
137
|
-
|
|
138
|
-
Increment: {increment_id}
|
|
139
|
-
Feature ID: FS-{XXX} (derived from increment number)
|
|
140
|
-
Project: {project}
|
|
141
|
-
|
|
142
|
-
Files created:
|
|
143
|
-
• {project}/FS-{XXX}/FEATURE.md
|
|
144
|
-
• {project}/FS-{XXX}/us-001-*.md
|
|
145
|
-
• {project}/FS-{XXX}/us-002-*.md
|
|
146
|
-
...
|
|
147
|
-
|
|
148
|
-
═══════════════════════════════════════════════════════
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
---
|
|
152
|
-
|
|
153
|
-
## STEP 3: Identify Missing/New Specs
|
|
154
|
-
|
|
155
|
-
After sync, compare increments vs specs:
|
|
156
|
-
|
|
157
|
-
```bash
|
|
158
|
-
# Get all increment numbers
|
|
159
|
-
INCREMENT_NUMS=$(ls -1 .specweave/increments/ | grep -E '^[0-9]{4}E?-' | sed 's/^\([0-9]*E\?\).*/\1/')
|
|
160
|
-
|
|
161
|
-
# Get all FS-XXX folders in specs
|
|
162
|
-
SPEC_NUMS=$(ls -1 .specweave/docs/internal/specs/*/FS-* 2>/dev/null | grep -oE 'FS-[0-9]+E?' | sed 's/FS-//')
|
|
163
|
-
|
|
164
|
-
# Find missing (increments without corresponding FS-XXX)
|
|
165
|
-
echo "Checking for gaps..."
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
**Report gaps** (increments without corresponding specs):
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
📊 GAP ANALYSIS
|
|
172
|
-
───────────────────────────────────────────────────────
|
|
173
|
-
|
|
174
|
-
{if gaps found}
|
|
175
|
-
⚠️ Found {N} increments without corresponding specs:
|
|
176
|
-
• 0106-ci-health-improvements → FS-106 missing
|
|
177
|
-
• 0113-enhanced-living-docs-architecture → FS-113 missing
|
|
178
|
-
|
|
179
|
-
These were synced in this run.
|
|
180
|
-
{else}
|
|
181
|
-
✅ All increments have corresponding spec folders!
|
|
182
|
-
{/if}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
---
|
|
186
|
-
|
|
187
|
-
## STEP 4: Feature ID Derivation Rules
|
|
188
|
-
|
|
189
|
-
**CRITICAL**: Feature ID is ALWAYS derived from increment number:
|
|
190
|
-
|
|
191
|
-
| Increment ID | Feature ID |
|
|
192
|
-
|--------------|------------|
|
|
193
|
-
| 0002-user-authentication | FS-002 |
|
|
194
|
-
| 0040-some-feature | FS-040 |
|
|
195
|
-
| 0106-ci-health | FS-106 |
|
|
196
|
-
| 0111E-dora-metrics-fix | FS-111E |
|
|
197
|
-
|
|
198
|
-
**Rules**:
|
|
199
|
-
- Increment `XXXX-name` → Feature `FS-XXX` (3-digit minimum)
|
|
200
|
-
- Increment `XXXXE-name` (external) → Feature `FS-XXXE`
|
|
201
|
-
- NO date-based patterns (FS-YY-MM-DD-name is WRONG)
|
|
202
|
-
- See ADR-0187 for rationale
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
## OPTIONS
|
|
207
|
-
|
|
208
|
-
### --dry-run
|
|
209
|
-
Preview what would be synced without making changes:
|
|
210
|
-
|
|
211
|
-
```bash
|
|
212
|
-
/sw:sync-specs --dry-run # Preview ALL
|
|
213
|
-
/sw:sync-specs 0106 --dry-run # Preview single
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### --force
|
|
217
|
-
Overwrite existing files without prompting:
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
/sw:sync-specs --force # Force ALL
|
|
221
|
-
/sw:sync-specs 0106 --force # Force single
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
## EXAMPLES
|
|
227
|
-
|
|
228
|
-
### Example 1: Sync ALL (Default - Most Common)
|
|
229
|
-
```
|
|
230
|
-
User: /sw:sync-specs
|
|
231
|
-
|
|
232
|
-
Output:
|
|
233
|
-
🔄 Syncing ALL increments to living docs...
|
|
234
|
-
|
|
235
|
-
Found 25 increments with spec.md files.
|
|
236
|
-
|
|
237
|
-
| Increment | Feature ID | Status |
|
|
238
|
-
|-----------|------------|--------|
|
|
239
|
-
| 0093-ado-permission-profile-fixes | FS-093 | ✅ |
|
|
240
|
-
| 0094-unit-test-alignment | FS-094 | ✅ |
|
|
241
|
-
| 0095-per-project-epic-hierarchy | FS-095 | ✅ |
|
|
242
|
-
| 0096-ado-import-fixes | FS-096 | ✅ |
|
|
243
|
-
| 0097-umbrella-module-detection | FS-097 | ✅ |
|
|
244
|
-
| ... | ... | ... |
|
|
245
|
-
| 0116-livingspec-universal-standard | FS-116 | ✅ |
|
|
246
|
-
|
|
247
|
-
📊 SUMMARY: 25 succeeded, 0 failed
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### Example 2: Sync Single Increment
|
|
251
|
-
```
|
|
252
|
-
User: /sw:sync-specs 0106
|
|
253
|
-
|
|
254
|
-
Output:
|
|
255
|
-
🎯 Target increment: 0106-ci-health-improvements
|
|
256
|
-
📁 Increment path: .specweave/increments/0106-ci-health-improvements
|
|
257
|
-
🔄 Mode: Single increment sync
|
|
258
|
-
|
|
259
|
-
✅ Synced 0106-ci-health-improvements → FS-106
|
|
260
|
-
Created: specweave/FS-106/FEATURE.md
|
|
261
|
-
Created: specweave/FS-106/us-001-*.md
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Example 3: Dry Run ALL
|
|
265
|
-
```
|
|
266
|
-
User: /sw:sync-specs --dry-run
|
|
267
|
-
|
|
268
|
-
Output:
|
|
269
|
-
🔍 DRY RUN MODE - No files will be modified
|
|
270
|
-
|
|
271
|
-
Would sync 25 increments:
|
|
272
|
-
• 0093 → FS-093 (exists, would update)
|
|
273
|
-
• 0094 → FS-094 (exists, would update)
|
|
274
|
-
• 0106 → FS-106 (NEW - would create)
|
|
275
|
-
• 0113 → FS-113 (NEW - would create)
|
|
276
|
-
...
|
|
277
|
-
|
|
278
|
-
No changes made (dry run mode)
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
## ERROR HANDLING
|
|
284
|
-
|
|
285
|
-
### Error: No Increments Found
|
|
286
|
-
```
|
|
287
|
-
❌ Error: No increments found in .specweave/increments/
|
|
288
|
-
|
|
289
|
-
Create an increment first:
|
|
290
|
-
/sw:increment "feature name"
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Error: Specific Increment Not Found
|
|
294
|
-
```
|
|
295
|
-
❌ Error: Increment '0999' not found
|
|
296
|
-
|
|
297
|
-
Available increments:
|
|
298
|
-
0093-ado-permission-profile-fixes
|
|
299
|
-
0094-unit-test-alignment
|
|
300
|
-
...
|
|
301
|
-
|
|
302
|
-
Usage: /sw:sync-specs [increment_id]
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
### Error: Missing spec.md
|
|
306
|
-
```
|
|
307
|
-
⚠️ Skipping 0107-incomplete-feature (no spec.md)
|
|
308
|
-
|
|
309
|
-
Increment must have a spec.md file to sync.
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
---
|
|
313
|
-
|
|
314
|
-
## IMPORTANT NOTES
|
|
315
|
-
|
|
316
|
-
1. **DEFAULT = ALL**: Running without arguments syncs ALL increments
|
|
317
|
-
2. **Idempotent**: Safe to run multiple times (updates existing, creates missing)
|
|
318
|
-
3. **Feature ID derivation**: Always from increment number (not stored in metadata)
|
|
319
|
-
4. **Project detection**: Reads `project:` from spec.md YAML frontmatter
|
|
320
|
-
5. **External sync**: Triggers GitHub/JIRA/ADO sync if configured
|
|
321
|
-
|
|
322
|
-
---
|
|
323
|
-
|
|
324
|
-
## WHEN TO USE THIS COMMAND
|
|
325
|
-
|
|
326
|
-
✅ **Use `/sw:sync-specs` (no args) when**:
|
|
327
|
-
- You want to ensure ALL increments are in living docs
|
|
328
|
-
- After creating multiple increments
|
|
329
|
-
- To fix gaps in specs folder
|
|
330
|
-
- Regular maintenance sync
|
|
331
|
-
|
|
332
|
-
✅ **Use `/sw:sync-specs <id>` when**:
|
|
333
|
-
- You only want to sync one specific increment
|
|
334
|
-
- After updating a single spec.md
|
|
335
|
-
- Debugging sync issues for one increment
|
|
336
|
-
|
|
337
|
-
---
|
|
338
|
-
|
|
339
|
-
**Execute this command now. Default = sync ALL increments.**
|