Skip to content

feat(skills): add /setup-skill to install bundled agent skills into Claude Code - #55

Merged
wangcansunking merged 1 commit into
masterfrom
worktree-setup-skill-command
Jul 8, 2026
Merged

wangcansunking merged 1 commit into
masterfrom
worktree-setup-skill-command

Conversation

@wangcansunking

Copy link
Copy Markdown
Owner

What

Adds a /setup-skill command that installs a bundled agent skill into Claude Code's skills directory via an interactive picker — ~/.claude/skills/<name>/ (global) or ./.claude/skills/<name>/ (project).

Ships one curated skill to start: analyze-session-create-issue — walks the agent through analyzing the current session, gathering repo + environment diagnostics, and opening a well-formed GitHub issue (the example from the feature request).

How it works

  • /setup-skill opens a picker (handled in the App like /config): choose a skill → choose scope → install.
  • Skill content is inlined as TS constants in src/tui/skills/catalog.ts. The build only emits dist/ and package.json.files ships only dist/, so loose .md assets under src/ would never be published — same inline-constant pattern changes.ts uses.
  • installSkill() writes each of a skill's files under <skillsDir>/<name>/. It's non-destructive to other skills already present and idempotent — a no-op re-install reports no change; a stale copy is overwritten (that's the intended "update to what shipped").

Files

File Role
src/tui/skills/catalog.ts Bundled skills as TS constants (SkillEntry = name/title/description/files map)
src/tui/skills/install.ts skillsDir(scope) + installSkill(scope, entry) → ApplyResult, mirrors setup/apply.ts
src/tui/screens/skill.tsx pick → scope → install screen, modeled on SetupWizard
commands.ts, app.tsx, cli/index.ts wiring (stub command, Screen union + handler + render, installSkill prop)

Tests

  • tests/tui/skill-install.test.ts — catalog well-formedness (kebab id, SKILL.md present, frontmatter name: matches entry id) + install FS behavior (correct global/project path, idempotency, non-destructiveness, multi-file).
  • tests/tui/app-interaction.test.tsx — full picker → scope → install → success-card flow driven through the real Ink <App> over stdin.
  • tests/tui/slash.test.ts — /setup-skill recognized + listed in /help/autocomplete.

Full suite green: 667 tests, 75 files. npm run build clean.

Verified the compiled installer writes ~/.claude/skills/analyze-session-create-issue/SKILL.md with valid discoverable frontmatter, correct path shape, and idempotent re-install.

e2e scope

Local-FS + TUI feature with no proxy request/response surface — the http-e2e / cli-e2e matrices don't apply. Unit + real-<App> interaction coverage is the gate here.

Changeset: minor.

…laude Code

New /setup-skill command opens an interactive picker (like /config) that
installs a bundled agent skill into ~/.claude/skills/ (global) or
./.claude/skills/ (project). Ships one curated skill,
analyze-session-create-issue, which walks the agent through turning the
current session into a well-formed GitHub issue.

- src/tui/skills/catalog.ts: bundled skills as inlined TS constants (loose
  .md under src/ would never ship — build only emits dist/).
- src/tui/skills/install.ts: skillsDir(scope) + installSkill() — writes each
  file under <skillsDir>/<name>/, non-destructive to other skills, idempotent
  (a no-op re-install reports no change).
- src/tui/screens/skill.tsx: pick → scope → install screen, modeled on the
  setup wizard.
- Wired through commands.ts (stub), app.tsx (Screen union + handler + render),
  and cli/index.ts (installSkill prop).

Tests: skill-install.test.ts (catalog well-formedness + install FS behavior),
a full picker→scope→install interaction test, and /setup-skill recognition in
slash.test.ts. Full suite green (667).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wangcansunking
wangcansunking merged commit b16fabd into master Jul 8, 2026
6 checks passed
@wangcansunking
wangcansunking deleted the worktree-setup-skill-command branch July 8, 2026 07:33
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