From harn
Generate or update the quality gate Stop hook. Use when: /harn:quality-gate, 'set up type checking', 'add quality gate', 'stop hook'
npx claudepluginhub sliday/harnThis skill uses the workspace's default tool permissions.
Generate or update `scripts/harness/quality_gate.sh` for the current project.
Provides Ktor server patterns for routing DSL, plugins (auth, CORS, serialization), Koin DI, WebSockets, services, and testApplication testing.
Conducts multi-source web research with firecrawl and exa MCPs: searches, scrapes pages, synthesizes cited reports. For deep dives, competitive analysis, tech evaluations, or due diligence.
Provides demand forecasting, safety stock optimization, replenishment planning, and promotional lift estimation for multi-location retailers managing 300-800 SKUs.
Generate or update scripts/harness/quality_gate.sh for the current project.
npx tsc --noEmitcargo checkgo vet ./...mypy or pyrightnpx eslint ..claude/settings.jsonstop_hook_active payload to prevent infinite loopsThe generated scripts/harness/quality_gate.sh must include the following robustness patterns:
# Harn quality gate — blocks agent completion if code is broken
# Why: https://harn.app/kb/safety.html — "Quality checks in the loop"
# Pattern: https://harn.app/kb/evals.html — "Infrastructure noise moves benchmarks"
command -v jq &>/dev/null || { echo "Harn: jq not found, quality gate skipped" >&2; exit 0; }
LOG_FILE="${TMPDIR:-/tmp}/harn_gate_${PPID}_$$.log"
Each checker must be guarded with command -v before invocation:
if [ -f "tsconfig.json" ]; then
command -v npx &>/dev/null || {
echo "QUALITY GATE BLOCKED: TypeScript detected but 'npx' not found." >&2
echo "Install Node.js or remove tsconfig.json." >&2
exit 2
}
npx tsc --noEmit > "$LOG_FILE" 2>&1 || {
echo "QUALITY GATE BLOCKED: TypeScript errors found:" >&2
cat "$LOG_FILE" >&2
exit 2
}
fi
if [ -f "Cargo.toml" ]; then
command -v cargo &>/dev/null || {
echo "QUALITY GATE BLOCKED: Rust detected but 'cargo' not found." >&2
echo "Install Rust toolchain or remove Cargo.toml." >&2
exit 2
}
cargo check > "$LOG_FILE" 2>&1 || {
echo "QUALITY GATE BLOCKED: Cargo check errors found:" >&2
cat "$LOG_FILE" >&2
exit 2
}
fi
if [ -f "go.mod" ]; then
command -v go &>/dev/null || {
echo "QUALITY GATE BLOCKED: Go detected but 'go' not found." >&2
echo "Install Go or remove go.mod." >&2
exit 2
}
go vet ./... > "$LOG_FILE" 2>&1 || {
echo "QUALITY GATE BLOCKED: Go vet errors found:" >&2
cat "$LOG_FILE" >&2
exit 2
}
fi
if [ -f "mypy.ini" ] || [ -f "setup.cfg" ] || [ -f "pyproject.toml" ]; then
command -v mypy &>/dev/null || {
echo "QUALITY GATE BLOCKED: Python type checking configured but 'mypy' not found." >&2
echo "Install mypy or remove type checking config." >&2
exit 2
}
mypy . > "$LOG_FILE" 2>&1 || {
echo "QUALITY GATE BLOCKED: mypy errors found:" >&2
cat "$LOG_FILE" >&2
exit 2
}
fi
"Harn: Quality gate passed." (minimal output)