Restore a feature or epic from archive back to active status
Restore archived features or epics back to active status. Use this when you need to bring back a feature or epic that was previously archived, including all project folders and automatic link updates.
/plugin marketplace add anton-abyzov/specweave/plugin install sw@specweaveRestore an archived feature or epic back to its active location. This also restores all project-specific folders and updates links throughout the codebase.
/sw:restore-feature <feature-or-epic-id>
# Restore a feature
/sw:restore-feature FS-001
# Restore an epic
/sw:restore-feature EPIC-2024-Q4
{project}/_archive/FS-XXX/ → {project}/FS-XXX/Note: The _features/ folder is OBSOLETE. Features live in {project}/FS-XXX/.
_epics/_archive/EPIC-XXX/ → _epics/EPIC-XXX/import { Task } from '@claude/types';
const task = new Task('restore-feature', 'Restore feature or epic from archive');
task.run(async () => {
const itemId = process.argv[3]; // Get the feature/epic ID
if (!itemId) {
console.error('❌ Please provide a feature or epic ID to restore');
console.log('Usage: /sw:restore-feature <feature-or-epic-id>');
console.log('Example: /sw:restore-feature FS-001');
process.exit(1);
}
const { FeatureArchiver } = await import('../../../dist/src/core/living-docs/feature-archiver.js');
const archiver = new FeatureArchiver(process.cwd());
try {
// Determine if it's a feature or epic
const isEpic = itemId.startsWith('EPIC-');
if (isEpic) {
// Restore epic (to be implemented)
await archiver.restoreEpic(itemId);
console.log(`✅ Restored epic ${itemId} from archive`);
} else {
// Restore feature
await archiver.restoreFeature(itemId);
console.log(`✅ Restored feature ${itemId} from archive`);
}
// Show current stats
const stats = await archiver.getArchiveStats();
console.log('\n📊 Current Archive Statistics:');
console.log(` Features: ${stats.features.active} active, ${stats.features.archived} archived`);
console.log(` Epics: ${stats.epics.active} active, ${stats.epics.archived} archived`);
} catch (error) {
console.error(`❌ Failed to restore ${itemId}: ${error.message}`);
process.exit(1);
}
});
export default task;