AutoDevOps hook‑agents run at pre‑commit / pre‑push / PR. This page shows how to wire them into your favorite agentic tools so developers get instant fixes locally and consistent gates in CI.
# local dev install (recommended) npm i -D autodevops npx husky init
.husky/pre-commit
echo "npx autodevops verify --staged" >> .husky/pre-commit chmod +x .husky/pre-commit
# GitHub Actions example (.github/workflows/verify.yml) name: verify on: [pull_request] jobs: verify: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: 20 } - run: npm ci - run: npx autodevops verify --diff HEAD~1..HEAD
Create .shadow/hooks.yaml
to enable agents at key events.
hooks: pre-commit: - agent: secret-guard on_fail: block - agent: test-focus-blocker with: { frameworks: ["jest","vitest"], auto_fix: true } on_fail: block pre-push: - agent: pr-size-guard with: { max_lines_added: 800, max_files_changed: 30 } on_fail: warn
.only
sneaking into mainStream hook failures into Claude's context; let it propose and apply the minimal patch.
1) Enable pre-commit hooks as above. 2) Add a small script to emit hook results to JSON. 3) In Claude Code, set a custom command to read the JSON and propose a patch. 4) Accept patch, re-run commit.
# package.json { "scripts": { "verify:json": "npx autodevops verify --staged --format json > .autodevops/out.json" } } # .husky/pre-commit npm run verify:json || true
Round‑trip staged diffs to a code model for fix suggestions; apply patch before CI.
1) Produce a unified diff of staged files. 2) Feed diff + error summary to your model/tooling. 3) Apply suggested patch and re-stage. 4) Commit.
# scripts/mkdiff.sh #!/usr/bin/env bash git diff --staged > .autodevops/diff.patch # scripts/prompt.txt (consumed by your CLI of choice) Context: This is a pre-commit failure summary and the staged diff. Goal: produce the smallest possible patch to pass hooks.
Invoke Gemini on hook failure automatically with a concise, structured prompt.
1) Add a post-failure runner in your pre-commit. 2) Pipe .autodevops/out.json + diff to Gemini CLI. 3) Review patch, apply if safe.
# .husky/pre-commit (excerpt) npx autodevops verify --staged --format json > .autodevops/out.json || FAIL=1 if [ "$FAIL" = "1" ]; then # pseudo: gemini CLI invocation echo "Handing off to Gemini..." # gemini --model=2.5-pro --prompt-file=scripts/prompt.txt --input=.autodevops/out.json .autodevops/diff.patch exit 1 fi
Surface hook results inline; Cursor explains failures and offers one‑click fix patches.
1) Ensure .autodevops/out.json is produced on each commit attempt. 2) Teach Cursor to watch that file (Custom Commands). 3) Map each issue to a fix-it instruction.
# .cursor/commands.json (conceptual) [{ "name": "Explain Hook Failures", "command": "read .autodevops/out.json and propose smallest patch for each item" }]
Pipe hook summaries into Cline chat; use its multi‑step tool execution to apply diffs.
1) Add a VS Code task that runs verify:json. 2) Expose the JSON path to Cline as context. 3) Use Cline's 'apply patch' to modify files.
// .vscode/tasks.json { "version": "2.0.0", "tasks": [{ "label": "AutoDevOps Verify JSON", "type": "shell", "command": "npx autodevops verify --staged --format json > .autodevops/out.json" }] }
Experimental: feed hook telemetry so Augmentum can reason about failing lint/tests/policy.
1) Emit JSON + unified diff. 2) Let Augmentum read both as inputs. 3) Constrain it to 'smallest patch wins'.
// .autodevops/out.json (shape) { "issues": [ { "agent": "secret-guard", "severity": "high", "path": ".env", "message": "API key detected" }, { "agent": "test-focus-blocker", "severity": "med", "path": "auth.test.ts", "message": "it.only found" } ] }
Everything you run in hooks should also run in CI so policies can't be bypassed.
1) Add a CI workflow that runs 'autodevops verify' on PR diffs. 2) Fail PR if violations remain. 3) Post annotations as PR comments.
# .gitlab-ci.yml verify: image: node:20 stage: test script: - npm ci - npx autodevops verify --diff $CI_MERGE_REQUEST_DIFF_BASE_SHA..$CI_COMMIT_SHA
docs/
for guides.