# Pre Push Gate

Diagnose a failing stage of this repo's pre-push gate, and run it correctly.

- Repository: https://github.com/modelcontextprotocol/inspector (11208 stars)
- Category: Git and review
- License: see repository
- Last updated: 2026-10-29
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add modelcontextprotocol/inspector --skill pre-push-gate -g -a claude-code -y`
Codex: `npx skills add modelcontextprotocol/inspector --skill pre-push-gate -g -a codex -y`
Cursor: `npx skills add modelcontextprotocol/inspector --skill pre-push-gate -g -a cursor -y`
Gemini CLI: `npx skills add modelcontextprotocol/inspector --skill pre-push-gate -g -a gemini-cli -y`

## Description

Diagnose a failing stage of this repo's pre-push gate, and run it correctly. Use when npm run local:gate or npm run validate fails; when lint, coverage, a smoke, or Storybook goes red; when a stage behaves differently inside a git worktree; when the whole run times out; or when deciding what to run before pushing.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# The pre-push gate

**The rule** (stated in [`AGENTS.md`](../../../AGENTS.md)): run `npm run format`
before committing and **`npm run local:gate`** before pushing. `npm run
validate` is the fast inner-loop check and is **not** a substitute, it runs no
coverage gate, no smokes, and no Storybook tests.

The reference for what each stage covers, and the CI-vs-local split, is
[`docs/quality-gate.md`](../../../docs/quality-gate.md). This skill is how to
run it and what to do when it goes red.

## The two commands

```sh
cd <repo root>
npm run format      # auto-fix: core/, scripts/, the shared surface, every client
npm run local:gate  # several minutes
```

The stages it runs, in order, are listed in
[`docs/quality-gate.md`](../../../docs/quality-gate.md), deliberately in one
place only. That list drifted apart across three copies while this PR was in
review, which is the argument for not making a fourth. `npm run local:gate`
prints each stage as it starts, so the running command is the other reliable
answer.

It runs **every check** GitHub CI runs (which additionally runs `npm install`,
and runs `coverage` as a parallel job), plus one local-only step. So the
direction that matters holds: **passing `local:gate` locally means every check
CI applies has already passed on your machine**, the strongest predictor of a
green CI there is here, though not a proof (a different OS, and the bare test
pass noted below). The reverse does not hold at all.

One difference in *invocations*, not checks: CI runs each client's unit suite
twice, bare inside `validate`, instrumented inside `coverage`, on two
parallel runners, while the gate runs it **once**, instrumented (#2341). The
gate's first stage is `local:validate`, which is `validate` minus each client's
`test` leg; `npm run validate` itself is unchanged. The reasoning is in
[`AGENTS.md`](../../../AGENTS.md#mandatory-pre-push-gate).

The rest: https://github.com/modelcontextprotocol/inspector/blob/HEAD/.claude/skills/pre-push-gate/SKILL.md
