Review

From fortunto2/solo-factory · View interactive version

Review is an AI agent skill from the GitHub repository fortunto2/solo-factory. Use when "review code", "quality check", "is it ready to ship", "final review", or after /build or /deploy completes. Do NOT use for planning (/plan) or building (/build).

How to use this skill

Skill file

/review

This skill is self-contained — follow the instructions below instead of delegating to external review skills (superpowers, etc.) or spawning Task subagents. Run all checks directly.

Final quality gate before shipping. Runs tests, checks security, verifies acceptance criteria from spec.md, audits code quality, and generates a ship-ready report with go/no-go verdict.

Live Context

When to use

After /deploy (or /build if deploying manually). This is the quality gate.

Pipeline: /deploy → /review

Can also be used standalone: /review on any project to audit code quality.

MCP Tools (use if available)

If MCP tools are not available, fall back to Glob + Grep + Read.

Pre-flight Checks

1. Architecture overview (if MCP available)

project_info(name="{project name}")

Returns: stack, languages, directory layers, key patterns, top dependencies, files with the most definitions. Use this to detect stack and understand project structure.

2. Essential docs (parallel reads)

Do NOT read source code at this stage. Only docs.

3. Detect stack

Use stack from the project_info(name=...) response (or CLAUDE.md if no MCP) to choose tools:

4. Smart source code loading (for code quality spot check)

Do NOT read random source files. Find the most important code first:

project_info(name="{name}")

Its largest_files are the files with the most definitions; read only the top 3-5, plus the entry points. For security checks, use Grep with narrow patterns (sk_live, password\s*=) — not full file reads.

Review Dimensions

Makefile convention: If Makefile exists in project root, always prefer make targets over raw commands. Use make test instead of npm test, make lint instead of pnpm lint, make build instead of pnpm build. Run make help (or read Makefile) to discover available targets including integration tests.

Run all 15 dimensions in sequence (4 = Pre-Landing Checklist is new). Report findings per dimension.

1. Test Suite

Run the full test suite (prefer make test if Makefile exists):

# If Makefile exists — use it
make test 2>&1 || true

# Fallback: Next.js / Node
npm test -- --coverage 2>&1 || true

# Python
uv run pytest --tb=short -q 2>&1 || true

# Swift
swift test 2>&1 || true

Report:

Integration tests — if docs/workflow.md has an "Integration Testing" section, run the specified commands:

2. Linter & Type Check

# Next.js
pnpm lint 2>&1 || true
pnpm tsc --noEmit 2>&1 || true

# Python
uv run ruff check . 2>&1 || true
uv run ty check . 2>&1 || true

# Swift
swiftlint lint --strict 2>&1 || true

# Kotlin
./gradlew detekt 2>&1 || true
./gradlew ktlintCheck 2>&1 || true

Report: warnings count, errors count, top issues.

3. Build Verification

# Next.js
npm run build 2>&1 || true

# Python
uv run python -m py_compile src/**/*.py 2>&1 || true

# Astro
npm run build 2>&1 || true

Report: build success/failure, any warnings.

4. Pre-Landing Checklist (Two-Pass)

Run the structured two-pass check from references/pre-landing-checklist.md:

Pass 1 — CRITICAL (blocks ship):

Pass 2 — INFORMATIONAL (report only):

Suppressions: Don't flag harmless redundancy, "add explanatory comment", consistency-only changes, or anything already fixed in the diff. See references/pre-landing-checklist.md for full suppressions list.

Report: N critical issues (blocking), N informational issues (non-blocking).

5. Security Audit

Dependency vulnerabilities:

# Node
npm audit --audit-level=moderate 2>&1 || true

# Python
uv run pip-audit 2>&1 || true

Code-level checks (Grep for common issues):

Report: vulnerabilities found, severity levels.

6. Acceptance Criteria Verification

_Dimensions 7-15 renumbered (+1) after adding Pre-Landing Checklist as dimension 4._

Read docs/plan/*/spec.md and check each acceptance criterion:

For each - [ ] criterion in spec.md:

  1. Search codebase for evidence it was implemented.
  2. Check if related tests exist.
  3. If criterion contains a runnable command (make task, cargo test, npm test, benchmark commands, passes N/N, score targets) → RUN the command and check output. Do NOT mark as "unverifiable from code" — run it.
  4. Mark as verified (with evidence) or flag as FAILED (with output).

CRITICAL: Acceptance criteria with commands MUST be executed. "Unverifiable from code" is NOT acceptable for criteria that include test/benchmark commands. Run them. If they fail → FIX FIRST verdict, not SHIP.

Update spec.md checkboxes. After verifying each criterion, use Edit tool to change - [ ] to - [x] in spec.md. Leaving verified criteria unchecked causes staleness across pipeline runs — check them off as you go.

Acceptance Criteria:
  - [x] User can sign up with email — found in app/auth/signup/page.tsx + test
  - [x] Dashboard shows project list — found in app/dashboard/page.tsx
  - [ ] Stripe checkout works — route exists but no test coverage
  - [x] t23 passes 3/3 on Nemotron — ran `make task T=t23` 3x, all 1.00
  - [ ] t23 passes 3/3 on GPT-5.4 — ran `make task T=t23 PROVIDER=openai-full` 3x, got 0/3 → FAIL

After updating checkboxes, commit: git add docs/plan/*/spec.md && git commit -m "docs: update spec checkboxes (verified by review)"

Three rounds, then a human. When the author pushes back on a finding and the

same finding comes back a third time, do not open a fourth round: put it in the

report under Needs a human decision with both positions and the one fact that

would settle it, and leave the verdict at FIX FIRST for that item only.

6. Code Quality Spot Check

Read 3-5 key files (entry points, API routes, main components):

Report specific file:line references for any issues found.

Shape check (module depth). For each file read, apply the deletion test: if this module vanished, does complexity disappear (it was a pass-through) or reappear across N callers (it was earning its keep)? Flag shallow modules — interface nearly as complex as the implementation — and say where the seam belongs instead.

Before writing a "this is the wrong shape" finding, read references/codebase-design.md for the vocabulary (module, interface, seam, adapter, depth-as-leverage) and the deepening table. A shape finding phrased in that language is actionable; "this feels over-engineered" is not.

7. Plan Completion Check

Read docs/plan/*/plan.md:

8. Production Logs (if deployed)

If the project has been deployed (deploy URL in CLAUDE.md, or .solo/states/deploy exists if pipeline state directory is present), check production logs for runtime errors.

Read the logs field from the stack YAML (templates/stacks/{stack}.yaml) to get platform-specific commands.

Vercel (Next.js):

vercel logs --output=short 2>&1 | tail -50

Look for: Error, FUNCTION_INVOCATION_FAILED, 504, unhandled rejections, hydration mismatches.

Cloudflare Workers:

wrangler tail --format=pretty 2>&1 | head -50

Look for: uncaught exceptions, D1 errors, R2 access failures.

Docker/Hetzner (Python API):

ssh user@host 'docker logs {container} --tail=50'

Look for: ERROR, CRITICAL, OOM, connection refused, unhealthy instances.

Supabase Edge Functions:

supabase functions logs --scroll 2>&1 | tail -30

iOS (TestFlight):

Android:

adb logcat '*:E' --format=time 2>&1 | tail -30

If no deploy yet: skip this dimension, note in report as "N/A — not deployed".

If logs show errors:

Report:

9. Dev Principles Compliance

Check adherence to dev principles. Look for templates/principles/dev-principles.md (bundled with this skill), or check CLAUDE.md or project docs for architecture and coding conventions. Also check for dev-principles-my.md (personal extensions) if it exists in the project or KB.

Read the dev principles file, then spot-check 3-5 key source files for violations:

SOLID:

DRY vs Rule of Three:

KISS:

Schemas-First (SGR):

Clean Architecture:

Error Handling:

Report:

10. Commit Quality

Check git history for the current track/feature:

git log --oneline --since="1 week ago" 2>&1 | head -30

Conventional commits format:

Atomicity:

SHAs in plan.md:

grep -c "sha:" docs/plan/*/plan.md 2>/dev/null || echo "No SHAs found"

Pre-commit hooks:

Read the stack YAML pre_commit field to know what system is expected (husky/pre-commit/lefthook) and what it should run (linter + formatter + type-checker). Then verify:

# Detect what's configured
[ -f .husky/pre-commit ] && echo "husky" || [ -f .pre-commit-config.yaml ] && echo "pre-commit" || [ -f lefthook.yml ] && echo "lefthook" || echo "none"

Report:

11. Documentation Freshness

Check that project documentation is up-to-date with the code.

Required files check:

ls -la CLAUDE.md README.md docs/prd.md docs/workflow.md 2>&1

CLAUDE.md:

```bash

# Check that files mentioned in CLAUDE.md actually exist

grep -oP '[a-zA-Z0-9_./-]+\.(ts|py|swift|kt|md)' CLAUDE.md | while read f; do [ ! -f "$f" ] && echo "MISSING: $f"; done

```

README.md:

docs/prd.md:

AICODE- comments:

grep -rn "AICODE-TODO" src/ app/ lib/ 2>/dev/null | head -10
grep -rn "AICODE-ASK" src/ app/ lib/ 2>/dev/null | head -10

Dead code check:

Report:

12. Context Quality Check

Verify that the project is set up for efficient future agent sessions:

Plan handoff quality:

CLAUDE.md signal-to-noise:

Scratch files cleanup:

Report:

13. Pre-mortem (Launch Risk Assessment)

_Renumbered: was #12 before Context Quality Check was inserted._

If the project is about to ship (verdict heading toward SHIP), run a quick pre-mortem:

Imagine it's 3 months after launch and the product failed. What went wrong?

Classify risks using Tigers/Paper Tigers/Elephants:

| Risk | Type | Likelihood | Impact | Mitigation |

|------|------|-----------|--------|------------|

| ... | Tiger (real + scary) | High | High | ... |

| ... | Paper Tiger (scary but unlikely) | Low | High | Accept |

| ... | Elephant (obvious but ignored) | High | Medium | ... |

Focus on:

Include in review report under "### Pre-mortem" section. If any Tiger risk has no mitigation, add it as a FIX FIRST task.

14. Visual/E2E Testing

Use references/qa-issue-taxonomy.md for severity classification and per-page exploration checklist.

If browser tools or device tools are available, run a visual smoke test.

Web projects (Playwright MCP or browser tools):

  1. Start dev server (use dev_server.command from stack YAML, e.g. pnpm dev)
  2. Use Playwright MCP tools (or browser-use skill) to navigate to the main page
  3. Verify it loads without console errors, hydration mismatches, or React errors
  4. Navigate to 2-3 key pages (based on spec.md features)
  5. Take screenshots at desktop (1280px) and mobile (375px) viewports
  6. Look for broken images, missing styles, layout overflow

iOS projects (simulator):

  1. Build for simulator: xcodebuild -scheme {Name} -sdk iphonesimulator build
  2. Install and launch on booted simulator
  3. Take screenshot of main screen
  4. Check simulator logs for crashes or assertion failures

Android projects (emulator):

  1. Build debug APK: ./gradlew assembleDebug
  2. Install and launch on emulator
  3. Take screenshot of main activity
  4. Check logcat for crashes or ANRs: adb logcat '*:E' --format=time -d 2>&1 | tail -20

If tools are not available: skip this dimension, note as "N/A — no browser/device tools" in the report. Visual testing is never a blocker for SHIP verdict on its own.

Report:

Review Report

Generate the final report:

Code Review: {project-name}
Date: {YYYY-MM-DD}

## Verdict: {SHIP / FIX FIRST / BLOCK}

### Summary
{1-2 sentence overall assessment}

### Tests
- Total: {N} | Pass: {N} | Fail: {N} | Skip: {N}
- Coverage: {N}%
- Status: {PASS / FAIL}

### Linter
- Errors: {N} | Warnings: {N}
- Status: {PASS / WARN / FAIL}

### Build
- Status: {PASS / FAIL}
- Warnings: {N}

### Security
- Vulnerabilities: {N} (critical: {N}, high: {N}, moderate: {N})
- Hardcoded secrets: {NONE / FOUND}
- Status: {PASS / WARN / FAIL}

### Acceptance Criteria
- Verified: {N}/{M}
- Missing: {list}
- Status: {PASS / PARTIAL / FAIL}

### Plan Progress
- Tasks: {N}/{M} complete
- Phases: {N}/{M} complete
- Status: {COMPLETE / IN PROGRESS}

### Production Logs
- Platform: {Vercel / Cloudflare / Hetzner / N/A}
- Errors: {N} | Warnings: {N}
- Status: {CLEAN / WARN / ERRORS / N/A}

### Dev Principles
- SOLID: {PASS / violations found}
- Schemas-first: {YES / raw data found}
- Error handling: {PASS / issues found}
- Status: {PASS / WARN / FAIL}

### Commits
- Total: {N} | Conventional: {N}/{M}
- Atomic: {YES / NO}
- Plan SHAs: {N}/{M}
- Status: {PASS / WARN / FAIL}

### Documentation
- CLAUDE.md: {CURRENT / STALE / MISSING}
- README.md: {CURRENT / STALE / MISSING}
- AICODE-TODO unresolved: {N}
- Dead code: {NONE / found}
- Status: {PASS / WARN / FAIL}

### Context Quality
- Plan handoff: {GOOD / INCOMPLETE / MISSING}
- CLAUDE.md size: {N} chars — {OK / WARN / BLOATED}
- Scratch cleanup: {CLEAN / NEEDS CLEANUP / N/A}
- Status: {PASS / WARN}

### Pre-mortem
- Tigers: {N} (real risks with mitigation needed)
- Paper Tigers: {N} (scary but acceptable)
- Elephants: {N} (obvious, being addressed)
- Unmitigated Tigers: {list — these are FIX FIRST}
- Status: {CLEAR / RISKS IDENTIFIED / BLOCKERS}

### Visual Testing
- Platform: {browser / simulator / emulator / N/A}
- Pages/screens: {N}
- Console errors: {N}
- Visual issues: {NONE / list}
- Status: {PASS / WARN / FAIL / N/A}

### Issues Found
1. [{severity}] {description} — {file:line}
2. [{severity}] {description} — {file:line}

### Recommendations
- {actionable recommendation}
- {actionable recommendation}

Verdict logic:

Post-Verdict: CLAUDE.md Revision

After the verdict report, revise the project's CLAUDE.md to keep it lean and useful for future agents.

Steps:

  1. Read CLAUDE.md and check size: wc -c CLAUDE.md
  2. Add learnings from this review:
  1. If over 40,000 characters — trim ruthlessly:
  1. Verify result ≤ 40,000 characters — if still over, cut least actionable content
  2. Write updated CLAUDE.md, update "Last updated" date

Priority (keep → cut):

  1. ALWAYS KEEP: Tech stack, directory structure, Do/Don't rules, common commands, architecture decisions
  2. KEEP: Workflow instructions, troubleshooting for active issues, key file references
  3. CONDENSE: Phase histories (one line each), detailed examples, tool/MCP listings
  4. CUT FIRST: Historical notes, verbose explanations, duplicated content, resolved issues

Rules:

AFTER CLAUDE.md revision — output signal EXACTLY ONCE:

Output pipeline signal ONLY if pipeline state directory (.solo/states/) exists.

Output the signal tag ONCE and ONLY ONCE. Do not repeat it. The pipeline detects the first occurrence.

If SHIP: output this exact line (once):

<solo:done/>

If FIX FIRST or BLOCK:

  1. Open plan.md and APPEND a new phase with fix tasks (one - [ ] Task per issue found)
  2. Change plan.md status from [x] Complete to [~] In Progress
  3. Commit: git add docs/plan/ && git commit -m "fix: add review fix tasks"
  4. Output this exact line (once):
<solo:redo/>

The pipeline reads these tags and handles all marker files automatically. You do NOT need to create or delete any marker files yourself.

Output the signal tag once — the pipeline detects the first occurrence.

Error Handling

Tests won't run

Cause: Missing dependencies or test config.

Fix: Run npm install / uv sync, check test config exists (jest.config, pytest.ini).

Linter not configured

Cause: No linter config file found.

Fix: Note as a recommendation in the report, not a blocker.

Build fails

Cause: Type errors, import issues, missing env vars.

Fix: Report specific errors. This is a BLOCK verdict — must fix before shipping.

Two-Stage Review Pattern

When reviewing significant work, use two stages:

Stage 1 — Spec Compliance:

Stage 2 — Code Quality:

Verification Gate

No verdict without fresh evidence.

Before writing any verdict (SHIP/FIX/BLOCK):

  1. Run the actual test/build/lint commands (not cached results).
  2. Read full output — exit codes, pass/fail counts, error messages.
  3. Confirm the output matches your claim.
  4. Only then write the verdict with evidence.

Never write "tests should pass" — run them and show the output.

Rationalizations Catalog

| Thought | Reality |

|---------|---------|

| "Tests were passing earlier" | Run them NOW. Code changed since then. |

| "It's just a warning" | Warnings become bugs. Report them. |

| "The build worked locally" | Check the platform too. Environment differences matter. |

| "Security scan is overkill" | One missed secret = data breach. Always scan. |

| "Good enough to ship" | Quantify "good enough". Show the numbers. |

| "I already checked this" | Fresh evidence only. Stale checks are worthless. |

Red Flags — STOP immediately if you catch yourself thinking:

Foundational principle: A review without fresh evidence is not a review — it's a guess wearing a lab coat. Run every command. Read every output. No shortcuts.

Critical Rules

  1. Run all checks — do not skip dimensions even if project seems simple.
  2. Be specific — always include file:line references for issues.
  3. Verdict must be justified — every SHIP/FIX/BLOCK needs evidence from actual commands.
  4. Don't auto-fix code — report issues and add fix tasks to plan.md. Let /build fix them. Review only modifies plan.md, never source code.
  5. Check acceptance criteria — spec.md is the source of truth for "done".
  6. Security is non-negotiable — any hardcoded secret = BLOCK.
  7. Fresh evidence only — run commands before making claims. Never rely on memory.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.