code-review
Skill0 starsChanged 7 months agoMITView on GitHub
Review changed code against project standards. Checks for missing tests, dead code, type safety, lint issues, and coding conventions. Run after completing any implementation work.
194 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- mdiri-ai/SoduWorktheir own version, first seen Nov 15, 2026
- microsoft/vscodetheir own version, first seen Nov 12, 2026
- doggy8088/spec-kittheir own version, first seen Nov 9, 2026
- strelov1/freehiretheir own version, first seen Nov 9, 2026
- storybookjs/storybooktheir own version, first seen Nov 8, 2026
- codewithmukesh/dotnet-claude-kittheir own version, first seen Nov 8, 2026
Used with
Projects with it also use close-spec, design-with-images and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
dzhngSkillclose-spec
When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).
Also in 5 projects that use this
dzhngSkilldesign-with-images
Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.
Also in 5 projects that use this
PydanticSkilladd-new-model
Add support for a newly-released language or image generation model in pydantic-ai (e.g. openai:gpt-5.6, anthropic:claude-sonnet-5, openai:gpt-image-2). Use when a provider ships a new model id and you need to wire literals, profile flags, adapters, and tests to recognize it. Handles SDK-lag, gateway list conventions, capability probing, and direct image-model geometry.
Also in 9 projects that use this
transitive-bullshitSkillcompare-screenshots
Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.
Also in 5 projects that use this
Microsoft AzureSkillazsdk-common-apiview-feedback-resolution
Analyze and resolve APIView review feedback on Azure SDK PRs. **UTILITY SKILL**. USE FOR: APIView comments, API review feedback, SDK API surface changes. DO NOT USE FOR: general code review, non-APIView feedback. INVOKES: azure-sdk-mcp:azsdk_apiview_get_comments, azure-sdk-mcp:azsdk_customized_code_update, azure-sdk-mcp:azsdk_typespec_delegate_apiview_feedback, azure-sdk-mcp:azsdk_run_typespec_validation, azure-sdk-mcp:azsdk_package_generate_code.
Also in 6 projects that use this
Microsoft AzureSkillazsdk-common-generate-sdk-locally
Generate and finalize Azure SDKs locally from TypeSpec, including build, checks, tests, changelog, metadata, and version updates by default. WHEN: "generate SDK locally", "build SDK", "run SDK tests", "run CI checks", "validate package", "run checks", "update changelog", "fix SDK build errors", "resolve SDK generation errors", "customize TypeSpec", "rename SDK client", "rename SDK model", "hide operation from SDK", "fix analyzer errors", "resolve customization drift", "create subclient", "update metadata", "update version". INVOKES: azsdk_verify_setup, azsdk_package_generate_code, azsdk_package_build_code, azsdk_package_run_check, azsdk_package_run_tests, azsdk_customized_code_update, azsdk_package_update_changelog_content, azsdk_package_update_metadata, azsdk_package_update_version.
Also in 6 projects that use this
- +4 more from dzhng
- +2 more from Azure
Other versions194 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- vectorize-io/hindsight★ 60k17% same
Wrote their own version · 193
- mattpocock/skills★ 309ksame name
- TheAlgorithms/Python★ 226ksame name
- microsoft/vscode★ 195ksame name
- github/spec-kit★ 150ksame name
- ggml-org/llama.cpp★ 134ksame name
- supabase/supabase★ 115ksame name
- storybookjs/storybook★ 91ksame name
- shareAI-lab/analysis_claude_code★ 80ksame name
- shareAI-lab/learn-claude-code★ 80ksame name
- dbeaver/dbeaver★ 52ksame name
183 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 repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- hindsight-cloudSkill
- hindsight-docsSkill
- hindsight-localSkill
- hindsight-self-hostedSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 0 are common, 13 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 184 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Read and internalize these standards before writing code.
- Distinctive: line 20
No Python files at project root - maintain clean directory structure
- Very specific: line 25
Use Pydantic BaseModel for all data structures passed between functions
- Very specific: line 26
Use @dataclass for lightweight internal data containers when Pydantic validation isn't needed
- Very specific: line 27
Add @field_validator for type coercion (e.g., ensuring datetimes are timezone-aware)
- Very specific: line 28
Avoid dict.get() patterns - use typed model attributes instead
- Distinctive: line 63
Don't comment obvious code — only where the "why" isn't self-evident from the code itself.
- Distinctive: line 81
Don't add features, refactor code, or make "improvements" beyond what was asked
- Distinctive: line 82
Don't add unnecessary error handling for impossible scenarios
- Distinctive: line 83
Don't create helpers or abstractions for one-time operations
- Distinctive: line 84
No backwards-compatibility hacks (unused vars, re-exports, "removed" comments)
- Distinctive: line 91
Run git log --oneline main..HEAD to list all commits on the branch.
- Distinctive: line 92
Verify every commit is relevant to the feature/PR.
- Very specific: line 93
Check the branch is based on a recent origin/main (no stale base).
- Distinctive: line 97
Run git diff --name-only HEAD (unstaged) and git diff --cached --name-only (staged) to get all changed files.
- Distinctive: line 131
Check if there is a corresponding test addition or update
- Very specific: line 140
If any files in hindsight-api-slim/hindsight_api/api/ were changed:
- Very specific: line 154
If any files in hindsight-integrations/ were added or changed, verify:
- Very specific: line 162
If any new MCP tools were added or existing tools renamed in hindsight-api-slim/hindsight_api/mcp_tools.py:
- Distinctive: line 171
Check the diff for violations of the standards listed above:
- Distinctive: line 205
Do NOT auto-fix any issues.
“Common” is measured: kept by at least 6 in 10 of the 184 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
Code Review
Review all changed code against the project's quality standards and coding conventions.
Code Standards
Read and internalize these standards before writing code. The review steps below verify compliance.
Python Style
- Python 3.11+, type hints required
- Async throughout (asyncpg, async FastAPI)
- Pydantic models for request/response
- Ruff for linting (line-length 120)
- No Python files at project root - maintain clean directory structure
- Never use multi-item tuple return values — not even for internal/private functions. Always use a dataclass or Pydantic model. No exceptions, no "it's just two values" shortcuts. If a function returns more than one value, define a named type for it.
Type Safety with Pydantic Models
NEVER use raw dict types for structured data — this applies to all code, including internal helpers and private functions. If the dict has known keys, it must be a dataclass or Pydantic model:
- Use Pydantic
BaseModelfor all data structures passed between functions - Use
@dataclassfor lightweight internal data containers when Pydantic validation isn't needed - Add
@field_validatorfor type coercion (e.g., ensuring datetimes are timezone-aware) - Avoid
dict.get()patterns - use typed model attributes instead - Parse external data (JSON, API responses) into Pydantic models at the boundary
- This catches type errors at parse time, not deep in business logic
- The only acceptable
dictusage is for truly dynamic/unknown keys (e.g., arbitrary metadata, JSON blobs with no fixed schema)
# BAD - error-prone dict access
def process(data: dict) -> str:
return data.get("name", "") # No validation, silent failures
# GOOD - typed and validated
class UserData(BaseModel):
name: str
created_at: datetime
@field_validator("created_at", mode="before")
@classmethod
def ensure_tz_aware(cls, v):
if isinstance(v, str):
v = datetime.fromisoformat(v.replace("Z", "+00:00"))
if v.tzinfo is None:
return v.replace(tzinfo=timezone.utc)
return v
def process(data: UserData) -> str:
return data.name # Type-safe, validated at constructionTypeScript Style
- Next.js App Router for control plane
- Tailwind CSS with shadcn/ui components
Code Comments
- Always comment non-trivial technical decisions with the reasoning behind the choice. If someone would ask "why is it done this way?", there should be a comment.
- Keep comments up to date with history — when changing an approach, update the comment to explain what was tried before and why it was changed. Comments serve as a tracker of previous implementations that likely had problems.
- Don't comment obvious code — only where the "why" isn't self-evident from the code itself.
# BAD - no context for future readers
results = await asyncio.gather(*tasks, return_exceptions=True)
# GOOD - explains the non-obvious choice
# Use return_exceptions=True to avoid cancelling sibling tasks on failure.
# Previously we used TaskGroup but it cancelled all tasks when one failed,
# causing partial writes that left orphaned entity links (see #412).
results = await asyncio.gather(*tasks, return_exceptions=True)Branch Hygiene
- Always start new feature branches from
origin/main— rebase to ensure a clean base. - Only include commits relevant to the PR/branch/feature — no unrelated changes. If the branch contains commits that don't belong, they must be removed before merging.
General Principles
- Don't add features, refactor code, or make "improvements" beyond what was asked
- Don't add unnecessary error handling for impossible scenarios
- Don't create helpers or abstractions for one-time operations
- No backwards-compatibility hacks (unused vars, re-exports, "removed" comments)
- Three similar lines of code is better than a premature abstraction
Review Steps
1. Check branch hygiene
- Run
git log --oneline main..HEADto list all commits on the branch. - Verify every commit is relevant to the feature/PR. Flag any unrelated commits.
- Check the branch is based on a recent
origin/main(no stale base).
2. Identify changed files
Run git diff --name-only HEAD (unstaged) and git diff --cached --name-only (staged) to get all changed files. If there are no local changes, diff against the base branch using git diff main...HEAD --name-only and git diff main...HEAD to review all commits on the current branch.
3. Run linters
./scripts/hooks/lint.shReport any failures. Do NOT fix them yourself — just report.
4. Check for dead code
For each changed Python file, check for:
- Unused imports (Ruff should catch these, but verify)
- Functions/methods/classes that were added but are never called from anywhere
- Variables assigned but never read
- Commented-out code blocks that should be removed
For each changed TypeScript file, check for:
- Unused imports
- Unused variables or functions
- Commented-out code
5. Check type safety (Python)
For each changed Python file, check for violations:
- No raw
dictfor structured data — must use Pydantic model or dataclass, even for internal/private functions (only exception: truly dynamic/unknown keys) - No multi-item tuple returns — must use dataclass or Pydantic model, even for internal/private functions (no exceptions)
- Missing type hints on function parameters and return types
- Missing
@field_validatorfor datetime fields that should be timezone-aware
6. Check for missing tests
For each new or significantly changed function/endpoint/class:
- Check if there is a corresponding test addition or update
- New API endpoints MUST have integration tests
- New utility functions MUST have unit tests
- Bug fixes SHOULD have a regression test
Flag any new logic that lacks test coverage.
7. Check API consistency
If any files in hindsight-api-slim/hindsight_api/api/ were changed:
- Were the OpenAPI specs regenerated? (
./scripts/generate-openapi.sh) - Were the client SDKs regenerated? (
./scripts/generate-clients.sh) - Were the control plane proxy routes updated? (
hindsight-control-plane/src/app/api/)
8. Check code comments
For each non-trivial change:
- New non-obvious logic — is there a comment explaining the reasoning?
- Changed approach — does the comment include what was done before and why it changed?
- Stale comments — do existing comments near the changed code still accurately describe the behavior?
9. Check integration completeness
If any files in hindsight-integrations/ were added or changed, verify:
- Tests exist — the integration must have tests that simulate/exercise the external framework (not just pure unit tests of helpers). Check for a
tests/directory with meaningful test files. - CI job exists — check
.github/workflows/test.ymlfor a correspondingtest-<name>-integrationjob. If missing, flag it. - Release process — check that the integration name is in the
VALID_INTEGRATIONSarray inscripts/release-integration.sh. If missing, flag it. - Code standards — the integration code must follow all Python style rules (type hints, no raw dicts, no tuple returns, etc.).
10. Check MCP tool registration completeness
If any new MCP tools were added or existing tools renamed in hindsight-api-slim/hindsight_api/mcp_tools.py:
_ALL_TOOLSset inmcp_tools.py— must include the new tool nametools_to_registerdefault set inregister_mcp_tools()inmcp_tools.py— must include the new tool name_SINGLE_BANK_TOOLSset inhindsight-api-slim/hindsight_api/api/mcp.py— must include the new tool if it is bank-scoped (not a bank-management tool likelist_banks/create_bank)MCP_TOOL_GROUPSinhindsight-control-plane/src/components/bank-config-view.tsx— must include the new tool in the appropriate group for the UI tool selector- Tool count assertions in tests (e.g.,
test_mcp_tools.py) — must be updated to reflect the new count
11. Review against other coding standards
Check the diff for violations of the standards listed above:
- Python files at project root (not allowed)
- Missing async patterns (should be async throughout)
- Pydantic models for request/response
- Line length > 120 chars
- New features/code beyond what was asked (over-engineering)
- Unnecessary error handling for impossible scenarios
- Premature abstractions or speculative helpers
- Backwards-compatibility hacks (unused vars, re-exports, "removed" comments)
12. Report findings
Present a clear summary organized by severity:
Must fix — issues that will break CI or violate hard project rules:
- Unrelated commits on the branch
- Lint failures
- Missing type hints on public functions
- Raw dict usage for structured data (including internal code)
- Multi-item tuple returns (including internal code)
- Missing tests for new endpoints
- New integration missing tests, CI job, or release-integration.sh entry
Should fix — issues that hurt code quality:
- Dead code / unused imports missed by linter
- Missing tests for non-trivial utility functions
- Over-engineering beyond the task scope
Note — observations that may or may not need action:
- API changes that might need client regeneration
- Patterns that deviate from nearby code style
For each finding, include the file path, line number, and a brief explanation.
Do NOT auto-fix any issues. Report all findings and let the user decide what to address. If there are no findings, confirm the code looks good.
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.

