source: Klonkt/CLAUDE.md@ 3ccca13

main
Last change on this file since 3ccca13 was 87696ce, checked in by Bart <bart@…>, 3 weeks ago

De mod/-modules krijgen een cache-buster: MOD_V

/assets staat buiten development op max-age=1y, en de dynamische import van
assets/js/mod/*.js had als enige geen ?v= -- style.css, audio.css en
audio-player.js hebben er al jaren een. Gevolg: wie de pagina eerder bezocht,
draaide een jaar lang de oude module. Een reparatie bereikt dan precies de
bezoekers die de fout al hebben.

Gemerkt bij read.js: de gerepareerde module stond goed op de server (curl
bevestigde het) maar de browser bleef de oude draaien, ook na herladen en na het
wissen van de service-worker-caches. En de hernoemde klasse maakte het zichtbaar:
oude JS zet read-chrome-weg, nieuwe CSS luistert naar read-chrome-hidden, dus de
balken schoven bij die bezoekers helemaal niet meer weg.

Eén nummer voor de hele map, met de hand te bumpen; de regel staat nu ook in
CLAUDE.md en AGENTS.md, want een discipline die nergens staat is er geen.

Co-Authored-By: Claude Opus 5 <claude@…>

  • Property mode set to 100644
File size: 3.6 KB
Line 
1# Project Instructions for AI Agents
2
3This file provides instructions and context for AI coding agents working on this project.
4
5<!-- BEGIN BEADS INTEGRATION v:1 profile:minimal hash:7510c1e2 -->
6## Beads Issue Tracker
7
8This project uses **bd (beads)** for issue tracking. Run `bd prime` to see full workflow context and commands.
9
10### Quick Reference
11
12```bash
13bd ready # Find available work
14bd show <id> # View issue details
15bd update <id> --claim # Claim work
16bd close <id> # Complete work
17```
18
19### Rules
20
21- Use `bd` for ALL task tracking — do NOT use TodoWrite, TaskCreate, or markdown TODO lists
22- Run `bd prime` for detailed command reference and session close protocol
23- Use `bd remember` for persistent knowledge — do NOT use MEMORY.md files
24
25**Architecture in one line:** issues live in a local Dolt DB; sync uses `refs/dolt/data` on your git remote; `.beads/issues.jsonl` is a passive export. See https://github.com/gastownhall/beads/blob/main/docs/SYNC_CONCEPTS.md for details and anti-patterns.
26
27## Session Completion
28
29**When ending a work session**, you MUST complete ALL steps below. Work is NOT complete until `git push` succeeds.
30
31**MANDATORY WORKFLOW:**
32
331. **File issues for remaining work** - Create issues for anything that needs follow-up
342. **Run quality gates** (if code changed) - Tests, linters, builds
353. **Update issue status** - Close finished work, update in-progress items
364. **PUSH TO REMOTE** - This is MANDATORY:
37 ```bash
38 git pull --rebase
39 git push
40 git status # MUST show "up to date with origin"
41 ```
425. **Clean up** - Clear stashes, prune remote branches
436. **Verify** - All changes committed AND pushed
447. **Hand off** - Provide context for next session
45
46**CRITICAL RULES:**
47- Work is NOT complete until `git push` succeeds
48- NEVER stop before pushing - that leaves work stranded locally
49- NEVER say "ready to push when you are" - YOU must push
50- If push fails, resolve and retry until it succeeds
51<!-- END BEADS INTEGRATION -->
52
53
54
55## Build & Test
56
57```bash
58npm start # production: node src/server.js
59npm run dev # watch mode
60npm test # unit tests (built-in node:test runner, no extra deps)
61```
62
63Tests live in `test/*.test.js` and run against an in-memory SQLite
64(`DATABASE_PATH=':memory:'`), so they never touch real data. Cover new
65permission logic with tests — `PermissionsService.canAdminSite` was once
66silently broken; see `test/site-permissions.test.js`.
67
68## Architecture Overview
69
70_Add a brief overview of your project architecture_
71
72## Conventions & Patterns
73
74- **Bump `MOD_V` whenever you change anything in `src/assets/js/mod/`.** It sits
75 at the top of the module loader in `src/views/shell.ejs` and is the
76 cache-buster for every page module. `/assets` is served `max-age=1y` outside
77 development, so without a bump a browser that visited before keeps running the
78 old module for a year — meaning a fix reaches everyone *except* the people who
79 already have the bug. Same discipline as `audio-player.js?v=N` a few hundred
80 lines up. One number for the whole directory: bumping too often costs one
81 download, bumping too rarely costs a bugfix that never arrives.
82
83- **Comments and commit messages in Dutch, identifiers in English.** The modules
84 in `assets/js/mod` read `setIcon`, `uploadOne`, `applyAccent`; the comments
85 around them are Dutch prose. Both halves matter — a Dutch identifier in an
86 English file is the same wrong note as an English comment in a Dutch one. This
87 extends to anything long-lived and outward-facing: URL paths and CSS class
88 names are English (`/read`, `.read-end`), never a Dutch verb form.
Note: See TracBrowser for help on using the repository browser.