This skill helps you perform code review across diffs and PRs, focusing on architecture and cross-file patterns to improve quality.
npx playbooks add skill gigaverse-app/skillet --skill code-review
Review at PR level, not file-by-file. Focus on egregious structural issues, not minutia. Look for cross-file patterns that indicate architectural problems.
# ALWAYS filter out lock files first (often 10k+ lines of noise)
git diff main...HEAD -- . ':!uv.lock' ':!poetry.lock' > /tmp/pr-diff.txt
wc -lc /tmp/pr-diff.txt # Most diffs fit in 256KB after this
# Check size - if under 256KB, analyze the whole thing
# If still too big, filter more
git diff main...HEAD -- . ':!uv.lock' ':!docs/*' > /tmp/code-diff.txt
These are auto-fixable or minor. Focus on structural problems.
# Flag: Weak types
def process(data: Any) -> dict: # Any, raw dict
def process(data: UserData) -> UserResponse: # Specific types
# Flag: hasattr/getattr (type deficiency marker)
if hasattr(obj, "name"): # Why don't you know the type?
if isinstance(obj, Named): # Use protocol or union type
# Flag: God functions
def process_order(order_data): # 200 lines doing everything
validated = _validate(data) # Extract responsibilities
transformed = _transform(validated)
# Flag: Duplicate logic across files
# service_a.py and service_b.py have same 20-line validation
# Extract to shared utility
# Flag: Related classes without shared interface
class CacheDirectory:
def list_entries(self): ... # Names differ
class StatusDirectory:
def get_all_entries(self): ... # Should share ABC
Keep maximum context to spot cross-file patterns.
git diff main...HEAD -- . ':!uv.lock' > /tmp/diff.txt
wc -lc /tmp/diff.txt # Under 256KB? STOP - analyze whole thing
git diff main...HEAD -- . ':!uv.lock' ':!docs/*' > /tmp/code-diff.txt
git diff main...HEAD -- . ':!uv.lock' ':!docs/*' ':!tests/*' > /tmp/prod.txt
# Only if >256KB after all filtering
# Use 15k lines to preserve cross-file patterns
# Small chunks (2k lines) defeat the purpose!
Why use external LLM tools? Claude Code has a 25K context limit per tool call. For reviewing entire PR diffs (50K-200K+ tokens), use models with larger context windows.
Benefits:
# 1. Extract changes (handles lock file exclusion automatically)
./scripts/extract-changes.sh # PR: current branch vs main
./scripts/extract-changes.sh abc123 # Specific commit
./scripts/extract-changes.sh auth/login # Path pattern (fuzzy match)
# 2. Run code review with large-context model
./scripts/llm-review.sh -m gpt-4o
./scripts/llm-review.sh -m claude-3-5-sonnet-latest
# 3. Run specialized reviews
./scripts/llm-review-tests.sh -m gpt-4o # Test quality
./scripts/llm-review-types.sh -m gpt-4o # Type hints
Requires [Simon Willison's llm tool](https://llm.datasette.io/):
pip install llm
llm keys set openai # For GPT-4
pip install llm-claude-3 # For Claude
llm keys set claude
See [references/llm-tooling.md](references/llm-tooling.md) for full setup and usage guide.
LLM review provides hints, not final answers:
For detailed patterns and examples:
Remember: The ENTIRE POINT of full diff review is cross-file patterns. Don't chunk unless you absolutely must!
CRITICAL: After completing a code review, ALWAYS:
Why this matters:
Example flow:
[Code review findings output]
## Suggested Actions
1. Add format-duration validator to Schema
2. Add tests for format-duration validation
3. Move constant to config class
Which items should I proceed with?Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.