reviewing-code
Code review methodology for evaluating implementation changes. Use when reviewing code changes for quality, design, correctness, and maintainability. Focuses on changes made during implementation using Conventional Comments for clear, actionable feedback.
What this skill does
# Code Review Methodology Deep code reviews that protect architecture, catch correctness issues, and provide mentoring-quality feedback using Conventional Comments. ## Purpose This skill provides methodology for reviewing code changes introduced during implementation. Unlike full codebase audits, this focuses on the delta - what was added or modified - to catch quality issues before they're committed. ## Review Workflow Follow this order - don't jump to nits. ### 1. Understand Context - What problem is this solving? - Is there a linked ticket/design doc? - Read the implementation plan if available ### 2. Scan High Level - Files/directories touched - New public APIs or endpoints - New dependencies - Migrations and data changes - **Size check:** 200-400 lines optimal, >1000 recommend splitting ### 3. Evaluate Correctness - Does it solve the described problem? - Edge cases and error conditions handled? - Assumptions explicit? - Race conditions considered? ### 4. Evaluate Design - Aligns with existing architecture? - New pattern where existing one would work? - Local change or architecture decision in disguise? **Pattern Recognition:** | Smell | Pattern to Suggest | |-------|-------------------| | Long method | Compose Method | | Type-based conditionals | Replace Conditional with Polymorphism | | Duplicate algorithm structure | Form Template Method | | Scattered null checks | Introduce Null Object | | Type field drives behavior | Replace Type Code with State/Strategy | Always name patterns explicitly. **SOLID Quick Check:** | Principle | Red Flag | |-----------|----------| | SRP | Class has multiple unrelated responsibilities | | OCP | Must modify existing code to add behavior | | LSP | Subclass changes expected behavior | | ISP | Fat interface forces unused dependencies | | DIP | High-level depends on low-level details | ### 5. Evaluate Tests - Tests for critical paths and edge cases? - Tests read like specifications? - Stable, isolated, fast? **Red Flags:** - Testing private methods instead of behavior - Mocking what can be used for real (never mock what you can use for real) - Tests slower than necessary - Missing edge case coverage ### 6. Evaluate Security (Lightweight) Note obvious security concerns for security-reviewer to examine in depth: - User input crossing trust boundaries? - Authorization and privacy concerns? - Secrets handling? Defer detailed security analysis to the security-reviewer agent. ### 7. Evaluate Operability - Logging, metrics, traces where needed? - Clear error messages? - Impact on alerts and SLOs? - Failure modes understood? ### 8. Evaluate Maintainability - Can a mid-level engineer understand this? - Coupling and cohesion appropriate? - Naming, structure, comments carry weight? - Future changes considered? ### 9. Provide Feedback - Use Conventional Comments syntax - Classify blocking vs non-blocking - Explain **why** each point matters - Include at least one praise per review - End with clear verdict ## Conventional Comments ```text <label> [decorations]: <subject> [discussion] ``` ### Labels | Label | Use For | |-------|---------| | `praise:` | Highlight positives (aim for 1+ per review) | | `nitpick:` | Trivial preferences (non-blocking) | | `suggestion:` | Propose improvement with what and why | | `issue:` | Concrete problem (pair with suggestion) | | `todo:` | Small necessary changes | | `question:` | Need clarification | | `thought:` | Non-blocking future ideas | | `chore:` | Process tasks before acceptance | ### Decorations - `(blocking)` - Must resolve before merge - `(non-blocking)` - Helpful but not required - `(security)`, `(performance)`, `(tests)`, `(readability)`, `(maintainability)` ### Examples ```text [src/validation.ts:34] **praise**: Clean extraction of validation logic improves readability. ``` ```text [api/users.py:127] **issue (blocking)**: Missing null check before accessing user.email. Add guard clause or use optional chaining. ``` ```text [handlers/payment.js:89-105] **suggestion (non-blocking, readability)**: Nested conditionals hard to scan. Consider early returns to flatten. Classic Compose Method pattern (Fowler). ``` ```text [core/processor.go:234] **question**: Is this on the hot path? If so, consider allocation cost in loop. ``` ## Principle-Based Review Apply first principles and attribute by name for shared vocabulary: ```text **issue (blocking, design)**: This mutates shared state. Following Rich Hickey's immutability principle, return new value from pure function instead. ``` ```text **suggestion (non-blocking)**: Following Ousterhout's principle, pull this complexity into the implementation. Simplify the interface. ``` ```text **issue (blocking)**: Subclass overrides parent method but changes expected behavior. This violates Liskov Substitution - callers can't safely substitute implementations. ``` **Principles to apply:** - **Rich Hickey**: Simple, immutable data structures; pure functions - **John Carmack**: Direct implementation; avoid unnecessary abstraction - **Joe Armstrong**: Isolate failures; rigorous error handling - **Barbara Liskov**: Respect interface contracts; substitutability - **John Ousterhout**: Deep modules with simple interfaces - **Donald Knuth**: Readability and maintainability above cleverness ## Change Size Guidelines | Lines | Action | |-------|--------| | < 200 | Full detailed review of every line | | 200-400 | Full detailed review (optimal size) | | 400-1000 | Focus on critical paths, security boundaries, architecture; suggest splitting | | > 1000 | Architectural review only; strong recommendation to split | For large changes: ```text **suggestion (blocking)**: This change (1,450 lines) exceeds reviewable size. Please split per atomic change principle (200-400 lines optimal). Providing architectural review only until split. ``` ## Report Format ```text ## Code Review: $ARGUMENTS ### Summary [Brief overview of changes reviewed and overall assessment] ### Findings [File location first, then Conventional Comment] [file:line] **<label> (<decorations>)**: <subject> <discussion> ### Verdict [APPROVE / APPROVE WITH NITS / REQUEST CHANGES] ### Rationale [Brief explanation of verdict decision] ``` ## Verdict Criteria **APPROVE** - No blocking issues, code is ready - Implementation may proceed to security review - Note any minor items for awareness **APPROVE WITH NITS** - Only non-blocking suggestions - Implementation may proceed - Suggestions are improvements, not blockers - Author may address at their discretion **REQUEST CHANGES** - Blocking issues present - Should address issues before proceeding - Provide specific remediation for each blocking issue - User may choose to proceed anyway (soft gate) ## Integration with Implementation When called from implementation phase: 1. Review all changes made during implementation 2. Reference the plan to understand intended behavior 3. Focus on quality implications of the changes 4. Report findings clearly with actionable recommendations 5. Soft-gate completion if blocking issues found (user can override) 6. Security concerns flagged here will be examined by security-reviewer next
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.