| 1 | # Web agent guidance |
| 2 | |
| 3 | Read the repository guidance first. This directory is the Codewhale Next.js |
| 4 | site. |
| 5 | |
| 6 | - Repository facts are generated by `npm run prebuild` into |
| 7 | `lib/facts.generated.ts`. Change their source and regenerate; never hand-edit |
| 8 | the generated file. |
| 9 | - `data/agent-docs.generated.json`, the full text of every source named in |
| 10 | `lib/docs-map.ts`, is not tracked. `npm run prebuild`, `npm run dev` and the |
| 11 | vitest global setup derive it; never commit it. |
| 12 | - `lib/changelog.generated.ts`, `lib/release-notes.generated.ts` and |
| 13 | `lib/install-guide.generated.ts` are not tracked. `npm run prebuild`, |
| 14 | `npm run dev` and the vitest global setup derive them from `CHANGELOG.md` |
| 15 | and `docs/INSTALL.md`; never commit them. `lib/docs-preview.generated.ts` is |
| 16 | also untracked; `npm run prebuild` and `npm run dev` derive it from `docs/*.md` |
| 17 | and the Runtime API route table for the `/docs-preview` prototype. |
| 18 | - Shared public copy lives in `lib/content/`. Keep product vocabulary aligned |
| 19 | with `docs/public-surface-facts.json` and `docs/MODES.md`; extend locale data, |
| 20 | not individual pages. |
| 21 | - Localization migrations are one-way. New or touched pages use the shared |
| 22 | dictionary/content spine; do not add page-local language booleans, `isZh` |
| 23 | copy forks, or hard-coded translated page clones. A compatibility exception |
| 24 | must name the external contract that still requires it. Website/docs |
| 25 | machine translation uses `npm run i18n:gt` (local JSON catalogs into the |
| 26 | same dictionaries). Do not add `gt-next` beside that path, and do not |
| 27 | point GT at TUI locale packs. |
| 28 | - Released terminal capture metadata lives in `lib/media-manifest.ts` |
| 29 | (`TERMINAL_SCREENSHOT`), verified against `public/codewhale-tui-latest.png`. |
| 30 | - Review a change to the home headline or subhead against the churn rule in |
| 31 | `MESSAGING.md`: it needs a new decision and names the proof it retires. |
| 32 | - `AGENT.md` (singular) documents maintainer-owned community automation. Do not |
| 33 | expand its authority without Hunter. |
| 34 | |
| 35 | Choose evidence according to the claim. For a localized page, render and inspect |
| 36 | that page at representative widths and run the narrow dictionary/content check |
| 37 | if it adds useful confidence. For a build-system or release-wide change, a full |
| 38 | gate may be justified. Do not run this whole sequence by default, and do not add |
| 39 | a test merely to freeze copy or component structure: |
| 40 | |
| 41 | ```sh |
| 42 | npm ci |
| 43 | npm run prebuild |
| 44 | npm run check:facts |
| 45 | npm run check:docs |
| 46 | npm test |
| 47 | npm run lint |
| 48 | npm run build |
| 49 | ``` |
| 50 | |
| 51 | <!-- BEGIN:nextjs-agent-rules --> |
| 52 | |
| 53 | ## This is NOT the Next.js you know |
| 54 | |
| 55 | This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. |
| 56 | |
| 57 | This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. |
| 58 | |
| 59 | <!-- END:nextjs-agent-rules --> |
| 60 |