mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-05 09:08:20 +01:00
Best-practices pass on the Phase 1 composer + standards reflected in docs so they don't need restating: - resolve route now derives intent ids from ORCHESTRATION_TASK_INTENT_IDS (SSOT) instead of a hardcoded local copy; type is OrchestrationTaskIntentId. - palette status line uses a new neutral `ui-palette-status` class instead of reusing the negative/error class (design discipline — no stray design). - CONTRIBUTING "Engineering Standards" now names the full bar (first-principles, SSOT, DRY, SoC, no god files, no hardcoded values, four-layer design system, config-driven, validate-at-boundary) and points to the global standards in CLAUDE.md as the authoritative source. - loki-command-surface.md references those standards. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2.8 KiB
2.8 KiB
Contributing
FleetCrown 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.mdCLAUDE.mddocs/architecture-first-principles.md- relevant domain files in
src/db/schema,src/db/queries, andsrc/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 ortailwind.config. Run the audit grep inCLAUDE.mdbefore 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:
npx tsc --noEmit
npm run lint
npm run check:design
npm run test:control-presenter
npm run test:home
npm run test:db-url
npm run test:orchestration-summary
npm run build
npm run smoke
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.