configure-pre-commit
БесплатноБез исполняемых скриптовНе проверенSet up .pre-commit-config.yaml: hooks for the project type at current revs. Use when installing pre-commit in a repo, auditing stale hook revs, or migrating…
от laurigates★ 61 звезда на GitHubОб этом скилле
/configure:pre-commit
Check and configure pre-commit hooks against project standards.
When to Use This Skill
| Use this skill when... | Use another approach when... |
|---|---|
| Setting up or validating pre-commit hooks | Project doesn't use pre-commit framework (use git hooks directly) |
| Checking compliance with project standards | Just running hooks manually (use pre-commit run command) |
| Installing project-type-specific hooks | Hooks are already properly configured |
| Migrating to pre-commit framework | Simple project with no quality checks needed |
| Updating hook configurations for detected tools | Need to disable pre-commit entirely |
Context
- Pre-commit config: !
find . -maxdepth 1 -name '.pre-commit-config.yaml' - Project standards: !
find . -maxdepth 1 -name '.project-standards.yaml' - Has terraform: !
find . -maxdepth 2 \( -name '*.tf' -o -type d -name 'terraform' \) -print -quit - Has helm: !
find . -maxdepth 2 -type d -name 'helm' -print -quit - Has package.json: !
find . -maxdepth 1 -name 'package.json' - Has pyproject.toml: !
find . -maxdepth 1 -name 'pyproject.toml'
Parameters
Parse from $ARGUMENTS:
--check-only: Report status without offering fixes--fix: Apply all fixes automatically without prompting--type <type>: Override project type detection (frontend,infrastructure,python)
Execution
Execute this pre-commit compliance check:
Step 1: Detect project type
- Read
.project-standards.yamlforproject_typefield if it exists - If not found, auto-detect:
- infrastructure: Has
terraform/,helm/,argocd/, or*.tffiles - frontend: Has
package.jsonwith vue/react dependencies - node: Has any other
package.json - python: Has
pyproject.tomlorrequirements.txt
- infrastructure: Has
- Apply
--typeflag override if provided
Step 2: Check configuration file
- If
.pre-commit-config.yamlis missing: report FAIL, offer to create from template - If it exists: read and parse the configuration
Step 3: Verify hook versions against latest releases
CRITICAL: Take the latest revs from the tool, not from a pinned list or memory. After writing or auditing the config, run pre-commit autoupdate (it resolves each hook repo's newest tag), then pre-commit validate-config .pre-commit-config.yaml. A new config written from a template with older revs moved pre-commit-hooks v5.0.0 to v6.0.0, conventional-pre-commit v4.3.0 to v4.5.0, gitleaks v8.22.1 to v8.30.0 and actionlint v1.7.7 to v1.7.12 in one run.
autoupdate cannot resolve a repo: local hook; read a local hook's version from where it is pinned (for a Biome hook, package.json). Use WebSearch or WebFetch on a hook repo's releases page only when autoupdate fails for it. For --check-only, run it on a copy (cp .pre-commit-config.yaml tmp/pc.yaml && pre-commit autoupdate --config tmp/pc.yaml) and diff, so the audit writes nothing.
Step 4: Analyze compliance
Compare existing configuration against the project standards in REFERENCE.md:
Required Base Hooks (All Projects):
pre-commit-hooksv5.0.0+ with: trailing-whitespace, end-of-file-fixer, check-yaml, check-json, check-merge-conflict, check-added-large-filesconventional-pre-commitv4.3.0+ with commit-msg stagedefault_install_hook_typeslistingpre-commitandcommit-msg, plusdefault_stages: [pre-commit]whenevercommit-msgis installed. Flag a missingdefault_stagesas WARN: without it every unstaged file hook runs at both installed stages, so each commit runs the hook list twice
Frontend-specific:
biome(pre-commit) v0.4.0+helmlint(if helm/ directory exists)
Infrastructure-specific:
tflint,helmlint(gruntwork v0.1.29+)actionlintv1.7.7+helm-docsv1.14.2+gitleaksv8.22.1+
Python-specific:
ruff-pre-commitv0.8.4+ (ruff, ruff-format)gitleaksv8.22.1+
Step 5: Generate compliance report
Print a report in this format:
Pre-commit Compliance Report
================================
Project Type: [type] ([detected|override])
Config File: .pre-commit-config.yaml ([found|missing])
Hook Status:
[hook-name] [version] [PASS|WARN|FAIL] ([details])
Hook Types:
default_install_hook_types [pre-commit, commit-msg] [PASS|FAIL]
default_stages [pre-commit] [PASS|WARN] (missing: file hooks run twice per commit)
Outdated Hooks:
- [hook]: [current] -> [standard]
Overall: [N] issues found
Step 6: Apply fixes (if requested)
If --fix flag is set or user confirms:
- Missing config file: Create from standard template for detected project type
- Missing hooks: Add required hooks with standard versions
- Outdated versions: Update
rev:values to standard versions - Missing hook types: Add
default_install_hook_typeswithpre-commitandcommit-msg, and `default_stage
Установить configure-pre-commit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
GlobGrepReadWriteEditBash(find *)Bash(pre-commit install *)Bash(pre-commit autoupdate *)Bash(pre-commit validate-config *)Bash(grep *)Bash(sed *)AskUserQuestionTodoWriteWebSearchWebFetchВложенные файлы
FAQ
Что делает скилл configure-pre-commit?
Set up .pre-commit-config.yaml: hooks for the project type at current revs. Use when installing pre-commit in a repo, auditing stale hook revs, or migrating to pre-commit.
Как установить скилл configure-pre-commit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл configure-pre-commit запускает скрипты?
Нет, скилл состоит только из инструкций (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