/gatewaze-skills:preflightfrom gatewaze-skills
Pre-submission self-review for any Gatewaze repo. Run it BEFORE you consider a change done — after you finish editing, before the diff is handed off for a PR. Phase 1 runs the repo's own mechanical checks (typecheck, lint, build, format) and auto-fixes what is safely auto-fixable; Phase 2 reviews the diff against the repo's CLAUDE.md and .claude/rules (security boundaries, mass-assignment, shell safety, secrets) and reports what a human reviewer would otherwise catch. Adapts to whatever the repo actually declares — it reads the repo's rules, it does not assume a fixed toolchain. Especially useful for autonomous agents whose work goes straight to a pull request.
Ships in gatewaze-skills. 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.
You have finished editing and are about to declare the work done (an autonomous run will open a PR from it; a human contributor is about to commit). This is the last cheap moment to catch what CI or a reviewer would bounce. Run both phases.
This skill is repo-agnostic by design. It does not hardcode a toolchain — it
reads the repo's own working agreement and scripts and runs those. The single
most important input is the repo's CLAUDE.md (and any .claude/rules/*.md);
everything below is how to apply it, not a substitute for it.
Modes:
--skip-review — Phase 1 only. Use mid-development to just check build/lint.Non-negotiable: never make a check pass by weakening it. Do not add
// eslint-disable, @ts-ignore, --no-verify, continue-on-error, .skip,
or delete an assertion to get to green. Fix the code, or report the failure as
unresolved. Disabling a gate to pass is itself a Phase 2 finding.
git rev-parse --show-toplevel # confirm which repo you are in
For each writable repo in the workspace:
CLAUDE.md at the repo root — this is the contract. Note anything it
lists under "never do", "security", or a commit/push checklist..claude/rules/*.md. In this monorepo the security boundaries live
in .claude/rules/security-boundaries.md and the lint/CI baseline in
.claude/rules/lint-and-ci.md. A rule file with a paths: frontmatter only
applies to files matching that glob — apply the most specific match to each
changed file.package.json "scripts" to discover the actual check commands (the names
below are the common ones; use what the repo declares).Everything after this adapts to what you just read.
Scope the checks to what changed. Establish the diff first:
git status
git diff --stat $(git merge-base origin/main HEAD)...HEAD 2>/dev/null || git diff --stat
Run the repo's declared checks. In the Gatewaze monorepo these are typically:
| Check | Typical command | Auto-fix? |
|---|---|---|
| Typecheck | pnpm -r typecheck (or per-package) | No — fix the code |
| Lint | pnpm -r lint | Partially — eslint --fix for import-order/unused; logic issues by hand |
| Format | the repo's formatter, if one is configured | Yes |
| Build | pnpm --filter <pkg> build | No — fix the code |
| Tests | pnpm --filter <pkg> test | No — fix the code or the test if the behaviour legitimately changed |
Rules for Phase 1:
shared's lint is a deliberate no-op; that is not a failure.Walk the changed lines — not the whole repo — and check each against the rules you
read in Step 0. This is where you catch what lint can't. Report findings; do not
silently rewrite (the point is a reviewable list). The high-signal checks in this
monorepo, straight from security-boundaries.md:
env || 'literal' fallback. Example
files carry placeholders only.req.body inserted/updated directly — an allowlist of
writable fields only..or() / filter injection. User input must be sanitised before it
reaches a .or() filter, a constructed SQL string, an ICS line, or a built URL.child_process.exec, execSync with a single string, or
spawn with shell: true outside the repo's sanctioned wrapper
(packages/api/src/lib/safe-exec.ts). Never build a shell string from user input.permissions: block and no action unpinned from
its commit SHA without a stated reason.@radix-ui/themes imported directly inside a module
file (it duplicates the singleton in prod and crashes useThemeContext).Also apply anything specific the repo's own CLAUDE.md adds that is not in this
list — the repo contract wins.
For each changed file, ask: does this line cross a trust boundary (parses untrusted
input, builds a query/command/URL from user data, handles a credential, enforces
authz)? If yes, verify it against the matching rule above. If a repo ships the
pragma:security skill, prefer running that over eyeballing — it is the validator
these rules were written for.
Produce a compact report, not prose:
PREFLIGHT — <repo> @ <short-sha>
Phase 1 (mechanical):
✓ typecheck ✓ lint (2 files auto-formatted) ✓ build ⚠ tests: 1 skipped (needs DB — CI will run)
Phase 2 (rules):
✗ packages/api/src/routes/foo.ts:41 — inserts req.body directly (mass assignment). Use a writable-field allowlist.
✓ no secrets, no unsafe shell, no unpinned actions, no .or() injection
Verdict: NOT READY — 1 blocking finding above. Fix before handoff.
⚠ (deferred to CI) — never
claim a check passed that you did not run.What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/evidence-reviewAdversarial, evidence-gated review of a diff in any Gatewaze repo. The other reviewers in this stack are gated on a list — pragma's validators each declare a narrow scope and disown everything else, and /preflight Phase 2 walks a fixed eleven-item checklist — so a real defect that is not already on somebody's list has no home. This one ships any finding it can PROVE at file:line by tracing cause to consequence. Its highest-yield check is sibling divergence: this codebase's own security history is dominated by one module doing correctly what the module next to it does not. Reads full files plus siblings and callers. Report-only.
/gatewaze-memoryUse the project's accumulated engineering MEMORY while developing Gatewaze locally — the same durable knowledge the Software Engineer agent uses. It lives in the AI memory wiki and is git-synced to a dedicated memory repo (danthebaker/gatewaze-memory for the gatewaze monorepo; danthebaker/lfx-memory for LFX). Invoke at the START of a task on a Gatewaze/LFX repo ("what do we already know about X", "recall memory", "anything to watch out for here"), BEFORE committing (to check your changes against known gotchas/conventions), and when you learn something durable ("record a learning", "remember that ..."). This closes the loop: local dev and the SE agent share one brain — you read what the agent learned, and your learnings flow back to it.
/modulesGatewaze module development workflow. Invoke when fixing or building anything inside a Gatewaze module — admin UI, portal UI, api routes, edge functions, or migrations — e.g. newsletters, forms, meetups, events, ambassadors. The #1 rule: edit the canonical source in the module's OWN repo (~/Git/gatewaze/gatewaze-modules or ~/Git/gatewaze/lf-gatewaze-modules), NEVER the gitignored, generated `.gatewaze-modules/` staging directory in the gatewaze repo — its materialised copy is silently overwritten on rebuild. Covers where each module lives, module anatomy, how `.gatewaze-modules` is generated, how to confirm you're editing the real file, and the migrate / deploy / type-check workflow.
/production-readinessGuardrails distilled from the multi-week production-hardening pass on the Gatewaze monorepo. Invoke when working on Gatewaze (admin / api / portal / shared) to keep new feature work from undoing the security, type, lint, and CI improvements that landed across the prod-hardening/phase-1..4 branches. Encodes how to handle Supabase typing without a generated Database type, where the listing-primitive structural query-builder abstraction lives, the ICS / PostgREST / mass-assignment / rate-limit patterns, the lint baseline (admin = flat config, api = flat config, portal = next lint via root .eslintrc, shared = no-op), and the expected zero-error TypeScript baseline across all four packages.
/se-handoffHand off a locally-written spec to the Software Engineer module — creates a GitHub issue with the spec embedded and the agent:spec labels so the SE run skips its own (billed) spec phase. Use when the user says /se-handoff, "hand this spec to SE", "queue this for the SE module", or has just finished writing a spec they want implemented autonomously./test-coverageValidate that a diff's new behaviour is actually pinned by tests. Every other validator in this stack explicitly disowns test coverage — pragma's security, state-machine and typescript-style validators all list it under "MUST NOT report on", and there is no test validator among them — so nothing owns this category by default. Uses the inversion test: for each new condition, invert it and ask which existing test would fail. If none would, the branch is unpinned. Report-only.
Other plugins' skills for the same job
npx claudepluginhub gatewaze/gatewaze-skills --plugin gatewaze-skills