|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Before opening a PR or pushing a branch |
| 6 | + |
| 7 | +Run a self-check on the diff before creating a PR or pushing: |
| 8 | +1. Compute effective LoC — exclude lockfiles, generated files, snapshots, and vendor code. |
| 9 | +2. Count effective touched files — exclude the above plus one-to-one test pairs. |
| 10 | +3. If effective LoC > 400 or effective files > 10, stop and propose a split before proceeding. |
| 11 | +4. Report the result inline before continuing. |
| 12 | + |
| 13 | +## Key Principles |
| 14 | + |
| 15 | +- Search the codebase before assuming something isn't implemented |
| 16 | +- Write comprehensive tests with clear documentation |
| 17 | +- Follow Test-Driven Development when refactoring or modifying existing functionality |
| 18 | +- Always write tests for new functionality you implement |
| 19 | +- Keep changes focused and minimal |
| 20 | +- Follow existing code patterns |
| 21 | +- Prefer the `ddt` package for parameterized tests to reduce code duplication |
| 22 | + |
| 23 | +## Documentation & Institutional Memory |
| 24 | + |
| 25 | +- Document new functionality in `docs/references/` |
| 26 | +- When you learn something important about how this codebase works (gotchas, non-obvious |
| 27 | + patterns, integration quirks), capture it in the relevant `docs/references/` file or |
| 28 | + in `docs/architecture-patterns.md` |
| 29 | +- These docs are institutional memory - future sessions (yours or others) will benefit |
| 30 | + from what you record here |
| 31 | + |
| 32 | +## Testing Notes |
| 33 | + |
| 34 | +- Uses pytest with Django integration |
| 35 | +- Coverage reporting enabled by default |
| 36 | +- PII annotation checks required for Django models |
0 commit comments