Skip to content

Conversation

TabishB
Copy link
Contributor

@TabishB TabishB commented Oct 15, 2025

Summary

  • Add $ARGUMENTS placeholder to /openspec:archive slash command to allow explicit change ID specification
  • Update archive command template with argument validation and fail-fast behavior
  • Add documentation updates to AGENTS.md for proper archive command usage

Context

The /openspec:archive slash command previously relied on context inference to determine which change to archive, creating a safety risk when multiple changes exist or context is ambiguous. This change brings it in line with the CLI behavior and matches the pattern already used by the proposal command.

Changes

  • Modified src/core/configurators/slash/opencode.ts:
    • Added $ARGUMENTS to archive frontmatter
    • Added rewriteArchiveFile method to handle managed section updates
    • Override generateAll and updateExisting to ensure archive file is rewritten
  • Modified src/core/templates/slash-command-templates.ts:
    • Updated archive steps to validate change ID from arguments
    • Added fail-fast behavior when change ID is missing or invalid
    • Enhanced validation steps before archiving
  • Modified openspec/AGENTS.md:
    • Updated archive command documentation with explicit change ID requirement
    • Added OpenCode slash command usage example

Test Plan

  • Run openspec update to regenerate slash commands
  • Verify .opencode/command/openspec-archive.md contains $ARGUMENTS placeholder
  • Test /openspec:archive <change-id> with valid change ID
  • Test /openspec:archive without arguments prompts for clarification
  • Verify openspec validate --strict passes

🤖 Generated with Claude Code

TabishB and others added 3 commits October 15, 2025 15:20
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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant