agentleFS
vrppaulvrppaul/claude-review/AGENTS.md

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.

  • In this repository2 other files it gives its agents.

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
  1. Very specific:

    All Python commands use uv — never use pip or manually activate a virtualenv.

    line 28
  2. Distinctive:

    TDD: write tests BEFORE implementation.

    line 84
  3. Very specific:

    Python deps: add via uv add (never specify version), never pip, never manually edit pyproject.toml deps

    line 88
  4. Very specific:

    JS deps: add via pnpm add / pnpm add -D (never specify version), never manually edit package.json deps

    line 89
  5. Very specific:

    Type hints: all function signatures, modern syntax (str | None, list[X])

    line 92
  6. Very specific:

    Enums: use StrEnum with auto() for all string enumerations

    line 94
  7. Very specific:

    Test selectors: use data-testid attributes for targeting elements to interact with (click, type, check disabled).

    line 95
  8. Very specific:

    Use uv for everything Python (uv init, uv sync, uv run, uv add without version)

    line 100
  9. Very specific:

    Use pnpm for everything JS (pnpm add / pnpm add -D without version, pnpm run)

    line 101
  10. Distinctive:

    Use Pydantic models, not plain dataclasses

    line 102
  11. Very specific:

    Run tests (uv run pytest), linter (uv run ruff check src/), and type checker (uv run ty check src/) after changes

    line 103
  12. Distinctive:

    Use structlog for logging, never print()

    line 104
  13. Distinctive:

    Use type hints on all function signatures

    line 105
  14. Distinctive:

    Use pip or activate venv manually

    line 114
  15. Distinctive:

    Use plain dataclasses (always Pydantic BaseModel)

    line 115
  16. Very specific:

    Put any code in __init__.py files (no re-exports, no version, nothing)

    line 116
  17. Distinctive:

    Use generic Exception for error handling

    line 117
  18. Common:

    Commit secrets or credentials

    line 118
  19. Distinctive:

    Before presenting work, review every changed file against these principles:

    line 122
  20. Distinctive:

    After any meaningful change, follow this checklist (details in CONTRIBUTING.md):

    line 144
  21. Very specific:

    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 …

    line 147
  22. Very specific:

    Update README.md features, TODO.md (remove completed items)

    line 149
  23. Very specific:

    After the Release workflow is green, update local skill: npx skills update review-ui -g -y

    line 152

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 frontend

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.

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__.py must 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/await for all I/O, no sync blocking calls
  • Enums: use StrEnum with auto() for all string enumerations
  • Test selectors: use data-testid attributes for targeting elements to interact with (click, type, check disabled). Use getByText / text= only for asserting visible content the user sees. Never use CSS class selectors in tests. Add data-testid to every new button, input, textarea, and container.

Boundaries

Always:

  • Use uv for everything Python (uv init, uv sync, uv run, uv add without version)
  • Use pnpm for everything JS (pnpm add / pnpm add -D without 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__.py files (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):

  1. Bump version in pyproject.toml, plugin/.claude-plugin/plugin.json, and CHANGELOG.md (keep in sync)
  2. 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 telling a returning reader about, write its entry in frontend/src/lib/guide/news.ts under the same version — the review shows it once to whoever last saw an older release
  3. Update README.md features, TODO.md (remove completed items)
  4. Commit: chore: release vX.Y.Z
  5. Push + tag: git push origin master && git tag vX.Y.Z && git push origin vX.Y.Z — the tag triggers release.yml: full CI suite, artifact verification (scripts/verify_artifacts.py), then PyPI publish (tag must match pyproject.toml version)
  6. After the Release workflow is green, update local skill: npx skills update review-ui -g -y
  7. Reinstall CLI locally: uv tool install --upgrade --editable .

Documentation

  • README.md — project overview, usage, installation
  • CHANGELOG.md — what changed and when
  • TODO.md — planned work (remove items when done, don't check them off)
  • CONTRIBUTING.md — dev setup, conventions for contributors
  • SECURITY.md — vulnerability reporting

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.