From alamops-skills
(alamops) Performs a thorough, read-only code review on any source of changes — a pull request, a git diff, uncommitted edits in the working tree, recent commits on the current branch, or code that was just produced or discussed in the conversation. Flags bugs, security issues (tenant isolation, authz gaps, atomicity, retry safety, multi-step flow completeness, RLS / row-policy self-recursion), performance issues (in-memory aggregation, sequential fan-out, partial-period comparisons), consistency issues (including schema ↔ code column-reference drift), and blast-radius gaps. Returns structured findings (category, severity, file, line, suggestion) without modifying any code. Use whenever the user asks for a code review, PR review, diff review, feedback on pending or recent changes, or a critique of code just written in this session.
How this skill is triggered — by the user, by Claude, or both
Slash command
/alamops-skills:code-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A read-only review skill: produce structured findings, never edit code. Tone: friendly coding teammate, concise.
A read-only review skill: produce structured findings, never edit code. Tone: friendly coding teammate, concise.
Before reviewing, identify what you are reviewing. The skill applies the same rigor regardless of source — only the discovery step changes:
| Trigger | How to gather the diff |
|---|---|
| User names a PR (URL or number) | Fetch PR metadata + diff (e.g., gh pr view <n>, gh pr diff <n>). |
| User asks to review "this branch" / "my changes" / "what I'm about to push" | git status, git diff <base>...HEAD, git log <base>..HEAD --stat. Default <base> to origin/main (or origin/master); fall back to main. |
| User asks to review uncommitted / pending / staged work | git status, git diff (unstaged) and git diff --cached (staged). |
| User asks to review "recent commits" / "the last commit" | git log -n <N> --stat, git show <sha> for each. |
| User asks to review code we just wrote / discussed in this conversation | Use the in-conversation edits and tool results. Re-read the modified files from disk if it has been a while or if context may have been compacted. |
| Ambiguous ("review my code") | Ask once: "Review the open PR, the uncommitted changes in your working tree, the diff against main, recent commits, or the code we just wrote together?" Then proceed. |
[info] Positive: … items, do not dress up "this is fine" or "nice touch" observations as findings, and do not add info entries that boil down to "this code is good / consistent / well-scoped / harmless." If something is clean, it goes in the overall summary as a one-line acknowledgement — not as its own finding block. When in doubt, ask: "Is there an action the author should take?" If no, it is not a finding.git status, or the user's stated intent in the conversation. Look at full diffs and file contents after you know what changed and why.git diff + git diff --cached; for branch reviews, git diff <base>...HEAD; for in-conversation reviews, the files actually edited this session.Copy this into your response and check items off as you progress:
Review progress:
- [ ] Review target identified (PR / branch diff / working tree / recent commits / in-conversation edits)
- [ ] Intent gathered (PR description, commit messages, conversation context, or stated goal)
- [ ] All changed files reviewed
- [ ] Security swept (tenant isolation, authz, atomicity, retry, flow completeness, orphaned state, RLS self-recursion)
- [ ] Performance swept (in-memory aggregation, fan-out, duplicate scans, period comparisons)
- [ ] Consistency swept (enums, validation, business-rule duplication, contract alignment, schema↔code column-reference drift)
- [ ] Blast radius traced for every modification (callers, sibling paths, downstream flows)
- [ ] Findings logged with category, severity, file, line, suggestion
- [ ] Overall summary written (counts, top issues, verdict)
Clean, readable, maintainable code. Names that describe intent.
USING / WITH CHECK clause query the same table the policy protects (directly, or transitively via a view)? Postgres throws 42P17 infinite recursion detected in policy for relation "<T>" at query time, often only on the read path that triggers it — easy to ship undetected. The fix is to wrap the membership check in a SECURITY DEFINER helper function so the inner lookup bypasses RLS. Also: when adding a new query, RPC, or join that touches table T, scan T's existing policies for self-referencing EXISTS (SELECT … FROM T …) patterns even if T is not in this diff — the recursion only manifests when something queries T, so a clean new RPC can still detonate an old policy.Are tests adequate? Do they cover edge cases, error paths, and the new behavior introduced in this change?
Are non-obvious decisions, invariants, or workarounds documented where a future reader will need them?
Is failure handled, or punted upward without context?
.select('a, b, last_message_at'), .eq('status', …), .order('created_at'), raw SQL strings, ORM field refs — does the column actually exist in the migration history? Grep the migrations for each referenced column name. A missing column produces a runtime 42703 column "X" does not exist that unit tests typically miss (they mock the DB). Conversely: when a diff adds a column, is something on the other side reading it, or is it stranded? This catches the "client merged before the migration" and "migration merged but feature shipped without the column wired up" failure modes.The highest-impact bugs are not in the code that was changed — they are in the code that should have been changed but wasn't. For every modification:
Each finding:
### [<severity>] <short title>
- **Category:** Bug | Security | Performance | Style | Suggestion | Improvement
- **File:** `path/to/file.ts:LINE`
<description: what is wrong and why it matters>
**Suggestion:**
<actionable fix, with snippet if useful>
\`\`\`ts
// optional snippet
\`\`\`
Fields:
category: Bug | Security | Performance | Style | Suggestion | Improvementseverity: critical | high | medium | low | infodescription: self-contained Markdown prosesuggestion: actionable; optional but strongly preferredfile_path: relative to repo rootline_number: specific line if applicablecode_snippet: relevant snippet, if applicable### [critical] Missing tenant scope on resource listing
- **Category:** Security
- **File:** `path/to/listing-handler:LINE`
The listing operation returns records for all tenants — it neither accepts nor applies a tenant identifier. Any authenticated user can read records belonging to any other tenant, a tenant-isolation breach.
**Suggestion:**
Require the caller to pass the tenant scope, resolved from the authenticated session at the request boundary — not deep inside callers, where it is easy to forget.
### [high] Sequential fan-out in notification broadcast
- **Category:** Performance
- **File:** `path/to/broadcast-handler:LINE`
The handler iterates over recipients and awaits each external call serially. For a list of N recipients, this is ~N× slower than necessary and risks exceeding the function's wall-clock timeout.
**Suggestion:**
Use bounded parallelism — fire requests concurrently with a concurrency limit. Hoist invariants (template / payload construction) outside the loop so they aren't recomputed per recipient.
End every review with:
critical / high / medium / low / info.approve / request changes / comment.If the review surfaced zero findings, skip the counts table and the must-fix line. Lead directly with a 2–4 sentence summary of what the change does and what was done well, then state the verdict. Do not pad the response with empty sections or fabricated nits.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub alamops/skills --plugin alamops-skills