|
| 1 | +# Claude Code guidance for sfs-processor |
| 2 | + |
| 3 | +## Commit messages |
| 4 | + |
| 5 | +Write commit messages in English, imperative mood, sentence case, no trailing period. |
| 6 | + |
| 7 | +Follow the pattern established in this repo: |
| 8 | + |
| 9 | +- Bug fixes: `Fix: <what was broken and how>` |
| 10 | +- New additions: `Add <thing being added>` |
| 11 | +- Updates/changes: `Update <thing being changed>` |
| 12 | +- Improvements: `Improve <what improved>` |
| 13 | +- Renames/moves: `Rename <old> to <new>` |
| 14 | + |
| 15 | +When a commit closes a GitHub issue, append `(#N)` at the end. |
| 16 | + |
| 17 | +Examples from this repo: |
| 18 | + |
| 19 | +```text |
| 20 | +Fix: YAML list corruption for forarbeten in frontmatter |
| 21 | +Add GitHub Pages publishing workflow |
| 22 | +Update README.md: Clarify target-date usage |
| 23 | +Improve HTML site upload scripts |
| 24 | +``` |
| 25 | + |
| 26 | +## Code style |
| 27 | + |
| 28 | +- Python 3.10+ — use `match`, `X | Y` union types, and other modern syntax freely. |
| 29 | +- Line length: 120 characters (configured in `pyproject.toml`). |
| 30 | +- Lint and format with `ruff` before committing: |
| 31 | + |
| 32 | +```sh |
| 33 | +ruff check . --fix |
| 34 | +ruff format . |
| 35 | +``` |
| 36 | + |
| 37 | +## Tests |
| 38 | + |
| 39 | +```sh |
| 40 | +python -m pytest test/ -v |
| 41 | +``` |
| 42 | + |
| 43 | +All existing tests must pass. Tag new tests with the appropriate marker: `unit`, `integration`, `api`, or `slow`. |
| 44 | + |
| 45 | +## Architecture decisions |
| 46 | + |
| 47 | +Significant architectural choices are documented as ADRs in `docs/adr/`. If a change involves a non-obvious architectural trade-off, add or update an ADR. |
| 48 | + |
| 49 | +## Domain language |
| 50 | + |
| 51 | +`sfs-processor` converts Swedish legislation (SFS — Svensk författningssamling) from JSON to Markdown, HTML, and Git-history formats. Terms like *forarbeten*, *normtyp*, *giltighetstid*, and *SFS-nummer* are intentional Swedish legal vocabulary — do not translate or alter them. |
0 commit comments