run-pre-commit-checks
БесплатноБез исполняемых скриптовНе проверенRun every check of the pre-commit hook, or one step alone to debug it. Use when about to commit, or when the pre-commit hook fails.
от torrust★ 539 звёзд на GitHubОб этом скилле
Run Pre-commit Checks
Git Hook (Recommended Setup)
The repository ships a pre-commit Git hook that runs ./contrib/dev-tools/git/hooks/pre-commit.sh
automatically on every git commit. Install it once after cloning:
./contrib/dev-tools/git/install-git-hooks.sh
After installation the hook fires automatically; you do not need to invoke the script manually before each commit.
For AI agents: before invoking the script manually, check whether the hook is installed:
./contrib/dev-tools/git/check-git-hooks.shIf installed, skip the manual run —
git commitwill trigger it automatically. Running both would execute every check twice.
Automated Checks
⏱️ Expected runtime: ~1 minute on a modern developer machine with warm caches. AI agents should set a command timeout of at least 3 minutes before invoking
./contrib/dev-tools/git/hooks/pre-commit.sh.
Run the pre-commit script. It must exit with code 0 before every commit.
For AI agents: set TORRUST_GIT_HOOKS_LOG_DIR=.tmp so per-step log files are
written inside the workspace (git-ignored) instead of /tmp (outside workspace,
requiring permission prompts):
TORRUST_GIT_HOOKS_LOG_DIR=.tmp ./contrib/dev-tools/git/hooks/pre-commit.sh
Restricted Agent Sandboxes
Some restricted sandboxes also omit Cargo from the PATH inherited by hook
subprocesses. When both restrictions apply, run:
PATH="$HOME/.cargo/bin:$PATH" \
TORRUST_GIT_HOOKS_LOG_DIR=.tmp \
./contrib/dev-tools/git/hooks/pre-commit.sh
This is an agent-environment workaround. Normal developer environments should continue using the standard command above.
The script runs these steps in order:
./contrib/dev-tools/checks/format-project-words.sh- formatsproject-words.txtwithLC_ALL=C sort -ucargo run --quiet --package clippy-allow-reasons -- --staged- prospective native-reason check for changed staged Clippy allow attributes. The command resolves the first available base reference fromorigin/develop,upstream/develop,torrust/develop, or localdevelop.cargo run --quiet --package source-location-check -- --staged- check, on the staged content, that non-test Rust code does not useLocation::caller(),#[track_caller]ortorrust-located-error(ADR20261118045443_errors_do_not_record_source_locations). Exceptions go incontrib/dev-tools/checks/source-location-check/allow-list.txt, one reason per entry.cargo run --quiet --package frontmatter-validator --bin frontmatter-validator -- --staged- read-only v1 frontmatter check of the staged content of staged Markdown files. A staged edit to a draft or open issue spec without v1 frontmatter fails withlegacy-shape. Seecontrib/dev-tools/checks/frontmatter-validator/README.mdfor the migration checklist.cargo run --quiet --package frontmatter-validator --bin frontmatter-validator -- --skill-layout- repository-wide check of the agent skills in the index: every skill at.claude/skills/<name>/SKILL.md, the redirect stubs under.github/skills/and their inventory, each skill'sname, and the index.claude/skills/README.md. See the validator README for each finding.cargo run --quiet --package frontmatter-validator --bin frontmatter-validator -- --skill-descriptions- check of each skill'sdescriptionin the index: whole as YAML reads it (not cut by a#comment) and 200 characters or less. See theadd-new-skillskill's description rules.cargo run --quiet --package agent-reply-validator --bin agent-reply-validator -- --all- check of the staged content of every agent reply file in the index: every file in anagent-replies/folder or named like a reply file. See theagent-reply-v1schema indocs/schemas/README.md.cargo machete --with-metadata- unused dependency checkcargo deny check bans- workspace layer-boundary dependency checkcargo +nightly fmt --all -- --check- nightly Rust formatting checklinter all- all linters (markdown, lychee local links, YAML, TOML, clippy, rustfmt, shellcheck, cspell)./contrib/dev-tools/checks/lint-containerfile.sh- hadolint check of theContainerfilecargo test --doc --workspace- documentation tests
If the formatter changes the dictionary, the hook exits non-zero before the verification steps.
Stage project-words.txt and retry the commit. Run the formatter independently with:
./contrib/dev-tools/checks/format-project-words.sh
This is an interim action related to EPIC #2003 and may be replaced or refactored after its automation design decision.
When scripting the gate before a commit, test the hook's own exit code. Never pipe it into
tail, grep, or another filter inside an && chain: the pipeline returns the filter's status,
so a failing gate still lets the commit run.
./contrib/dev-tools/git/hooks/pre-commit.sh > .tmp/p
Установить run-pre-commit-checks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл run-pre-commit-checks?
Run every check of the pre-commit hook, or one step alone to debug it. Use when about to commit, or when the pre-commit hook fails.
Как установить скилл run-pre-commit-checks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл run-pre-commit-checks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic