claude-review
AGENTS.md2 starsChanged 5 months agoMITView on GitHub
Browser-based code review tool for Claude Code. Shows git diffs in a GitHub-style UI, lets you write inline comments, sends formatted feedback back to Claude. All Python commands use uv — never use pip or manually activate a virtualenv. Use uv init to initialize, uv add to add dependencies (NEVER specify a version — let uv resolve), uv run to execute anything. DDD-lite with clean layer separation: Dependencies flow inward: presentation → services → domain, repositories → domain
- Installs packages
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,638 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
23 rules. About 1 is common, 9 are distinctive, and 13 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
All Python commands use uv — never use pip or manually activate a virtualenv.
- Distinctive: line 84
TDD: write tests BEFORE implementation.
- Very specific: line 88
Python deps: add via uv add (never specify version), never pip, never manually edit pyproject.toml deps
- Very specific: line 89
JS deps: add via pnpm add / pnpm add -D (never specify version), never manually edit package.json deps
- Very specific: line 92
Type hints: all function signatures, modern syntax (str | None, list[X])
- Very specific: line 94
Enums: use StrEnum with auto() for all string enumerations
- Very specific: line 95
Test selectors: use data-testid attributes for targeting elements to interact with (click, type, check disabled).
- Very specific: line 100
Use uv for everything Python (uv init, uv sync, uv run, uv add without version)
- Very specific: line 101
Use pnpm for everything JS (pnpm add / pnpm add -D without version, pnpm run)
- Distinctive: line 102
Use Pydantic models, not plain dataclasses
- Very specific: line 103
Run tests (uv run pytest), linter (uv run ruff check src/), and type checker (uv run ty check src/) after changes
- Distinctive: line 104
Use structlog for logging, never print()
- Distinctive: line 105
Use type hints on all function signatures
- Distinctive: line 114
Use pip or activate venv manually
- Distinctive: line 115
Use plain dataclasses (always Pydantic BaseModel)
- Very specific: line 116
Put any code in __init__.py files (no re-exports, no version, nothing)
- Distinctive: line 117
Use generic Exception for error handling
- Common: line 118
Commit secrets or credentials
- Distinctive: line 122
Before presenting work, review every changed file against these principles:
- Distinctive: line 144
After any meaningful change, follow this checklist (details in CONTRIBUTING.md):
- Very specific: line 147
Update skill files if description or usage changed: plugin/commands/review-ui.md and skills/review-ui/SKILL.md And if the release is worth …
- Very specific: line 149
Update README.md features, TODO.md (remove completed items)
- Very specific: line 152
After the Release workflow is green, update local skill: npx skills update review-ui -g -y
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude Review
Browser-based code review tool for Claude Code. Shows git diffs in a GitHub-style UI, lets you write inline comments, sends formatted feedback back to Claude.
Commands
uv sync # Install Python dependencies
uv run pytest # Run all Python tests
uv run pytest tests/unit/ # Unit tests only (pure logic, no I/O)
uv run pytest tests/integration/ # Integration tests (real git, real server)
uv run pytest tests/e2e/ # E2E tests (Playwright browser)
uv run ruff check src/ # Lint Python
uv run ruff format src/ # Format Python
uv run ty check src/ # Type check Python
uv run claude-review diff # Run the tool (diff mode)
uv run claude-review diff --base HEAD~3 # Diff since a specific commit
uv run claude-review files f.md # Run the tool (files mode)
uv run claude-review transcript c.jsonl # Run the tool (transcript mode)
uv run claude-review --port 8080 diff # Run on specific port
cd frontend && pnpm install # Install frontend dependencies
cd frontend && pnpm build # Build frontend (outputs to src/claude_review/static/dist/)
cd frontend && pnpm test # Run frontend tests
cd frontend && pnpm lint # Lint frontend
cd frontend && pnpm check # Type check frontendAll Python commands use uv — never use pip or manually activate a virtualenv. Use uv init to initialize, uv add to add dependencies (NEVER specify a version — let uv resolve), uv run to execute anything.
Tech Stack
- Python 3.14 — modern syntax (type parameter syntax, match,
str | None) - uv — project init, dependency management, running everything
- hatchling — build system
- FastAPI + uvicorn — async web server
- Pydantic — all models (domain, schemas)
- structlog — structured logging
- ruff — lint + format
- pytest + pytest-asyncio — Python tests
- Svelte 5 — frontend (runes:
$state,$derived,$effect) - Vite 8 — frontend build tool
- TypeScript — strict mode, no
any - Tailwind CSS 4 + DaisyUI 5 — styling
- pnpm — JS package manager
- Vitest + @testing-library/svelte — frontend unit tests
- Playwright (Python, pytest-playwright) — E2E tests
- ESLint + Prettier + svelte-check — frontend code quality
Architecture
DDD-lite with clean layer separation:
- domain/ — Pydantic models (DiffFile, Comment, ReviewResult). No I/O, no framework imports.
- services/ — orchestration (DiffService, TextFileService, TranscriptService, ReviewService, TranscriptReviewService). Depends on domain + repository protocols.
- repositories/ — infrastructure boundary (GitRepository). Protocol-based for testability.
- presentation/ — FastAPI routes + Pydantic schemas +
Depends()DI. Routes declare dependencies explicitly.
Dependencies flow inward: presentation → services → domain, repositories → domain
Code Style
# Domain — pure models, no I/O
class FileStatus(StrEnum):
MODIFIED = auto()
ADDED = auto()
# Protocols — interfaces for infrastructure
class GitRepositoryProtocol(Protocol):
async def get_raw_diff(self, path: Path) -> str: ...
# Presentation — FastAPI routes with Depends() DI
@router.post("/submit")
async def submit_review(
request: SubmitRequest,
state: ServerState = Depends(get_state),
mode: ReviewMode = Depends(get_review_mode),
) -> SubmitResponse:
...Conventions
- TDD: write tests BEFORE implementation. Tests encode functional requirements, not implementation details.
- Test what the user cares about: "diff shows all changed files", not "parse_hunk returns a list"
- Modules:
__init__.pymust be empty — no code, no re-exports, nothing - Error handling: specific exceptions, not generic
Exception - Python deps: add via
uv add(never specify version), never pip, never manually edit pyproject.toml deps - JS deps: add via
pnpm add/pnpm add -D(never specify version), never manually edit package.json deps - TODO/Changelog: track in
TODO.md/CHANGELOG.md - Logging: DEBUG for timing/perf, INFO for operations, WARNING for recoverable issues, ERROR for failures
- Type hints: all function signatures, modern syntax (
str | None,list[X]) - Async:
async/awaitfor all I/O, no sync blocking calls - Enums: use
StrEnumwithauto()for all string enumerations - Test selectors: use
data-testidattributes for targeting elements to interact with (click, type, check disabled). UsegetByText/text=only for asserting visible content the user sees. Never use CSS class selectors in tests. Adddata-testidto every new button, input, textarea, and container.
Boundaries
Always:
- Use
uvfor everything Python (uv init,uv sync,uv run,uv addwithout version) - Use
pnpmfor everything JS (pnpm add/pnpm add -Dwithout version,pnpm run) - Use Pydantic models, not plain dataclasses
- Run tests (
uv run pytest), linter (uv run ruff check src/), and type checker (uv run ty check src/) after changes - Use structlog for logging, never print()
- Use type hints on all function signatures
- async/await for all I/O
Ask first:
- Adding new dependencies
- Architecture changes
- Changing domain models
Never:
- Use pip or activate venv manually
- Use plain dataclasses (always Pydantic BaseModel)
- Put any code in
__init__.pyfiles (no re-exports, no version, nothing) - Use generic Exception for error handling
- Commit secrets or credentials
Self-Review
Before presenting work, review every changed file against these principles:
Clean and readable — each function does one thing. No god methods. Decompose like existing services do (e.g. DiffService has _parse_diff, _parse_file_chunk, _extract_path, _detect_status, _parse_hunks, _build_hunk).
Well documented / self-documenting — names explain intent. Non-obvious patterns get a one-line comment (e.g. # Only close when clicking the backdrop itself, not the modal content). Module docstrings explain why, not just what.
Functional tests — tests verify user-facing behavior, not internal data structures. Test names read like requirements: "file content is preserved line by line", not "returns list of DiffLine with type CONTEXT". Compare tests/integration/test_diff_service.py for the standard.
Modular — components and services are independently testable. Dependencies are explicit (FastAPI Depends(), constructor injection). No hidden coupling between layers.
No meaningless defaults — required parameters must be explicit. If a caller must always provide a value, don't give it a default that silently hides bugs. Optional parameters (like body: str | None = None) are fine when the absence is a valid state.
Extensible for future modes — new review modes (transcript, etc.) should work by adding code, not modifying existing conditionals. Use isDiffMode checks (opt-in to diff-specific behavior) rather than !isFilesMode checks (which break when a third mode is added). Use lookup maps for mode-dependent values (see sidebarTitle in FileList.svelte).
Commit Messages
Conventional Commits: type(scope): description
Types: feat fix docs style refactor perf test build ci chore
Releasing
After any meaningful change, follow this checklist (details in CONTRIBUTING.md):
- Bump version in
pyproject.toml,plugin/.claude-plugin/plugin.json, andCHANGELOG.md(keep in sync) - Update skill files if description or usage changed:
plugin/commands/review-ui.mdandskills/review-ui/SKILL.mdAnd if the release is worth telling a returning reader about, write its entry infrontend/src/lib/guide/news.tsunder the same version — the review shows it once to whoever last saw an older release - Update
README.mdfeatures,TODO.md(remove completed items) - Commit:
chore: release vX.Y.Z - Push + tag:
git push origin master && git tag vX.Y.Z && git push origin vX.Y.Z— the tag triggersrelease.yml: full CI suite, artifact verification (scripts/verify_artifacts.py), then PyPI publish (tag must matchpyproject.tomlversion) - After the Release workflow is green, update local skill:
npx skills update review-ui -g -y - Reinstall CLI locally:
uv tool install --upgrade --editable .
Documentation
README.md— project overview, usage, installationCHANGELOG.md— what changed and whenTODO.md— planned work (remove items when done, don't check them off)CONTRIBUTING.md— dev setup, conventions for contributorsSECURITY.md— vulnerability reporting
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.

