/engineering-paved-path:pr-self-reviewfrom Engineering Paved Path
Local pre-PR self-review gate. Before any GitHub-outbound git command (git push / gh pr create / gh pr merge) or on demand, it reviews the current diff by routing each changed file to the matching project skills — UI files through the frontend skills (engineering-paved-path:frontend-ui-architecture, engineering-paved-path:react-best-practices, engineering-paved-path:next-best-practices, engineering-paved-path:react-testing-library), backend & domain files through the backend skills (engineering-paved-path:onion-architecture, engineering-paved-path:fastify-best-practices, engineering-paved-path:drizzle-orm-patterns, engineering-paved-path:postgresql-table-design), and engineering-paved-path:zod / engineering-paved-path:typescript-expert / engineering-paved-path:security across both — assigns each finding a severity, and BLOCKS the push/PR when any critical is found. Use this skill WHENEVER about to push a branch, open or update a pull request, or when asked to self-review, pre-flight, or sanity-check local changes before they leave the machine — even if the word 'review' isn't used.
Trending skills
7-day visitors to each skill page
Ships in Engineering Paved Path. 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.
Read when SKILL.md points to them.
Catch problems locally, before code leaves the machine. This skill reviews the current diff by reusing the project's own skills as the review rubric — each changed file is routed to the skills that govern its layer — then blocks the push / PR when any critical is found.
It does not contain review rules of its own. It is an orchestrator: it classifies the diff and runs the existing skills against the files they own. Edit a routed skill and this review sharpens for free.
PreToolUse hook (hooks/pr-gate.mjs) intercepts git push,
gh pr create, and gh pr merge. If the current diff is un-reviewed, stale, or had a
critical, the hook denies the command and asks Claude to run this skill first. A hook
can't invoke a skill — it injects the instruction; you act on it, then retry the command./pr-self-review at any time to pre-flight the branch.The diff that would become / update the PR, plus everything still open locally:
git diff main...HEADgit diff HEAD (staged + unstaged)git ls-files --others --exclude-standardTreat new files as fully in scope (read them whole), not just their diff hunks.
Classify every changed file by path; a file can land in several buckets (review it under each). Full globs + rationale in references/skill-routing.md.
| Changed path | Bucket | Skills to run as the rubric |
|---|---|---|
frontend components (e.g. **/*.{ts,tsx} in a web/client package) | UI | engineering-paved-path:frontend-ui-architecture, engineering-paved-path:react-best-practices, engineering-paved-path:next-best-practices, engineering-paved-path:typescript-expert |
UI tests (e.g. **/*.test.{ts,tsx}, e2e/**) | UI tests | engineering-paved-path:react-testing-library (+ UI above) |
backend HTTP routes / framework layer (e.g. **/routes.ts, a platform/ or http/ dir) | Backend HTTP | engineering-paved-path:fastify-best-practices, engineering-paved-path:onion-architecture |
backend services & data access (e.g. **/{service,repository}*.ts, **/repository/**) | Backend app/data | engineering-paved-path:onion-architecture, engineering-paved-path:drizzle-orm-patterns |
DB schema & migrations (e.g. **/db/schema*/**, **/db/migrations/**) | DB | engineering-paved-path:postgresql-table-design, engineering-paved-path:drizzle-orm-patterns |
shared contracts / any z.object (e.g. a contracts/ or shared package) | Contracts | engineering-paved-path:zod, engineering-paved-path:onion-architecture |
| pure domain/engine code (framework-free core) | Pure engine | engineering-paved-path:onion-architecture (purity), engineering-paved-path:typescript-expert |
| any file touching auth / secrets / user input / uploads / an endpoint | Cross-cutting | engineering-paved-path:security |
engineering-paved-path:engineering-insights (and any non-review skill) is intentionally
excluded — it is not a review rubric.
Only critical blocks; high / medium / low are reported but pass the gate. The full rubric
and the exact critical list are in references/severity-rubric.md.
Critical = ships broken or unsafe behavior, e.g. a leaked secret, a missing-authz / injectable
endpoint, a data query missing its tenant scope (e.g. workspace_id), a hand-edited or
destructive migration, a forked / out-of-sync shared contract copy, dropped boundary
validation, or a pure-domain module importing from an outer framework / infrastructure ring.
When invoked, copy this checklist and work through it:
- [ ] 1. Compute the review scope (above) and list every changed file.
- [ ] 2. Classify each file into buckets via references/skill-routing.md.
- [ ] 3. For each NON-EMPTY bucket, spawn a subagent (Task) that invokes the bucket's
skills and reviews ONLY that bucket's files against them. Run buckets in
parallel. Each returns findings: [{ file, line, severity, skill, title, why, fix }].
(Small diff / one bucket → review inline instead of fanning out.)
- [ ] 4. Merge findings; dedup the same issue reported by two skills; apply the severity
rubric. Count criticals.
- [ ] 5. Record the verdict so the gate can read it (run the helper bundled with this skill):
node "${CLAUDE_PLUGIN_ROOT}/skills/pr-self-review/hooks/pr-gate.mjs" record --verdict <clean|blocked> --criticals <N>
(clean iff N == 0). This stamps the current diff hash — re-run after any fix.
- [ ] 6. Report (format below), leading with the gate result.
Run step 5 as the last action, after any fixes, so the recorded hash matches the tree the user will push. If the diff changes afterward, the hook marks the review stale and asks for a re-run.
PR Self-Review — <BLOCKED: N critical> | <PASS: 0 critical>
Scope: <X files> across buckets: <UI, Backend, …>
CRITICAL (blocks push)
- <file:line> [<skill>] <title> — <why>. Fix: <fix>.
HIGH / MEDIUM / LOW
- <file:line> [<skill>] <title> — <why>.
Verdict recorded: <clean|blocked>. <Next step.>
If blocked, state plainly that git push / gh pr create / gh pr merge will be denied until
every critical is resolved and the review re-run.
git push / gh pr create / gh pr merge; it cannot
reach GitHub's web "Merge" button. The guarantee is verify before the PR is opened/updated.What SKILL.md sets; muted values are Claude Code's defaults
Trigger phrases: 'self-review', 'review my changes before I push', 'pre-PR check', 'pre-flight the diff', 'is this branch ready to push', 'run pr-self-review', 'check the diff against our skills', 'gate the PR'. Also fires automatically when a git push / gh pr create / gh pr merge is attempted with an un-reviewed, stale, or critical-blocked diff.
npx claudepluginhub rostk/my-monkeys --plugin engineering-paved-path13 skills in this plugin
/drizzle-orm-patternsProvides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations. Proactively use for any Drizzle ORM development including defining database schemas, writing type-safe queries, implementing relations, managing transactions, and setting up migrations with Drizzle Kit. Supports PostgreSQL, MySQL, SQLite, MSSQL, and CockroachDB./engineering-insightsCaptures durable engineering learnings to the touched module's learnings file (LEARNINGS.md by default, configurable). Use at the end of a substantive session (>30 min with a real problem, decision, or discovery) as a wrap-up, or mid-session when something non-obvious surfaces. Re-reads the target file first, then appends actionable-cold notes; never overwrites and never duplicates./fastify-best-practicesGuides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript. Use when building, configuring, or debugging a Fastify application — including defining routes, implementing plugins, setting up JSON Schema validation, handling errors, optimising performance, managing authentication, configuring CORS and security headers, integrating databases, working with WebSockets, and deploying to production. Covers the full Fastify request lifecycle (hooks, serialization, logging with Pino) and TypeScript integration via strip types. Trigger terms: Fastify, Node.js server, REST API, API routes, backend framework, fastify.config, server.ts, app.ts./frontend-ui-architectureFrontend UI architecture and code organization for React & Next.js — deciding WHERE code should live (folder/file structure, feature- vs type-based layout, colocation, where components / hooks / business logic / utils / constants / types / Server Actions belong, module boundaries and imports, and organizing the Server/Client boundary). Use this skill WHENEVER the user asks how to structure or organize a React/Next.js project, where a file/component/hook/type should go, how to split a large component, where to put business logic or data access, utils-vs-lib-vs-helpers, or barrel files — or asks for an architecture/structure review — even if they don't say the word 'architecture' and even though such questions can look answerable directly. Structure & organization only — not in-component coding rules (use react-best-practices) or Next.js API/feature mechanics (use next-best-practices)./next-best-practicesNext.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling/onion-architectureOnion / ports-and-adapters / layered architecture for a TypeScript/Node backend (Fastify modules plus a pure domain core) — deciding WHICH ring backend code belongs in and WHICH WAY its dependencies may point. Use this skill WHENEVER working server-side: adding or changing a route/service/repository, adding an adapter or port, wiring something into the DI Container, deciding whether a route or service may import Drizzle / an SDK / another module, or reviewing the backend's layering — even when the user does not say 'onion' or 'architecture'. It enforces the inward dependency rule, the ports-in-shared / implementations-in-adapters split, the Container as the single composition root, Drizzle-queries-only-in-the-repository, and the Zod contracts in your shared package as the shared domain + boundary type. Backend structure and boundaries only — not Drizzle query syntax (use engineering-paved-path:drizzle-orm-patterns), Fastify route mechanics (use engineering-paved-path:fastify-best-practices), Postgres schema design (use engineering-paved-path:postgresql-table-design), Zod syntax (use engineering-paved-path:zod), or frontend layout (use engineering-paved-path:frontend-ui-architecture).Other plugins' skills for the same job