archlang
AGENTS.md33 starsChanged 21 days agoMITView on GitHub
ArchLang: a declarative language (.arch) that compiles to SVG floor plans. TypeScript, Node 18+, npm-workspaces monorepo; the core (repo root, @chanmeng666/archlang) also runs in the browser. Code and tests are the documentation; this file holds only what they cannot say. - Prove a change through the CLI (arch compile|describe|lint --json), not by eyeballing SVG. - Local gate is exactly check:quick (+ docs:build for docs), then push. check, drift, typecheck:all, vitest runs, e2e and bench are CI's; only CI green is…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 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 repository9 other files it gives its agents.
- docs-site/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- archlang-brief-to-planSkill
- archlang-edit-planSkill
- archlang-exportSkill
- archlang-review-planSkill
- archlangSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
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 24
Commit or push only when asked.
- Very specific: line 40
Never hand-edit dist/ or a generated file.
- Very specific: line 43
Every new language form ships a byte-identity law pinned by test (SHA-256 of SVG + describe() + lint() over the examples).
- Very specific: line 58
No secrets in this public repo.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md
ArchLang: a declarative language (.arch) that compiles to SVG floor plans. TypeScript, Node 18+,
npm-workspaces monorepo; the core (repo root, @chanmeng666/archlang) also runs in the browser.
Code and tests are the documentation; this file holds only what they cannot say.
npm run build # core + CLI → dist/ (before typecheck:all, e2e)
npm run cli -- compile examples/studio.arch -o studio.svg
npm run check:quick # local pre-push: changed files, nearest tests (CI runs the rest)
npm run check # typecheck + lint + test-wiring + vitest (CI only)
npm run check:drift # generated artifacts == generator output (CI only)
npm run typecheck:all # CI only; the one typecheck that compiles test/ + workspaces
npm run docs:build # after any docs/*.md edit
npm run gen:all # every gen:* generatorHow to work
- Prove a change through the CLI (
arch compile|describe|lint --json), not by eyeballing SVG. - Local gate is exactly
check:quick(+docs:buildfor docs), then push.check, drift,typecheck:all, vitest runs, e2e and bench are CI's; only CI green is merge evidence. A hook blocks them (.claude/hooks/local-gate.mjs). Executor briefs list only the local gate. - Commit or push only when asked. Merge by risk tier (
docs/agents/commands.md§ Merging a PR).
Hard rules
compile()is pure, sync, deterministic: no I/O, time, randomness or Node APIs insrc/outsidesrc/cli.ts+src/cli/; environment via theWorldseam; numbers viasrc/num-format.ts; never mutate the memoised parse-stagePlanNode(clone). Zero runtime deps.- User-source errors are returned as a
Diagnostic(bytespan+ cataloguedE_*/W_*), never thrown. compile()is bounded: every input returns within the step budget and the drawing budget. Charge new evaluator work to the step meter BEFORE allocating (MAX_EVAL_STEPS,E_STEP_LIMIT,src/expr.ts); budgets are counts, never time. Every coordinate/length stays withinMODEL_RANGE_MM(src/num-format.ts,E_OUT_OF_RANGE).- New element = one
src/elements/module registered indefs.ts, no switch; it declaresdrawCost(an upper bound on what it draws) andbounds()/measures()covering every coordinate and length it draws. New fixture category = aFIXTURE_FAMILIESrow + aCATALOGentry; a drawn symbol ignores itslabel. - Never hand-edit
dist/or a generated file; rungen:*. Drift-green proves reproducibility, not correctness: derive generator templates from the source of truth, never retype. - A derived position comes from the shape, never its bounding box or centroid.
- Every new language form ships a byte-identity law pinned by test (SHA-256 of SVG +
describe()+lint()over the examples). Never bless a golden to green a suite. - Heights draw nothing;
--viewmeasures nothing (describe()/lint()never learn it). 3D lives only in the separatepackages/archlang-3d, never a core dependency (.claude/rules/archlang-3d.md). - A drawing change never moves
describe()/lint()over the corpus, except drafting-layer lint rules, which read the sheet (ADR 0032;docs/agents/iron-laws.md); a glyph never gains handedness and a loss is allow-listed (test/glyph-chirality.test.ts). npm run checkdoes not typechecktest/;typecheck:alldoes.- A clean auto-merge of a MOVED function another branch MODIFIED is not evidence: diff the moved body, run both branches' fixtures together.
- Releases are tokenless OIDC (
v*tag); never an npm token, never automate npmjs account/2FA. Pushingmaindeploys the sites. Before a tag:/release-check. - Eval: T3 live run declined forever;
eval:liveis paid, owner-only; the eval corpus is a public fixture, never a holdout; dataset canary never regenerated. - Sites are light-only (no dark mode);
brand/archlang-logo-master.svgis byte-sacred. - No secrets in this public repo. Versions come from npm/tags/
gh release, never a doc; release narrative lives only inCHANGELOG.md.
Where to look
src/index.ts public surface · REVIEW.md what a bad diff looks like · docs/adr/ decisions · docs/backlog.md open work · docs/plans/ programmes · .claude/rules/ path-scoped rules (auto-loaded).
docs/agents/: architecture.md (pipeline, module map) · gotchas.md (traps) · iron-laws.md
(owner decisions) · commands.md (CI, scripts). docs/testing.md: red guards, golden policy.
docs/seo.md § 8: where the project is listed and who may submit.
A root .ignore hides CHANGELOG, generated files and goldens from ripgrep; name the path to search them.
Authoring .arch (not contributing): spec.llm.md, skills/archlang/SKILL.md.
Conventional Commits. This is the only root instruction file; CLAUDE.md just imports it;
path-scoped rules go in .claude/rules/. Together ≤ 5,000 bytes (wc -c); detail goes in docs/agents/.
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.

