Back to skills
SKILL.md
Sync Specs
ASecuritySync ALL increment specifications to living docs structure by default. Creates FS-XXX folders for each increment. Use with increment ID to sync single increment.
- 57 stars
- 0 votes
- 0 copies
- 0 views
- Added October 17, 2026
Security analysis
100/100npx -y skills add diegosouzapw/awesome-omni-skill --skill sync-specs --agent claude-codeAre you the author of Sync Specs?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/diegosouzapw-sync-specs)---
name: sync-specs
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.
---
# Sync Increment Specifications to Living Docs
**DEFAULT BEHAVIOR**: Syncs ALL increments to living docs (not just one!)
---
## STEP 1: Parse Arguments & Determine Mode
```
Arguments provided: $ARGUMENTS
```
**Parse the input to determine sync mode**:
| Input | Mode | Action |
|-------|------|--------|
| `/sw:sync-specs` | **ALL** (default) | Sync ALL increments |
| `/sw:sync-specs --all` | **ALL** (explicit) | Sync ALL increments |
| `/sw:sync-specs 0106` | **SINGLE** | Sync only increment 0106 |
| `/sw:sync-specs 0106 --dry-run` | **SINGLE + DRY** | Preview sync for 0106 |
| `/sw:sync-specs --dry-run` | **ALL + DRY** | Preview sync for ALL |
**CRITICAL**: No increment ID = sync ALL increments (this is the DEFAULT!)
---
## STEP 2: Execute Sync Based on Mode
### MODE A: Sync ALL Increments (Default)
**This is the DEFAULT when no increment ID is provided!**
```bash
# List ALL syncable increments (with spec.md)
ls -1 .specweave/increments/ | grep -E '^[0-9]{4}E?-' | sort
```
**Execute sync for EACH increment**:
```
π Syncing ALL increments to living docs...
Found {N} increments with spec.md files.
```
**For each increment**, call the sync logic:
```typescript
import { LivingDocsSync } from './src/core/living-docs/living-docs-sync.js';
const sync = new LivingDocsSync(projectRoot);
// Get all increment folders
const incrementsDir = '.specweave/increments';
const entries = fs.readdirSync(incrementsDir);
const increments = entries.filter(e => /^\d{4}E?-/.test(e));
let successCount = 0;
let failCount = 0;
const results = [];
for (const incrementId of increments.sort()) {
// Check if spec.md exists
const specPath = path.join(incrementsDir, incrementId, 'spec.md');
if (!fs.existsSync(specPath)) {
console.log(` β οΈ Skipping ${incrementId} (no spec.md)`);
continue;
}
try {
const result = await sync.syncIncrement(incrementId, { dryRun, force });
if (result.success) {
successCount++;
results.push({ id: incrementId, featureId: result.featureId, status: 'β
' });
} else {
failCount++;
results.push({ id: incrementId, featureId: '', status: 'β', error: result.errors[0] });
}
} catch (error) {
failCount++;
results.push({ id: incrementId, featureId: '', status: 'β', error: error.message });
}
}
```
**Output summary table**:
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
BULK SYNC COMPLETE
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Increment | Feature ID | Status |
|-----------|------------|--------|
| 0093-ado-permission-profile-fixes | FS-093 | β
|
| 0094-unit-test-alignment | FS-094 | β
|
| 0095-per-project-epic-hierarchy | FS-095 | β
|
| ... | ... | ... |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π SUMMARY
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Total increments: {N}
β
Succeeded: {successCount}
β Failed: {failCount}
βοΈ Skipped: {skippedCount} (no spec.md)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
### MODE B: Sync SINGLE Increment
**Only when a specific increment ID is provided**:
```
π― Target increment: {increment_id}
π Increment path: .specweave/increments/{increment_id}
π Mode: Single increment sync
```
**Execute single sync**:
```typescript
const result = await sync.syncIncrement(incrementId, { dryRun, force });
```
**Output**:
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
SINGLE INCREMENT SYNC COMPLETE
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Increment: {increment_id}
Feature ID: FS-{XXX} (derived from increment number)
Project: {project}
Files created:
β’ {project}/FS-{XXX}/FEATURE.md
β’ {project}/FS-{XXX}/us-001-*.md
β’ {project}/FS-{XXX}/us-002-*.md
...
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
---
## STEP 3: Identify Missing/New Specs
After sync, compare increments vs specs:
```bash
# Get all increment numbers
INCREMENT_NUMS=$(ls -1 .specweave/increments/ | grep -E '^[0-9]{4}E?-' | sed 's/^\([0-9]*E\?\).*/\1/')
# Get all FS-XXX folders in specs
SPEC_NUMS=$(ls -1 .specweave/docs/internal/specs/*/FS-* 2>/dev/null | grep -oE 'FS-[0-9]+E?' | sed 's/FS-//')
# Find missing (increments without corresponding FS-XXX)
echo "Checking for gaps..."
```
**Report gaps** (increments without corresponding specs):
```
π GAP ANALYSIS
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
{if gaps found}
β οΈ Found {N} increments without corresponding specs:
β’ 0106-ci-health-improvements β FS-106 missing
β’ 0113-enhanced-living-docs-architecture β FS-113 missing
These were synced in this run.
{else}
β
All increments have corresponding spec folders!
{/if}
```
---
## STEP 4: Feature ID Derivation Rules
**CRITICAL**: Feature ID is ALWAYS derived from increment number:
| Increment ID | Feature ID |
|--------------|------------|
| 0002-user-authentication | FS-002 |
| 0040-some-feature | FS-040 |
| 0106-ci-health | FS-106 |
| 0111E-dora-metrics-fix | FS-111E |
**Rules**:
- Increment `XXXX-name` β Feature `FS-XXX` (3-digit minimum)
- Increment `XXXXE-name` (external) β Feature `FS-XXXE`
- NO date-based patterns (FS-YY-MM-DD-name is WRONG)
- See ADR-0187 for rationale
---
## OPTIONS
### --dry-run
Preview what would be synced without making changes:
```bash
/sw:sync-specs --dry-run # Preview ALL
/sw:sync-specs 0106 --dry-run # Preview single
```
### --force
Overwrite existing files without prompting:
```bash
/sw:sync-specs --force # Force ALL
/sw:sync-specs 0106 --force # Force single
```
---
## EXAMPLES
### Example 1: Sync ALL (Default - Most Common)
```
User: /sw:sync-specs
Output:
π Syncing ALL increments to living docs...
Found 25 increments with spec.md files.
| Increment | Feature ID | Status |
|-----------|------------|--------|
| 0093-ado-permission-profile-fixes | FS-093 | β
|
| 0094-unit-test-alignment | FS-094 | β
|
| 0095-per-project-epic-hierarchy | FS-095 | β
|
| 0096-ado-import-fixes | FS-096 | β
|
| 0097-umbrella-module-detection | FS-097 | β
|
| ... | ... | ... |
| 0116-livingspec-universal-standard | FS-116 | β
|
π SUMMARY: 25 succeeded, 0 failed
```
### Example 2: Sync Single Increment
```
User: /sw:sync-specs 0106
Output:
π― Target increment: 0106-ci-health-improvements
π Increment path: .specweave/increments/0106-ci-health-improvements
π Mode: Single increment sync
β
Synced 0106-ci-health-improvements β FS-106
Created: specweave/FS-106/FEATURE.md
Created: specweave/FS-106/us-001-*.md
```
### Example 3: Dry Run ALL
```
User: /sw:sync-specs --dry-run
Output:
π DRY RUN MODE - No files will be modified
Would sync 25 increments:
β’ 0093 β FS-093 (exists, would update)
β’ 0094 β FS-094 (exists, would update)
β’ 0106 β FS-106 (NEW - would create)
β’ 0113 β FS-113 (NEW - would create)
...
No changes made (dry run mode)
```
---
## ERROR HANDLING
### Error: No Increments Found
```
β Error: No increments found in .specweave/increments/
Create an increment first:
/sw:increment "feature name"
```
### Error: Specific Increment Not Found
```
β Error: Increment '0999' not found
Available increments:
0093-ado-permission-profile-fixes
0094-unit-test-alignment
...
Usage: /sw:sync-specs [increment_id]
```
### Error: Missing spec.md
```
β οΈ Skipping 0107-incomplete-feature (no spec.md)
Increment must have a spec.md file to sync.
```
---
## IMPORTANT NOTES
1. **DEFAULT = ALL**: Running without arguments syncs ALL increments
2. **Idempotent**: Safe to run multiple times (updates existing, creates missing)
3. **Feature ID derivation**: Always from increment number (not stored in metadata)
4. **Project detection**: Reads `project:` from spec.md YAML frontmatter
5. **External sync**: Triggers GitHub/JIRA/ADO sync if configured
---
## WHEN TO USE THIS COMMAND
β
**Use `/sw:sync-specs` (no args) when**:
- You want to ensure ALL increments are in living docs
- After creating multiple increments
- To fix gaps in specs folder
- Regular maintenance sync
β
**Use `/sw:sync-specs <id>` when**:
- You only want to sync one specific increment
- After updating a single spec.md
- Debugging sync issues for one increment
---
**Execute this command now. Default = sync ALL increments.**
Attribution
Comments
Loading commentsβ¦
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.