Skip to content
cccskills
FreePublished on GitHub

code-review

Pre-PR code review checklist for this repo. Plan alignment, security gates, layering, dead code, API-surface completeness. Used by the code-reviewer agent.

The English summary is being prepared. Showing the original description.

Works withSupabase
See how to install

Files included (1)

  • SKILL.md5.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Code Review Skill

Version: 1.0 | Read-only — reviewer agent does not edit files.

Review a diff against origin/main for this repo. Produce a verdict and an ordered issue list. Do not fix issues yourself.

Inputs

  • <slug> — feature slug; read docs/features/<slug>/plan.md and task.md
  • git diff origin/main...HEAD — committed changes on the feature branch
  • git diff — unstaged/uncommitted changes in the working tree
  • git status --short — new/deleted files

Output Contract

MUST be parseable — /ship parses the VERDICT: line verbatim.

VERDICT: APPROVE
ISSUES: (none)
FOLLOW-UPS: <non-blocking nits or empty>

or

VERDICT: CHANGES_REQUESTED
ISSUES:
1. [BLOCKER] [backend] app/routers/admin.py:42 — missing Depends(require_admin) on new endpoint — move under the admin router's prefix or add the dependency explicitly
2. [MAJOR] [frontend] components/Foo.tsx:12 — raw fetch against NEXT_PUBLIC_API_URL — route through lib/api.ts
FOLLOW-UPS:
- [frontend] Button aria-label could be more descriptive (non-blocking)

Severity levels: BLOCKER (security, correctness, architecture violation) · MAJOR (non-security bug, dead code, missing tests for new surface) · MINOR (style, naming) — MINOR goes under FOLLOW-UPS, never in ISSUES.

Any BLOCKER or MAJOR → CHANGES_REQUESTED.

Checklist

1. Plan alignment

  • Every [x] entry in task.md::Shipped maps to at least one hunk in the diff
  • No files touched outside the plan's scope (check plan.md::Out of scope — any hit is a BLOCKER)
  • Reused components listed in plan.md::Reuses are extended, not re-implemented

2. Security (BLOCKERS)

  • SUPABASE_SERVICE_ROLE_KEY appears nowhere under frontend/
  • Every new admin endpoint in backend/app/routers/admin.py is under the router's dependencies=[Depends(require_admin)] (or explicitly on the route)
  • No new endpoint returns or logs the service-role key, JWTs, or user emails in error messages
  • New migrations in backend/db/migrations/ are additive and numbered after the latest existing file — never edit a shipped migration
  • RLS not widened without an explicit migration + approval note in plan.md
  • No hardcoded secrets; config goes through app/config.py (backend) or process.env.NEXT_PUBLIC_* (frontend)

3. Backend architecture (backend/)

  • Routers are thin: each endpoint body ≤ ~5 statements and calls exactly one service function
  • Business logic lives in app/services/, not routers/ or schemas/
  • Supabase access via get_supabase() only — no inline client construction
  • Multi-row atomic writes go through a Postgres RPC (checkout uses create_order), not Python loops
  • Pydantic v2 schemas validate every request body; response_model= set on data-returning routes
  • Domain errors raised as HTTPException(status, "snake_case_code")
  • Public reads filter is_active = true

4. Frontend architecture (frontend/)

  • Server Component by default; "use client" only at leaves that need hooks/handlers/browser APIs
  • All FastAPI calls go through lib/api.ts — no raw fetch to NEXT_PUBLIC_API_URL elsewhere
  • New lib/api.ts helpers have matching request/response types in lib/types.ts
  • Admin pages verify user.app_metadata.role === "admin" server-side before rendering
  • Cart state via useCart(); no alternate cart implementation
  • Path aliases (@/...) — no ../../
  • Empty / loading / error states handled

5. Tests

  • New backend services have backend/tests/test_*.py covering happy path + every HTTPException branch named in plan.md
  • New frontend components/pages have *.test.tsx co-located
  • Tests do not hit real Supabase (look for SUPABASE_URL with production-looking values in test fixtures)

6. Hygiene

  • No unused imports, unused exports, unreachable branches
  • No console.log / print() debugging
  • No any in frontend TypeScript; no # type: ignore without a comment explaining why
  • Migration filename matches pattern 000N_<kebab_desc>.sql

Review Workflow

  1. Read docs/features/<slug>/plan.md + task.md in full
  2. Run git diff origin/main...HEAD --stat to see scope
  3. For each file in the diff: read the full hunks (not just headers); map to a checklist section
  4. Group issues by severity; emit the output contract verbatim
  5. Stop. Do not edit files; do not propose patches beyond the one-line "suggested fix" in the issue format

What NOT To Flag

  • Style preferences that aren't in CLAUDE.md or this checklist (save for FOLLOW-UPS)
  • Tailwind class ordering — no enforced convention
  • Comment density — this repo prefers minimal comments
  • Test coverage % — binary: does the new surface have at least one happy-path + error-branch test?

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Supabase Postgres + Storage + Auth operations from FastAPI — service-role client, RLS-aware queries, additive SQL migrations under backend/db/migrations, the create_order RPC, and the product-images bucket. Use when adding tables/columns, writing queries, calling RPCs, or working with Storage.

The English summary is being prepared. Showing the original description.

shanraisshan/learning-x-claude2Updated May 7, 2026

Build FastAPI endpoints in the layered router → service → Supabase pattern, with Pydantic v2 schemas, JWT/admin gating, and consistent HTTPException-based domain errors. Use when adding/modifying any endpoint under backend/.

The English summary is being prepared. Showing the original description.

shanraisshan/learning-x-claude2Updated May 7, 2026

pytest + httpx + TestClient patterns for the FastAPI backend. Dependency overrides for auth, FakeSupabase mocking, HTTPException assertions. Use when writing or reviewing backend/tests/test_*.py.

The English summary is being prepared. Showing the original description.

shanraisshan/learning-x-claude2Updated May 7, 2026

Drive Chrome via the claude-in-chrome MCP to exercise plan.md::Verify steps for a shipped feature. Loads deferred MCP tool schemas, asserts console/network cleanliness, records a GIF for the PR. Used by the browser-verifier agent.

The English summary is being prepared. Showing the original description.

shanraisshan/learning-x-claude2Updated May 7, 2026

Integrate with the FastAPI backend through the typed wrapper in frontend/lib/api.ts, attach Supabase JWTs for admin calls, and handle errors via ApiError. Use when adding/modifying API calls or wiring auth.

The English summary is being prepared. Showing the original description.

shanraisshan/learning-x-claude2Updated May 7, 2026

Build pages and components in the Next.js 15 App Router (RSC by default, "use client" only when needed), Tailwind for styling, typed props, and the existing CartProvider for cart state. Use when creating or modifying pages, layouts, components, or forms in frontend/.

The English summary is being prepared. Showing the original description.

shanraisshan/learning-x-claude2Updated May 7, 2026

See all skills by shanraisshan

Report a problem with this skill