Skip to content

Commit 562e320

Browse files
committed
Add CLAUDE.md with coding and commit conventions
1 parent 342ddc7 commit 562e320

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Agent guidance
2+
3+
See [CLAUDE.md](CLAUDE.md).

CLAUDE.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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

Comments
 (0)