Skip to content

AGENTS.md

34 lines · 1.5 KB · Markdown
Raw

@kentcdodds/pirate-side-scroller

This package is a hosted app only. It has no callable exports.

Layout

  • src/app.ts is the Kody fetch handler (kody.app.entry). It renders the HTML shell and links assets using packageContext.assetBasePath and packageContext.clientModuleUrl. Never hard-code those paths.
  • src/main.ts is the browser client (kody.app.client). It injects src/markup.ts into the page and starts the game. It must stay browser-safe: no kody: imports and no CSS imports.
  • public/ is kody.app.assets: the stylesheet, the icon, and the web app manifest. The manifest uses relative URLs so it works under the app mount.
  • index.html is only used by the local Vite dev server.
  • src/kody-runtime.d.ts declares the slice of kody:runtime the app uses, so local tsc passes.

Smoke tests

After publishing, call packageAppFetch for @kentcdodds/pirate-side-scroller with path /. Expect status 200 and HTML that references /_assets/style.css and a client.<hash>.js module. Then open the hosted URL in a browser and start a game.

Edge cases

  • The high score and mute setting live in localStorage under the pirate-side-scroller: prefix. Package apps share an origin, so keep that prefix distinct from the other shooters'.
  • Gameplay changes should usually be mirrored in @kentcdodds/pirate-shooter (vertical) and @kentcdodds/space-shooter, which share the same game loop. This version is rotated: the play field is landscape, the player is on the left, and enemies move right to left.