Quality Gates
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
- Agent uses
EditorWriteto modify a file - PostToolUse hook fires automatically
- Validation script detects the file type and runs the appropriate checker
- Output is shown to the agent immediately
- 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:
{
"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 stackreferences/deploy-checklist.md— 5-stage pre-deploy verificationreferences/ci-pipeline.md— Local CI pipeline pattern
More from hedera-dev/hedera-skills
hedera hackathon prd
This skill should be used when the user wants to plan a Hedera hackathon project, create a PRD, write a project spec, brainstorm a hackathon idea, or structure their hackathon submission. Triggered by phrases like "hackathon project plan", "hackathon PRD", "plan my hackathon project", "hedera hackathon idea", "write a hackathon spec", "hackathon project structure", "prepare for hackathon", or "build for hackathon".
26hedera-token-service
How to create, manage, and transfer tokens on Hedera using the Hiero JavaScript SDK (@hiero-ledger/sdk). Use this skill whenever the user wants to work with fungible tokens, NFTs, token creation, minting, burning, transfers, token association, custom fees (fixed, fractional, royalty), airdrops, KYC/freeze/wipe/pause operations, or any HTS (Hedera Token Service) operation in JavaScript or TypeScript. Also trigger when users mention @hashgraph/sdk token operations, ERC-20/ERC-721 equivalents on Hedera, or tokenization on the Hedera network.
20hedera-consensus-service
How to create topics, submit messages, and subscribe to real-time message streams on Hedera using the Hiero JavaScript SDK (@hiero-ledger/sdk). Use this skill whenever the user wants to work with Hedera Consensus Service (HCS), including topic creation, message submission, pub/sub messaging, mirror node subscriptions, chunked large messages, topic fees, or any consensus-related operation in JavaScript or TypeScript. Also trigger when users mention @hashgraph/sdk topic operations, event logging on Hedera, decentralized messaging, audit trails, or ordered message streams.
17schedule service system contract skill
Hedera Schedule Service (HSS) smart contract development. Use when creating or interacting with scheduled transactions from Solidity via the Schedule Service system contract at 0x16b (e.g. scheduleNative for token creation, scheduleCall for generalized contract calls, authorizeSchedule, signSchedule, deleteSchedule, or querying scheduled token info).
15session management
This skill should be used when the user wants to resume previous work, continue from a last session, check what was being worked on, track completed work, log session activity, manage tech debt, review pending items, view session history, or maintain a work log. Triggered by phrases like "resume work", "continue from last session", "what was I working on", "track this work", "log what we did", "tech debt", "what's pending", "session history", "work log".
12project scaffolding
This skill should be used when the user wants to set up Claude for a project, create a CLAUDE.md file, scaffold the .claude directory, initialize an AI workflow, configure a project for Claude, set up dev intelligence, initialize a new project, or do a new project setup. Triggered by phrases like "set up claude for this project", "create CLAUDE.md", "scaffold .claude directory", "init AI workflow", "configure project for claude", "set up dev intelligence", "initialize project", "new project setup".
12