Agent-HTML / agent-html
AGENTS.md539 starsChanged 6 months agoApache-2.0View on GitHub
For cold start, read agent-html/README.md first, then this file. This file owns hard operating rules and strong defaults. - Keep agent-html as a portable source workspace. - Treat canvases/.layout/** as generated geometry; inspect it only through an explicit spatial query. - Do not add node_modules, lockfiles, generated bundles, .vite, dist, build, vendored dependency folders, full graphs, declaration rollups, or tool dumps inside agent-html. - Keep AGENTS.md, components.json, and tsconfig.json at the workspace root for agent, shadcn, TypeScript, and editor discovery.…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- shadcnSkill
- ui-ux-pro-maxSkill
- wranglerSkill
- shadcnSkill
- ui-ux-pro-maxSkill
- wranglerSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
33 rules. About 0 are common, 9 are distinctive, and 24 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 7
Keep agent-html as a portable source workspace.
- Very specific: line 8
Treat canvases/.layout/ as generated geometry.
- Very specific: line 9
Do not add node_modules, lockfiles, generated bundles, .vite, dist, build, vendored dependency folders, full graphs, declaration rollups, …
- Very specific: line 10
Keep AGENTS.md, components.json, and tsconfig.json at the workspace root for agent, shadcn, TypeScript, and editor discovery.
- Very specific: line 11
Use index/* only as generated decision context.
- Very specific: line 15
Use GOVERNANCE.md before changing workspace conventions, route files, generated indexes, artifact or data patterns, or copyable examples.
- Very specific: line 19
Put artifact entries in artifacts/*.artifact.tsx.
- Very specific: line 20
Import defineArtifact from @agent-html/react.
- Very specific: line 21
Default export defineArtifact({ title, blocks }) from artifact entries.
- Distinctive: line 22
Use artifact entries only for artifact title and block order.
- Very specific: line 23
Put split block implementations in artifacts/<artifact>/<block-id>.block.tsx.
- Very specific: line 24
Default export the block component from each *.block.tsx file.
- Distinctive: line 25
Use stable, unique, readable, kebab-case block ids.
- Very specific: line 26
Use { id, title } only when the visible block title cannot be inferred from the id.
- Distinctive: line 27
Do not render host block prompt actions or block hover chrome from artifact source.
- Very specific: line 28
Do not use old AHTML <Cell> DSL for React Canvas artifacts.
- Very specific: line 32
Put common visual primitives in components/ui.
- Very specific: line 33
Put rich reusable components in components/<name>.tsx or components/<name>/.
- Very specific: line 34
Put reusable React behavior in hooks, pure helpers in lib, shared contracts in types or schema, and Canvas CSS in styles.
- Distinctive: line 35
Keep artifact data artifact-local unless multiple artifacts consume it and a route names the shared owner.
- Distinctive: line 36
Keep generated or raw data separate from authored interpretation.
- Very specific: line 37
Put bundle-time imports in assets, artifact-owned URL files in artifacts/<artifact>/public, and shared URL files in public.
- Very specific: line 39
Do not import from ../public or ./public.
- Very specific: line 43
Check index/api-surface.md before adding, duplicating, or changing a local primitive, hook, helper, schema, or shared component.
- Very specific: line 44
Check index/style-surface.md before adding or changing artifact-facing Canvas classes.
- Very specific: line 45
Use styles/layouts/index.css L2 composition classes when they fit ordinary artifact content styling.
- Distinctive: line 46
Do not use raw palette classes, arbitrary value classes, or inline visual styles in artifacts.
- Distinctive: line 47
Do not recreate root reading width, block hover highlighting, toolbar placement, sidebar chrome, or theme editor chrome in artifact source.
- Very specific: line 48
Treat every agent-html validate diagnostic as blocking.
- Very specific: line 50
Use TASTE.md before changing artifact visual composition, media-heavy blocks, layout density, component choice, source placement, or …
- Distinctive: line 54
Do not call Codex app-server, the filesystem, shell commands, MCP servers, or privileged host APIs from artifact code.
- Very specific: line 55
Do not import @/app/*, apps/agent-html-app, @/agent-html/runtime/ui, renderAgentHtml, or renderInteractiveAgentHtml.
- Distinctive: line 56
Do not import Canvas host internals from artifact source.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AgentHTML React Canvas
For cold start, read agent-html/README.md first, then this file. This file owns hard operating rules and strong defaults.
Workspace Boundaries
- Keep
agent-htmlas a portable source workspace. - Treat
canvases/.layout/**as generated geometry; inspect it only through an explicit spatial query. - Do not add
node_modules, lockfiles, generated bundles,.vite,dist,build, vendored dependency folders, full graphs, declaration rollups, or tool dumps insideagent-html. - Keep
AGENTS.md,components.json, andtsconfig.jsonat the workspace root for agent, shadcn, TypeScript, and editor discovery. - Use
index/*only as generated decision context. Do not edit generated index files by hand. package.jsonis generated source dependency metadata. Change the Kernel runtime catalog, then runnpm run canvas:catalog:sync; do not edit dependency versions here by hand.- Use
GOVERNANCE.mdbefore changing workspace conventions, route files, generated indexes, artifact or data patterns, or copyable examples.
Artifact Protocol
- Put artifact entries in
artifacts/*.artifact.tsx. - Import
defineArtifactfrom@agent-html/react. - Default export
defineArtifact({ title, blocks })from artifact entries. - Use artifact entries only for artifact title and block order.
- Put split block implementations in
artifacts/<artifact>/<block-id>.block.tsx. - Default export the block component from each
*.block.tsxfile. - Use stable, unique, readable, kebab-case block ids.
- Use
{ id, title }only when the visible block title cannot be inferred from the id. - Do not render host block prompt actions or block hover chrome from artifact source.
- Do not use old AHTML
<Cell>DSL for React Canvas artifacts.
Source Ownership
- Put common visual primitives in
components/ui. - Put rich reusable components in
components/<name>.tsxorcomponents/<name>/. - Put reusable React behavior in
hooks, pure helpers inlib, shared contracts intypesorschema, and Canvas CSS instyles. - Keep artifact data artifact-local unless multiple artifacts consume it and a route names the shared owner.
- Keep generated or raw data separate from authored interpretation.
- Put bundle-time imports in
assets, artifact-owned URL files inartifacts/<artifact>/public, and shared URL files inpublic. - Reference artifact URL files with
artifactPublicUrlFactoryand shared URL files withsharedPublicUrl. - Do not import from
../publicor./public.
API And Style Safeguards
- Check
index/api-surface.mdbefore adding, duplicating, or changing a local primitive, hook, helper, schema, or shared component. - Check
index/style-surface.mdbefore adding or changing artifact-facing Canvas classes. - Use
styles/layouts/index.cssL2 composition classes when they fit ordinary artifact content styling. - Do not use raw palette classes, arbitrary value classes, or inline visual styles in artifacts.
- Do not recreate root reading width, block hover highlighting, toolbar placement, sidebar chrome, or theme editor chrome in artifact source.
- Treat every
agent-html validatediagnostic as blocking. Kernel rules cannot be disabled or suppressed from workspace source. - Use
TASTE.mdbefore changing artifact visual composition, media-heavy blocks, layout density, component choice, source placement, or narrative UI.
Forbidden Imports And Actions
- Do not call Codex app-server, the filesystem, shell commands, MCP servers, or privileged host APIs from artifact code.
- Do not import
@/app/*,apps/agent-html-app,@/agent-html/runtime/ui,renderAgentHtml, orrenderInteractiveAgentHtml. - Do not import Canvas host internals from artifact source.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

