Copie o bloco abaixo, troque os {…} e escolha um foco da lista no fim. Escreva o prompt em inglês; o relatório volta em português.
You are doing a READ-ONLY code review of part of the codebase at {REPO_PATH} ({ONE-LINE STACK}). Do NOT edit files, do NOT commit, do NOT run the test suite (the coordinator runs validation).
YOUR SCOPE: {PATHS} (≈{N}k lines, non-test). Read their tests too, to judge coverage. {EXTRA CONTEXT, e.g. "intake has PUBLIC endpoints — treat as untrusted input"}
Rules to review against — read these first:
{PROJECT RULE FILES WITH PATHS, e.g. CLAUDE.md, STANDARDS.md, README sections with line ranges}
- ~/.claude/skills/dev/references/review.md (checklist) and principles.md / ddd.md / ui.md next to it.
- The project glossary (ubiquitous language): {GLOSSARY PATH or "none"}.
DDD is ALWAYS in scope (rules D1-D6): ubiquitous language (one business term per concept, from the glossary, used identically in aggregate, table, route, procedure, DTO, error code and test names; no synonyms; no technical names like update/setStatus/process/Manager for business concepts) and domain modeling (rich aggregates holding invariants instead of anemic models with rules in use cases/routers/client, value objects instead of loose primitives, aggregate boundaries with references by id, one module = one bounded context, external concepts translated in adapters).
Note: {ARCHITECTURE/LANGUAGE TESTS} already enforce {WHAT THEY ENFORCE} and pass — don't re-report that; look for what they can't see.
Folder structure (rule A0) is mandatory and was measured by the coordinator with structure.sh: {STRUCTURE RESULT FOR YOUR SCOPE}. Subject first, layers inside: src/server/modules/<module>/{domain, application/usecases, application/dto, infra/db, infra/drivers/<technology>}, plus src/server/kernel/ (same layers) for what several modules use. Modules talk through ports: never import another module's domain or infra; another module's application only from this module's infra adapter. Beyond the script, check that each file is the right KIND for its folder (a DTO inside usecases/, a use case inside dto/, a Drizzle repository in infra/drivers/, a port outside usecases/, a file in the wrong module, kernel code used by a single module) and report it as major with the correct destination path.
What to look for (priority order): {FOCUS — pick from the list below}
Method: survey the structure, then read the important files fully. Use grep to quantify systemic patterns (counts + example locations). Verify every finding against the actual code — no speculation; if unsure, say "not confirmed". Prefer systemic findings over nits. Max ~20 findings.
RULE MATRIX (mandatory): ~/.claude/skills/dev/references/rules.md lists every rule with an id. You must give EVERY rule a status for your scope — no blanks:
PASS (one sentence of evidence: what you checked), FAIL or PARTIAL (path:line, and the finding it maps to), N/A (short reason).
Rules marked "auto" were already measured by the coordinator: {AUTO RESULTS}; confirm or contradict them. Project-specific rules to add: {P-RULES}.
Findings are still capped at ~20 and prioritized; the matrix is not capped.
Output (your final message is all the coordinator sees), in Portuguese:
1. Findings, most severe first, each as:
- **[blocker|major|minor|nit] Short title** — `path:line` (+ other locations/count)
- Rule id(s) violated · Why it matters (concrete scenario) · Suggested fix (short)
2. "Matriz": a table `Regra | Status | Evidência` with one row per rule id in rules.md (+ P-rules).
3. "Pontos fortes" (max 3 bullets).
4. "Cobertura": read fully / skimmed / not read.
Modelo para o revisor de premissas
You are verifying documented premises (open-question assumptions) against the code at {REPO_PATH}. READ-ONLY: do not edit, commit or run tests.
Premises doc: {DOC PATH, e.g. README.md section "Premissas", lines X-Y}. Your ids: {ID RANGE or LIST}.
Output of premises.sh for these ids (code references and locations found/missing): {SCRIPT OUTPUT}
Project rule: each premise lives in ONE point of the code (an injected policy interface with a default implementation, or a named constant), chosen in the composition root, and is registered in the doc table.
For EACH id, read the premise text and the code it points to (and grep the id and the behavior), then give one status:
OK (does what the premise says, in one point, with a test) · DIVERGE (code does something else, or another place contradicts it) · ESPALHADA (implemented in more than one point, e.g. copied in the client) · SEM TESTE · NÃO ENCONTRADA · LOCAL QUEBRADO (the "where to change" no longer exists) · NÃO DOCUMENTADA (id in code, not in doc).
Verify against the code — no speculation; if unsure, say "não confirmado".
Output in Portuguese: a table `Id | Status | Evidência (path:line) | Nota`, one row per id, then a short list of the most serious DIVERGE/ESPALHADA cases with why they matter.
Focos por tipo de fatia
Módulo de servidor (domain/application/infra/router): ubiquitous language and domain modeling (D1-D6: glossary terms vs. names in every layer, synonyms, technical verbs instead of business ones, anemic aggregates, primitive obsession, aggregate boundaries, cross-context leaks); error handling — any throw outside the single transport-edge helper (operations must return Either with specific typed errors: kind + stable code + English message + params), generic Error/untyped Left, third-party exceptions not wrapped in the adapter, wrong status for the error kind (400/401/403/404/409/422/429/502/500); correctness bugs and security (missing authorization on procedures, unvalidated input, injection, data leaks, money as floats, missing transactions on multi-table writes, lost updates / no optimistic concurrency, race conditions, non-idempotent jobs/webhooks, state machines that allow invalid transitions); business rules in routers/infra/jobs instead of domain; anemic aggregates or generic setters; services mixing subjects or pass-through facades; ports not injected via constructor / container bypassed; optional deps or boolean flags that switch behavior; untested behavior (domain/application without tests, repositories without contract tests, invalid transitions untested); YAGNI/KISS (dead code, speculative options); duplication; naming/convention breaks.
Plataforma, auth e integrações: SECURITY first — session/cookie, password hashing, reset/invite tokens (single use, expiry, constant-time compare), lockout bypass, CSRF, rate limiting, API key compare, authorization coverage across ALL routers and HTTP routes (grep for unprotected procedures), error translation leaking internals, secrets or PII in code/logs/audit. Then integration clients (timeouts, retries, rate-limit correctness, token refresh races, idempotency keys), job queue (dead-letter, idempotency, overlap), composition root, env validation for production; duplication across clients; untested behavior.
Client — páginas: raw HTML controls instead of design-system components; hand-built layout instead of the project's page/table/drawer patterns; inconsistent control heights (ad-hoc h-* overrides); duplicated UI across pages; giant pages mixing fetching, rules and rendering; business rules reimplemented instead of imported from domain; missing loading/empty/error states (lists that show "empty" on error); hand-made modals, window.confirm; list filters/search/sort/pagination/tabs not managed by nuqs search params (useState filters, manual useSearchParams/URLSearchParams, useEffect URL sync); mutations that block the screen waiting for the server instead of applying the change to local state/cache and sending the tRPC mutation in background with snapshot + rollback + invalidate (allowed only for irreversible/external actions: login, payment, filing, sending); useEffect state sync that clobbers edits; keys by index in dynamic lists; labels without htmlFor; localStorage holding business state; non-English identifiers/routes.
Client — componentes e design system: heights of every primitive (Input, Select, Button, DatePicker, Textarea, react-select styles) side by side, flag mismatches; raw HTML controls outside ui/; several components doing the same thing (selects differing only by data source, dialogs, uploaders) — quantify and propose one generic component; components that fetch data or run mutations instead of taking props; oversized components; boolean-flag props; dead components (zero importers); keyboard accessibility of primitives; keys by index; non-English identifiers.
Client — lib e app: business rules reimplemented instead of importing domain (compare with the server domain, list both locations); duplicated helpers (formatters, masks, dates, downloads, label maps); inconsistent tRPC hook patterns (optimistic, error handling, invalidation) — every common mutation should be optimistic through one shared helper; search-param parsers for nuqs defined once per list rather than inline; localStorage business state; hardcoded user-facing error strings bypassing the error-code map; untested non-trivial logic; dead exports; router (English routes, lazy loading, guards consistent with server permissions).