Syntax
Description
Thespec delete command permanently removes specifications from your project. This operation:
- Deletes the spec from the SQLite database
- Removes the markdown file from
.sudocode/specs/ - Updates the JSONL file to reflect the deletion
- Does NOT automatically delete related issues or relationships
Arguments
SPEC-001 or SPEC-001 SPEC-002 SPEC-003You can delete multiple specs in a single command by providing multiple IDs.Examples
Delete a Single Spec
Remove one spec:Expected output
Expected output
Delete Multiple Specs
Remove several specs at once:Expected output
Expected output
Delete Non-Existent Spec
Attempt to delete a spec that doesn’t exist:Expected output
Expected output
Expected output
Expected output
JSON Output
Get machine-readable output:JSON output
JSON output
What Gets Deleted
When you delete a spec:Database record removed
specs tableMarkdown file removed
.md file in .sudocode/specs/ is deletedJSONL updated
specs.jsonlTags cleaned up
What Doesn’t Get Deleted
Relationships
Relationships
Issues implementing the spec
Issues implementing the spec
implements relationship pointing to a non-existent spec.Impact: These issues become orphaned.Solution: Close or reassign these issues before deleting the spec:Feedback on the spec
Feedback on the spec
Child specs
Child specs
parent_id references.Impact: Child specs lose their parent relationship.Solution: Update or delete child specs first:Safe Deletion Workflow
Follow these steps to safely delete a spec:Review spec details
- Incoming relationships (issues implementing it)
- Outgoing relationships (specs it depends on)
- Child specs (if it’s a parent)
- Feedback received
Handle relationships
Address feedback
Delete the spec
Verify deletion
Alternative: Archive Instead of Delete
Consider archiving instead of deleting:- Spec is hidden from default listings
- Historical reference is preserved
- Relationships remain intact
- Can be unarchived if needed
- Delete: Duplicate specs, test specs, genuinely wrong/useless content
- Archive: Deprecated features, superseded designs, historical documentation
Common Workflows
Cleaning Up Old Specs
List deprecated specs
Review each spec
Close related issues
Delete the specs
Bulk Delete with Scripting
Delete all archived specs:Recovering from Accidental Deletion
If you accidentally delete a spec:Check git history
Restore from git
Or restore from backup
.sudocode/, restore the database and JSONL filesCommon Questions
Is there a confirmation prompt before deleting?
Is there a confirmation prompt before deleting?
spec delete executes immediately without confirmation. Be careful with this command.For safety, you could create a shell alias that prompts for confirmation:Can I undo a deletion?
Can I undo a deletion?
What happens to issues that implement a deleted spec?
What happens to issues that implement a deleted spec?
implements relationship points to a non-existent spec. This creates an orphaned relationship.Best practice: Close or update these issues before deleting the spec.Should I delete or archive deprecated specs?
Should I delete or archive deprecated specs?
- Superseded designs you might reference later
- Historical documentation
- Deprecated features still in use
- Duplicate/accidental specs
- Test/temporary specs
- Genuinely incorrect content
Can I delete multiple specs by pattern?
Can I delete multiple specs by pattern?
Will deleting a parent spec delete children?
Will deleting a parent spec delete children?
parent_id references.Update children first:Troubleshooting
Error: Spec not found
Error: Spec not found
Error: Failed to delete spec
Error: Failed to delete spec
- Check database isn’t locked by another process
- Verify file permissions on
.sudocode/directory - Try syncing first:
sudocode sync
Spec deleted but still appears in list
Spec deleted but still appears in list
Markdown file remains after deletion
Markdown file remains after deletion
Related Commands
spec list
spec show
spec update
issue close
feedback dismiss
sync
Next Steps
Review the spec
Consider archiving instead
If deleting, clean up relationships
Delete the spec
Commit changes

