Files
loki/CONTRIBUTING.md
CatoandClaude Fable 5.1 95c40a9cd8 refactor: rename the product from FleetCrown to Loki (#695)
The product, its assistant, the repo, the host and every unit on the box now
share one name. 638 files, ~3,000 mentions: UI copy, config, env keys
(FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs,
articles, the deploy workflow other repos reuse, and nine file names.

- Three article slugs carried the old name and had been shared; permanent
  redirects keep those links alive (next.config.ts).
- test-no-retired-name.sh now also forbids the old product name across the
  whole repo, so the rename cannot creep back through templates and examples.
- ASSISTANT_STACK collapses the product and the assistant into one entry,
  because they are now the same name.

Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki`
database and role, loki.orangecat.ch (old host 308s to it; /api, /widget,
/embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases.
The Resend sending domain stays fleetcrown.orangecat.ch until the new domain
is verified in DNS.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:13:10 -07:00

2.7 KiB

Contributing

Loki is optimized for clear ownership, tight feedback loops, and production trust. Changes should be small enough to review and strong enough to ship.

Before Editing

Read:

  • README.md
  • CLAUDE.md
  • docs/architecture-first-principles.md
  • relevant domain files in src/db/schema, src/db/queries, and src/components

Engineering Standards

These are non-negotiable and apply to every change. The authoritative, detailed source is the global engineering standards imported at the top of CLAUDE.md (@~/.claude/CLAUDE.md), plus docs/architecture-first-principles.md and the four-layer design system documented in CLAUDE.md. This list is the quick checklist; read those for the "why". These are the bar — they should not need restating per task.

  • First-principles, not analogy. Derive each decision from the actual problem and constraints, not "other projects do X".
  • SSOT. Every fact lives in exactly one place. Types derive from schemas; options/labels/constants/intents come from config, never re-listed (e.g. intent ids come from ORCHESTRATION_TASK_INTENT_IDS, never a local copy).
  • DRY. Reuse existing primitives, hooks, API helpers, queries, and ui-* classes before writing new ones. Extract on the third repetition, not the first.
  • SoC. config/ = what exists; lib/domain = logic; app/api = thin HTTP; components = rendering; hooks = data/state. No business logic in components.
  • No god files. Split anything that grows past ~300 lines or owns >1 concern.
  • No hardcoded values. No magic strings/numbers/stats in code or JSX — source them from config or the database.
  • Design discipline (no stray design). All visual decisions flow through the four layers (globals.css tokens → @theme → ui-* classes → JSX). Never put raw hex/rgb, palette colors, or arbitrary sizes in JSX or tailwind.config. Run the audit grep in CLAUDE.md before committing UI.
  • Config-driven over code-driven for anything that changes.
  • Validate inputs at the route boundary; preserve user/tenant scoping in every query.
  • Modern stack, used correctly (Next 16 App Router, TS strict, Drizzle, Tailwind 4).
  • Keep local-runtime behavior behind the daemon/bridge contracts.

Required Checks

Run the relevant subset while developing. Before pushing a broad change, run:

pnpm run verify   # the canonical gate — CI runs exactly this
pnpm run build
pnpm run smoke    # needs the dev server up

Pull Requests

A good PR explains:

  • what changed
  • why the change matters
  • how it was verified
  • any production or migration steps
  • remaining risks or follow-up work

Do not hide known risk in a summary. Put it directly in the PR.