Skip to content

fix: refresh preset commands on re-init to apply replaces logic (v0.1.5)#82

Merged
kanfil merged 1 commit intomainfrom
fix-refresh-preset-commands-v0.1.5
Mar 14, 2026
Merged

fix: refresh preset commands on re-init to apply replaces logic (v0.1.5)#82
kanfil merged 1 commit intomainfrom
fix-refresh-preset-commands-v0.1.5

Conversation

@kanfil
Copy link
Copy Markdown
Member

@kanfil kanfil commented Mar 14, 2026

Summary

Fixes the issue where speckit.* commands persisted even after upgrading to v0.1.3+ and running specify init --here.

Problem

When running specify init --here on a project with an existing preset, the replaces field was not being applied because install_bundled_presets() skipped the preset as "already installed":

├── ○ presets (agentic-sdlc (existing))

Users had to delete both .specify/ AND .opencode/ to get clean command namespaces.

Solution

  1. Added refresh_preset_commands() method to PresetManager that re-runs command registration for existing presets
  2. Modified install_bundled_presets() to call refresh_preset_commands() for existing presets before skipping them

Result

Now when running specify init --here with an existing .specify/ directory:

  • The preset is still marked as "existing" (no duplicate installation)
  • But _register_commands() is called which applies the replaces logic
  • speckit.* commands are removed, leaving only adlc.spec.* and spec.*

Testing

  • All 356 pytest tests pass
  • Tested manually: specify init --ai opencode --here on project with existing .specify/ now produces correct command set

When running 'specify init --here' on a project with an existing preset,
the 'replaces' field was not being applied because the preset was skipped
as 'already installed'.

- Add refresh_preset_commands() method to PresetManager
- Call refresh for existing presets in install_bundled_presets()
- Ensures speckit.* commands are removed even when .specify/ persists

This fixes the issue where users had to delete both .specify/ and .opencode/
to get clean command namespaces after upgrading to v0.1.3+.
@kanfil kanfil merged commit 2f0852a into main Mar 14, 2026
8 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