Files
photoreport/AGENTS.md
sparkandClaude Opus 5.5 02eb41060e
ci / rust (push) Failing after 53s
ci / typescript (push) Failing after 1m44s
feat(api): accounts, organizations and auth schema; CI with Postgres (1/10)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
2026-10-11 14:39:11 +01:00

31 lines
2.2 KiB
Markdown

# Rules for agents (Paperclip, Claude Code, Cursor)
Read `docs/ARCHITECTURE.md` before any task. One task id per branch/PR (`task/BIT-<id>-short-slug`).
## Non-negotiables
1. **LightCraft is consumed, never forked.** Only `engine/core` imports `lightcraft-*` crates. Pin by `rev` in
the root `Cargo.toml`. A bump is its own PR and must pass the reference-image tests. Missing engine features
go upstream as PRs to storytold/lightcraft.
2. **Edits are commands, not pixels.** Every edit is an `EditCommand` (`packages/contracts`, mirrored in
`engine/core`). The server assigns a per-photo `seq`; clients replay from a `seq`.
3. **Files and edits travel separately.** Uploads go through the queue (tus / SFTPGo); edits through Socket.io.
4. **Organizations from day one.** Every row that belongs to someone carries `organization_id`. Agency mode and
independent-photographer mode are an organization setting, not separate code paths.
5. **No Adobe assets or names in the UI.** Same workflow as Lightroom, original icons, labels and presets.
6. **Biometrics are opt-in per organization** and the legal basis is stored with the setting.
7. **No third-party AI by default.** Faces and OCR run locally; external fallbacks are opt-in per organization.
8. **Language:** code, comments, identifiers and commit messages in English. User-facing copy via i18n (pt-PT first).
9. **Never commit** secrets, `.env`, generated status/summary markdown files, or build output. Deploys never
overwrite a server `.env` (norm BIT-25005, `docs/DEPLOY.md`).
10. **Tests touch real infrastructure safely:** API tests run against PostgreSQL and only on a database whose name
ends in `_test`. Never run `prisma migrate reset` or other destructive commands against shared databases.
11. **Green CI before merge:** `pnpm -r build && pnpm -r typecheck && pnpm -r test` and `cargo fmt --check`,
`cargo clippy -D warnings`, `cargo test`.
## Porting from the old projects
Port logic and tests, not UI. Sources: `BitReport.pt/app.photoreport.pt`, `BitReport.pt/events.photoreport.pt`,
`BitReport.pt/PhotoReport_Studio`. Keep behaviour identical unless the task says otherwise, and note the
original file in the PR description.