skills/using-quality-gates/SKILL.md
Quality Gates workflow for Claude Code. Use when editing code in projects with quality enforcement. Covers the full cycle: TDD guard (write failing test first) → implement → auto-lint/typecheck. Activates on code edits, quality issues, or when user asks about testing/linting workflow.
npx skillsauth add jaggerxtrm/jaggers-agent-tools using-quality-gatesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Quality Gates provides automated code quality enforcement through PostToolUse hooks:
Separate Installation Required for TDD:
┌─────────────────────────────────────────────────────────────────┐
│ QUALITY GATES (this skill) │
│ ───────────────────────────── │
│ PostToolUse Hooks (installed by this skill): │
│ • .claude/hooks/quality-check.cjs → TS/JS files │
│ • .claude/hooks/quality-check.py → Python files │
│ • .claude/settings.json → Hook registration │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ TDD GUARD (separate installation) │
│ ─────────────────────────────────── │
│ PreToolUse Hook (requires xtrm install project tdd-guard): │
│ • Global CLI: npm install -g tdd-guard │
│ • Test reporter: tdd-guard-vitest / tdd-guard-pytest / etc. │
│ • Hook: .claude/hooks/tdd-guard-pretool-bridge.cjs │
└─────────────────────────────────────────────────────────────────┘
xtrm install project quality-gates
This installs:
.claude/hooks/quality-check.cjs — TypeScript/JavaScript checks.claude/hooks/quality-check.py — Python checks.claude/settings.json — PostToolUse hook registration.claude/skills/using-quality-gates/ — This documentationTypeScript Projects:
npm install --save-dev typescript eslint prettier
Python Projects:
pip install ruff mypy
For test-first enforcement, install TDD Guard separately:
# 1. Install global CLI
npm install -g tdd-guard
# 2. Install project-skill for hook wiring
xtrm install project tdd-guard
# 3. Install test reporter (choose one)
npm install --save-dev tdd-guard-vitest # Vitest
npm install --save-dev tdd-guard-jest # Jest
pip install tdd-guard-pytest # pytest
Configure test reporter (see https://github.com/nizos/tdd-guard):
Vitest:
// vitest.config.ts
import { defineConfig } from 'vitest/config'
import { VitestReporter } from 'tdd-guard-vitest'
export default defineConfig({
test: {
reporters: ['default', new VitestReporter('/path/to/project')],
},
})
pytest:
# pyproject.toml
[tool.pytest.ini_options]
tdd_guard_project_root = "/path/to/project"
Runs after: Every .ts, .tsx, .js, .jsx file edit
Checks:
Configuration (.claude/hooks/hook-config.json):
{
"typescript": { "enabled": true, "showDependencyErrors": false },
"eslint": { "enabled": true, "autofix": true },
"prettier": { "enabled": true, "autofix": true },
"general": { "autofixSilent": true }
}
Runs after: Every .py file edit
Checks:
Configuration (environment variables):
CLAUDE_HOOKS_RUFF_ENABLED=true
CLAUDE_HOOKS_MYPY_ENABLED=true
CLAUDE_HOOKS_AUTOFIX=true
| Code | Meaning | Action | |------|---------|--------| | 0 | All checks passed | Continue | | 1 | Fatal error (missing deps) | Install missing tool | | 2 | Blocking errors | Claude must fix |
When blocked with exit code 2:
Example:
[ERROR] TypeScript compilation failed:
src/auth.ts:42:5 - error TS2322: Type 'string' is not assignable to type 'number'
[WARN] Auto-fix applied: 2 issues fixed
[BLOCK] 1 issue remains - fix before continuing
When TDD Guard is installed alongside Quality Gates:
User Request: "Add feature X"
↓
┌───────────────────────────────────┐
│ TDD Guard (PreToolUse) │
│ Checks: Failing test exists? │
│ • NO → BLOCK: "Write test first" │
│ • YES → Allow implementation │
└───────────────────────────────────┘
↓
Implementation (Write/Edit)
↓
┌───────────────────────────────────┐
│ Quality Gates (PostToolUse) │
│ Runs: Lint + Typecheck + Format │
│ • Errors → BLOCK, fix issues │
│ • Pass → Continue │
└───────────────────────────────────┘
↓
Tests pass → Commit
"ESLint not found" / "Prettier not found"
npm install --save-dev eslint prettier
"Ruff not found" / "Mypy not found"
pip install ruff mypy
"tdd-guard: command not found"
npm install -g tdd-guard
"TDD Guard: No failing test found"
Hook not running
.claude/settings.json exists.ts/.py)Triggers:
Response Modes:
Full Workflow Mode (user mentions quality/testing, blocked by gate errors):
Minimal Mode (general coding tasks without quality context):
.claude/
├── settings.json # PostToolUse hook registration
├── hooks/
│ ├── quality-check.cjs # TypeScript/JavaScript checks
│ ├── quality-check.py # Python checks
│ └── hook-config.json # TS hook configuration
├── skills/
│ └── using-quality-gates/ # This skill
└── docs/
└── quality-gates-readme.md
development
Operational service-knowledge system for a project's services. One skill that creates, discovers, activates, updates, and scopes per-service expert skill packages (SKILL.md + diagnostic scripts + references), kept in sync with the code via a GitNexus-aware drift engine. Use when onboarding to a service, routing a task to the right expert, scaffolding a missing skill, or syncing a skill after the implementation drifted. Triggers: /service-skills, /creating-service-skills, /using-service-skills, /updating-service-skills, /scope, or any task that touches a registered service territory.
development
Bootstrap a complete security pipeline (Dependabot + OSV + Semgrep + gitleaks + pre-commit hooks + Codex review) on any GitHub repo. Designed for free user-private repos where GitHub Advanced Security is unavailable. Reusable across Python/TypeScript/Go/Rust stacks.
testing
Merges queued PRs from xt worktree sessions in the correct order (FIFO), maintaining linear history by rebasing remaining PRs after each merge. Use this skill whenever the user has multiple open PRs from xt worktrees, asks to "merge my PRs", "process the PR queue", "drain the queue", "merge worktree branches", or says "what PRs do I have open". Also activate after any xt-end completion when other PRs are already open, or when the user asks "can I merge yet" or "is CI green". Handles the full sequence: list → sort → CI check → merge oldest → rebase cascade → repeat until queue is empty.
testing
Autonomous session close flow for xt worktree sessions. Use this skill whenever the user says "done", "finished", "wrap up", "close session", "ship it", "I'm done", "ready to merge", or similar. Also activate when all beads issues in the session are closed, or when the user explicitly runs /xt-end. This skill is designed for headless/specialist use: it must make deterministic decisions, auto-remediate common anomalies, and avoid clarification questions unless execution is truly blocked.