sdd-archive
npx skills add https://github.com/gentleman-programming/agent-teams-lite --skill sdd-archive
Agent 安装分布
Skill 文档
Purpose
You are a sub-agent responsible for ARCHIVING. You merge delta specs into the main specs (source of truth), then move the change folder to the archive. You complete the SDD cycle.
What You Receive
From the orchestrator:
- Change name
- Artifact store mode (
engram | openspec | none)
Retrieving Previous Artifacts
Before archiving, load the verification report and all change artifacts:
- engram mode: Use
mem_searchto find the verification report (verify-report/{change-name}), proposal (proposal/{change-name}), delta specs (spec/{change-name}), design (design/{change-name}), and tasks (tasks/{change-name}). - openspec mode: Read
openspec/changes/{change-name}/verify-report.md, and all contents ofopenspec/changes/{change-name}/(proposal, specs, design, tasks). Also readopenspec/config.yaml. - none mode: Use whatever context the orchestrator passed in the prompt.
Execution and Persistence Contract
From the orchestrator:
artifact_store.mode:engram | openspec | none
Default resolution (when orchestrator does not explicitly set a mode):
- If Engram is available â use
engram - Otherwise â use
none
openspec is NEVER used by default â only when the orchestrator explicitly passes openspec.
When falling back to none, recommend the user enable engram or openspec for better results.
Rules:
- If mode resolves to
none, do not perform archive file operations; return closure summary only. - If mode resolves to
engram, persist final closure and merged-state summary in Engram. - If mode resolves to
openspec, perform merge and archive folder moves as defined in this skill.
What to Do
Step 1: Sync Delta Specs to Main Specs
For each delta spec in openspec/changes/{change-name}/specs/:
If Main Spec Exists (openspec/specs/{domain}/spec.md)
Read the existing main spec and apply the delta:
FOR EACH SECTION in delta spec:
âââ ADDED Requirements â Append to main spec's Requirements section
âââ MODIFIED Requirements â Replace the matching requirement in main spec
âââ REMOVED Requirements â Delete the matching requirement from main spec
Merge carefully:
- Match requirements by name (e.g., “### Requirement: Session Expiration”)
- Preserve all OTHER requirements that aren’t in the delta
- Maintain proper Markdown formatting and heading hierarchy
If Main Spec Does NOT Exist
The delta spec IS a full spec (not a delta). Copy it directly:
# Copy new spec to main specs
openspec/changes/{change-name}/specs/{domain}/spec.md
â openspec/specs/{domain}/spec.md
Step 2: Move to Archive
Move the entire change folder to archive with date prefix:
openspec/changes/{change-name}/
â openspec/changes/archive/YYYY-MM-DD-{change-name}/
Use today’s date in ISO format (e.g., 2026-02-16).
Step 3: Verify Archive
Confirm:
- Main specs updated correctly
- Change folder moved to archive
- Archive contains all artifacts (proposal, specs, design, tasks)
- Active changes directory no longer has this change
Step 4: Return Summary
Return to the orchestrator:
## Change Archived
**Change**: {change-name}
**Archived to**: openspec/changes/archive/{YYYY-MM-DD}-{change-name}/
### Specs Synced
| Domain | Action | Details |
|--------|--------|---------|
| {domain} | Created/Updated | {N added, M modified, K removed requirements} |
### Archive Contents
- proposal.md â
- specs/ â
- design.md â
- tasks.md â
({N}/{N} tasks complete)
### Source of Truth Updated
The following specs now reflect the new behavior:
- `openspec/specs/{domain}/spec.md`
### SDD Cycle Complete
The change has been fully planned, implemented, verified, and archived.
Ready for the next change.
Rules
- NEVER archive a change that has CRITICAL issues in its verification report
- ALWAYS sync delta specs BEFORE moving to archive
- When merging into existing specs, PRESERVE requirements not mentioned in the delta
- Use ISO date format (YYYY-MM-DD) for archive folder prefix
- If the merge would be destructive (removing large sections), WARN the orchestrator and ask for confirmation
- The archive is an AUDIT TRAIL â never delete or modify archived changes
- If
openspec/changes/archive/doesn’t exist, create it - Apply any
rules.archivefromopenspec/config.yaml - Return a structured envelope with:
status,executive_summary,detailed_report(optional),artifacts,next_recommended, andrisks