Mav local verification

From thermiteau/maverick · View interactive version

Mav local verification is an AI agent skill from the GitHub repository thermiteau/maverick. Pre-push code quality verification — lint, typecheck, and tests run locally before pushing. Covers discovering project verification commands, run order, scope-appropriate checks, and fixing failures. Used as a dependency from workflow skills.

How to use this skill

Skill file

Local Verification

Run lint, typecheck, and tests locally before every push. Never push code that fails local checks.

Principles

  1. Verify locally first — never push code that fails lint, typecheck, or tests
  2. Never skip git hooks — never use --no-verify with git commands
  3. Fix before proceeding — stop at the first failure, fix it, then continue

Process

digraph verify {
    "Ready to push?" [shape=diamond];
    "Discover verification commands" [shape=box];
    "Run lint" [shape=box];
    "Lint passes?" [shape=diamond];
    "Fix lint issues" [shape=box];
    "Run typecheck" [shape=box];
    "Typecheck passes?" [shape=diamond];
    "Fix type errors" [shape=box];
    "Run tests" [shape=box];
    "Tests pass?" [shape=diamond];
    "Fix failing tests" [shape=box];
    "Push to remote" [shape=box];

    "Ready to push?" -> "Discover verification commands" [label="yes"];
    "Discover verification commands" -> "Run lint";
    "Run lint" -> "Lint passes?";
    "Lint passes?" -> "Run typecheck" [label="yes"];
    "Lint passes?" -> "Fix lint issues" [label="no"];
    "Fix lint issues" -> "Run lint";
    "Run typecheck" -> "Typecheck passes?";
    "Typecheck passes?" -> "Run tests" [label="yes"];
    "Typecheck passes?" -> "Fix type errors" [label="no"];
    "Fix type errors" -> "Run typecheck";
    "Run tests" -> "Tests pass?";
    "Tests pass?" -> "Push to remote" [label="yes"];
    "Tests pass?" -> "Fix failing tests" [label="no"];
    "Fix failing tests" -> "Run tests";
}

Discovering Verification Commands

Projects use different tooling. Discover the available commands by checking these sources in order:

  1. package.json scripts (Node.js projects):

```bash

cat package.json | jq '.scripts | keys[]' 2>/dev/null

```

Look for: lint, typecheck, type-check, tsc, test, test:unit, check

  1. Makefile targets:

```bash

grep -E '^[a-zA-Z_-]+:' Makefile 2>/dev/null

```

Look for: lint, check, test, verify, validate

  1. Monorepo root (if applicable):

```bash

cat package.json | jq '.scripts' 2>/dev/null

```

Look for workspace-level commands like test:all, lint:all, or use the package manager's workspace filter.

  1. Common patterns if no scripts are found:

| Tool | Lint | Typecheck | Test |

|---|---|---|---|

| npm/pnpm | pnpm lint | pnpm typecheck | pnpm test |

| Turborepo | pnpm turbo lint | pnpm turbo typecheck | pnpm turbo test |

| Make | make lint | make typecheck | make test |

| Python (uv) | uv run ruff check | uv run mypy . | uv run pytest |

| Go | golangci-lint run | (built into compile) | go test ./... |

Running Verification

Run in this order — each stage catches different classes of issues:

  1. Lint — catches style issues, unused imports, formatting
  2. Typecheck — catches type errors, missing properties, wrong arguments
  3. Tests — catches logic errors, regressions, broken integrations
  4. Project checks — the project's invariant scripts (rules such as

"every route declares a capability" or "nothing deletes from a

retract-only table"), configured in .maverick/config.json under

checks.commands:

```bash

uv run maverick checks run --base "$(uv run maverick git-workflow story-base)"

```

--base reads the checks from the base branch's committed config, so

a change on your branch can never alter the checks that gate it. It

exits 0 with a notice when none are configured. A failing check is

a failed verification like any other: fix the code, never the check,

unless the issue explicitly changes the invariant.

Stop at the first failure. Fix it before proceeding to the next stage.

Reading the output

Agents pay for every line they read, again on every later call. Send

each command's output to a log and read back only what decides the next

step: the exit status, the summary lines and the failures.

mkdir -p .maverick/tmp
LOG=.maverick/tmp/verify-<issue>-<stage>.log
<command> > "$LOG" 2>&1; echo "exit=$?"
tail -n 30 "$LOG"
grep -nE 'FAIL|Error|error:' "$LOG" | head -n 40

Widen the read only around a failure you are diagnosing. Keep the log in

the checkout's .maverick/tmp/, never a shared /tmp path, so parallel

stories never read each other's.

Scope-Appropriate Verification

Not every change needs the full suite:

| Change type | Lint | Typecheck | Tests | Project checks |

|---|---|---|---|---|

| Code changes | Yes | Yes | Yes — at minimum the affected test files | Yes |

| Config/YAML only | No | No | No (unless config affects runtime) | Yes |

| Documentation only | No | No | No | No |

| New dependencies added | Yes | Yes | Yes — full suite | Yes |

For the final push before PR creation, always run the full suite regardless of change type.

After Merging the Base Branch

A moving base branch is merged into a story branch often. Re-running the

full suite after every such merge, when nothing the branch touches

changed, can cost more than the story itself. A suite that passed

before the merge still stands when all of these hold:

<passed> the commit the suite last passed on and <base> the story

base, these two lists must not overlap:

```bash

git diff --name-only "origin/<base>...<passed>" # the branch's own files

git diff --name-only "<passed>" HEAD # what the merge changed

```

change, and no change to build, lint, test or checks.commands

configuration.

Otherwise, run the full suite again. Say which way you went, and why,

in the push's report note. Before marking a PR ready, the CI checks on

the pushed head still have to pass, whatever was skipped locally.

<!-- maverick-plugin-version: 5.3.1 -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.