openspec-archive
Complete a change and update the source of truth specifications. Use after all implementation tasks are finished and verified.
How do I install this agent skill?
npx skills add https://github.com/chyiiiiiiiiiiii/openspec-skills --skill openspec-archiveIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill automates the archiving of project specifications and documentation. While functional, it presents a surface for indirect prompt injection from processed files and lacks sanitization for shell command parameters.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
OpenSpec: Archive
Complete a change and update the source of truth specifications.
Usage
/openspec-archive <change-id>
Example:
/openspec-archive add-user-search
What This Skill Does
- Verify all tasks are complete
- Merge delta specs into main specs
- Move change to archive with timestamp
- Update completion status
Execution Steps
Step 1: Verify Completion
Check openspec/changes/{change-id}/tasks.md:
- All tasks marked
[x] - All quality gates passed
- No open blockers
If incomplete, report what's missing and stop.
Step 2: Final Quality Check
Run project's quality verification commands. All must pass before archiving.
Step 3: Merge Delta Specs
For each file in openspec/changes/{change-id}/specs/:
3.1 Check if target spec exists
- If
openspec/specs/{component}.mdexists → Merge changes - If not → Create new spec file
3.2 Apply ADDED sections
Copy new requirements to the target spec:
# {Component} Specification
## Requirements
### {New Requirement from Delta}
{Description}
#### Scenario: {Name}
- GIVEN ...
- WHEN ...
- THEN ...
3.3 Apply MODIFIED sections
Update existing requirements in target spec with new content.
3.4 Apply REMOVED sections
Remove deprecated requirements from target spec.
Add to a ## Deprecated section for reference:
## Deprecated
### {Removed Requirement} (Removed: {date})
Reason: {from delta spec}
Step 4: Archive the Change
# Create archive directory with timestamp
mkdir -p openspec/archive/{change-id}
# Move all change files
mv openspec/changes/{change-id}/* openspec/archive/{change-id}/
rmdir openspec/changes/{change-id}
Step 5: Update Archive Metadata
Add completion info to openspec/archive/{change-id}/proposal.md:
---
## Archive Information
**Archived:** {YYYY-MM-DD HH:MM}
**Duration:** {days from creation to archive}
**Outcome:** Successfully implemented
### Files Modified
- `lib/feature/...`
- `test/...`
### Specs Updated
- `openspec/specs/{component}.md`
Step 6: Commit the Archive
git add openspec/
git commit -m "docs(openspec): archive {change-id}
- Merged delta specs into main specs
- Archived change history
- Implementation complete"
Step 7: Report Completion
## Archived: {change-id}
### Specs Updated
- `openspec/specs/{component}.md` - {summary of changes}
### Archive Location
- `openspec/archive/{change-id}/`
### Change History
- Created: {original date}
- Completed: {today}
- Duration: {X days}
### Summary
{Brief description of what was accomplished}
---
The OpenSpec workflow for this change is complete.
The specifications are now the source of truth.
Merge Strategy
For ADDED content
- Append to existing spec under appropriate section
- Maintain consistent formatting
- Add creation date comment if helpful
For MODIFIED content
- Replace the existing requirement
- Keep the same location in the document
- Note the modification date
For REMOVED content
- Move to Deprecated section (don't delete immediately)
- Include removal reason and date
- Can be fully removed in future cleanup
Troubleshooting
Tasks not complete
Cannot archive: {X} tasks still pending in tasks.md.
Please complete all tasks first or update tasks.md if they're done.
Quality gate fails
Cannot archive: Quality checks failed.
Please fix issues before archiving.
Merge conflict in specs
If the target spec has changed since the proposal:
- Review both versions
- Manually resolve conflicts
- Ensure final spec is consistent
- Proceed with archive
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/chyiiiiiiiiiiii/openspec-skills/openspec-archive">View openspec-archive on skillZs</a>