agentleFS
constkconstk/harness-python-react/CLAUDE.md

harness-python-react

CLAUDE.md2 starsChanged 7 months agoMITView on GitHub

You are working in harness-python-react, a template repo whose harness IS the product. Code quality here is enforced mechanically — every gate fails CI, not just tests. Keep that bar as you work. A production-quality LLM-driven coding harness over a minimal FastAPI + React scaffold. The point isn't the features (one /health, one /echo, one hello page); the point is that every layer of the pipeline — lint, types, architecture, security, eval, agent hooks — catches a different failure class…

  • Reads credentials

The file

We split this CLAUDE.md into the rules it gives an agent

12 rules. About 0 are common, 1 is distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Type hints: every public function. from __future__ import annotations at module top.

    line 27
  2. Very specific:

    API: every route under /api/v1/.

    line 29
  3. Very specific:

    Don't bypass gates. --no-verify / --no-hooks / --no-gpg-sign are blocked by pretooluse_bash.py for a reason.

    line 36
  4. Very specific:

    Don't introduce a new commit-type prefix without updating both pyproject.toml's commitizen schema AND pr-title.yml (the Commit-type sync …

    line 37
  5. Very specific:

    Don't add a CI job without listing it in .github/branch-protection/{develop,main}.json (the Branch-protection contexts sync meta-gate will …

    line 38
  6. Very specific:

    Don't skip the architecture contract by accident — lint-imports runs in CI and locally via just architecture.

    line 39
  7. Very specific:

    Don't write code without tests.

    line 40
  8. Very specific:

    Don't hand-roll secrets into config.

    line 41
  9. Distinctive:

    Don't create files unless they're necessary.

    line 42
  10. Very specific:

    If the change touches a gate, update the meta-gate inputs (branch-protection/*.json, pr-title.yml, check_required_contexts.py's exemption …

    line 59
  11. Very specific:

    If the change touches an invariant, decide whether the invariant is wrong (update docs/INVARIANTS.md in the same PR) or the change is wrong …

    line 60
  12. Very specific:

    If a CI job is failing for a reason that doesn't match the change, dig — don't reroll.

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
CLAUDE.md

CLAUDE.md — agent project instructions

You are working in harness-python-react, a template repo whose harness IS the product. Code quality here is enforced mechanically — every gate fails CI, not just tests. Keep that bar as you work.

What this repo is

A production-quality LLM-driven coding harness over a minimal FastAPI + React scaffold. The point isn't the features (one /health, one /echo, one hello page); the point is that every layer of the pipeline — lint, types, architecture, security, eval, agent hooks — catches a different failure class without anyone remembering to run it.

Read first

  • docs/HARNESS.md — umbrella; the controls and where they live.
  • docs/INVARIANTS.md — the load-bearing rules. Every PR is checked against them.
  • docs/BOUNDARIES.md — layered import-linter contract; reverse imports fail CI.
  • docs/DEVELOPMENT.md — branching, commit format, justfile, CI overview.

Workflow

  • One issue per change. Branch name: feat|fix|chore|docs|test|refactor/<issue-number>-<kebab-title>.
  • One PR per branch, base develop. PR title = the conventional-commit subject.
  • develop → main happens via a release: PR.
  • The pre-push gate is just check (lint + typecheck + architecture + tests). Run it before pushing.
  • For frontend changes, also run just frontend-check.

Code conventions

  • Python: 3.14, uv run --frozen everywhere, mypy --strict, ruff with the wide select set (E W F I N UP B SIM TCH S RUF).
  • Type hints: every public function. from __future__ import annotations at module top.
  • Models: anything crossing a module / process seam inherits from StrictModel (src/models/_base.py). extra="forbid". Add strict=True to the class when you want strict type coercion (rejecting "3.14" → float).
  • API: every route under /api/v1/. Typed Pydantic responses, not raw dicts.
  • Layer flow: one-way. Reverse imports are a CI failure. See docs/BOUNDARIES.md.
  • Observability: OTel agent_span(...) for any operation in the request path; semconv-defined attribute keys only (constants at the top of src/observability/spans.py).
  • Frontend: React 19 + TS strict; functional components + hooks; never dangerouslySetInnerHTML on backend output; SSE consumers use the typed primitive at frontend/src/lib/api/client.ts.

What NOT to do

  • Don't bypass gates. --no-verify / --no-hooks / --no-gpg-sign are blocked by pretooluse_bash.py for a reason. If a hook is wrong, fix the hook.
  • Don't introduce a new commit-type prefix without updating both pyproject.toml's commitizen schema AND pr-title.yml (the Commit-type sync meta-gate will fail otherwise).
  • Don't add a CI job without listing it in .github/branch-protection/{develop,main}.json (the Branch-protection contexts sync meta-gate will fail).
  • Don't skip the architecture contract by accident — lint-imports runs in CI and locally via just architecture.
  • Don't write code without tests. Coverage gate is 75% on src/.
  • Don't hand-roll secrets into config. Use env / .env (gitignored) → Settings from src/models/config.py.
  • Don't create files unless they're necessary. The scaffold has no dead modules.

Use the skills

The agent-side skills in .claude/skills/ auto-activate based on context:

  • architect — when designing module boundaries, API contracts, layer-flow decisions.
  • code-reviewer — after writing/editing code; runs the 10-point review checklist.
  • devops — when touching Docker, CI, pyproject.toml, observability config.
  • frontend — when working in frontend/ (React 19 + TS + Vite).
  • qa-engineer — when writing tests or extending the eval harness.
  • technical-writer — when updating docs / READMEs.

Trust their guidance — they encode this project's conventions.

When in doubt

  • If the change touches a gate, update the meta-gate inputs (branch-protection/*.json, pr-title.yml, check_required_contexts.py's exemption list).
  • If the change touches an invariant, decide whether the invariant is wrong (update docs/INVARIANTS.md in the same PR) or the change is wrong (rework).
  • If a CI job is failing for a reason that doesn't match the change, dig — don't reroll. Recent fix patterns: tag-vs-commit SHA in pinned action references, if: hashFiles(...) startup failures (see project-memory), pytest exit-5 on empty test suites.

The harness exists to make sloppy work hard. Lean into it — when a gate trips, it's protecting the next person reading this codebase.

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.