Skip to content

fix: implement preset 'replaces' field to remove superseded commands (v0.1.3)#80

Merged
kanfil merged 1 commit intomainfrom
fix-preset-replaces-v0.1.3
Mar 14, 2026
Merged

fix: implement preset 'replaces' field to remove superseded commands (v0.1.3)#80
kanfil merged 1 commit intomainfrom
fix-preset-replaces-v0.1.3

Conversation

@kanfil
Copy link
Copy Markdown
Member

@kanfil kanfil commented Mar 14, 2026

Summary

Implements the replaces field in preset manifest commands, which was defined but not functional.

Problem

When installing the agentic-sdlc preset, both old (speckit.*) and new (adlc.spec.* + spec.*) command files were present:

.opencode/command/
├── speckit.specify.md      # Old - should be removed
├── speckit.plan.md         # Old - should be removed
├── adlc.spec.specify.md    # New - from preset
├── spec.specify.md         # New - alias from preset
├── adlc.spec.plan.md       # New - from preset
├── spec.plan.md            # New - alias from preset
...

Solution

  1. Added remove_replaced_commands() method to CommandRegistrar in agents.py
  2. Updated _register_commands() in presets.py to:
    • Collect all replaces values from command templates
    • Remove those files from all detected agent directories
    • Then write the new commands and aliases
  3. Fixed missing replaces: "speckit.constitution" in preset.yml

After fix

.opencode/command/
├── adlc.spec.specify.md    # New command
├── spec.specify.md         # Alias
├── adlc.spec.plan.md       # New command
├── spec.plan.md            # Alias
├── speckit.taskstoissues.md  # No replacement defined - stays
...

Testing

  • All 356 pytest tests pass
  • Manual test: specify init --ai opencode --here produces correct command set

…(v0.1.3)

Preset commands with 'replaces' field now properly remove the replaced
command files from all agent directories before writing new commands.

- Add remove_replaced_commands() method to CommandRegistrar
- Update _register_commands() in presets.py to process replaces field
- Add missing replaces: speckit.constitution to preset.yml

This ensures clean command namespace with only adlc.spec.* commands
and spec.* aliases, removing the confusing speckit.* duplicates.
@kanfil kanfil merged commit b1a0191 into main Mar 14, 2026
9 checks passed
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