Manually synchronize acceptance criteria (AC) checkbox status in spec.md based on task completion
Manually sync acceptance criteria checkboxes in spec.md to match task completion status. Use when ACs are out of sync, after manual task completion, or to verify status before closing an increment.
/plugin marketplace add anton-abyzov/specweave/plugin install sw@specweavePurpose: Manually trigger AC checkbox synchronization to ensure spec.md acceptance criteria accurately reflect task completion status.
Use When:
Detect Active Increment
Parse Task Completion
Parse AC Definitions
Intelligent Sync Logic
Atomic File Update
# Auto-detect and sync active increment
/sw:sync-acs
# Sync specific increment
/sw:sync-acs 0039
# Show what would change (dry run)
/sw:sync-acs --dry-run
# Force sync (ignore conflicts)
/sw:sync-acs --force
# Validate only (check for mismatches)
/sw:sync-acs --validate
The command uses ACStatusManager for sophisticated synchronization:
import { ACStatusManager } from '../../../../../src/core/increment/ac-status-manager';
const manager = new ACStatusManager(process.cwd());
const result = await manager.syncACStatus(incrementId);
// result.synced: true if sync was performed
// result.updated: string[] - AC-IDs updated to [x]
// result.conflicts: string[] - Conflicts detected
// result.warnings: string[] - Orphaned ACs, missing files
// result.changes: string[] - Human-readable diff
# Auto-detect active increment
ACTIVE_INCREMENT=$(ls -t .specweave/increments/ 2>/dev/null | grep -v "_backlog\|_archive" | head -1)
if [[ -z "$ACTIVE_INCREMENT" ]]; then
echo "❌ No active increment found"
exit 1
fi
echo "🔄 Syncing AC status for $ACTIVE_INCREMENT..."
# Use the update-ac-status.js hook script (already integrated)
node plugins/specweave/lib/hooks/update-ac-status.js "$ACTIVE_INCREMENT"
Or invoke directly:
const result = await manager.syncACStatus(incrementId);
# Updated ACs
if [[ -n "${result.updated}" ]]; then
echo "✅ Updated AC checkboxes:"
for acId in "${result.updated[@]}"; do
echo " $acId → [x]"
done
fi
# Conflicts
if [[ -n "${result.conflicts}" ]]; then
echo "⚠️ Conflicts detected:"
for conflict in "${result.conflicts[@]}"; do
echo " $conflict"
done
fi
# Warnings
if [[ -n "${result.warnings}" ]]; then
echo "⚠️ Warnings:"
for warning in "${result.warnings[@]}"; do
echo " $warning"
done
fi
Before:
# spec.md
- [ ] AC-US1-01: User can login
- [ ] AC-US1-02: Session persists
# tasks.md
#### T-001: Implement login API
**AC**: AC-US1-01
**Status**: [x] (100% - Completed)
#### T-002: Add session storage
**AC**: AC-US1-01
**Status**: [x] (100% - Completed)
After:
# spec.md
- [x] AC-US1-01: User can login ✓ UPDATED
- [ ] AC-US1-02: Session persists
Output:
🔄 Syncing AC status for increment 0039...
✅ Updated AC checkboxes:
AC-US1-01 → [x]
📝 Changes:
AC-US1-01: [ ] → [x] (2/2 tasks complete - 100%)
Before:
# spec.md
- [ ] AC-US1-02: Session persists
# tasks.md
#### T-003: Add Redis session store
**AC**: AC-US1-02
**Status**: [x] (100% - Completed)
#### T-004: Test session expiry
**AC**: AC-US1-02
**Status**: [ ] (0% - Not started)
After:
# spec.md
- [ ] AC-US1-02: Session persists (NO CHANGE - 50% complete)
Output:
🔄 Syncing AC status for increment 0039...
ℹ️ No AC updates needed
📊 Completion Status:
AC-US1-02: 1/2 tasks complete (50%) - threshold not met
Before:
# spec.md
- [x] AC-US1-03: Data validated (manually checked)
# tasks.md
#### T-005: Add validation rules
**AC**: AC-US1-03
**Status**: [x] (100% - Completed)
#### T-006: Add error handling
**AC**: AC-US1-03
**Status**: [ ] (0% - Not started)
After:
# spec.md
- [x] AC-US1-03: Data validated (PRESERVED - conflict detected)
Output:
🔄 Syncing AC status for increment 0039...
⚠️ Conflicts detected:
AC-US1-03: Marked [x] but only 1/2 tasks complete (50%)
→ Manual override preserved (no change made)
💡 Tip: Review tasks for AC-US1-03 or uncheck manually if premature
Before:
# spec.md
- [ ] AC-US1-04: Performance optimized
- [ ] AC-US1-05: Security hardened
# tasks.md
#### T-007: Implement caching
**AC**: AC-US1-04
**Status**: [x] (100% - Completed)
(No tasks reference AC-US1-05)
Output:
🔄 Syncing AC status for increment 0039...
✅ Updated AC checkboxes:
AC-US1-04 → [x]
⚠️ Warnings:
AC-US1-05: No implementing tasks found (orphaned AC)
→ Add tasks or remove AC from spec.md
The hook automatically calls ACStatusManager.syncACStatus() after every task completion:
# plugins/specweave/hooks/post-task-completion.sh (lines 232-269)
if [ -n "$CURRENT_INCREMENT" ]; then
node plugins/specweave/lib/hooks/update-ac-status.js "$CURRENT_INCREMENT"
fi
Disable automatic sync:
export SKIP_AC_SYNC=true
# Now hooks won't sync ACs (useful for batch work)
# Validate ACs before closing increment
/sw:sync-acs --validate
# Warns if ACs out of sync
# Auto-sync ACs before closing
/sw:sync-acs
# Then proceed with increment closure
# Show AC completion alongside task progress
/sw:sync-acs --status
# Display: 8/10 ACs complete (80%)
This command ensures acceptance criteria accurately reflect implementation progress!