Docs

Ecosystem Integrations — Hook‑Agents that play nice with your IDE & CI

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.

Claude Code
OpenAI Codex / GPT‑4o
Gemini CLI
Cursor (background agent)
Cline (VS Code)
Augmentum
GitHub Actions
GitLab CI

Quickstart

  1. Install & init hooks
    # local dev install (recommended)
    npm i -D autodevops
    npx husky init
    
  2. Add AutoDevOps to .husky/pre-commit
    echo "npx autodevops verify --staged" >> .husky/pre-commit
    chmod +x .husky/pre-commit
  3. Mirror checks in CI (no bypass)
    # 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

Configuration

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

Common Agents

  • Secret & Key Leak Guard — blocks creds in diffs
  • Test Focus Blocker — prevents .only sneaking into main
  • Dockerfile Linter — pins base, drops root user
  • OpenAPI Guard — keeps code and spec in sync
  • PR Size Guard — nudges splits for giant PRs

Claude Code

Stream hook failures into Claude's context; let it propose and apply the minimal patch.

Steps

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.

Emit hook results to JSON

# package.json
{
  "scripts": {
    "verify:json": "npx autodevops verify --staged --format json > .autodevops/out.json"
  }
}

# .husky/pre-commit
npm run verify:json || true

How it works

  • Hook runs, writes .autodevops/out.json
  • Claude reads JSON and crafts a targeted diff
  • Developer approves; commit proceeds

OpenAI Codex / GPT‑4o

Round‑trip staged diffs to a code model for fix suggestions; apply patch before CI.

Steps

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.

Create a diff + prompt locally

# 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.

How it works

  • Hook provides failure summary
  • Model proposes minimal patch
  • Developer applies and commits

Gemini CLI

Invoke Gemini on hook failure automatically with a concise, structured prompt.

Steps

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.

Pre-commit with Gemini handoff

# .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

How it works

  • On failure, shell hands context to Gemini
  • Gemini suggests patch or rationale
  • You apply and re-run commit

Cursor (background agent)

Surface hook results inline; Cursor explains failures and offers one‑click fix patches.

Steps

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 command idea

# .cursor/commands.json (conceptual)
[{
  "name": "Explain Hook Failures",
  "command": "read .autodevops/out.json and propose smallest patch for each item"
}]

How it works

  • Background agent reacts to JSON updates
  • Shows explanation + patch
  • You accept and re-stage

Cline (VS Code)

Pipe hook summaries into Cline chat; use its multi‑step tool execution to apply diffs.

Steps

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.

VS Code task example

// .vscode/tasks.json
{
  "version": "2.0.0",
  "tasks": [{
    "label": "AutoDevOps Verify JSON",
    "type": "shell",
    "command": "npx autodevops verify --staged --format json > .autodevops/out.json"
  }]
}

How it works

  • Task populates the JSON context
  • Cline reads and proposes steps
  • Tool runs apply the edits

Augmentum

Experimental: feed hook telemetry so Augmentum can reason about failing lint/tests/policy.

Steps

1) Emit JSON + unified diff.
2) Let Augmentum read both as inputs.
3) Constrain it to 'smallest patch wins'.

Telemetry file shape

// .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" }
  ]
}

How it works

  • Agent ingests issues + diff
  • Proposes minimal patch set
  • You review and commit

CI Parity (no bypass)

Everything you run in hooks should also run in CI so policies can't be bypassed.

Steps

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 example

# .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

How it works

  • Same checks in hooks and CI
  • CI is the source of truth
  • Green CI == mergeable

Resources

Need a missing integration? Open a request in GitHub Discussions.
Repository