openspec-bulk-archive-change
它能做什么
这项技能一次归档多个已完成的 OpenSpec 变更,并检查代码库是否与每项变更相符。适合在 OpenSpec 中并行处理多项变更的开发者。
适用场景
- ✓当多个并行的 OpenSpec 变更已完成,需要一起归档时。
- ✓当不同变更之间的规格文件存在冲突,需要对照代码检查的时候。
- ✓当你想从列表中挑选要归档的变更的时候。
技能链接
https://github.com/fengshao1227/ccg-workflow/blob/main/.agents/skills/openspec-bulk-archive-change/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请归档本次迭代中所有已完成的 OpenSpec 变更,并先检查规格是否存在冲突。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会列出进行中的变更,请你选择,然后检查每项变更的产物、任务和规格,通过查看代码解决冲突,最后归档你选中的变更。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Archive multiple completed changes in a single operation.
This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
Input: None required (prompts for selection)
Steps
Get active changes
Run
openspec list --jsonto get all active changes.If no active changes exist, inform user and stop.
Prompt for change selection
Use AskUserQuestion tool with multi-select to let user choose changes:
- Show each change with its schema
- Include an option for "All changes"
- Allow any number of selections (1+ works, 2+ is the typical use case)
IMPORTANT: Do NOT auto-select. Always let the user choose.
Batch validation - gather status for all selected changes
For each selected change, collect:
a. Artifact status - Run
openspec status --change "<name>" --json- Parse
schemaNameandartifactslist - Note which artifacts are
donevs other states
b. Task completion - Read
openspec/changes/<name>/tasks.md- Count
- [ ](incomplete) vs- [x](complete) - If no tasks file exists, note as "No tasks"
c. Delta specs - Check
openspec/changes/<name>/specs/directory- List which capability specs exist
- For each, extract requirement names (lines matching
### Requirement: <name>)
- Parse
Detect spec conflicts
Build a map of
capability -> [changes that touch it]:auth -> [change-a, change-b] <- CONFLICT (2+ changes) api -> [change-c] <- OK (only 1 change)A conflict exists when 2+ selected changes have delta specs for the same capability.
Resolve conflicts agentically
For each conflict, investigate the codebase:
a. Read the delta specs from each conflicting change to understand what each claims to add/modify
b. Search the codebase for implementation evidence:
- Look for code implementing requirements from each delta spec
- Check for related files, functions, or tests
c. Determine resolution:
- If only one change is actually implemented -> sync that one's specs
- If both implemented -> apply in chronological order (older first, newer overwrites)
- If neither implemented -> skip spec sync, warn user
d. Record resolution for each conflict:
- Which change's specs to apply
- In what order (if both)
- Rationale (what was found in codebase)
Show consolidated status table
Display a table summarizing all changes:
| Change | Artifacts | Tasks | Specs | Conflicts | Status | |---------------------|-----------|-------|---------|-----------|--------| | schema-management | Done | 5/5 | 2 delta | None | Ready | | project-config | Done | 3/3 | 1 delta | None | Ready | | add-oauth | Done | 4/4 | 1 delta | auth (!) | Ready* | | add-verify-skill | 1 left | 2/5 | None | None | Warn |For conflicts, show the resolution:
* Conflict resolution: - auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)For incomplete changes, show warnings:
Warnings: - add-verify-skill: 1 incomplete artifact, 3 incomplete tasksConfirm batch operation
Use AskUserQuestion tool with a single confirmation:
- "Archive N changes?" with options based on status
- Options might include:
- "Archive all N changes"
- "Archive only N ready changes (skip incomplete)"
- "Cancel"
If there are incomplete changes, make clear they'll be archived with warnings.
Execute archive for each confirmed change
Process changes in the determined order (respecting conflict resolution):
a. Sync specs if delta specs exist:
- Use the openspec-sync-specs approach (agent-driven intelligent merge)
- For conflicts, apply in resolved order
- Track if sync was done
b. Perform the archive:
mkdir -p openspec/changes/archive mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>c. Track outcome for each change:
- Success: archived successfully
- Failed: error during archive (record error)
- Skipped: user chose not to archive (if applicable)
Display summary
Show final resul
常见问题
它会不经询问就归档变更吗?
不会。它会请你选择要归档的变更,不会自动替你选择。
它如何处理相互冲突的规格?
它会检查代码库,确认实际实现了什么。
我需要 OpenSpec 吗?
需要。它配合 OpenSpec 变更及其命令行工具使用。
详情
作者的原始描述
Archive multiple completed changes at once. Use when archiving several parallel changes.
热度
- GitHub 星标
- 6.0k
- 排名
- #14516
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
openspec-continue-change
6.0k帮你的智能体继续推进 OpenSpec 变更,创建下一个产物,例如提案、规格、设计或任务清单。
openspec-ff-change
6.0k帮你的智能体一次性创建 OpenSpec 变更的全部产物,让你无需逐步操作即可开始实现。
openspec-new-change
6.0k帮你的智能体为功能或修复开启新的 OpenSpec 变更,创建其文件夹,并提示接下来应编写哪些产物。
openspec-onboard
6.0k带你完整走一遍第一个 OpenSpec 变更周期,从挑选小任务到实现和归档,并解释每一步。