review-diff
Skill16 starsChanged 3 days agoApache-2.0View on GitHub
Review the diff between the current branch and main as a senior developer. Analyzes architecture, coding standards, security, performance, and correctness. Use when user says 'review my code', 'pre-PR review', 'review diff', 'code review before PR', 'check my changes', 'senior review', or 'review branch'. Provides actionable feedback organized by severity. Do NOT use for only running tests (use /test-scope), only linting (use /lint), or full PR preparation (use /create-pr).
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 18 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Read the full diff carefully.
- Very specific: line 31
No cross-scope imports (only through packages/core.
- Distinctive: line 52
No string concatenation in queries or shell commands
- Distinctive: line 56
No hardcoded credentials or tokens
- Very specific: line 73
Test markers applied correctly (slow, integration, flaky)
- Distinctive: line 101
Do NOT suggest adding backwards compatibility unless explicitly asked
“Common” is measured: kept by at least 6 in 10 of the 18 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Review Diff - Pre-PR Code Review
Perform a comprehensive code review of all changes between the current branch and main, as a senior developer would.
Step 1: Gather the Diff
git diff main...HEAD
git diff main...HEAD --stat
git log main...HEAD --onelineRead the full diff carefully. Understand every change before reviewing.
Step 2: Read Affected CLAUDE.md Files
For each scope touched by the diff, read its CLAUDE.md to understand scope-specific conventions. The root CLAUDE.md
has 20 Coding Conventions — use those as the baseline for all reviews.
Step 3: Review Checklist
Architecture & Scope Boundaries
- Code is in the correct scope (shared code in
packages/core, scope-specific code in its scope) - No cross-scope imports (only through
packages/core;packages/processdepends onpackages/agentfor tests only) - Controller → Service → Entity separation respected (see
packages/api/swiss_ai_hub/api/routes/agent/for reference) - New entities use MongoEngine Documents in
packages/core/swiss_ai_hub/core/persistence/<domain>/(*_entity.py) - New events follow Swiss AI Agent Protocol hierarchy (Control vs Display, see
/nats-events); events that are both extendControlAndDisplayEventand ship their own event display component inpackages/web/components/Event/Display/ - Agent classes hold
@stepmethods only; helpers live in standalone imported classes or dispatcher-injected dependencies
Coding Standards (root CLAUDE.md rules 01-20)
Review against ALL 20 Coding Conventions in the root CLAUDE.md. Flag any violations. Pay special attention to rules
that are easy to miss in diffs:
- Cross-scope imports bypassing
packages/core(rules 18-19 — linter won't catch this) - Missing
@classmethodfactories on new Pydantic models (from_entity(),from_request()) try-exceptwrappers that swallow errors instead of failing fast (rule 03)- Dataclasses or plain dicts used instead of Pydantic models (rule 02)
- New abstractions that don't follow existing patterns in the codebase (rule 16)
Security (OWASP Top 10)
- No string concatenation in queries or shell commands
- Permission checks via
Security(self.user_with_permission(...))on all new endpoints AccessChecker.from_user(user).has_access_to_agent(...)for fine-grained authorization- Secrets use
SecretStr, never plain strings - No hardcoded credentials or tokens
- Input validation at system boundaries (FastAPI path/query params, Pydantic models)
NATS & Event Patterns
- New events inherit from correct base (
ControlEvent,DisplayEvent, orControlAndDisplayEvent) - Event names follow
{Verb}{Noun}Eventconvention - NATS subjects follow the topic hierarchy classes in
packages/core/swiss_ai_hub/core/topics/(agent events:agent.{agent_class}.{agent_id}.{thread_id}.{display_id}.{run_id}.{event_type}.{event_name}.{event_id}) - Subscribers extend
AbstractSubscriber(e.g.AgentNCSubscriber) — not raw NATS subscriptions
Testing
- New code has corresponding tests in the scope's
tests/orplayground/testing/tests/directory - Tests are specific (not just "no exception") with meaningful assertions
- External services properly mocked (NATS, MongoDB, S3, LLM calls)
- BDD (pytest-bdd with
.featurefiles) for complex agent/process workflows - Test markers applied correctly (
slow,integration,flaky)
Step 4: Produce the Review
Organize findings by severity:
Format
## Critical (must fix before merge)
- [file:line] Description of the issue and why it matters
## Important (should fix)
- [file:line] Description and suggestion
## Suggestions (nice to have)
- [file:line] Description and alternative approach
## What looks good
- Brief acknowledgment of well-done aspectsRules
- Be specific: reference exact files and line numbers
- Be constructive: suggest the fix, not just the problem
- Be honest: if the code is good, say so
- Focus on substance: skip nitpicks that formatters/linters catch (ruff handles formatting, imports, pyupgrade)
- Do NOT suggest adding backwards compatibility unless explicitly asked
Examples
/review-diff— Review all changes on the current branch vs main/review-diff feat/new-agent— Review a specific branch (if provided via $ARGUMENTS)
Troubleshooting
| Problem | Solution |
| No diff found | Ensure you are on a feature branch, not main |
| Diff is very large | Focus on architectural issues first, then drill into details |
| Cannot determine scope conventions | Read the scope's CLAUDE.md for patterns |
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- faizkhairi/claude-code-blueprint★ 71same name
- huytd/skills★ 19same name
- nesnilnehc/ai-cortex★ 8same name
- tardigrde/agent-skill-eval★ 4same name
- Pradnyeshp/Claude-Skills★ 2same name
- anorth/agent-skills★ 1same name
- erikediner/skills★ 1same name
- giacomo-ciro/skills★ 1same name
- Hy0sh/claude-skills★ 1same name
- kaiitunnz/claude-skills★ 1same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- .github/actions/CLAUDE.mdCLAUDE.md
- arc42Skill
- audit-frontendSkill
- bot-frameworkSkill
- create-or-audit-claude-mdSkill
- create-or-audit-skillSkill
- create-or-audit-subagentSkill
- create-prSkill
- dagster-pipelinesSkill
- debug-agentSkill
- debug-frontendSkill
- debug-pipelineSkill
- design-systemSkill
- docker-devSkill
- document-decisionSkill
- document-featureSkill
- explainSkill
- generate-sdkSkill
- i18nSkill
- implement-feedback-from-prSkill
- likec4-dslSkill
- lintSkill
- merge-mainSkill
- nats-eventsSkill
- plan-issueSkill
- pr-demo-videoSkill
- primevue-lookupSkill
- rclone-guideSkill
- reflectSkill
- scaffold-agentSkill
- scaffold-api-endpointSkill
- scaffold-api-repositorySkill
- scaffold-api-serviceSkill
- scaffold-bot-handlerSkill
- scaffold-composableSkill
- scaffold-event-displaySkill
- scaffold-frontend-componentSkill
- scaffold-frontend-pageSkill
- scaffold-frontend-subpageSkill
- scaffold-pipelineSkill
- setup-bot-connectionSkill
- splice-issueSkill
- sync-agent-docsSkill
- test-scopeSkill
- update-docSkill
- verify-sdk-syncSkill
- write-docSkill
- write-issueSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

