skills/linuxlewis-code-review/SKILL.md
Apply linuxlewis's code review style to pull requests, local diffs, or proposed code changes. Use when asked to review code the way linuxlewis would, emulate Sam Bolgert's review strategy, predict likely PR feedback, or explain linuxlewis's review profile.
npx skillsauth add linuxlewis/agent-skills linuxlewis-code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review code with linuxlewis's observed preferences: scope discipline, local pattern fit, API and auth correctness, domain invariants, operational safety, performance, and useful tests.
For more detail, read references/review-profile.md when asked to justify or
tune the style.
nit: for minor
issues. When suggesting a different design, explain the operational or domain
reason, not just taste.Prioritize these checks:
bulk_update for large writes, upstream prefetching, avoiding
extra downstream queries, file parallelism, and external API rate limits.Apply these checks aggressively for backend PRs:
Request-path latency
Identify all blocking work done before the HTTP response: external API calls, LLM calls, file reads, large serialization, loops over database rows, and cross-service retries. Ask whether the endpoint should dispatch a Celery task and let the client poll, use an async view, or return an accepted/job status instead of holding an API worker.
Query shape
Look for N+1 queries, downstream queries inside service methods, extra
queries that could be folded into an upfront load, and filters that will scan
large tables. Prefer querying the data needed upfront,
select_related/prefetch_related where appropriate, narrow filters, and
in-memory calculation only after the bounded dataset is loaded.
Backfills and management commands
Before accepting a backfill or command, ask:
bulk_update, bulk_create, or a single queryset update instead
of per-row save()?External rate limits and retries
Check whether the change uses the repo's existing retry/rate-limit client instead of adding a new retry loop or throttle. Validate concurrency limits and rate limits against the provider. If the framework already rate-limits a sensitive auth flow, question custom throttling.
Test suite performance
Notice changes that slow CI: removed file parallelism, overbroad integration tests, duplicated assertions, or unnecessary database work. Prefer focused regression coverage at the right boundary.
Use this section when reviewing tests, especially backend tests around APIs, Celery tasks, SDKs, and external providers.
Mock external APIs, not the code under test
Prefer tests that execute the real view/service/task/serializer path and mock
the remote provider boundary with the repo's HTTP mocking tools, provider API
fake, responses, request mocking, or existing provider API mock patterns.
Do not patch the whole method, service, Celery task, or SDK call if the
purpose of the test is to verify how the app uses that layer.
Keep the application integration path intact
API tests should usually hit the real view, serializer validation, permissions, service dispatch, and response shape. Celery-related tests should remember that tasks often run synchronously in the test environment unless the codebase says otherwise, so patching task dispatch often removes useful coverage.
Use the right test layer for the risk
Use unit tests for pure transformations and narrow branch logic. Use API tests for route, permission, serializer, and response contracts. Use integration tests for app/provider boundaries. Use E2E tests for user-visible flows, and do not replace E2E backend calls with frontend mocks when the point is to validate the real system.
Avoid over-mocked or duplicative tests
If a test is heavily patched, duplicates an API test, or only asserts wiring that another test already covers, ask to remove it or fold the assertion into existing coverage. More tests are not better if they do not increase trust.
Prefer local test conventions
Use existing factories instead of manual object setup, framework base test classes where consistent, and test module paths that mirror the owning app/module. Remove unnecessary database markers when the chosen base class already provides the database behavior.
Require real-flow coverage for risky changes
Ask for registration-flow, OAuth login, permission, generated client/schema, or production-shaped dev-environment verification when the change is risky. The key question is whether the test would fail if the real integration broke.
Review module placement as a product and maintainability concern, not just organization:
Put code in the owning app
New domain behavior should usually live in the app that owns the concept. Treat catch-all legacy areas as a smell when the code is clearly domain-owned.
Keep views thin
Views/controllers should handle request parsing, permissions, serializer validation, and response shape. Domain work belongs in services, model managers, or the owning module. If a view is assembling domain payloads, choosing records, or formatting service internals, ask whether the service/module should own that behavior.
Prefer cohesive services over pass-through flags
Passing skip_*, include_*, or mode flags through many methods is a design
smell. Ask whether the operation can be split, whether data can be appended at
the end, or whether the service interface should accept a query object/status
filter with clearer semantics.
Choose legacy compatibility deliberately
Do not add more code to legacy paths by default. Either preserve legacy behavior through a clear fallback for old records/clients, or create a new cleaner path with explicit migration/rollout semantics. Question PRs that are half-generic and half-client-specific.
Use local naming conventions
Names should reveal domain intent and API semantics. Avoid include_* when
the parameter is actually exclusive; use status filters when callers need
permutations; move tests to the owning app with a parallel module path; add
docstrings only when they prevent future readers from needing ticket
archaeology.
Prefer short comments in this shape:
Can we ... ?Do we need ... ?Why are we ... ?This seems like ...nit: ...I would ... because ...Use direct requests when the fix is obvious:
nit: can this type be more specific? Can we use the choices from above?
Use questions when intent, ownership, or tradeoffs need confirmation:
Do we really need a separate query for this? Should we just query once and calculate in memory?
Use rationale when pushing back on implementation direction:
We should not do this synchronously. These calls can take a long time and will hold up API workers.
Avoid generic "looks good" reviews when there are meaningful risks. If approving, still mention any important rationale or residual risk briefly.
When returning a review:
development
Run Ralph Wiggum autonomous coding loops. Use when user asks to run ralph, start autonomous coding, execute a PRD, implement features from a task list, or wants Claude Code to work through user stories iteratively.
development
Review and respond to GitHub PR comments. Use when analyzing PR feedback, determining which comments to address, classifying review comments by priority, or implementing fixes for code review feedback.
data-ai
Notify OpenClaw gateway when background tasks complete. Use when you were dispatched by OpenClaw/TARS for background work and need to ping the user that you're done, failed, or blocked.
tools
Browser automation using the agent-browser CLI. Use when user asks to browse websites, open webpages, interact with page elements, take screenshots, fill forms, click buttons, scrape content, or automate browser tasks.