ad-hooks
SkillAI & modelsScaffold deterministic quality gates per WORKFLOW.md §11 — pre-commit (lint, format, secret-scan), pre-push (build, unit, integration). Detects the project's stack and recommends a hook runner (Husky / lefthook / pre-commit / native), scaffolds the runner config, and updates AGENTS.md Quality Gates. Use when the user wants to wire hooks, configure pre-commit / pre-push, set up quality gates, prevent --no-verify bypass, or close the WORKFLOW §11 advisory-vs-deterministic gap. Opt-in skill; not auto-installed.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the ad-hooks skill
What this skill tells your AI
The instructions your AI receives, as published by corridortech/posecap in .agents/skills/ad-hooks/SKILL.md and read by ahel’s review.
<background_information>
Scaffolds the deterministic gates WORKFLOW.md §11 names. The skill writes config files for a hook runner and updates AGENTS.md Quality Gates; it does not execute install scripts. The user runs the runner's one-time bootstrap (npx husky init, lefthook install, pre-commit install) — the skill names the exact command.
Codex auto-trigger on description keywords is less mature than Claude Code's. If auto-invocation does not fire when the user asks about hooks, pre-commit, or quality gates, invoke the skill manually. </background_information>
Confirm both tiers are in scope. If the user wants only one, scaffold only that tier.
Visual / E2E for UI projects (Cypress, Playwright) live in CI, not pre-push. Out of scope.
Step 1 — detect the runner. Read repo signals in this order:
- Existing runner.
.husky/→ Husky.lefthook.ymlor.lefthook.yml→ lefthook..pre-commit-config.yaml→ pre-commit..git/hooks/with non-sample scripts → native hooks. - Stack signals (if no runner present).
package.json→ recommend Husky or lefthook.pyproject.toml→ recommend pre-commit.go.mod→ recommend lefthook.Cargo.toml→ recommend lefthook. Multiple stacks → recommend lefthook (cross-language by default). - No signals. Recommend native
.git/hooks/only as fallback. Warn the user that native hooks are not portable across clones.
If multiple runners are present, surface the conflict and ask the user before scaffolding. Never silently pick.
Step 2 — recommend the per-stack commands:
- Node: lint =
npm run lintornpx eslint .; format check =npm run format:checkornpx prettier --check .; secret-scan =gitleaks detect --no-banner; build =npm run build(skip if no script); test =npm test. - Python: lint =
ruff check .; format check =ruff format --check .orblack --check .; secret-scan =gitleaks detect --no-banner; test =pytest -q. - Go: lint =
golangci-lint run; format check =gofmt -d .; secret-scan =gitleaks detect --no-banner; build =go build ./...; test =go test ./.... - Rust: lint =
cargo clippy -- -D warnings; format check =cargo fmt --check; secret-scan =gitleaks detect --no-banner; build =cargo build; test =cargo test. - Mixed / other: ask for the per-tier command list. Do not invent.
Offer to swap any default. Confirm before writing.
Step 3 — scaffold the runner config. Write the runner-specific config file:
- Husky:
.husky/pre-commitand.husky/pre-push(shell scripts) +"prepare": "husky"inpackage.json. Bootstrap:npm install. - lefthook:
lefthook.ymlat the repo root withpre-commitandpre-pushcommands keyed by stage. Bootstrap:lefthook install. - pre-commit:
.pre-commit-config.yamlwith stack-specific hook references. Bootstrap:pre-commit installandpre-commit install --hook-type pre-push. - Native:
.git/hooks/pre-commitand.git/hooks/pre-push+ asetup-hooks.shscript the user runs after every clone (since.git/is not committed).
Step 4 — update AGENTS.md Quality Gates. Append or refresh the section with: pre-commit gate list, pre-push gate list, runner name + config path, bootstrap command, CI status if known, no-bypass policy. Honor existing managed markers if ad-bootstrap already wrote Quality Gates.
Step 5 — mirror CI locally. WORKFLOW §11: "CI failure is a local gate gap." Read the CI config and compare:
- Detect CI surface in order:
.github/workflows/*.yml,.gitlab-ci.yml,.circleci/config.yml,azure-pipelines.yml,.buildkite/pipeline.yml. If none, note the gap and skip — mirror check has no target. - Extract CI commands from
run:/script:steps — test / lint / typecheck / build. Skip checkout, setup, cache, publish. - Extract CI matrix — language versions, OS runners, feature flags. These become pre-push matrix requirements when they change the failure surface.
- Diff against pre-push. For each CI command not covered locally, warn:
CI runs <cmd> — pre-push does not. Add to pre-push or CI will catch what local won't.For each matrix dimension CI covers that pre-push does not, warn:CI matrix <dim>=<values>, pre-push runs <value>. - Offer to close the gap. Propose specific edits to the runner config; ask the user before writing (matrix mirroring can be expensive).
Step 6 — tell the user the bootstrap command. Output the exact one-line command the user runs. The skill does not execute it.
<output_contract> Filesystem changes:
- The runner's config file (
.husky/pre-commit,lefthook.yml,.pre-commit-config.yaml, or.git/hooks/). - An updated
AGENTS.mdQuality Gates section. - For native-hooks fallback: a
setup-hooks.shscript.
The skill does not execute the runner's install command. The skill does not write CI config. The skill does not configure agent-side hooks (.claude/settings.json) — different surface, deferred.
Documentation discipline rules apply at write time:
- No emoji anywhere in scaffolded config or AGENTS.md update.
- No version stamps or DRAFT markers.
- Quality Gates section opens with the operational rule (gates are deterministic) before listing the gates.
- One scope: Quality Gates. No duplication of ARCHITECTURE.md or ADR rationale.
- No commented-out scripts. No orphan TODO / FIXME. </output_contract>
Next
- Run the runner's bootstrap command (cited in Step 6 — e.g.,
npm install,lefthook install,pre-commit install). - Verify a deliberately-failing edit (e.g., a known lint violation) gets blocked at commit.
- Add a redundant CI gate so contributors cannot bypass via
--no-verify. WORKFLOW §11 binding. /ad-driftperiodically to confirm hooks stay wired as the project evolves.
Signals
- GitHub stars
- 206
- Forks
- 16
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
ad-hooks- Source
- github.com/corridortech/posecap