← ClaudeAtlas

pre-commitlisted

Set up the xstyle pre-commit hook of a git repository in Tsukini's way - checks the style of what is committed with xstyle (only the staged lines by default), refuses the commit on a major / unforgivable issue, warns on minor ones, only warns when xstyle is not installed - every option asked first with several choices (scope, fail / warn levels, safe auto fixes, missing xstyle, output, languages / excludes / ignored rules, local or shared .githooks), the needed tools checked and installed on request (xstyle, cmake, clang++, libutils), an existing hook kept and chained, and a throwaway demo repository to try it. Use whenever the user wants a pre-commit hook, a git hook checking the style, to block commits with style errors, or to change / remove that hook.
TsukiNi22/ai-utils · ★ 1 · Code & Development · score 74
Install: claude install-skill TsukiNi22/ai-utils
# xstyle pre-commit hook `SKILL_DIR` = the directory of this file. - `templates/pre-commit`: the hook (bash, config block at the top, readable by the user). - `scripts/install_hook.sh install|remove|status [options]` (`--help`), also `curl -fsSL https://raw.githubusercontent.com/TsukiNi22/ai-utils/main/setup.sh | bash -s -- hook [command] [options]` run from the repository. - `scripts/demo_repo.sh [dir] [options]`: throwaway repository (`/tmp/xstyle-hook-demo`) with one file per verdict and `TRY.md` listing the scenarios. The hook runs **locally** at each `git commit` (before the commit exists), never on GitHub: the remote check is the style job of `ci-cd` (`templates/style.yml`). Both are complementary (local = fast feedback, skippable; CI = enforced). ## Behavior (defaults) | Case | Result | |---|---| | xstyle not installed | warning `xstyle not found`, commit accepted (`--missing warn`) | | unforgivable / major issue | issues listed, **commit refused** (`--fail-on major`) | | minor issue only | issues listed + warning, commit accepted (`--warn-on minor`) | | negligible only / clean | silent, commit accepted | | mandatory rule (R34) | never counted: neither refuses nor warns; shown with the issues when xstyle prints them (`--r34` / `XSTYLE_R34=1` or `--extra "--r34"` hides it) | | xstyle crashes | warning, commit accepted (never blocks on a tool error) | Skip once: `git commit --no-verify` or `XSTYLE_HOOK=0 git commit ...`. Fix: `xstyle --fix --staged` then `git add