Quality Gates — Claude Code skill: lint, types and pre-deploy checks
This skill wires up automatic code checks: lint and typecheck after every edit, a local CI run before push, and a five-stage deploy checklist.
npx skills add hedera-dev/hedera-skills --skill quality-gates -a claude-codeWhat Quality Gates does
Quality Gates covers validation at every stage, from a single file edit to a full deploy. The core piece is a PostToolUse hook. The agent calls Edit or Write, the hook fires on its own, and scripts/post-edit-check.sh detects the file type and runs the matching checker. The agent sees errors right away and fixes them in the same session.
Stack detection reads project files: tsconfig.json maps to npx tsc --noEmit, package.json without tsconfig to npx eslint, pyproject.toml or setup.py to ruff check, Cargo.toml to cargo check, go.mod to go vet ./.... Individual files fall back to extension matching. Install it as a plugin and the hook in hooks/hooks.json is picked up automatically. For manual setup in .claude/settings.json, the command has to be exactly bash .claude/scripts/post-edit-check.sh with no arguments, because the script reads $CLAUDE_TOOL_INPUT from the environment itself. Any extra flag breaks the hook.
Before a push the skill runs a local pipeline: lint, build, test, security scan. Stages run in order, the run stops at the first failure, and results land in .claude/reports/ci/. Before a deploy there are five verification stages: code quality, build, environment variables, container, and post-deploy health. The script checks that env vars are present and never reads their values.
What it helps with
- catch a type error right after editing a file
- set up a hook that runs the linter on its own
- run lint, build and tests before pushing
- build a pre-deploy verification checklist
- pick the right validator for the project stack
Example prompts for the agent
- set up linting and auto-check after edits
- add pre-push checks: lint, build, tests
- create a deploy checklist for this project
How to install Quality Gates
1Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a claude-code2Manually: put the files in place
~/.claude/skills/quality-gates/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/quality-gates/
1Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a codex2Manually: put the files in place
.agents/skills/quality-gates/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a cursor2Manually: put the files in place
.cursor/skills/quality-gates/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hedera-dev/hedera-skills quality-gates2Manually: put the files in place
.github/skills/quality-gates/SKILL.md1Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a gemini-cli2Platform CLI
gemini skills install https://github.com/hedera-dev/hedera-skills --path plugins/dev-intelligence/skills/quality-gatesManually: put the files in place
.devin/skills/quality-gates/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hedera-dev/hedera-skills --skill quality-gates -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about Quality Gates
How do I install Quality Gates in Claude?
Install it from the skills marketplace: npx skills add hedera-dev/hedera-skills --skill quality-gates -a claude-code. The skill file then lives at ~/.claude/skills/quality-gates/SKILL.md.
What does Quality Gates do?
It sets up quality checks at every stage: a hook after each file edit, a local CI pipeline before push, and a five-stage checklist before deploy.
Which stacks does the skill support?
TypeScript, JavaScript, Python, Rust and Go. The stack is detected from tsconfig.json, package.json, pyproject.toml, Cargo.toml or go.mod, and individual files are matched by extension.
Source text
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