Skip to content
factory-staged-code-reviewer logo

Factory — staged code review

factory-staged-code-reviewer

Principal-style review of git staged hunks only: writes a markdown report under .code-review/, applies file-type specialist lens and project context, never runs git commit. Triggers: staged review, factory-staged-code-reviewer, factory:staged-code-reviewer, pre-commit review. Use factory-conventional-commit for commit messages after.

SKILL.md

Full skill instructions

Factory — staged code review

Quick start (DX)

PurposeReview only the Git index (next commit); produce a saved report in .code-review/.
Typical ask“Review staged changes”, “PR-style review on staged files”, or this skill’s name.
Nevergit commit, merge, rebase, or drafting Conventional Commits — use factory-conventional-commit for messages.
OutputOne report file per run, open it in the editor when possible, + one short line in chat (path + verdict).

Role

Act as a principal-level reviewer for staged changes only: quality, architecture, security, performance, and fit with the project. Pick a specialist lens from staged paths (references/​specialist-lenses.md). Optionally load minimal project context (references/​project-context.md) so feedback is grounded, not generic.

Hard rules

  1. Never run git commit, git merge, git rebase, or otherwise create or alter commits.
  2. Never draft Conventional Commits; use factory-conventional-commit for short / long messages.
  3. Scope: git diff --cached / git diff --staged only — not the full working tree unless the user explicitly overrides.
  4. Always write the report to .code-review/ at the repository root (create the directory if needed).

Procedure

  1. Git — Confirm repo; run git diff --cached --stat then full git diff --cached.
  2. Empty index — If no output, say nothing staged and suggest git add / git add -p. Do not create an empty report.
  3. Lens — From staged paths, note specialist lens(es) per references/​specialist-lenses.md.
  4. Context (optional) — Read a small set of project files only if they clarify the diff (references/​project-context.md).
  5. Review — Apply rubric references/​review-rubric.md; justify impact; avoid taste-only nits.
  6. Report file — Create .code-review/ if missing. Filename: staged-review-{YYYYMMDD-HHMMSS}.md (use date from shell when available, else ISO-like timestamp). Populate using references/​report-template.md. Use an absolute path for the next step.
  7. Open in editor — After the file is written, open it so the user can read it immediately:
    • Preferred: cursor "<absolute-path-to-report.md>" (Cursor CLI; install from Command Palette: “Shell Command: Install ‘cursor’ command” if missing).
    • macOS fallback: open -a Cursor "<absolute-path>" if cursor is not in PATH.
    • Linux fallback: xdg-open "<absolute-path>" only if appropriate for the user’s setup.
    • If every open attempt fails (CLI missing, sandbox), say so in the chat line and rely on the path.
  8. Chat — Reply with one short line: path to the report, whether it was opened, and optional one-line verdict. Do not paste the full report in chat unless the user asks.

Report contract

  • Path: .code-review/​staged-review-<timestamp>.md
  • Content: Follow references/​report-template.md: decision (APPROVE | REQUEST_CHANGES | BLOCK), confidence, staged file list, findings by severity, architecture/​testing notes, quick wins.
  • Language: English for the report body (matches Factory docs convention).

Checklist (self)

  • Used --cached / --staged for stat and patch.
  • Report written under .code-review/ with unique filename (absolute path known).
  • Attempted to open the report via cursor or fallback; noted failure if not possible.
  • Findings reference file (and line when possible) from the staged patch.
  • Specialist lens and project context (if any) stated in the report.
  • No git commit; no Conventional Commit text.

Gotchas

  • Open in editor — Some environments block GUI or CLI; opening is best-effort, not a hard gate.
  • Unstaged work is out of scope unless needed to read context for a hunk (say so in the report).
  • Partial staging — review exactly what --cached shows.
  • Renames / binaries — git diff --cached --summary; binary: note change, no line nits.
  • Generated blobs — call out; do not nitpick generated content.

Progressive disclosure

Related skills

  • factory-conventional-commit — short / long commit messages after you are satisfied with the review.

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View