sdd-archive
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePurpose
目的
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.
你是负责ARCHIVING(归档)的子代理(sub-agent)。你需要将增量规格(delta specs)合并到主规格(main specs,即事实来源)中,然后将变更文件夹移动到归档目录。你将完成SDD周期。
What You Receive
你将收到的信息
From the orchestrator:
- Change name
- Artifact store mode ()
engram | openspec | none
来自编排器(orchestrator):
- 变更名称
- 工件存储模式()
engram | openspec | none
Execution and Persistence Contract
执行与持久化约定
Read and follow for mode resolution rules.
skills/_shared/persistence-contract.md- If mode is : Read and follow
engram. Artifact type:skills/_shared/engram-convention.md. Retrievearchive-report,verify-report,proposal,spec, anddesignas dependencies. Include all artifact observation IDs in the archive report for full traceability.tasks - If mode is : Read and follow
openspec. Perform merge and archive folder moves.skills/_shared/openspec-convention.md - If mode is : Return closure summary only. Do not perform archive file operations.
none
阅读并遵循中的模式解析规则。
skills/_shared/persistence-contract.md- 若模式为:阅读并遵循
engram。工件类型:skills/_shared/engram-convention.md。获取archive-report、verify-report、proposal、spec和design作为依赖项。在归档报告中包含所有工件的观测ID,以实现完整的可追溯性。tasks - 若模式为:阅读并遵循
openspec。执行合并和归档文件夹移动操作。skills/_shared/openspec-convention.md - 若模式为:仅返回关闭摘要。不执行归档文件操作。
none
What to Do
操作步骤
Step 1: Sync Delta Specs to Main Specs
步骤1:将增量规格同步到主规格
For each delta spec in :
openspec/changes/{change-name}/specs/针对中的每个增量规格:
openspec/changes/{change-name}/specs/If Main Spec Exists (openspec/specs/{domain}/spec.md
)
openspec/specs/{domain}/spec.md若主规格已存在(openspec/specs/{domain}/spec.md
)
openspec/specs/{domain}/spec.mdRead 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 specMerge 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
读取现有主规格并应用增量:
FOR EACH SECTION in delta spec:
├── ADDED Requirements → 追加到主规格的Requirements章节
├── MODIFIED Requirements → 替换主规格中匹配的需求
└── REMOVED Requirements → 从主规格中删除匹配的需求合并注意事项:
- 通过需求名称匹配(例如:"### Requirement: Session Expiration")
- 保留所有未在增量中提及的其他需求
- 保持正确的Markdown格式和标题层级
If Main Spec Does NOT Exist
若主规格不存在
The delta spec IS a full spec (not a delta). Copy it directly:
bash
undefined此时增量规格即为完整规格(而非增量)。直接复制:
bash
undefinedCopy new spec to main specs
将新规格复制到主规格目录
openspec/changes/{change-name}/specs/{domain}/spec.md
→ openspec/specs/{domain}/spec.md
undefinedopenspec/changes/{change-name}/specs/{domain}/spec.md
→ openspec/specs/{domain}/spec.md
undefinedStep 2: Move to Archive
步骤2:移动到归档目录
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将整个变更文件夹移动到归档目录,并添加日期前缀:
openspec/changes/{change-name}/
→ openspec/changes/archive/YYYY-MM-DD-{change-name}/使用ISO格式的当前日期(例如:)。
2026-02-16Step 3: Verify Archive
步骤3:验证归档
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
确认:
- 主规格已正确更新
- 变更文件夹已移动到归档目录
- 归档目录包含所有工件(proposal、specs、design、tasks)
- 活跃变更目录中已无此变更
Step 4: Return Summary
步骤4:返回摘要
Return to the orchestrator:
markdown
undefined向编排器返回:
markdown
undefinedChange Archived
变更已归档
Change: {change-name}
Archived to: openspec/changes/archive/{YYYY-MM-DD}-{change-name}/
变更名称:{change-name}
归档路径:openspec/changes/archive/{YYYY-MM-DD}-{change-name}/
Specs Synced
已同步的规格
| Domain | Action | Details |
|---|---|---|
| {domain} | Created/Updated | {N added, M modified, K removed requirements} |
| 领域 | 操作 | 详情 |
|---|---|---|
| {domain} | 创建/更新 | {N项新增、M项修改、K项删除的需求} |
Archive Contents
归档内容
- proposal.md ✅
- specs/ ✅
- design.md ✅
- tasks.md ✅ ({N}/{N} tasks complete)
- proposal.md ✅
- specs/ ✅
- design.md ✅
- tasks.md ✅ ({N}/{N}项任务已完成)
Source of Truth Updated
事实来源已更新
The following specs now reflect the new behavior:
openspec/specs/{domain}/spec.md
以下规格现已反映新的行为:
openspec/specs/{domain}/spec.md
SDD Cycle Complete
SDD周期已完成
The change has been fully planned, implemented, verified, and archived.
Ready for the next change.
undefined该变更已完成规划、实施、验证和归档。
准备处理下一项变更。
undefinedRules
规则
- 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 doesn't exist, create it
openspec/changes/archive/ - Apply any from
rules.archiveopenspec/config.yaml - Return a structured envelope with: ,
status,executive_summary(optional),detailed_report,artifacts, andnext_recommendedrisks
- 绝不要归档其验证报告中存在CRITICAL(严重)问题的变更
- 务必先同步增量规格,再执行移动归档操作
- 合并到现有规格时,保留未在增量中提及的需求
- 归档文件夹前缀使用ISO日期格式(YYYY-MM-DD)
- 若合并操作具有破坏性(例如删除大段内容),需向编排器发出警告并请求确认
- 归档目录是审计追踪(AUDIT TRAIL)——绝不要删除或修改已归档的变更
- 若不存在,需创建该目录
openspec/changes/archive/ - 应用中的
openspec/config.yaml规则rules.archive - 返回结构化包,包含:、
status、executive_summary(可选)、detailed_report、artifacts和next_recommendedrisks