Skip to content

Skill: install/check/uninstall subcommands (#37)#43

Open
MisterGC wants to merge 1 commit into
release/0.4.0from
feat/skill-install-check
Open

Skill: install/check/uninstall subcommands (#37)#43
MisterGC wants to merge 1 commit into
release/0.4.0from
feat/skill-install-check

Conversation

@MisterGC
Copy link
Copy Markdown
Owner

Implements issue #37 (description rewritten on the issue to match the agreed design).

Three new sub-subcommands under grafli skill:

  • grafli skill install [all|claude|codex|opencode] — copy the bundled SKILL.md into the user-level skill directory for each target. Bare invocation prompts per target. Positional installs only that target. all installs everywhere unattended.
  • grafli skill check [all|claude|codex|opencode] — report install status per target. Bare invocation checks every target with no prompting. Human-readable by default; --json for machines.
  • grafli skill uninstall [all|claude|codex|opencode] — remove the installed grafli/ skill directory per target, symmetric to install.

Behaviour highlights:

  • Version detection via <!-- grafli skill version: X.Y.Z --> injected after the YAML frontmatter at install time; hash compare on canonical (version-line-stripped) content distinguishes five states: ok, stale, modified, unknown, missing.
  • Flags: --force (skip prompts), --dry-run (preview without writing) on install/uninstall; --json on check.
  • Non-TTY stdin without --force → refuses with a hint instead of guessing.
  • Missing parent dir (target tool likely not installed) → prompts before creating, unless --force is passed.
  • Targets:
    • claude → ~/.claude/skills/grafli/SKILL.md
    • codex → ~/.agents/skills/grafli/SKILL.md
    • opencode → ~/.config/opencode/skills/grafli/SKILL.md
  • Backwards-compatible: bare grafli skill, grafli skill -o FILE, grafli skill --where still work as before.

Out of scope for this PR (deferred per design notes on the issue): --symlink install mode, project-level installs, additional targets.

Test plan

  • grafli skill check reports all three as missing on a clean machine (exit 0)
  • grafli skill install all --dry-run lists planned writes (exit 1 since drift exists)
  • grafli skill install claude < /dev/null refuses with non-zero exit
  • After grafli skill install all --force, check reports all three ok (exit 0)
  • Edit one installed SKILL.md by hand → check reports modified
  • grafli skill uninstall all --force cleanly removes the three directories
  • 13 new unit tests cover stamping, canonicalisation, all 5 status states, write/remove primitives (full suite at 338)

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