Plans001 2026 02 20 Plan Service
Set Up @services/plan
Overview
Set up @services/plan in the ions monorepo — a Cloudflare Workers-deployed SSR documentation site (TanStack Start + Fumadocs) that serves the @plan/ directory as a navigable, searchable docs portal at plan.atlas.prata.ma.
Modeled directly after /Users/bianpratama/Code/pra/pilot/@services/plan. The service renders all Markdown files from @plan/ as a Fumadocs site with full-text search, Mermaid diagram support, and dark/light theming via next-themes.
Goals
- Add required catalog entries to root
package.json(react, docs, style, type, infra, build additions) - Create
NETWORK.ymlat repo root establishing the15xxxport policy for ions - Create
@plan/meta.jsonfor Fumadocs navigation ordering - Scaffold
@services/plan/with all config files (package.json, tsconfig, vite, wrangler, etc.) - Implement all
src/source files (routes, components, lib) - Update
AGENTS.mdwithplancommit scope and NETWORK.yml policy - Run
bun installand verify the workspace resolves cleanly - Verify type-check passes with
bun run test:type --filter @services/plan
Non-Goals
- Deploying to Cloudflare (wrangler deploy) — config is set up but deploy is manual
- Setting up Cloudflare account/DNS
- Implementing
@services/dashboardor any other service - Adding content to
@plan/beyondmeta.json - CI/CD pipeline setup
Phases
- Phase 1: Foundation — root package.json catalogs, NETWORK.yml, @plan/meta.json (partially done)
- Phase 2: Service config — all @services/plan config files (partially done)
- Phase 3: Source files — all src/ files (routes, components, lib)
- Phase 4: Integration — bun install, AGENTS.md update, type-check verification
Success
- Root
package.jsonhas all new catalog entries (react, docs, style, type, infra, build additions, next-themes) -
NETWORK.ymlcreated withprefix: 15, plan service at port15001 -
@plan/meta.jsoncreated with correct nav ordering -
@services/plan/has all config files (package.json, tsconfig, vite, app.config, wrangler, eslint, .gitignore, source.config) - All
src/files created: router.tsx, routeTree.gen.ts, __root.tsx, index.tsx, docs/index.tsx, docs/$.tsx, api/search.ts, lib/source.ts, lib/layout.shared.tsx, components/mermaid.tsx, styles.css -
AGENTS.mdupdated withplanscope and NETWORK.yml policy -
bun installcompletes without errors -
bun run test:type --filter @services/planpasses
Requirements
- Reference implementation at
/Users/bianpratama/Code/pra/pilot/@services/plan @repo/typescript/tanstackpreset (noEmit, react-jsx, bundler resolution)@repo/lintESLint base config- Bun workspaces already configured for
@services/**in rootpackage.json - Turbo pipeline already handles
build,lint,test:type @plan/directory exists with: architecture.md, model.md, analytics.md, glossary.md, registry.md, domains/, discussions/, plans/
Context
Why This Approach
- Direct port of
@pilot/plan— same tech stack (TanStack Start + Fumadocs + Cloudflare Workers), adapted for ions branding and content - TanStack Start for consistency with planned
@services/dashboard - Fumadocs for its TanStack Start integration and built-in search/theming
- Cloudflare Workers for zero-cold-start global edge deployment
- Content in
@plan/read at build time — fully static at runtime, no DB needed
Key Constraints
- Bun catalog syntax: must add named catalogs to root
package.jsonbefore referencing withcatalog:react,catalog:docs, etc. fumadocs-mdx:collections/*is a virtual module — must be mapped in tsconfig paths to.source/*(generated at build time)routeTree.gen.tsis auto-generated by TanStack Router — seed manually for initial type-check; regenerated onvite dev- Default landing:
/docs→/docs/architecture(lowercase, matchesarchitecture.mdfilename) - Nav title and
<title>:Atlas Plan - Dev port:
15001(ions uses15xxxprefix) - Worker name:
pra-atlas-plan; prod domain:plan.atlas.prata.ma
Edge Cases
routeTree.gen.tshas@ts-nocheckandeslint-disable— never modify manually; TanStack Router regenerates on dev start- LSP errors in config files before
bun installare expected — not real errors source.config.tsglobs match actual@plan/structure:*.md,domains/**/*.md,discussions/**/*.md,plans/**/*.md- Virtual imports
fumadocs-mdx:collections/browserandfumadocs-mdx:collections/serverresolve via Vite plugin at runtime
Tradeoffs
- Seeding
routeTree.gen.tsmanually: needed fortsc --noEmitbefore firstvite dev. File is@ts-nocheckso type errors inside are suppressed. - Catalog version ranges use
^: allows minor/patch upgrades viabun upgwhile keeping major versions locked source.config.tsglobs only known subdirs: intentional — avoids pulling in unrelated markdown files
Skills
plan— plan file format and conventions (this skill)
Boundaries
- Always: Follow the exact file structure from the reference implementation
- Always: Use
catalog:references in package.json, never pin versions directly - Always: Use
workspace:*for@repo/lintand@repo/typescript - Always: Update Progress.md after each task completion
- Ask first: Any structural deviation from the reference
- Ask first: Adding dependencies not in the reference
- Never: Run
wrangler deploy— out of scope - Never: Modify
routeTree.gen.tsbeyond the initial seed - Never: Add content to
@plan/markdown files
Questions
- Deploy to Cloudflare? → Config set up; actual deploy is out of scope
- Dark/light theming? → Keep next-themes (match reference)
- Content source path? →
../../@plan - Create meta.json? → Yes: architecture → model → analytics → glossary → registry → domains → discussions → plans
- Catalog strategy? → Add all needed catalogs to root package.json
- Domains? → prod: plan.atlas.prata.ma, dev: dev.plan.atlas.prata.ma, local: plan.atlas.test
- Default landing? → /docs/architecture
- Site title? → Atlas Plan
- Port? → 15001 (15xxx prefix for ions)
- NETWORK.yml? → Create at repo root