Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hedera-dev/hedera-skills --skill quality-gates -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/quality-gates/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/quality-gates/

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

Similar skills

Everything for Testing and QA →

From the same set13

Hedera Hackathon PRD Turns your hackathon idea into a PRD: asks about the track, writes HACKATHON-PRD.md, then predicts your score against the judging rubric. CX Codex +1 549installs hedera-token-service Teaches your agent to write Hedera token and NFT code with the Hiero JavaScript SDK. Useful when the project already lives on that network. CX Codex +1 547installs hedera-consensus-service A skill that teaches your agent Hedera Consensus Service in JavaScript: create topics, submit messages, subscribe to the stream via mirror node. CX Codex +1 547installs Session Management Keeps a work log and a tech debt tracker across agent sessions, so a restart still shows what got done and what is pending. CX Codex +1 538installs Hedera Agent Kit v4 Migration Walks a project from [email protected] to v4: swaps packages, rewrites imports and ports custom tools to BaseTool. CX Codex +1 484installs agent-kit-plugin This skill guides the creation of Hedera Agent Kit plugins and tools. Use it when adding token, account, consensus, smart contract, or custom Hedera functionality. CX Codex +1 463installs create-harness-spec Turns a Hedera feature idea into a runnable hedera-harness recipe: PRD, spec file and validators. Useful when you need a spec you can actually run. CX Codex +1 465installs harness-spec-anatomy Defines what a hedera-harness recipe is made of: the files, the v3 defaults, the run stages and the blind evaluate-checklist rule. For anyone authoring or auditing recipes. CX Codex +1 464installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor