-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathllms.txt
More file actions
94 lines (77 loc) · 8.37 KB
/
Copy pathllms.txt
File metadata and controls
94 lines (77 loc) · 8.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# ArchLang
> A small declarative language that compiles to professional SVG floor plans — like Typst/LaTeX, but for architecture.
This file follows the [llms.txt](https://llmstxt.org/) convention: a concise, machine-readable map
of the project for large language models and AI agents.
## About
- Repository: https://github.com/chanmeng666/archlang
- Primary stack: Node.js / JavaScript
- License: MIT
## Key documents
- [README](https://github.com/chanmeng666/archlang/blob/main/README.md): overview, features, installation, usage
- [spec.llm.md](https://github.com/chanmeng666/archlang/blob/main/spec.llm.md): the WHOLE language in one page (~2k tokens) — read this to author `.arch`
- [llms-full.txt](https://archlang.uk/llms-full.txt): the full agent context in one document — the spec, the workflow skill, the CLI reference, and every diagnostic code (also at `/llms-full.txt`)
- [SKILL.md](https://github.com/chanmeng666/archlang/blob/main/SKILL.md): the agent skill — how to drive ArchLang via the CLI
- [AGENTS.md](https://github.com/chanmeng666/archlang/blob/main/AGENTS.md): how AI agents should work in this repo
- [CONTRIBUTING](https://github.com/chanmeng666/archlang/blob/main/CONTRIBUTING.md): development setup and contribution workflow
- [CHANGELOG](https://github.com/chanmeng666/archlang/blob/main/CHANGELOG.md): version history
## Machine-native artifacts (served at the docs-site root)
- [/plan.schema.json](https://archlang.uk/plan.schema.json): JSON Schema (2020-12) for **Plan JSON** — the structured compile input (`arch compile --from-json`)
- [/intent.schema.json](https://archlang.uk/intent.schema.json): JSON Schema (2020-12) for an **Intent** — a brief's checkable expectations as data (`arch validate --intent` / `arch score --brief`)
- [/archlang.gbnf](https://archlang.uk/archlang.gbnf): **GBNF** constrained-decoding grammar — force a local model to emit only parseable ArchLang
- **Append `.md` to any generated doc route for raw markdown**: e.g. [/spec.md](https://archlang.uk/spec.md), `/reference.md`, `/errors.md`, `/analysis.md`, `/furniture.md`
- **MCP server** — [`@chanmeng666/archlang-mcp`](https://www.npmjs.com/package/@chanmeng666/archlang-mcp): an optional stdio MCP shim over the library (tools: compile/describe/lint/validate/score/repair/fix/suggest/complete; resources: spec/context/schema/intent-schema/grammar). The CLI stays the primary, token-cheaper interface — see the README's agent section
- **Dataset** — [`ChanMeng666/archlang-repair-trajectories`](https://huggingface.co/datasets/ChanMeng666/archlang-repair-trajectories): a fully synthetic, self-verifying corpus — `repair` trajectories (broken source + diagnostics → deterministically healed source) + `authoring` pairs (brief → golden + intent), CC0-1.0; generator + seed open source in `dataset/`
## To USE ArchLang (author floor plans)
ArchLang is agent-native via its CLI — no server required, nothing to configure (an optional MCP shim exists for MCP-native clients; the CLI stays primary):
```bash
npx @chanmeng666/archlang context # cold start: the whole bundled agent context (spec + skill + CLI + errors) in one call
npx @chanmeng666/archlang context --section spec # ...or one section only: spec | workflow | cli | errors (the catalog alone: 60KB → 13KB)
npx @chanmeng666/archlang spec # learn the whole language (read this first)
npx @chanmeng666/archlang help compile # per-command help + worked examples, rendered from the manifest (`arch <cmd> --help` works too)
npx @chanmeng666/archlang manifest --json # the whole CLI API as data: commands, flags, formats, lint rules, error codes
npx @chanmeng666/archlang --version # the core version, for a bug report or a capability check
npx @chanmeng666/archlang compile plan.arch -o out.svg --json # render; JSON: { ok, diagnostics, summary }
npx @chanmeng666/archlang preview plan.arch -o out.png --json # render a PNG to SHOW the user (zero-install where resvg is present; --install fetches it)
npx @chanmeng666/archlang describe plan.arch --json # verify: rooms, areas, adjacency, door connections, circulation
npx @chanmeng666/archlang describe plan.arch --select rooms,totals --room kitchen,bath --json # bounded read: only those keys / those rooms
npx @chanmeng666/archlang lint plan.arch --json # architectural soundness warnings
npx @chanmeng666/archlang lint plan.arch --code W_ROOM_UNREACHABLE --json # bounded read: one code (or --severity error) — a DISPLAY filter; the exit code still weighs every diagnostic
npx @chanmeng666/archlang validate plan.arch --strict --json # parse + lint, no render; --strict fails on warnings (the ship gate)
npx @chanmeng666/archlang fix plan.arch --dry-run --json # preview the machine-applicable diagnostic fixes AND the exact unified diff they produce
npx @chanmeng666/archlang fix plan.arch --backup --json # apply them in place, keeping the original bytes as plan.arch.bak (fix rewrites your SOURCE)
npx @chanmeng666/archlang suggest plan.arch --json # advisory door/window topology statements for unreachable rooms / windowless bedrooms
npx @chanmeng666/archlang score plan.arch --brief intent.json --json # continuous intent-satisfaction meter against a brief (satisfied/total; exit 0)
npx @chanmeng666/archlang repair plan.arch -o fixed.arch # explicit corrector: furniture out of walls/doorways/swings + change log
npx @chanmeng666/archlang compile plan.arch -o walk.svg --overlay circulation # opt-in: draw the walkability routes on top
npx @chanmeng666/archlang batch a.arch b.arch -f svg --json # render many plans/variants at once → results[]
npx @chanmeng666/archlang md notes.md -o out.md -f svg # render fenced arch blocks in Markdown → image links
```
Loop: `spec` → write `.arch` → `compile --json` → if `ok:false` (exit 2) fix via each
`diagnostics[].fix` → `describe --json` to confirm intent → `preview` to show the user a raster →
`lint --json` to confirm soundness. `arch <cmd> --help` is the cheap way to learn one command;
`manifest --json` is the whole API map in one call, and the help, the flag parser and the CLI
reference are all rendered from it, so none of them can claim a flag a command doesn't take.
`batch`/`md` cover variant exploration and embedding plans in Markdown. See
[SKILL.md](https://github.com/chanmeng666/archlang/blob/main/SKILL.md).
Exit codes: `0` ok · `2` user-source error (deterministic — fix it, don't retry) · `1` IO/internal ·
`3` bad usage. Misuse is loud, never silent: an unknown flag or verb exits 3 with a did-you-mean —
a typo'd `--jsn` on `lint` answers `error: unknown flag "--jsn" for \`arch lint\` — did you mean
\`--json\`?` plus a `usage:` echo — so a hallucinated flag fails fast instead of being read as a
filename. Source can come from stdin (`-`) on every command that takes a file.
In CI, the in-repo composite Action `ChanMeng666/archlang/.github/actions/arch-render@<tag>` renders
every ```` ```arch ```` fence in a repo's Markdown to images in one step (see
[.github/actions/arch-render/README.md](https://github.com/chanmeng666/archlang/blob/main/.github/actions/arch-render/README.md)).
`lint` catches tacit architectural mistakes, not just syntax: a bathroom reached only through a
bedroom, a wet room that isn't fully walled in, a door swing hitting furniture, a bath/kitchen with
no fixtures, a windowless bedroom, an unenterable room, a too-narrow door, a room use only inferred
from an indirect label alias (`W_ALIAS_MATCH`, with a fix that pins the explicit `uses`), plus **human-circulation**
checks — a walk that squeezes below a passable width (`W_PATH_TOO_NARROW`) or wanders far from a
straight line (`W_CIRCUITOUS_PATH`), measured on a clearance-eroded nav grid and also readable as
facts from `describe().circulation` (per-room walk distance / bottleneck width / detour) or drawn with
`compile --overlay circulation`. Every catalogued `furniture <kind>` draws a real plan symbol and
ignores its `label` (the catalogue is `arch manifest --json` → `fixtureCategories`; the escape hatch
for anything else is the labelled rectangle), most take their footprint from `against wall <id> in
<room>` with no `size`, and `dims auto` places dimension strings for you.
## To CONTRIBUTE (work on the repo)
Read the README and AGENTS.md first, then follow the commands and conventions they describe. Prefer
the project's own scripts over ad-hoc commands.