Skip to content

Add chunk skills command with embedded chunk-review skill#9

Merged
michael-webster merged 2 commits intomainfrom
webster/add-review-skill
Feb 27, 2026
Merged

Add chunk skills command with embedded chunk-review skill#9
michael-webster merged 2 commits intomainfrom
webster/add-review-skill

Conversation

@michael-webster
Copy link
Contributor

@michael-webster michael-webster commented Feb 26, 2026

Summary

  • Adds chunk skills command with install, status, and list subcommands
  • Embeds the chunk-review skill in the binary using Bun's text loader (--loader .md:text)
  • Installs skills to ~/.claude/skills/ and ~/.codex/skills/ for any agent whose config directory already exists
  • Introduces skills/ at the repo root as the canonical source for embedded skill files (.claude/skills/ is kept for in-repo Claude Code usage)
  • Fixes .gitignore anchor so chunk-* only ignores root-level binaries

Reproduction steps

Install skills and verify the file structure:

# Create a temp home dir simulating a machine with Claude Code installed
TMPDIR=$(mktemp -d) && mkdir -p "$TMPDIR/.claude"

# Install
HOME="$TMPDIR" chunk skills install
# claude: installed chunk-review
# codex: skipped (not installed)

# Verify the file was written
find "$TMPDIR/.claude/skills"
# $TMPDIR/.claude/skills/chunk-review/SKILL.md

# Confirm status shows current
HOME="$TMPDIR" chunk skills status
# claude
#   ✓ chunk-review  current
# codex  (not installed)

# Re-run install — idempotent, nothing changes
HOME="$TMPDIR" chunk skills install
# claude: all skills up to date

List bundled skills:

chunk skills list
# Bundled skills (1):
#   chunk-review
#     Use when asked to "review recent changes"...

Test plan

  • bun test src/**/*.unit.test.ts — 23 tests pass (15 new covering listSkills, installSkills, getSkillsStatus)
  • bun run typecheck — no errors
  • bun run lint — no warnings

webster added 2 commits February 26, 2026 18:11
Add the chunk-review SKILL.md to skills/ (embedded into the binary
at build time) and .claude/skills/ (installed to the agent config
directory when running chunk skills install).
Introduce src/core/skills.ts and src/commands/skills.ts to implement
install/status/list subcommands that manage skills in agent config
directories (~/.claude/skills/, ~/.codex/skills/). Skill content is
read from skills/ and embedded into the binary via Bun's text loader
(--loader .md:text added to all build targets). Register commands in
src/index.ts under the Commander.js program. Add 15 unit tests
covering idempotency, outdated-skill updates, and per-agent skipping.
Fix .gitignore to anchor chunk-* at root so the skills/ directory
is not accidentally ignored.
// Skill content is imported at build time. Bun's text loader inlines the file
// content as a string literal in the compiled binary (requires --loader .md:text
// in build commands).
import chunkReviewContent from "../../skills/chunk-review/SKILL.md";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we just embed them from the .clude/skills directory? Or do we think the ones in there may diverge from the ones we embed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we certainly could, i started doing that. i was a little concerned about embedding all of the skills in our binary. not that's it's secret, more i expect we end up with additional customizations. let me look around at other projects and how they handle it, bun might let us be selective on what actually get's included.

danmux

This comment was marked as spam.

skills: SkillStatus[];
}

const home = process.env.HOME ?? process.env.USERPROFILE ?? "~";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.homedir() would be safer here — the ~ fallback isn't a valid absolute path and would create a literal ~ directory in cwd.

— Claude Code (dm)

@danmux

This comment was marked as off-topic.

@michael-webster michael-webster merged commit 499bf0d into main Feb 27, 2026
5 checks passed
@michael-webster michael-webster deleted the webster/add-review-skill branch February 27, 2026 16:27
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.

2 participants