Paper → code → Storybook is only the visual slice. Adding, changing, or removing a feature in Agata goes through many more actors: product, schema, API, app, shell catalog, Eve, billing, seed, QA, and two Vercel projects.
This page is the map. The UI slice remains in Paper → code → Storybook workflow. Operational code for agents lives in AGENTS.md and DESIGN.md. Agents skip Paper and Storybook unless the user explicitly asked.
There is no test suite. The quality gate is type-check + architecture + Biome + manual QA with the seed user, and Vercel Preview before main.
Three sizes of change#
| Size | Example | What it requires |
|---|---|---|
| Surface inside an app | Vision board in Goals | App docs, Paper, Go + schema if there is new data, services/features, i18n, Storybook pages/, seed if a demo is needed |
| New studio app | A mini-app like Pomodoro | Everything for a surface plus ProfileAppId, catalog, theme, paths, entitlement, billing if there is a quota, Eve section/tools, General + Eve + API + DB docs |
| Non-visual | Logic bug, column rename, copy | Skip Paper and Storybook unless the look changes. Docs and contract still, if behavior or schema is visible |
A tweak to an existing control does not open a new Paper file; it does leave the story aligned if the look changes.
Actors#
Each actor is a place you must touch, update, or delete when the feature comes in or goes out. Not all apply to every PR.
Intent#
| Actor | Where | When |
|---|---|---|
| Product | General tab: apps/docs/apps/… or workspace/… | Behavior, onboarding copy, what the user sees |
| Paper | Agata file, product page (or Workflow for this map) | Any new or redesigned UI. Default / Empty / Loading / Error frames |
| Visual contract | DESIGN.md §0 and Design system tab | New pattern or density, not a one-off screen |
Data contract#
| Actor | Where | When |
|---|---|---|
| Migrations | apps/api/db/migrations/ (up + down) | Table, column, index, CHECK. Run bun run api:migrate-up locally before the app |
| DB docs | Database tab + changelog | The schema the product uses |
| Go domain | apps/api/internal/<domain>/ (ports → application → adapters) + HTTP in delivery/http | Persistence or HTTP contract |
| OpenAPI | apps/api/docs/openapi.yaml and copy to apps/docs/openapi/agata-v1.yaml | Public endpoints or shapes |
| API docs | API tab (reference/, guides, changelog) | Contract that clients and Eve must respect |
Authenticated app#
| Actor | Where | When |
|---|---|---|
| Feature UI | apps/app/features/<product>/ | Screens. domains/ + local shared/; public/ only if another feature consumes it |
| Services | apps/app/services/<domain>/ (queries/, actions/, types.ts) | I/O toward Go. Do not import features/ or app/ |
| Routes | apps/app/app/(authenticated)/studios/[profileId]/… | Thin page.tsx; orchestration in *-page-content.tsx |
| Paths | apps/app/shared/navigation/paths.ts | Never hand-roll studio URLs |
| Shell catalog | apps/app/shared/constants/studio-area-catalog.ts | Area, entitlementAppId, theme, destinations, ⌘K pages, shell copy |
| App / section IDs | apps/app/shared/constants/studio-app-ids.ts, studio-section-ids.ts | New app (not a one-off screen) |
| Theme | data-app-theme + tokens in packages/ui + themes | App or area with its own accent |
| i18n | apps/app/messages/{en,es}/… | All product copy. en and es in sync |
| Quick capture / shortcuts | capture registry + ⌘K + shortcuts | If the area creates something with C or enters the palette |
| Billing | ProfileLimiter + customer entitlements + private safeguards + plans | Members, AI pools, or abuse protection |
| Audit logs | Go domain + entity path in the logs UI | Sensitive mutations |
| Seed | apps/api/internal/seed/ + bun run api:seed | Demo data in Agata Full Demo |
Agents#
| Actor | Where | When |
|---|---|---|
| Eve tools | apps/app/agent/tools/… + registry in tool-kit.ts | The user must be able to do it in natural language. See Add a tool |
| Eve instructions | apps/app/agent/lib/domains/platform/instructions.ts | New domain or a gotcha the schema does not express |
| Evals | apps/app/evals/ | Routing / gating of new tools. See Evals |
| Eve docs | Eve tab | Capability the agent exposes |
| Docs index | bun --filter app eve:index-docs | Any new or touched MDX page. Feeds Eve |
Design system and playground#
| Actor | Where | When |
|---|---|---|
@agata/ui | packages/ui/components/ | Only if a second caller needs the chrome. See Contribute to the DS |
| Component Storybook | apps/storybook/stories/<category>/ | New wrapper or changed primitive look |
| Page Storybook | apps/storybook/stories/pages/<product>/<screen>/ | Product screen. DS mocks; never import apps/app or #/* |
Config, CI, and deploy#
| Actor | Where | When |
|---|---|---|
| Env vars | Configuration tab (config/app, config/api). No .env.example | New secret or flag. Document names, not values |
| Vercel agata-app | Root apps/app | Preview per PR; Production from main |
| Vercel agata-api | Root apps/api, Dockerfile.vercel | Same. The container runs migrate up on start |
| Local / PR CI | bun run type-check, bun run lint:architecture, bun run lint:stylex, bunx biome check --write, bun --filter app check:eve-tools if there are tools | Before calling the change good |
| Docs7 | deploy from main, directory apps/docs | Product docs in prod. Public: agata.in/docs → docs.agata.in |
Two Vercel projects, not Services. The Next BFF talks to Go via GO_API_URL. In next dev a remote URL is ignored and http://localhost:8080 is used unless GO_API_ALLOW_REMOTE=1. Detail: Configuration.
Create#
Canonical order. Skip the step the size does not need; do not reorder the ones that do apply.
Decide the size
Surface, new app, or non-visual. Note which actors from the table apply. If it is a new app, entitlement and theme go in from day one — not “we’ll wire that later”.
Product docs first
Write or update the page in General (apps/docs/apps/… or workspace/…) before inventing structure. What it does, empty states, plan limits, seed. Register it in docs.json. Docs flow: Contributing to the docs.
Paper (if there is UI)
Frames in the Agata file, product page. C2 density, page family, one accent. Desktop by default; narrow frame if the layout changes. Paper HTML = reference, it is not pasted into the repo. Detail: visual workflow.
Schema and migrate
up/down pair in apps/api/db/migrations/. bun run api:migrate-up locally. Checklist: Migrations. Expand/contract in prod with data.
Go + OpenAPI
Ports → application → adapters → HTTP. Envelope and errors per conventions. Update apps/api/docs/openapi.yaml and copy it to apps/docs/openapi/agata-v1.yaml. API reference page if the domain is new or changed shape.
App: services, feature, routes
Services toward Go. UI in features/<product>/. Thin route. Paths from apps/app/shared/navigation/paths.ts. Copy en + es. Studio catalog if there is a destination, tab, or ⌘K page. Theme if the area is new.
Surrounding platform
Billing if the resource is counted. Audit log if the mutation is sensitive. Demo seed. Quick capture / C shortcut if the area creates. Legal only if consent or real personal data actually changes.
Eve (if the domain is spoken)
Tool in a file under agent/tools/, registry, instructions, routing eval if there are neighbors. bun --filter app check:eve-tools. Do not expose an endpoint Go does not have.
Storybook
DS component and/or pages/<product>/<screen>/ composition with Default / Empty / Loading / ErrorState. It must match Paper. The visual change is not done until here.
Remaining docs + index
API, DB, Design system, Eve, Config tabs as touched. bun --filter app eve:index-docs. bun --filter docs broken-links if nav changed.
Local verification
bunx biome check --write on what you touched. bun run type-check, bun run lint:architecture, and bun run lint:stylex. No bun run build unless asked. Start the API only if port 8080 is free.
Manual QA and Preview
Follow Manual lane. The PR opens app and api Previews. Do not merge to main with the happy path only local.
Edit#
Same map as create, but only the layers the diff touches. Useful questions:
- Does it change what the user sees or can do? → General + Paper (if visual) + Storybook.
- Does persistence change? → migration + DB docs + seed if the demo breaks.
- Does HTTP change? → Go + OpenAPI + API docs + services + Eve if there is a tool.
- Does navigation change? → paths + catalog + shell i18n + ⌘K.
- Does capacity change? → customer entitlements, private safeguards, billing copy, and independent seed fixtures.
- After a visual ship: update the Paper frame or mark it stale. Do not leave Paper “current” if the code diverged.
Delete what the change leaves dead: components, i18n keys, stories, re-exports. Git is the backup.
Delete#
The repo default is delete dead code, not leave stubs. Removing a feature is the create map in reverse, with two exceptions:
| Layer | What to do |
|---|---|
| Migrations | Do not rewrite history. down for dev; in prod with data, expand/contract or a drop documented in the schema changelog. Rows 001…N stay |
| Billing / Stripe | Remove the LimitKey and the product quota. Do not leave an orphan counter in Upstash |
| OpenAPI | Delete paths and schemas. Sync the docs YAML |
| Eve | Tools, registry, instructions, evals. Run check:eve-tools |
| Catalog / paths / IDs | Remove area, destination, pages, ProfileAppId if it was an app. Shortcuts and capture |
| UI | Feature, services, routes, i18n in en and es, stories, Paper frames (or mark them retired) |
| Docs | General / API / DB / Eve / DS pages. Take them out of docs.json. Regenerate the index |
| Seed | Stop creating rows for that domain |
| Audit / entity paths | Entity paths in logs and any residual entityType |
Removing the UI and leaving the table “just in case” does not count as deleting the feature. Either the domain stays alive (then do not delete it) or it leaves entirely.
Manual lane#
CI does not cover this. It is part of the flow, not an extra.
Local QA#
bun run api:seedif the demo is missing. Without--resetthe command is idempotent: it refreshes Agata Full Demo and reuses existing unique rows (assignees, tags, week plans).--resetwipes demo data.- Sign in as
seed@agata.local/SeedDemo123!— not Google or personal accounts. - Exercise the change end to end as a user: click, type, submit, navigate. A screenshot is not enough.
- Walk the screens that share the state (list, detail, ⌘K, Today, Eve if it applies).
- Hunt regressions in the neighborhood, not only the happy path.
- States: empty, error, loading, alternate flag/route.
- Light and dark. Narrow width if the layout changes.
- If you touched Eve: a real turn against the local API (
bun run api:devon 8080 if it is free).
Vercel Preview (every PR)#
| Project | Root | What to look at |
|---|---|---|
| agata-app | apps/app | UI on the Preview URL. ignoreCommand skips the build if the diff does not touch app/packages |
| agata-api | apps/api | Go + migrate when the container starts. ignoreCommand skips if there are no changes under apps/api |
- The app Preview must talk to that api Preview (
GO_API_URL). If Preview is protected,GO_API_VERCEL_PROTECTION_BYPASS. - New envs: add them in the dashboard/CLI of both projects as needed, in Preview and Production. Document the name in the Configuration tab.
- Do not use Vercel Services (it breaks App Router).
Production (main)#
- App: canonical domain (e.g.
agata.in). - API: the container applies pending migrations before serving traffic. Prod schema does not lag behind
devifMIGRATE_DATABASE_URLis correct. - Docs7 redeploys docs from
main(apps/docs).agata.in/docsredirects todocs.agata.in. - Crons live in the api project (
/api/internal/...). A feature with a new job registers the schedule there and theCRON_SECRETsecret.
After merge#
- Confirm the happy path once in Production with seed or a test studio — not with personal data.
- If the docs index was regenerated in the PR, production Eve and MCP see it on that app deploy.
- Paper: the shipped frame still matches, or it is marked stale the same day.
Ship checklist#
Copy this into the PR when the change is a surface or an app. Strike what does not apply; do not silently strike what does.