AI agents
An agent writing code against this library gets a few things wrong by default,
and they are the same few things every time: it hand-writes attribute names,
it puts each inside a conditional, it edits generated files, and it forgets
that a reconnecting page has missed everything.
AGENTS.md is a drop-in file that covers those.
Install it
Section titled “Install it”curl -o AGENTS.md https://bmartel.github.io/alacris-go/AGENTS.mdPut it in your project root. Claude Code, Cursor, Copilot, Codex and others read it automatically; for tools that do not, paste it into the system prompt or whatever the equivalent is.
If you also write component internals (the JavaScript half), take alacris’ own file too, and keep both:
curl -o AGENTS.alacris.md https://bmartel.github.io/alacris/AGENTS.mdWhat it covers
Section titled “What it covers”- The model: shadow content is client-rendered, every prop crosses as an attribute, a prop is a signal.
- Project layout, and that generated wrappers must not be edited. App wrappers
go in a package that is not named
ui. That path is the Alacris UI design system. - The encoding rules, including the two that look odd: booleans always written
out, and
*boolfor a default oftrue. - The live layer:
OnOpenis not optional, details are user input, the cookie is the capability (not the page id). - Desktop apps: same live handler in
app.Run; native APIs are Go (SaveFile, menus), not a JSinvokebridge. - A wrong → right table of the mistakes that actually happen.
- A verification checklist, including the focus-and-node-identity check that
catches an
eachin a conditional.
Docs for agents that fetch them
Section titled “Docs for agents that fetch them”llms.txt is a map of this
site for agents that read documentation on demand:
https://bmartel.github.io/alacris-go/llms.txtEvery page is also plain content at its own URL, so an agent can fetch a specific guide rather than the whole site.
How the examples stay current
Section titled “How the examples stay current”Every Go example is extracted from
internal/docsgen/examples.go
with go/ast and then executed. The HTML shown beside it is what that code
actually rendered, and go test ./... fails if the committed output stops
matching the library.
The live-tier demos are the one exception, and they say so on the page: a static site has no Go server, so the frames are scripted. The client applying them is the real one, imported from the bytes the Go module embeds.
Prompts that work well
Section titled “Prompts that work well”Point at the specific thing rather than the general one:
Add a
priorityprop to<ala-board>cards: an integer, default 0. Update the JSDoc, regenerate the wrappers, and use it inviews/page.templ.
The board should update every open tab when a card moves. Use the live layer, and make sure
OnOpenpushes the full state.
Review
web/components.jsforeachused inside a conditional template.
The last one is worth running on any codebase using this library. An each
inside a conditional rebuilds every row on every change.