skills/review/SKILL.md
Usage `rdc:review [--unattended]` — Post-build quality gate: tsc, tests, stale docs, export conflicts, and a mandatory pr-review-toolkit:code-reviewer pass across modified packages. Fixes what it can automatically, escalates the rest. Call after rdc:build and before merging to main.
npx skillsauth add LIFEAI/rdc-skills rdc:reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
⚠️ OUTPUT CONTRACT (READ FIRST):
guides/output-contract.mdChecklist-only output. No tool-call narration. No raw MCP/JSON/log dumps. One checklist upfront, updated in place, shown again at end with a 1-line verdict.
If dispatching subagents or running as a subagent: read
{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.mdfirst (fallback:{PROJECT_ROOT}/.rdc/guides/agent-bootstrap.md), then{PROJECT_ROOT}/.rdc/guides/engineering-behavior.md(fallback:{PROJECT_ROOT}/.rdc/guides/engineering-behavior.md).
Sandbox contract: This skill honors
RDC_TEST=1perguides/agent-bootstrap.md§ RDC_TEST Sandbox Contract. Destructive external calls short-circuit under the flag.
rdc:overnight after each epic build completesrdc:review — interactive review, pauses on issues needing judgmentrdc:review --unattended — silent mode, auto-fixes everything fixableIdentify modified packages:
git diff --name-only origin/main...HEAD | grep "^packages/" | cut -d/ -f2 | sort -u
Run tests for each modified package:
cd packages/<name> && npx vitest run 2>&1 | tail -10
Report: package → test count → pass/fail → new tests added
IMPORTANT: pnpm build must NEVER be run (crashes system). Use npx tsc --noEmit --project <path>/tsconfig.json for typecheck instead. For packages without tests, typecheck is the verification method. Do NOT run vitest across the entire monorepo — check only modified packages individually.
Check test coverage delta:
git diff origin/main...HEAD -- packages/*/src/ | grep -c "^+" | head -5
git diff origin/main...HEAD -- packages/*/test* packages/*/src/**/*.test.* packages/*/src/**/*.spec.* 2>/dev/null | grep -c "^+" || echo 0
Flag any package where implementation lines added > 50 but test lines added = 0.
Check for export conflicts:
packages/*/src/index.ts for any package with new exportsCheck for TODO/FIXME/HACK:
grep -rn "TODO\|FIXME\|HACK\|XXX" packages/*/src/ --include="*.ts" --include="*.tsx"
Check package versions:
docs/SYSTEM-STATE.mdCheck for stale CLAUDE.md:
Orphan work item audit:
SELECT id, title, item_type, status, source, created_at::date
FROM work_items
WHERE parent_id IS NULL
AND item_type NOT IN ('epic', 'bug')
AND status NOT IN ('done', 'archived')
ORDER BY created_at DESC;
For each orphaned task found:
SELECT insert_work_item(p_title := 'Re-parent orphaned task <task-id> to epic <epic-id>', p_priority := 'normal', p_source := 'agent') and flag for supervisor to re-parent manually.UPDATE work_items SET parent_id = ... is forbidden — bypasses RLS and all constraint checks8b. Mandatory code-review gate — dispatch pr-review-toolkit:code-reviewer:
⛔ No CLEAN verdict without a code-review pass. This is the second half of the quality gate; tsc/vitest catch type and behavior errors, code-reviewer catches logic, security, and convention drift.
Dispatch ONE pr-review-toolkit:code-reviewer agent on the full diff under review:
Agent({
subagent_type: "pr-review-toolkit:code-reviewer",
description: "rdc:review code-review pass",
prompt: "Review `git diff origin/main...HEAD` on the development branch.
Focus on: bugs, logic errors, security vulnerabilities, project-convention
adherence (.claude/rules/*, CLAUDE.md, engineering-behavior.md).
Confidence-based filtering — high-confidence findings only.
Return CODE_REVIEW_COMPLETE with: { critical_count, high_count, medium_count,
low_count, findings: [{severity, file:line, issue, suggested_fix}] }."
})
Severity gate:
critical or high → verdict cannot be CLEAN. Interactive: report and pause. Unattended: auto-fix if mechanical (rename, missing await, obvious null check), otherwise escalate via advisor and mark HAS_ISSUES.medium or low → record in the review report's "Issues" section; verdict can still be CLEAN.CODE_REVIEW: CLEAN and continue.Under RDC_TEST=1: echo [RDC_TEST] skipping code-review dispatch and continue.
Verification gate — dispatch the verify agent:
After any fixes land, run the verify gate on every touched package. See guides/agents/verify.md.
Apply guides/engineering-behavior.md while reviewing: flag unnecessary abstraction, drive-by refactors, missing assumptions, hidden uncertainty, out-of-scope edits, and prose-only verification.
Iron Law: no CLEAN verdict without fresh evidence. Quote the checklist decomposition verdict, vitest output, and tsc output in the report.
The verify agent must reject any work item that lacks passed decomp-* checklist rows or whose rows are too coarse to prove one observable behavior at a time.
If verify fails → do NOT emit CLEAN. Loop back, fix, re-run verify.
Fix issues found:
Judgment calls:
## Review Results
| Package | Tests | Pass/Fail | New Tests | Issues |
## Fixed
## Remaining Issues
## Verdict: CLEAN / HAS ISSUES
REVIEW_STATUS: { verdict: "CLEAN|HAS_ISSUES", packages_checked, tests_passed, tests_failed, new_tests_added, fixes_applied, escalations }
pnpm build (crashes system) — vitest only$RDC_TEST=1 — echo [RDC_TEST] skipping git push instead)Before the final verdict line, follow .rdc/guides/lessons-learned-spec.md § Capture procedure. If this run taught something non-obvious — a first root-cause theory that turned out wrong, the documented/standard path not working, a missing gate or check that cost a round, or a surprising tool/infra behavior — write one .rdc/lessons/<YYYY-MM-DD>-review-<short-slug>.md per lesson using the schema in that spec. Set scope (simple | architectural) and status (open, or applied if you shipped the fix in this same run, with the commit linked). Commit the lesson file(s) on develop alongside the run's other commits, and note "N lessons captured" in your verdict/summary. A run that taught nothing writes nothing — absence is the default.
development
Read recent enhancement-log entries, cluster failures by pattern, generate candidate verifier rules, test them against the known-good corpus and the failure corpus, and propose pull requests adding the highest-confidence rules to forbidden-patterns.json. Use this skill on a nightly cadence (3 AM PT), or manually when the user says "extract verifier rules", "promote enhancement log", "what new rules should we add", or after a significant brochure run produced many failures.
testing
Orchestrate a Brochurify job from source ingest through delivered PDF, using six parallel-dispatched typed sub-agents and the convergence loop. Use this skill EVERY TIME the user invokes Brochurify directly via "brochurify this", "make a brochure from", "convert this to a brochure PDF", or "rdc:brochurify". Also runs automatically when a job arrives from the broker via monkey_dispatch. The skill enforces D-001 through D-016 from the brochurify DECISIONS-LOG.
devops
The mandatory contract for authoring brochure JSX using @lifeai/brochure-kit. Use this skill EVERY TIME any AI engine (Claude, Cursor, Copilot, /design, Cowork, v0) generates JSX intended for the Brochurify pipeline — whether the user says "write a brochure," "make a one-pager," "draft a PDF report," or any equivalent. Also trigger when a file imports from @lifeai/brochure-kit. Failing to read this skill before authoring is a defect.
testing
Usage `rdc:housekeeping [--fix]` — Weekly maintenance audit: directory structure verification, PUBLISH.md URL validation, CLAUDE.md freshness, orphan detection, places compliance, and stale version scan. Produces `.rdc/reports/YYYY-MM-DD-housekeeping.md`. With `--fix`, auto-remediate safe issues.