mirror of
https://github.com/Fission-AI/OpenSpec.git
synced 2026-09-14 20:16:53 +08:00
1.2 KiB
1.2 KiB
Add Update Command
Why
Users need a way to update their local OpenSpec instructions (README.md and CLAUDE.md) when the OpenSpec package releases new versions with improved AI agent instructions or structural conventions.
What Changes
- Add new
openspec updateCLI command that updates OpenSpec instructions - Replace
openspec/README.mdwith the latest template- Safe because this file is fully OpenSpec-managed
- Update only the OpenSpec-managed block in
CLAUDE.mdusing markers- Preserve all user content outside markers
- If
CLAUDE.mdis missing, create it with the managed block
- Display success message after update (ASCII-safe): "Updated OpenSpec instructions"
- A leading checkmark MAY be shown when the terminal supports it
- Operation is idempotent (re-running yields identical results)
Impact
- Affected specs:
cli-update(new capability) - Affected code:
src/core/update.ts(new command class, mirrorsInitCommandplacement)src/cli/index.ts(register new command)- Uses existing templates via
TemplateManagerandreadmeTemplate
Out of Scope
- No
.openspec/config.jsonis introduced by this change. The default directory nameopenspecis used.