|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- `src/app` hosts Next.js App Router routes: `(home)` for the landing page, `docs` for the spec, and `api` for server handlers. |
| 5 | +- Shared React lives in `src/components`; cross-cutting layout and data helpers sit in `src/lib`. |
| 6 | +- Canonical docs and examples live under `content/docs` and `content/references`; keep folder slugs stable to preserve OG images and LLM exports. |
| 7 | +- ReScript sources (`*.res`) output tracked `.res.mjs`; edit the `.res`, commit the pair, and treat the artefact as a snapshot check. |
| 8 | +- Root configs (`next.config.mjs`, `middleware.ts`, `source.config.ts`) handle routing and static generation—mirror their patterns when extending. |
| 9 | + |
| 10 | +## Build, Test, and Development Commands |
| 11 | +- `bun install` refreshes dependencies after pulling. |
| 12 | +- `bun run docs:dev` launches the Turbo dev server at `http://localhost:3000`. |
| 13 | +- `bun run docs:build` runs the production pipeline; execute before every PR. |
| 14 | +- `bun run docs:start` serves the build for smoke-testing. |
| 15 | +- `bun run res:dev` watches ReScript; `bun run res:build` performs a clean compile; pair with `bun run res:clean` if artefacts drift. |
| 16 | + |
| 17 | +## Coding Style & Naming Conventions |
| 18 | +- TypeScript/TSX follows Prettier defaults (2-space indent, semicolons, single quotes); rely on format-on-save or `bunx prettier`. |
| 19 | +- Export React components in PascalCase and keep route file names lowercase. |
| 20 | +- Prefer explicit bindings in ReScript and TitleCase module names; avoid unchecked external calls. |
| 21 | +- MDX files need concise frontmatter and relative links so the Fumadocs loader resolves correctly. |
| 22 | + |
| 23 | +## Testing Guidelines |
| 24 | +- No automated suite yet—ensure `bun run docs:build` succeeds and manually spot-check `/` and `/docs`. |
| 25 | +- Review the generated `.res.mjs` diff for ReScript changes to catch compiler regressions. |
| 26 | +- Add MDX demos for new interactive components and document manual QA steps in PRs. |
| 27 | + |
| 28 | +## Commit & Pull Request Guidelines |
| 29 | +- Commit history skews toward short descriptive subjects; keep messages imperative, ≤72 characters, with detail in the body. |
| 30 | +- Reference related issues and note affected routes or content directories. |
| 31 | +- PRs should include a summary, verification checklist, and visuals for UI or content shifts; request review from domain owners and wait for a clean build. |
| 32 | + |
| 33 | +## Architecture Overview |
| 34 | +- Next.js 15 powers the app, with Fumadocs loaders defined in `src/lib/source.ts`; OG images and LLM extracts rely on stable slugs, so avoid renaming docs without redirects. |
| 35 | + |
| 36 | +## Issues |
| 37 | +We track work in Beads instead of Markdown. Run `bd quickstart` to see how. |
0 commit comments