This repository uses a docs-first workflow to keep AI-assisted changes reliable, reviewable, and consistent.
Docs are the contract. Code must follow docs. When docs and code conflict, resolve explicitly.
- Map / Understand (Read-only)
- Identify relevant files and current behavior using repo evidence.
- Define the contract (Docs-only)
- Create/update a feature design doc under
docs/design/or a PR brief underdocs/pr/.
- Create/update a feature design doc under
- Slice into PRs
- Break work into independently mergeable PRs.
- Implement exactly one PR at a time
- Each PR implements exactly one
docs/pr/*.md.
- Each PR implements exactly one
- Verify
- Run the repo’s verification commands (tests/lint/typecheck/build).
- Reconcile
- If implementation differs from docs, propose a patch to either code or docs.
docs/design/— feature-level contracts (goals, non-goals, behavior, invariants, test plan)docs/pr/— PR-level contracts (one file per PR, concrete and testable)docs/plan.md— short execution plan / roadmap for current initiative(s)
- Start in read-only until explicitly instructed: “enter Build Mode” or “implement PR doc X”.
- Do not edit production code while in read-only or docs-only tasks.
- If requirements are missing or ambiguous:
- STOP
- present 2–3 options with tradeoffs
- ask the minimum clarifying questions
- do not proceed without a decision
- Keep diffs small and reviewable.
- No drive-by refactors (no unrelated cleanup).
- Prefer adding new files/modules over rewriting unrelated code.
- Only touch files required by the PR contract.
- Docs must only claim what can be supported by:
- code/config/scripts in the repo, or
- explicit assumptions labeled as ASSUMPTION/UNKNOWN.
- When implementing, follow
docs/pr/<slug>.mdexactly. - If the PR brief conflicts with repo reality, stop and propose a reconciliation plan.
As this repo is migrating to React/TypeScript/Vite, follow these conventions unless the repo explicitly differs:
- Vite entry:
index.html - App entry:
src/main.tsx,src/App.tsx - Config:
vite.config.ts,tsconfig*.json - Assets:
- Static public assets:
public/ - Imported assets:
src/assets/
- Static public assets:
If deploying to GitHub Pages or any subpath:
- Validate and document
vite.config.tsbase - Ensure routing strategy works under a subpath (HashRouter or basename)
Each PR brief must include verification commands. Use the repo’s package manager and scripts. If missing, propose adding them.
Typical commands:
- Install:
npm ci(orpnpm i --frozen-lockfile/yarn --frozen-lockfile) - Dev:
npm run dev - Build:
npm run build - Preview:
npm run preview - Test:
npm run test - Lint:
npm run lint - Typecheck:
npm run typecheck(recommendedtsc --noEmit)
If commands fail, report:
- what you ran
- what failed
- the minimal fix
- whether the failure is pre-existing or introduced
- Provide a concise summary.
- Cite file paths for claims.
- List unknowns explicitly.
- Keep docs tight and actionable.
- Avoid speculative instructions.
- Start with a short plan + files to touch.
- Implement the PR contract.
- Add/update tests.
- Run verification commands and report results.
- Summarize changes + deferred items.
- One PR ↔ one
docs/pr/*.md. - PR description must link to:
- the PR brief doc (
docs/pr/...) - and any relevant design doc (
docs/design/...)
- the PR brief doc (
- If a PR changes
src/**, it should generally include a docs/pr update. - Prefer incremental PRs to large “big bang” changes.
Codex must stop and ask if:
- requirements are ambiguous
- a change would touch many unrelated files
- deployment assumptions (base path/routing) are unknown but impactful
- tests/tooling are missing and changes would be unverified