mcpField
Q
Quality Gates

Quality Gates

github.com/hedera-devTesting & quality28551 installsUpdated 8w ago
Repository

About Quality Gates

Quality Gates is a development skill for agents that validates edited files and guides pre-push and pre-deployment checks. It combines automatic, stack-aware validation with CI and deployment checklists.

Key features

  1. 01Automatic checks after file edits
  2. 02Stack and file-type detection
  3. 03Local lint, build, test, and security pipeline
  4. 04Five-stage deployment checklist

Use cases

  1. 01Catch errors immediately after editing
  2. 02Run quality checks before pushing
  3. 03Verify an application before deployment

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/hedera-dev/hedera-skills --skill quality-gates

After installing, type/quality-gatesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
deploy-checklist.md
hook-patterns.md
ci-pipeline.md

Details

From the project README

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:

{
  "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:

StageWhatGate
1. Code QualityLint + Typecheck + TestsAll pass
2. BuildFull build succeedsArtifacts exist
3. EnvironmentRequired env vars presentAll set (never read values)
4. ContainerImage builds and startsNo errors
5. Post-DeployHealth endpoint, logs200 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
CheckDetected StackPrimary Validator
tsconfig.json existsTypeScriptnpx tsc --noEmit
package.json exists (no tsconfig)JavaScriptnpx eslint
pyproject.toml or setup.py existsPythonruff check
Cargo.toml existsRustcargo check
go.mod existsGogo vet ./...
File Extension Fallback

When editing individual files, detect by extension:

ExtensionValidator
.ts, .tsxTypeScript checker
.js, .jsxESLint (if configured)
.pyruff or py_compile
.rscargo check
.gogo vet
OtherSilent 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

Comments

Markdown supported