用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/truecourse-ai/truecourse --skill truecourse-hooks命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | truecourse-hooks |
| description | Install, configure, or remove the TrueCourse pre-commit hook |
| user_invocable | true |
| triggers | ["install the pre-commit hook","set up truecourse hooks","enable truecourse hook","check hook status","remove pre-commit hook","change what the hook blocks","edit hook config"] |
Install, configure, and manage the pre-commit hook that blocks new violations before they land in git.
npx -y — without -y, npx will hang on the "Ok to proceed?" prompt whenever the user hasn't cached the latest truecourse version.truecourse analyze --diff. On large repos that can be tens of seconds per commit. Make sure the user knows before you install..truecourse/LATEST.json. The user needs truecourse analyze to have run at least once. On main, they should also commit the resulting LATEST.json so the hook works in fresh clones and git worktree add checkouts without a per-checkout cold-start. If no baseline exists yet, suggest /truecourse-analyze first.hooks.yaml is the single source of truth. Installation creates <repo>/.truecourse/hooks.yaml with defaults; edit it to change policy. The file is meant to be committed so the whole team shares one hook config..truecourse/LATEST.json baseline (run analyze on main and commit the file so it propagates to clones and worktrees); policy lives in .truecourse/hooks.yaml which they should also commit.npx -y truecourse hooks install
.git/hooks/pre-commit (the script git invokes).truecourse/hooks.yaml (starter policy, blocks critical and high by default, LLM off)/truecourse-analyze — without a baseline, the hook has nothing to diff against. After analyze on main, also remind them to commit .truecourse/LATEST.json so fresh worktrees/clones inherit it.Run:
npx -y truecourse hooks status
Relay the output. It reports whether the hook is installed, the config path, the block severities, and whether LLM is on.
Run:
npx -y truecourse hooks uninstall
Only removes the git hook script. hooks.yaml is preserved (it's team policy, not install state).
The config lives at <repo>/.truecourse/hooks.yaml. Use the Read and Edit tools — do not shell out through truecourse for edits.
Schema:
pre-commit:
block-on: [critical, high] # valid: info, low, medium, high, critical
llm: false # true = LLM rules on every commit (tokens per commit)
Common edits the user might ask for:
block-on: [critical, high, medium]block-on: [critical]llm: true. Warn the user this spends tokens on every commit — confirm before flipping it.After editing, run npx -y truecourse hooks status so they can verify the parsed values match their intent.
If a user comes to you saying "my commit got blocked" or similar:
/truecourse-fix to apply fix suggestions to those violations.git commit --no-verify (standard git bypass).