/nexus-agents:pre-push-parityfrom nexus-agents
Runs CI gates locally before pushing to surface failures in seconds instead of waiting for a CI cycle. Enumerates checks in .github/workflows/, runs the locally-runnable subset in CI's order, and pins the local-vs-CI delta as a memory.
Ships in nexus-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
CI runs a strict superset of any local quality gate. When the local gate
(pnpm test, a make verify, etc.) is green but CI is red, the agent burns a
full ~3-minute cycle per discovery — push, wait, parse logs, fix, push — for a
check it could have run locally in seconds. On a multi-PR session that's hours.
The fix is to run the superset locally before git push.
Real failures that motivated this (#3073): ruff format --check (local gate
only ran ruff check) and a gitleaks false-positive on a *-Key-N test
fixture — neither was in the local gate, both cost CI cycles.
Whatever CI can fail you on, run it locally first. For the checks you can't run locally (SaaS / GitHub-native), know they exist and that they're the residual risk — don't be surprised by them.
# Job names + the commands each step runs:
grep -rEn 'name:|run:' .github/workflows/*.yml | grep -iv 'uses:'
Compare that list to your local gate. Anything CI runs that you don't is a parity gap. Write a memory pinning the delta so the next session starts informed (don't rediscover it):
ci-vs-local-gate-<repo>— CI runs these checks the local gate doesn't: X, Y, Z. Run them via<commands>before push. Z (CodeQL/Scorecard/Socket) can't run locally — residual risk.
In CI's order, fastest-feedback-first. Stop at the first failure, fix, restart.
| CI gate | Local command |
|---|---|
| Type Check | pnpm typecheck |
| Lint | pnpm lint |
| Test | pnpm test (CI uses pnpm test:coverage) |
| Build | pnpm build |
| Changeset Presence | pnpm exec tsx scripts/check-changeset.ts origin/main |
| Producer/Consumer (#3024) | pnpm exec tsx scripts/check-new-unused-exports.ts origin/main |
| Model String Drift | pnpm check:model-drift |
| Commit Messages | npx commitlint --from origin/main --to HEAD |
| Working-tree clean (#2872) | git status --porcelain (must be empty) |
| Secret scan | gitleaks detect --no-banner (runs in the pre-commit hook too) |
One-shot (mirrors CI, fails fast):
pnpm typecheck && pnpm lint && pnpm test && pnpm build \
&& pnpm exec tsx scripts/check-changeset.ts origin/main \
&& pnpm exec tsx scripts/check-new-unused-exports.ts origin/main \
&& pnpm check:model-drift \
&& npx commitlint --from origin/main --to HEAD \
&& test -z "$(git status --porcelain)" \
&& br="$(git branch --show-current)" && [ -n "$br" ] && [ "$br" != "main" ] && [ "$br" != "master" ] \
&& echo "PARITY OK ($br)"
The pre-commit hook already runs
gitleaks+ lint-stagedeslint --fix+prettier, so a successful commit covers formatting/secrets. This skill adds the gates the hook does not cover (typecheck, full test, build, changeset, unused-exports, model-drift, commitlint, clean-tree).
The harness can silently switch the working branch mid-session (#3072): a long
run can end up on main carrying another branch's uncommitted edits — risking
lost work or an accidental push to main. Before every push, confirm you are
on the branch you intend (the one-shot above already gates on this):
git branch --show-current # must be your feature branch — never empty (detached) or main/master
If it is main/master or empty (detached HEAD), STOP — do not push. Find
your work (git reflog, git stash list), check out / re-create the intended
feature branch, then re-run the gates before pushing.
These are GitHub-native or third-party SaaS — note them, don't be surprised:
codeql.yml), OpenSSF Scorecard (scorecard.yml),
Semgrep (semgrep.yml), Socket Security — security scanners.docker compose ...) — needs Docker; run it locally
only if you touched the data-dir / consolidation path.pnpm link-check and pnpm governance:check if you touched docs/skills.The generic-api-key rule false-positives on test fixtures containing the
literal word key with entropy (e.g. Idempotency-Key-1). When the test
doesn't need the literal word, use a neutral fixture (dash-shaped-value-7).
If a real fixture must trip it, add a scoped .gitleaksignore entry — never a
blanket disable.
PARITY OK, or every failure it surfaced is
fixed and re-run green.ci-vs-local-gate-* memory records the delta.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.PreToolUse.0: Hook matcher "hooks" must be an array of hook entries; received undefined; hooks.PreToolUse.1: Hook matcher "hooks" must be an array of hook entries; received undefined — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.PreToolUse.0: Hook matcher "hooks" must be an array of hook entries; received undefined; hooks.PreToolUse.1: Hook matcher "hooks" must be an array of hook entries; received undefined — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
34 skills in this plugin
/api-and-interface-designDesign stable, hard-to-misuse interfaces — REST endpoints, MCP tool
schemas, module boundaries, type contracts. Apply when defining new
surfaces or evolving public ones. Triggers on "API design", "interface",
"schema", "contract", "module boundary", "type design".
/browser-testing-with-devtoolsTest UI in real browsers via Chrome DevTools MCP. Apply when debugging
rendering issues, console errors, network behavior, performance, or
accessibility — anywhere static code analysis can't see runtime state.
Triggers on "browser test", "DOM inspect", "console errors",
"network trace", "core web vitals in browser", "ui bug repro".
/bug-fixFix a bug following project standards.
Use when fixing defects, debugging issues, or resolving reported problems.
Triggers on "fix bug", "debug", "fix issue", "resolve bug".
/code-simplificationReduce nesting, extract names, eliminate redundancy without changing
behavior. Apply after features work and tests pass — never as a
drive-by during feature work. Triggers on "simplify", "refactor for clarity",
"this is hard to read", "code review flagged complexity".
/codex-delegatorDelegate code generation tasks to Codex CLI for optimal performance.
Use when implementing features, generating tests, refactoring code, or
making bulk code changes. Triggers on "delegate to codex", "route to codex",
"use codex", "code generation".
/context-engineeringCurate what the agent sees, when, and how it's structured. Apply when
starting a session, when output quality drifts, when fanning out
subagents, or when configuring rules files. Triggers on
"context engineering", "rules file", "agent context",
"subagent fan-out", "context budget".
Other plugins' skills for the same job