You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guidance for AI agents (Claude Code, Codex, Cursor, etc.) working in this repository.
4
+
5
+
## Repository
6
+
7
+
ObjectOS — customer-hosted runtime for ObjectStack applications. Monorepo with the marketing + docs site under `apps/docs`.
8
+
9
+
## Critical rules
10
+
11
+
### 1. English is the single source of truth for all content
12
+
13
+
All marketing copy, UI strings, and documentation are authored in **English first**. Chinese (`cn`) and any future locales are **translations derived from English**.
14
+
15
+
-**Always edit the English source first.** Never patch a translation without updating the English original — translation passes will overwrite you.
16
+
- If a typo or wording change only appears in Chinese, fix English too (it almost certainly has the same issue or will after the next sync).
17
+
- New content must be added to English before translations are touched.
18
+
- Translations are derived artifacts; treat them like generated code that happens to be checked in.
19
+
20
+
### 2. Test in a real browser before claiming UI work is done
21
+
22
+
Type-checks and unit tests verify code correctness, not feature correctness. For any UI change in `apps/docs`, run the dev server and exercise the change in a browser before reporting done. If a tool can't drive a browser, say so explicitly rather than guessing.
23
+
24
+
## apps/docs (Fumadocs site)
25
+
26
+
Stack: Next.js 16 App Router + Fumadocs UI 16 + Fumadocs MDX. Many UI affordances (theme toggle, search modal, language switcher, sidebar, link rendering) come from Fumadocs components, not custom code. Check `node_modules/fumadocs-ui` before assuming something is broken in app code.
27
+
28
+
### Where things live
29
+
30
+
| Concern | File |
31
+
|---|---|
32
+
| Locale list & default |`apps/docs/lib/i18n.ts`|
33
+
| Language display names |`apps/docs/app/[lang]/layout.tsx` (`LANGUAGE_NAMES`) |
- Default locale has no prefix (`/docs/...`); other locales are prefixed (`/cn/docs/...`). This is set by `hideLocale: 'default-locale'` in `lib/i18n.ts`.
44
+
-**MDX translations:** add a sibling file with `.cn.mdx` next to the English `.mdx`. Fumadocs auto-falls-back to English when a translation is missing — you can ship translations incrementally without breaking links.
45
+
-**Homepage strings:** must exist in both `en` and `cn` objects in `lib/homepage-i18n.ts` (they implement the `HomepageTranslations` interface; missing keys are a type error).
46
+
-**Sidebar titles:**`meta.json``title` fields currently render in all locales. If you localize sidebar labels, add per-locale `meta.cn.json` (Fumadocs convention) — don't translate inside the English file.
47
+
48
+
### Sidebar grouping
49
+
50
+
Folder `meta.json` files declare a section's title, page order, and `defaultOpen: false` to make the group collapsible and collapsed by default. The root `content/docs/meta.json` references folders by name (`"deploy"`, `"build"`, …), not by the `"...deploy"` spread + `---Deploy---` separator pattern (the old pattern produced a flat ~50-item sidebar).
51
+
52
+
### Translation workflow
53
+
54
+
When the English source changes:
55
+
1. Edit the English `.mdx` / `en` object first; verify it renders.
56
+
2. Update the `.cn.mdx` / `cn` object to match.
57
+
3. If a `.cn.mdx` doesn't exist yet, that's fine — Fumadocs falls back to English. Create one when you're ready to translate, not as a stub.
- Don't reintroduce the `---Section---` + `"...folder"` flat sidebar pattern.
63
+
- Don't set `alt="ObjectOS"` on the logo image when the adjacent text already says "ObjectOS" — screen readers read it twice. Use `alt=""` + `aria-hidden`.
64
+
- Don't add Chinese-only strings or files. If it doesn't have an English source, it shouldn't exist yet.
65
+
66
+
## Commands
67
+
68
+
From `apps/docs/`:
69
+
-`npm run dev` — dev server on http://localhost:3001
70
+
-`npm run type-check` — `fumadocs-mdx && next typegen && tsc --noEmit`
0 commit comments