specmem prune¶
Archive or delete orphaned and stale specifications.
Synopsis¶
Description¶
The prune command helps maintain a lean spec collection by identifying and removing specs that are no longer relevant. It supports:
- Orphaned specs: Specs with no code references
- Stale specs: Specs not modified within a threshold period
- Explicit targeting: Prune specific specs by name
By default, pruning operates in dry-run mode to preview changes safely.
Arguments¶
| Argument | Description |
|---|---|
SPEC_NAMES |
Optional list of specific spec names to prune |
Options¶
| Option | Default | Description |
|---|---|---|
--mode, -m |
archive |
Prune mode: archive or delete |
--dry-run/--no-dry-run |
--dry-run |
Preview changes without applying |
--force, -f |
false |
Force delete without confirmation |
--orphaned |
false |
Prune all orphaned specs |
--stale |
false |
Prune all stale specs |
--stale-days |
90 |
Days threshold for stale detection |
--path, -p |
. |
Repository path |
Examples¶
Analyze specs (no changes)¶
Shows a health analysis table without making any changes.
Preview orphaned specs¶
Shows what would be archived if you ran with --no-dry-run.
Archive orphaned specs¶
Archives all orphaned specs to .specmem/archive/.
Delete specific specs¶
Permanently deletes the specified specs.
Prune stale specs¶
Archives specs not modified in the last 60 days.
Output¶
The command displays a table showing:
- Spec: Specification name
- Action:
archived,deleted, orskipped - Reason: Why the action was taken
Archive Location¶
Archived specs are stored in .specmem/archive/ with metadata including:
- Original path
- Archive timestamp
- Health score at time of archiving
- Reason for archiving
See Also¶
- specmem health - View spec health scores
- specmem generate - Generate specs from code