Validate feature folder consistency across project folders. Detects orphaned features, missing FEATURE.md, and auto-repairs discrepancies. Use for periodic health checks of living docs structure.
Validates feature folder consistency across projects, detecting orphaned features and missing FEATURE.md files. Use for periodic health checks or after sync operations to maintain living docs structure integrity.
/plugin marketplace add anton-abyzov/specweave/plugin install sw@specweaveValidates that feature folders in project directories (e.g., specweave/FS-XXX/) have proper structure.
Note (v5.0.0+): The _features/ folder is OBSOLETE. Features live in {project}/FS-XXX/.
If you find features in _features/, they should be migrated to the correct project folder.
Arguments: [user's arguments]
Options:
--repair: Auto-repair discrepancies (create missing project folders)--dry-run: Show what would be repaired without making changesExecute:
import { FeatureConsistencyValidator } from './dist/src/core/living-docs/feature-consistency-validator.js';
const validator = new FeatureConsistencyValidator(process.cwd(), {
defaultProject: 'specweave'
});
// Parse repair flag
const autoRepair = process.argv.includes('--repair');
const dryRun = process.argv.includes('--dry-run');
if (dryRun) {
console.log('š DRY RUN MODE - No files will be modified\n');
}
// Run validation
const result = await validator.validate(autoRepair && !dryRun);
Output format:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š FEATURE CONSISTENCY VALIDATION REPORT
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Total features scanned: {total}
Consistent: {consistent}
Discrepancies found: {discrepancies}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
{if discrepancies > 0}
ā ļø DISCREPANCIES FOUND
{for each discrepancy}
Feature: {featureId}
Type: {type}
Description: {description}
Auto-repairable: {yes/no}
{if linkedIncrement}
Linked increment: {incrementId} ({exists/not found})
{/if}
{/for}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
{/if}
{if repairs}
š§ REPAIR RESULTS
{for each repair}
{ā
/ā} {featureId}: {action}
{if error} Error: {error}{/if}
{/for}
{/if}
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
šÆ NEXT STEPS
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
{if discrepancies > 0 && !repair}
To auto-repair these discrepancies:
/sw:validate-features --repair
This will:
⢠Create missing project folders
⢠Generate README.md files
⢠Link to existing FEATURE.md
{/if}
{if all repaired}
ā
All discrepancies have been repaired!
Verify the repairs:
ls -la .specweave/docs/internal/specs/specweave/
{/if}
{if orphaned features}
ā ļø Some features could not be auto-repaired.
Manual intervention required for:
{list orphaned features}
Options:
1. Delete orphaned folder if no longer needed
2. Re-sync from increment if increment still exists
3. Move to correct project folder manually
{/if}
User: /sw:validate-features
Output:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š FEATURE CONSISTENCY VALIDATION REPORT
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Total features scanned: 7
Consistent: 6
Discrepancies found: 1
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ļø DISCREPANCIES FOUND
Feature: FS-062
Type: missing_feature_md
Description: Feature FS-062 folder exists but missing FEATURE.md
Auto-repairable: Yes
Linked increment: 0062-test-living-docs-auto-sync (not found)
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
šÆ To repair: /sw:validate-features --repair
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
User: /sw:validate-features --repair
Output:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š FEATURE CONSISTENCY VALIDATION REPORT
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Total features scanned: 7
Consistent: 7
Discrepancies found: 1
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š§ REPAIR RESULTS
ā
FS-062: Created .specweave/docs/internal/specs/specweave/FS-062/README.md
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Use this command when:
_features/ to {project}/ foldersRoot cause of discrepancies:
_features/ folders not yet migrated (v5.0.0+)/sw:sync-specs - Sync increment to living docs (includes consistency check)/sw:validate - Validate increment structure/sw:archive - Archive completed increments