Guidance for AI coding agents and new contributors. Read this before changing code. ForgeKit is a pnpm + turbo monorepo; this file covers conventions and boundaries and does not repeat the README.
- README.md - the package layout, the enforced dependency-flow graph, the gates, and the two Turbo traps (result caching and dist-consumption).
- docs/ (see docs/README.md) - the per-feature source of truth for mechanism and behavior. When you change a feature, update its doc in the same change. Keep docs mechanism-focused: do not record progress or status in them (it goes stale and misleads), read the current state from the code and git history instead.
- plan/ is a separate, private repository (git-ignored here). Do not read it, cite it, or copy anything from it into this repo's code, comments, commits, or docs. Everything you need is in the code and
docs/.
Not all of these are lint-enforced, so follow them by hand.
- Strict TypeScript. Named exports only; explicit return types on exported functions and components.
anyis a lint error. - Module resolution is NodeNext. Every relative import and re-export uses the eventual
.jsextension (import { x } from "./x.js"). UnderverbatimModuleSyntax, useimport typefor types and derive third-party prop types rather than value-importing them.exactOptionalPropertyTypesandnoUncheckedIndexedAccessare on. - Comments earn their place. A one-line header where a file's role is not obvious from its path; JSDoc on every exported symbol whose purpose is not obvious from its name; a WHY comment for non-obvious wiring. Never restate the code.
- Tests live in
__tests__beside the source. Keep route and service files small, splitting by sub-feature well before they reach roughly 400 lines. - Custom lints enforce the layering (
dependency-flow) and safe database mutations (no-unscoped-db-mutation); see docs/eslint-rules/.
Run pnpm build, pnpm lint, pnpm typecheck, and pnpm test from the root (see README, "Gates"). Turbo caches results, so force a real run with TURBO_FORCE=true. A package is consumed as its built dist/, so rebuild it (or run through Turbo) before typechecking or testing a dependent directly.
- No em dashes anywhere. Use commas, colons, parentheses, or a spaced hyphen ( - ).
- No tool attribution. No "Generated with ..." lines in PRs, no
Co-Authored-Bytrailers for tools, and the commit author and contributor list is the maintainer only.