/engineering-paved-path:pr-self-reviewfrom engineering-paved-path
Pre-PR local review gate for the dev-digest project. Explicitly triggered by the developer before opening a pull request or pushing to remote. Reads the full diff between the current branch and main, detects which surfaces changed (client vs. server vs. both), applies the complete set of relevant domain skills to each surface (ui-architecture + react-best-practices + react-testing-library for frontend; onion-architecture + fastify-best-practices + drizzle-orm-patterns for backend), then reports findings and emits a BLOCKED or PASS verdict. PR creation must not proceed while any CRITICAL finding remains unresolved. Invoke explicitly: /pr-self-review, 'run self review', 'check changes before PR', 'pre-push review', 'review my diff'.
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.
A mandatory review pass over all local changes before opening a pull request. This skill orchestrates all domain skills and emits a BLOCKED or PASS verdict. Do not push or open a PR while the verdict is BLOCKED.
Get everything that would enter the PR — all commits on this branch not yet in main:
git diff $(git merge-base main HEAD)..HEAD
If the branch has no commits yet (working tree only):
git diff HEAD
Extract the list of all changed file paths from the output. This is the input to Step 2.
Classify every changed file into one or more surfaces using its path prefix:
| Path prefix | Surface |
|---|---|
client/src/app/ | Frontend — Routes & Pages |
client/src/components/ | Frontend — Shared Components |
client/src/lib/hooks/ | Frontend — Data Hooks |
client/src/lib/api.ts | Frontend — API Entry Point |
client/src/**/*.test.tsx | Frontend — Component Tests |
client/src/lib/*.ts | Frontend — Utilities |
client/src/vendor/ | Vendor — note presence only; do not apply companion-skill rules |
server/src/modules/ | Backend — Feature Modules |
server/src/adapters/ | Backend — Adapters |
server/src/db/schema/ | Backend — DB Schema |
server/src/db/migrations/ | Backend — Migrations |
server/src/platform/ | Backend — Platform Core |
server/src/vendor/ | Backend — Shared Contracts |
reviewer-core/src/ | Reviewer Core — inspect manually (no surface routing) |
A single PR may activate multiple surfaces. Flag any changes to reviewer-core/src/grounding.ts, prompt.ts, or run.ts explicitly — these are high-risk files.
client/src/vendor/ is a hard do-not-touch zone (see root CLAUDE.md) — "note presence only; do not apply companion-skill rules" means skip ui-architecture/react-best-practices checks on its content, but it does not exempt a direct edit to a file under client/src/vendor/ from Step 4's CRITICAL check below; any such edit is always CRITICAL regardless of what the change contains. server/src/vendor/ is different: it is the canonical, editable source of the shared Zod contracts (@devdigest/shared) and routes normally as "Backend — Shared Contracts" — editing it is expected, not a violation, as long as changes stay backward-compatible.
Based on active surfaces, determine the complete set of companion skills to apply:
| Active surfaces | Companion skills |
|---|---|
Any client/src/ path | ui-architecture + react-best-practices |
client/src/**/*.test.tsx included | + react-testing-library |
Any server/src/ path | onion-architecture + fastify-best-practices |
server/src/db/schema/ or db/migrations/ | + drizzle-orm-patterns |
| Both frontend and backend | All skills from both rows above |
reviewer-core/src/ only | No routing — manual inspection required |
For each companion skill, read its full SKILL.md from:
.claude/skills/<skill-name>/SKILL.md
Apply every rule from its Anti-Patterns section to the diff.
For each active companion skill, scan the diff for violations. Evaluate in severity order:
fetch() in a component body or servicedb.select(), db.insert() etc. inside routes.ts)vendor/ file modified directlycomponents/ when used by only one routeindex.ts barrelnext-intl)getContext() call missing)req or res objects directlyconstants.ts or helpers.ts when the component has local static datasrc/test/modules/index.ts or app.tsEvery finding must cite the exact file path and line number from the diff where the violation occurs. Speculative or uncited findings must be dropped — this mirrors the citation grounding gate in reviewer-core/src/grounding.ts.
Emit this report structure:
## PR Self-Review: <branch-name>
Surfaces detected: <list>
Companion skills applied: <list>
### CRITICAL [BLOCKS PR]
- `<file>:<line>` — <one-sentence description of the violation>
→ [<skill-name> / Anti-Patterns: CRITICAL]
### HIGH
- `<file>:<line>` — <description>
→ [<skill-name> / Anti-Patterns: HIGH]
### MEDIUM
- `<file>:<line>` — <description>
### PASS ✓
- `<file>` — No violations found. (<skill-name>)
---
## Verdict: ❌ BLOCKED
<N> CRITICAL finding(s) must be resolved before this PR can be opened.
Run /pr-self-review again after fixing to confirm PASS.
If no CRITICAL findings:
---
## Verdict: ✅ PASS
<N> high / <M> medium findings noted above. PR may be opened.
Address HIGH findings before requesting merge.
| Verdict | Meaning | Action |
|---|---|---|
| ❌ BLOCKED | One or more CRITICAL findings | Fix all CRITICAL issues. Re-run. Do not push. |
| ✅ PASS | Zero CRITICAL findings | PR may be opened. HIGH/MEDIUM should be addressed during review. |
HIGH and MEDIUM findings alone never block. They are surfaced as PR review preparation, not merge gates.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
14 skills in this plugin
/dependency-checkerAudits all dependencies across the repo's 6 independent packages (server, client, reviewer-core, e2e, evals, mcp-server) — no shared workspace. Distinguishes external npm dependencies from internal cross-package dependencies (tsconfig path aliases, not workspace:*), draws a Mermaid schematic of dependency relationships, breaks down installed size per package, and prioritizes findings into P0/P1/P2/Info tiers with concrete, file-specific recommendations. Read-only: reports and advises, never runs pnpm remove/update itself. Invoke explicitly: /dependency-checker, 'check our dependencies', 'audit deps', 'why is node_modules so big', 'draw the dependency graph'./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./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./mermaid-diagramCreate Mermaid diagrams in markdown. Use when the user wants to visualize workflows, architectures, API flows, data models, state machines, or system designs. Covers flowcharts, sequence diagrams, class diagrams, ER diagrams, state diagrams, and more./next-best-practicesNext.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling/onion-architectureAnswers 'what goes where' in the server — the layer and placement decision tree for every new file in the Fastify backend. Use when adding a new feature module, a route handler, a service method, a repository query, a new adapter, or a platform utility. Use when reviewing a PR for layer violations (routes querying the DB directly, services importing adapters without DI). Covers the annotated server directory map, the four-layer onion model (routes → service → repository → platform/adapters), module file anatomy, DI container usage patterns, module registration steps, import boundary rules, and anti-patterns. Trigger terms: where to put, new module, add route, service method, repository query, adapter, DI container, module registration, layer violation, backend architecture, server structure, which layer.npx claudepluginhub vadimpoltoratskiy/dev-digest-ai-marketplace --plugin engineering-paved-path