Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.81 KB

File metadata and controls

42 lines (31 loc) · 1.81 KB

AGENTS.md

Guidance for AI agents and automated tooling working in this repository.

Stack

TanStack Start (React) storefront powered by @decocms/* packages, deployed to Cloudflare Workers via wrangler. Dev server: npm run dev (Vite). Build: npm run build. Type-check: npm run typecheck.

Deco CMS content (.deco/) — read before editing content

Source of truth: .deco/blocks/<encoded-key>.json — one JSON file per block (pages, section props, loader config, site settings). The filename is the URI-encoded block key. For ANY content change, edit only the matching .deco/blocks/*.json file(s).

Never hand-edit generated artifacts. These are derived from .deco/blocks/ and regenerated automatically; edits to them look correct in the dev preview but are silently discarded on the next regeneration/production build:

  • .deco/blocks.gen.json / .deco/blocks.gen.ts — merged block snapshot (regenerated by the dev watcher and by npm run build via generate:blocks)
  • .deco/meta.gen.json, .deco/sections.gen.ts, .deco/loaders.gen.ts
  • src/routeTree.gen.ts
  • any other *.gen.* file

How a content change propagates (no extra files need touching):

  • Dev/preview: the decoVitePlugin watches .deco/blocks/, patches blocks.gen.json, POSTs the delta to the dev server's /.decofile, and hot-reloads the preview.
  • Production: npm run build regenerates the bundled snapshot from .deco/blocks/, and the fast-deploy content sync (deco-sync-blocks-to-kv) reads .deco/blocks/*.json directly. Committing the .deco/blocks/*.json change is all that is needed for it to reach production.

Code changes

  • Cite files as path:line when explaining code.
  • Run npm run typecheck after TypeScript changes.
  • npm run format (Prettier) before committing src/** changes.