.agents/skills/pre-commit-setup/SKILL.md
# Pre-commit & Code Quality Setup Триггеры: "pre-commit", "настроить линтинг", "code quality gate", "lizard", "cyclomatic complexity", "настроить linter", "pre-commit hook", "статический анализ", "настроить проверку перед commit", "check before commit", "автопроверка кода", "настроить code quality" ## Контекст Настройка pre-commit хуков для проверки кода перед commit. Включает linter, formatter, complexity check. ## Обязательный инструмент: Lizard Анализатор cyclomatic complexity для ВСЕХ яз
npx skillsauth add kissrosecicd-hub/agents-evolution .agents/skills/pre-commit-setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Триггеры: "pre-commit", "настроить линтинг", "code quality gate", "lizard", "cyclomatic complexity", "настроить linter", "pre-commit hook", "статический анализ", "настроить проверку перед commit", "check before commit", "автопроверка кода", "настроить code quality"
Настройка pre-commit хуков для проверки кода перед commit. Включает linter, formatter, complexity check.
Анализатор cyclomatic complexity для ВСЕХ языков.
pip install lizard # или uv pip install lizard
lizard -l 15 -n 300 -a 10 <dir>
Ориентиры: complexity ≤ 15, NLOC ≤ 300, параметры ≤ 10.
| Язык | Линтер | Форматер | Анализатор | |------|--------|----------|------------| | Python | ruff | ruff format | mypy, lizard | | TypeScript | eslint, biome | biome, prettier | tsc --noEmit | | JavaScript | eslint | prettier | lizard | | Go | golangci-lint | gofmt | go vet | | Rust | clippy | rustfmt | cargo check | | C/C++ | clang-tidy | clang-format | cppcheck | | Java | checkstyle | spotless | pmd |
repos:
- repo: local
hooks:
- id: ruff-check
name: ruff check
entry: uv run ruff check --force-exclude
language: system
types: [python]
- id: ruff-format
name: ruff format
entry: uv run ruff format --check
language: system
types: [python]
- id: lizard
name: lizard complexity
entry: uv run lizard -l 15 -n 300 -a 10 .
language: system
types: [python]
repos:
- repo: local
hooks:
- id: eslint
name: eslint
entry: npx eslint
language: system
types: [ts, tsx, javascript]
- id: biome
name: biome format
entry: npx @biomejs/biome format --write
language: system
types: [ts, tsx, javascript]
- id: tsc
name: type check
entry: npx tsc --noEmit
language: system
types: [ts, tsx]
repos:
- repo: local
hooks:
- id: golangci-lint
name: golangci-lint
entry: golangci-lint run
language: system
types: [go]
- id: gofmt
name: gofmt
entry: gofmt -l -w
language: system
types: [go]
Для monorepo используй changed-files чтобы проверять только изменённые файлы:
repos:
- repo: local
hooks:
- id: ruff-check
name: ruff check
entry: bash -c 'git diff --cached --name-only --diff-filter=ACM | grep ".py$" | xargs -r uv run ruff check'
language: system
pass_filenames: false
.pre-commit-config.yaml с uv run (или npx для JS)pre-commit installpre-commit run --all-filesuv = мгновенная установка, изолированное окружениеМетрики — сигнал, не абсолютный запрет.
✅ Правильно:
❌ Неправильно:
tools
KISS reference skill for v2rayA on Arch/Ubuntu/Fedora with TUN, RoutingA, DoH DNS and Outline key import.
testing
Identifies dependencies at heightened risk of exploitation or takeover. Use when assessing supply chain attack surface, evaluating dependency health, or scoping security engagements.
development
Run Semgrep static analysis scan on a codebase using parallel subagents. Supports two scan modes — "run all" (full ruleset coverage) and "important only" (high-confidence security vulnerabilities). Automatically detects and uses Semgrep Pro for cross-file taint analysis when available. Use when asked to scan code for vulnerabilities, run a security audit with Semgrep, find bugs, or perform static analysis. Spawns parallel workers for multi-language codebases.
development
Identifies error-prone APIs, dangerous configurations, and footgun designs that enable security mistakes. Use when reviewing API designs, configuration schemas, cryptographic library ergonomics, or evaluating whether code follows 'secure by default' and 'pit of success' principles. Triggers: footgun, misuse-resistant, secure defaults, API usability, dangerous configuration.