plugins/dev-workflow/skills-pi/reviewing-code/SKILL.md
Sequential code review for security, quality, tests, and architecture. Use when reviewing code, checking changes, reviewing PRs, or looking for deep-module/refactoring opportunities.
npx skillsauth add alexei-led/claude-code-config reviewing-codeInstall 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 the current diff or specified scope for security, quality, test coverage, and architecture issues. Ground every claim in code or tool output.
Read the diff:
git diff --name-only HEAD
git diff HEAD
If the user supplied paths or a branch, use those instead.
Categorize changed files:
.go — Go.py — Python.ts, .tsx — TypeScript.html, .css, .js — WebIf present, read relevant CONTEXT.md, CONTEXT-MAP.md, and docs/adr/ files before naming architectural findings.
Use real tool calls before conclusions.
# Go
golangci-lint run ./... 2>&1 | head -100
go vet ./...
go test -race ./... 2>&1 | head -100
# Python
ruff check . 2>&1 | head -100
mypy . 2>&1 | head -100
pytest --tb=short 2>&1 | head -100
# TypeScript
bun lint 2>&1 | head -100
bun tsc --noEmit 2>&1 | head -100
bun test 2>&1 | head -100
Check for hardcoded secrets, injection risks, unsafe deserialization, missing auth, IDOR, XSS, command execution, goroutine leaks, unchecked errors, and insecure browser patterns.
Check for:
Use these terms exactly:
Apply the deletion test: if deleting a module makes complexity vanish, it was a pass-through. If complexity reappears across callers, it earned its keep.
Seam rule: one adapter means a hypothetical seam; two adapters means a real seam. Do not propose ports for decoration.
Find shallow modules, poor seams, fake ports, hidden coupling, and untestable interfaces. Propose deepening opportunities and explain how tests improve.
Use this exact format. One line per finding. No preamble. No hedging.
## Code Review
**Scope:** <description>
**Languages:** <list>
### CRITICAL
- `file:line` — <issue>. Fix: <action>.
### IMPORTANT
- `file:line` — <issue>. Fix: <action>.
### SUGGESTIONS
- `file:line` — <issue>. Fix: <action>.
### Architecture Opportunities
| Candidate | Files | Problem | Deepening Move | Test Benefit |
|-----------|-------|---------|----------------|--------------|
| ... | ... | ... | ... | ... |
### Test gaps
- `func/method` in `file` — no test for <scenario>.
**Summary:** X critical, Y important, Z suggestions, W test gaps.
Omit empty sections. If no issues are found, say exactly what checks ran and why no findings survived review.
tools
Idiomatic shell development for POSIX sh, Bash, Zsh, Fish, hooks, CI shell steps, and scriptable CLI glue. Use when writing or changing `.sh`, `.bash`, `.zsh`, `.fish`, `.bats`, shell functions, shell pipelines, or command-runner recipes. Emphasizes portability, quoting, safe filesystem/process handling, non-TUI CLI tools, ShellCheck, shfmt, Bats, and ShellSpec. NOT for Python, TypeScript, Go, web code, or infrastructure operations.
tools
Use when planning, executing, checkpointing, finishing, or inspecting lightweight spec-driven work. Runs one task at a time using `.spec/` markdown files and the bundled `specctl` helper. NOT for broad product discovery beyond a short requirement interview.
testing
Author, inspect, troubleshoot, and review infrastructure across IaC, Kubernetes, cloud resources, containers, CI/CD, and Linux hosts. Use when changing Terraform/OpenTofu, Kubernetes, Helm, Kustomize, Dockerfiles, GitHub Actions, AWS, GCP, Cloud Run, BigQuery, IAM, logs, instances, or service health. NOT for deploy/apply/rollback workflows (see deploying-infra). NOT for shell scripts or generic command pipelines (see writing-shell).
development
Configure safe git workflow hygiene: pre-commit/pre-push hooks, Gitleaks secret scanning, .gitignore rules, local git config, and guardrails. Use when setting up git hooks, gitleaks/git leaks, staged pre-commit checks, pre-push validation, core.hooksPath, .gitignore, or git config best practices. NOT for creating commits (use committing-code), cleaning branches/worktrees (use cleanup-git), or creating worktrees (use using-git-worktrees).