Skip to content

Conversation

@skylarkoo7
Copy link

Summary

Fixes #127.

The skill installer currently aborts with a hard error when the destination directory already exists. There is no built-in way to update a skill to a newer version, reinstall after local corruption, or recover from a partially-failed installation. This PR adds a --force flag that removes the existing directory before copying the new version in.

Changes

scripts/install-skill-from-github.py

  • Added --force CLI flag (defaults to False, preserving the current safe default).
  • Updated _copy_skill() to accept a force parameter; when True the existing directory is removed via shutil.rmtree before copytree.
  • Updated the early exists-check in main() to respect --force and surface an actionable hint ("Use --force to remove the existing skill and reinstall") when the flag is absent.
  • Success message now says "Reinstalled" vs "Installed" when --force is active.

scripts/list-skills.py

  • Added _installed_skills_detail() to return installed skill paths and health status (detects missing SKILL.md as "broken").
  • Added --show-path CLI flag that displays the install directory and health status for each installed skill in both text and JSON output modes.

SKILL.md

  • Documented --force in the Scripts and Behavior and Options sections.
  • Documented --show-path in the Scripts section.
  • Updated the Options line to include --force.

Test plan

  • Install a fresh skill, verify normal behavior unchanged
  • Install the same skill again without --force, verify error message includes the --force hint
  • Install the same skill again with --force, verify it reinstalls and prints "Reinstalled"
  • Run list-skills.py --show-path and verify paths and status are shown
  • Create a broken skill dir (no SKILL.md), verify --show-path reports "broken"
  • Verify --show-path --format json includes path and status fields

The installer currently aborts when a skill directory already exists,
with no way to update or recover from a broken installation.

- install-skill-from-github.py: add --force flag that removes the
  existing skill directory before reinstalling; error message now hints
  at the flag when the destination exists
- list-skills.py: add --show-path flag to display install location and
  detect broken installs (missing SKILL.md); surface this in both text
  and JSON output modes
- SKILL.md: document --force and --show-path in Scripts and Behavior
  sections
@skylarkoo7 skylarkoo7 requested a review from a team February 9, 2026 06:11
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.

Skill installer: no update/reinstall path when destination already exists

1 participant