/my-plugin:set-up-hooksfrom my-plugin
Set up recommended git hooks in the current repository. Strips Claude and Copilot co-author lines from commit messages, and runs the repo's tests before each commit when it has any. Use only when the user explicitly asks to set up hooks.
Ships in my-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run this skill by hand from the repository, once per clone. It writes hooks into the hooks directory that git uses in this clone. It never changes core.hooksPath, so other repositories and other machines are unaffected.
Find the hooks directory. Run git rev-parse --git-path hooks. Stop and report if the command fails.
Check for existing hooks. Look at commit-msg and pre-commit in that directory. A file whose second line is # set-up-hooks is ours and may be replaced. Any other existing file: stop and ask the user before replacing it.
Choose the test command for pre-commit. Use the first match below, and ask the user if more than one applies:
package.json with a test script: npm test, or pnpm test or yarn test when pnpm-lock.yaml or yarn.lock exists.go.mod: go test ./...Cargo.toml: cargo test*.sln or *.csproj: dotnet testpyproject.toml, pytest.ini, or a tests/ directory: pytesttest target in Makefile: make testIf nothing matches, ask the user for the command, or skip pre-commit if the repo has no tests.
Write the hooks. Create the hooks directory if it is missing. Write commit-msg from the template below. Write pre-commit only when you have a test command. Make each file you write executable.
Verify and report. Run sh -n on each file you wrote. Report the hook paths, the test command, and that core.hooksPath is unchanged. Tell the user the hooks apply to this clone only, so the skill must be run in each clone. Do not use git commit --no-verify to get past a hook unless the user asks.
commit-msg:
#!/bin/sh
# set-up-hooks
set -eu
msg=$1
tmp="$msg.tmp"
grep -viE '^Co-authored-by:.*(claude|copilot|@anthropic\.com)' "$msg" > "$tmp" &&
mv "$tmp" "$msg"
pre-commit, only with a test command:
#!/bin/sh
# set-up-hooks
set -eu
<test command>
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub olillevik/dotfiles --plugin my-plugin32 skills in this plugin
/ask-mattAsk which skill or flow fits your situation. A router over the skills in this repo./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary./code-reviewReview the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".Other plugins' skills for the same job