Skip to main content

Feature lifecycle

How to create, edit, and delete a product surface: docs, Paper, code, Storybook, Eve, QA, and Vercel.
10 min read

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.

Info

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#

SizeExampleWhat it requires
Surface inside an appVision board in GoalsApp docs, Paper, Go + schema if there is new data, services/features, i18n, Storybook pages/, seed if a demo is needed
New studio appA mini-app like PomodoroEverything for a surface plus ProfileAppId, catalog, theme, paths, entitlement, billing if there is a quota, Eve section/tools, General + Eve + API + DB docs
Non-visualLogic bug, column rename, copySkip 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#

ActorWhereWhen
ProductGeneral tab: apps/docs/apps/… or workspace/…Behavior, onboarding copy, what the user sees
PaperAgata file, product page (or Workflow for this map)Any new or redesigned UI. Default / Empty / Loading / Error frames
Visual contractDESIGN.md §0 and Design system tabNew pattern or density, not a one-off screen

Data contract#

ActorWhereWhen
Migrationsapps/api/db/migrations/ (up + down)Table, column, index, CHECK. Run bun run api:migrate-up locally before the app
DB docsDatabase tab + changelogThe schema the product uses
Go domainapps/api/internal/<domain>/ (ports → application → adapters) + HTTP in delivery/httpPersistence or HTTP contract
OpenAPIapps/api/docs/openapi.yaml and copy to apps/docs/openapi/agata-v1.yamlPublic endpoints or shapes
API docsAPI tab (reference/, guides, changelog)Contract that clients and Eve must respect

Authenticated app#

ActorWhereWhen
Feature UIapps/app/features/<product>/Screens. domains/ + local shared/; public/ only if another feature consumes it
Servicesapps/app/services/<domain>/ (queries/, actions/, types.ts)I/O toward Go. Do not import features/ or app/
Routesapps/app/app/(authenticated)/studios/[profileId]/…Thin page.tsx; orchestration in *-page-content.tsx
Pathsapps/app/shared/navigation/paths.tsNever hand-roll studio URLs
Shell catalogapps/app/shared/constants/studio-area-catalog.tsArea, entitlementAppId, theme, destinations, ⌘K pages, shell copy
App / section IDsapps/app/shared/constants/studio-app-ids.ts, studio-section-ids.tsNew app (not a one-off screen)
Themedata-app-theme + tokens in packages/ui + themesApp or area with its own accent
i18napps/app/messages/{en,es}/…All product copy. en and es in sync
Quick capture / shortcutscapture registry + ⌘K + shortcutsIf the area creates something with C or enters the palette
BillingProfileLimiter + customer entitlements + private safeguards + plansMembers, AI pools, or abuse protection
Audit logsGo domain + entity path in the logs UISensitive mutations
Seedapps/api/internal/seed/ + bun run api:seedDemo data in Agata Full Demo

Agents#

ActorWhereWhen
Eve toolsapps/app/agent/tools/… + registry in tool-kit.tsThe user must be able to do it in natural language. See Add a tool
Eve instructionsapps/app/agent/lib/domains/platform/instructions.tsNew domain or a gotcha the schema does not express
Evalsapps/app/evals/Routing / gating of new tools. See Evals
Eve docsEve tabCapability the agent exposes
Docs indexbun --filter app eve:index-docsAny new or touched MDX page. Feeds Eve

Design system and playground#

ActorWhereWhen
@agata/uipackages/ui/components/Only if a second caller needs the chrome. See Contribute to the DS
Component Storybookapps/storybook/stories/<category>/New wrapper or changed primitive look
Page Storybookapps/storybook/stories/pages/<product>/<screen>/Product screen. DS mocks; never import apps/app or #/*

Config, CI, and deploy#

ActorWhereWhen
Env varsConfiguration tab (config/app, config/api). No .env.exampleNew secret or flag. Document names, not values
Vercel agata-appRoot apps/appPreview per PR; Production from main
Vercel agata-apiRoot apps/api, Dockerfile.vercelSame. The container runs migrate up on start
Local / PR CIbun run type-check, bun run lint:architecture, bun run lint:stylex, bunx biome check --write, bun --filter app check:eve-tools if there are toolsBefore calling the change good
Docs7deploy from main, directory apps/docsProduct docs in prod. Public: agata.in/docs → docs.agata.in
Warning

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:

  1. Does it change what the user sees or can do? → General + Paper (if visual) + Storybook.
  2. Does persistence change? → migration + DB docs + seed if the demo breaks.
  3. Does HTTP change? → Go + OpenAPI + API docs + services + Eve if there is a tool.
  4. Does navigation change? → paths + catalog + shell i18n + ⌘K.
  5. Does capacity change? → customer entitlements, private safeguards, billing copy, and independent seed fixtures.
  6. 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:

LayerWhat to do
MigrationsDo 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 / StripeRemove the LimitKey and the product quota. Do not leave an orphan counter in Upstash
OpenAPIDelete paths and schemas. Sync the docs YAML
EveTools, registry, instructions, evals. Run check:eve-tools
Catalog / paths / IDsRemove area, destination, pages, ProfileAppId if it was an app. Shortcuts and capture
UIFeature, services, routes, i18n in en and es, stories, Paper frames (or mark them retired)
DocsGeneral / API / DB / Eve / DS pages. Take them out of docs.json. Regenerate the index
SeedStop creating rows for that domain
Audit / entity pathsEntity paths in logs and any residual entityType
Warning

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#

  1. bun run api:seed if the demo is missing. Without --reset the command is idempotent: it refreshes Agata Full Demo and reuses existing unique rows (assignees, tags, week plans). --reset wipes demo data.
  2. Sign in as seed@agata.local / SeedDemo123! — not Google or personal accounts.
  3. Exercise the change end to end as a user: click, type, submit, navigate. A screenshot is not enough.
  4. Walk the screens that share the state (list, detail, ⌘K, Today, Eve if it applies).
  5. Hunt regressions in the neighborhood, not only the happy path.
  6. States: empty, error, loading, alternate flag/route.
  7. Light and dark. Narrow width if the layout changes.
  8. If you touched Eve: a real turn against the local API (bun run api:dev on 8080 if it is free).

Vercel Preview (every PR)#

ProjectRootWhat to look at
agata-appapps/appUI on the Preview URL. ignoreCommand skips the build if the diff does not touch app/packages
agata-apiapps/apiGo + 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 dev if MIGRATE_DATABASE_URL is correct.
  • Docs7 redeploys docs from main (apps/docs). agata.in/docs redirects to docs.agata.in.
  • Crons live in the api project (/api/internal/...). A feature with a new job registers the schedule there and the CRON_SECRET secret.

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.