AI Operations
This page documents the mandatory AI workflow for Wargrid.
Vendor Docs
Before generating code for a third-party dependency:
- check whether the vendor provides an official
llms.txt - sync the official source into
skills/vendor-docs/<tool>/ - use that source while generating or refactoring code
- record any durable lesson in
AI-NOTES.md
Run:
bun run vendor-docs:sync
Current vendor snapshots also include:
- Better Auth
llms.txt - Drizzle
llms-full.txt - Elysia
llms.txt
Documentation Updates
Every meaningful change must update:
- human docs in
apps/docs/docs/ - AI notes in
AI-NOTES.mdwhen the workflow or constraints change - release docs and blog notes for user-visible work
Validation Flow
bun run typecheck
bun run lint
bun run test
bun run storybook:build
bun run docs:build
bun run blog:build
If a task touches Pixi, auth, or UI flows, also run the legacy CDP or image-tooling checks until the new testing package fully replaces them.
Workspace Linking
When an app or package starts importing a sibling workspace package, add the dependency explicitly from the consumer package:
bun add @wargrid/some-package@workspace:*
Do not rely on Bun resolving local package names implicitly.
Shared Runtime Paths
apps/apiowns the Better Auth server mounts under/api/auth/playerand/api/auth/admin.apps/playconsumesGET /api/player/bootstrap.apps/playalso consumes and mutates:GET /api/player/decksPOST /api/player/decks/importPOST /api/player/decks/defaultGET /api/player/socialPOST /api/player/social/actionsGET /api/player/lobbiesPOST /api/player/lobbies
apps/adminconsumesGET /api/admin/bootstrap.- Extend those routes and the matching Valibot contracts before introducing frontend-local bootstrap payloads.
- Keep stateful fixture logic in standalone modules that can be tested without booting the HTTP runtime. The current reference implementation is
apps/api/src/player-state.ts.