Quality Gates — скилл для Claude Code: линт, типы и проверки перед
Скилл настраивает автоматические проверки кода: линт и типы после каждой правки, локальный CI перед пушем, чек-лист перед деплоем.
npx skills add hedera-dev/hedera-skills --skill quality-gates -a claude-codeЧто делает Quality Gates
Скилл закрывает проверки на всех этапах: от правки одного файла до выката. Основной механизм — хук PostToolUse. Агент вызывает Edit или Write, хук срабатывает сам, скрипт scripts/post-edit-check.sh определяет тип файла и запускает нужный валидатор. Ошибки агент видит сразу и правит в той же сессии.
Стек определяется по файлам проекта: tsconfig.json — npx tsc --noEmit, package.json без tsconfig — npx eslint, pyproject.toml или setup.py — ruff check, Cargo.toml — cargo check, go.mod — go vet ./.... Для отдельных файлов работает запасной вариант по расширению. Если поставить скилл как плагин, хук из hooks/hooks.json подхватится сам. При ручной настройке в .claude/settings.json команда должна быть ровно bash .claude/scripts/post-edit-check.sh — без аргументов, потому что скрипт сам читает $CLAUDE_TOOL_INPUT из окружения. Лишний флаг здесь ломает весь хук.
Перед пушем скилл гоняет локальный конвейер: линт, сборка, тесты, сканирование безопасности. Стадии идут по порядку, выход на первой ошибке, результаты складываются в .claude/reports/ci/. Перед деплоем — пять шагов проверки: качество кода, сборка, переменные окружения, контейнер, здоровье после выката. Значения переменных скрипт не читает, только проверяет наличие.
Какие задачи решает
- поймать ошибку типов сразу после правки файла
- настроить хук, который сам запускает линтер
- прогнать линт, сборку и тесты до пуша
- собрать чек-лист проверок перед выкатом
- подобрать валидатор под стек проекта
Примеры запросов агенту
- настрой линтинг и автопроверку после правок
- сделай pre-push проверки: линт, сборка, тесты
- собери deploy checklist для этого проекта
Как установить Quality Gates
1Через Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a claude-code2Вручную: положить файлы
~/.claude/skills/quality-gates/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/quality-gates/
1Через Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a codex2Вручную: положить файлы
.agents/skills/quality-gates/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a cursor2Вручную: положить файлы
.cursor/skills/quality-gates/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install hedera-dev/hedera-skills quality-gates2Вручную: положить файлы
.github/skills/quality-gates/SKILL.md1Через Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a gemini-cli2Командой платформы
gemini skills install https://github.com/hedera-dev/hedera-skills --path plugins/dev-intelligence/skills/quality-gatesВручную: положить файлы
.devin/skills/quality-gates/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о Quality Gates
Как установить Quality Gates в Claude?
Через маркетплейс скиллов: npx skills add hedera-dev/hedera-skills --skill quality-gates -a claude-code. После установки файл скилла лежит в ~/.claude/skills/quality-gates/SKILL.md.
Что делает Quality Gates?
Настраивает проверки качества на всех этапах: хук после каждой правки файла, локальный CI перед пушем и чек-лист из пяти шагов перед деплоем.
Какие стеки поддерживает скилл?
TypeScript, JavaScript, Python, Rust и Go. Стек определяется по tsconfig.json, package.json, pyproject.toml, Cargo.toml или go.mod, а для отдельных файлов — по расширению.
Исходный текст
SKILL.md · Apache-2.0
---
name: Quality Gates
description: This skill should be used when the user wants to set up linting, configure auto-checking after edits, create a deploy checklist, set up pre-push checks, configure a CI pipeline, add quality gates, set up a hook for typechecking, enable post-edit validation, or auto-validate code changes. Triggered by phrases like "set up linting", "auto check after edits", "deploy checklist", "pre-push checks", "CI pipeline", "quality gates", "hook for typecheck", "post-edit validation", "auto-validate".
---
# Quality Gates
## Purpose
Automatic quality validation at every stage of development — from individual file edits to full deployments. Quality gates catch errors early when they're cheapest to fix.
## PostToolUse Hooks
The most powerful quality gate: automatic validation every time a file is edited or created.
### How It Works
1. Agent uses `Edit` or `Write` to modify a file
2. PostToolUse hook fires automatically
3. Validation script detects the file type and runs the appropriate checker
4. Output is shown to the agent immediately
5. Agent sees errors and can fix them in the same session
### Setting Up
The plugin includes a ready-to-use hook in `hooks/hooks.json` that runs `scripts/post-edit-check.sh`. When installed as a plugin, this works automatically.
For manual setup in a project, add to `.claude/settings.json`:
```json
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "bash .claude/scripts/post-edit-check.sh"
}
]
}
]
}
}
```
**Important:** The command must be exactly `bash .claude/scripts/post-edit-check.sh` — do not add arguments. The script reads `$CLAUDE_TOOL_INPUT` from the environment automatically.
See `references/hook-patterns.md` for stack-specific hook examples.
## Deploy Checklist
Before deploying any application, run through these 5 verification stages:
| Stage | What | Gate |
|-------|------|------|
| 1. Code Quality | Lint + Typecheck + Tests | All pass |
| 2. Build | Full build succeeds | Artifacts exist |
| 3. Environment | Required env vars present | All set (never read values) |
| 4. Container | Image builds and starts | No errors |
| 5. Post-Deploy | Health endpoint, logs | 200 OK, clean logs |
See `references/deploy-checklist.md` for complete verification commands per stack.
## CI Pre-Push Gate
Run the full quality suite locally before pushing to remote:
```
Lint → Build → Test → Security Scan
```
**Key rules:**
- Run stages sequentially
- Exit on first failure
- Target under 2 minutes total
- Don't skip stages
- Save results to `.claude/reports/ci/`
See `references/ci-pipeline.md` for the full pipeline template.
## Stack Detection
The quality gates system auto-detects your project stack to run the right validators.
### Detection Priority
| Check | Detected Stack | Primary Validator |
|-------|---------------|-------------------|
| `tsconfig.json` exists | TypeScript | `npx tsc --noEmit` |
| `package.json` exists (no tsconfig) | JavaScript | `npx eslint` |
| `pyproject.toml` or `setup.py` exists | Python | `ruff check` |
| `Cargo.toml` exists | Rust | `cargo check` |
| `go.mod` exists | Go | `go vet ./...` |
### File Extension Fallback
When editing individual files, detect by extension:
| Extension | Validator |
|-----------|-----------|
| `.ts`, `.tsx` | TypeScript checker |
| `.js`, `.jsx` | ESLint (if configured) |
| `.py` | ruff or py_compile |
| `.rs` | cargo check |
| `.go` | go vet |
| Other | Silent pass |
## Workflow Integration
### During Development
- PostToolUse hooks catch errors on every edit
- Agent fixes issues immediately before they compound
### Before Pushing
- Run the CI pipeline locally: lint → build → test → security
- All stages must pass before pushing
### Before Deploying
- Run through the deploy checklist
- Verify build, environment, and health endpoints
- Ensure rollback plan is ready
## Cross-References
- `references/hook-patterns.md` — PostToolUse hook examples for every stack
- `references/deploy-checklist.md` — 5-stage pre-deploy verification
- `references/ci-pipeline.md` — Local CI pipeline pattern
© hedera-dev · Apache-2.0 · hedera-dev/hedera-skills