mirror of
https://github.com/Fission-AI/OpenSpec.git
synced 2026-09-14 20:16:53 +08:00
63b8a3e9f9
* feat: add argument support to archive slash command Add $ARGUMENTS placeholder to the /openspec:archive slash command to allow explicit change ID specification, improving safety and matching CLI behavior. Changes: - Add $ARGUMENTS to archive command frontmatter in OpenCode configurator - Update archive command template with argument validation steps - Add rewriteArchiveFile method to handle managed section updates - Update AGENTS.md documentation for archive command usage This change makes it possible for users to run `/openspec:archive <change-id>` instead of relying on context inference, reducing the risk of archiving the wrong change. * refactor: improve archive slash command argument handling instructions Update the archive slash command template to provide clearer guidance on how to handle change IDs from arguments versus conversation context. The new instructions better distinguish between explicit argument-provided IDs and contextual references, and provide more explicit failure modes.
1.3 KiB
1.3 KiB
Add Archive Command Arguments
Why
The /openspec:archive slash command currently lacks argument support, forcing the AI to infer which change to archive from conversation context or by listing all changes. This creates a safety risk where the wrong proposal could be archived if the context is ambiguous or multiple changes exist. Users expect to specify the change ID explicitly, matching the behavior of the CLI command openspec archive <id>.
What Changes
- Add
$ARGUMENTSplaceholder to the OpenCode archive slash command frontmatter (matching existing pattern for proposal command) - Update archive command template steps to validate the specific change ID argument when provided
- Note: Codex, GitHub Copilot, and Amazon Q already have
$ARGUMENTSfor archive; Claude/Cursor/Windsurf/Kilocode don't support arguments
Impact
- Affected specs:
cli-update(slash command generation logic) - Affected code:
src/core/configurators/slash/opencode.ts(add$ARGUMENTSto archive frontmatter)src/core/templates/slash-command-templates.ts(archive template steps for argument validation)
- Breaking: No - this is additive functionality that makes the command safer
- User-facing: Yes - OpenCode users will be able to pass the change ID as an argument:
/openspec:archive <change-id>