archlang-export
Skill33 starsChanged 21 days agoMITView on GitHub
Use when the user wants an ArchLang .arch floor plan delivered as files, e.g. "export this plan as PDF", "give me a DXF for CAD", "a PNG I can paste into a document", "one sheet per floor", "print it at 1:50 on A3". Covers SVG, PNG, PDF and DXF output, paper size and scale, multi-storey plans and batches, through the archlang CLI, or through the ArchLang MCP tools and the Playground where the CLI cannot run. Not for writing or changing the plan itself.
- Installs packages
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs-site/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- archlang-brief-to-planSkill
- archlang-edit-planSkill
- archlang-review-planSkill
- archlangSkill
The file
We split this skill 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
- Very specific: line 11
If archlang is not on the path, write npx -y @chanmeng666/archlang in its place.
- Very specific: line 12
Never run a bare arch: on Linux, macOS and Git Bash that name is the coreutils command.
- Very specific: line 39
Many plans at once: Create the output directory first.
- Very specific: line 42
Confirm what was written: Read output (or outputs[] for a multi-storey plan) and bytes in the JSON result and list the files for the user.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
Export a plan
Produce drawing files from a .arch plan.
If archlang is not on the path, write npx -y @chanmeng666/archlang in its place.
Never run a bare arch: on Linux, macOS and Git Bash that name is the coreutils command.
This skill is a workflow, not a language reference. archlang compile --help lists every format and
flag; archlang spec describes the paper and scale statements.
Steps
- Check the plan compiles.
archlang compile plan.arch --jsonwrites nothing and reportsokand the diagnostics. Do not export a plan with errors; fix it first. - Make sure it is a sheet. A plan with no
paperstatement has no physical size.archlang finish plan.arch --only sheet --dry-run --jsonshows the sheet statements the plan lacks (paper, scale, dimensions, title block, room schedule, legend).archlang finish plan.arch --only sheetadds them on the smallest sheet the drawing fits. - If the user names a paper size or a scale, edit the plan's
paperandscalestatements to those values and compile again. If the drawing does not fit the sheet the plan declares,archlang finish plan.arch --reissue -o issued.archwrites a copy in which onlypaperandscaleare replaced by ones that fit. Tell the user when the sheet they asked for cannot hold the drawing at that scale. - Export. Pick the format by what the file is for:
- SVG, for the web or further editing:
archlang compile plan.arch -o plan.svg --json - PDF, for print at true size:
archlang compile plan.arch -f pdf -o plan.pdf --install --json - PNG, for a document or a chat:
archlang compile plan.arch -f png -o plan.png --install --json(-s 2doubles the raster scale) - DXF, for CAD:
archlang compile plan.arch -f dxf -o plan.dxf --json
- SVG, for the web or further editing:
- Multi-storey plans. A plan written with
levelblocks compiles to one file per storey, named<stem>.L<level>.<ext>, and the JSON result lists them inoutputs[]. To write one storey to one named file, add--level <n>. - Many plans at once. Create the output directory first;
batchdoes not create it. Thenarchlang batch a.arch b.arch -f pdf -o out/ --jsonrenders each input into it and returns one result row per input. - Confirm what was written. Read
output(oroutputs[]for a multi-storey plan) andbytesin the JSON result and list the files for the user. For a PNG you can look at it; for the other formats report the path, the sheet size and the scale.
Report to the user
- Each file written, with its format.
- The paper size and scale of the sheet, and whether you or
finishchose them. - Any storey or input that failed, with its diagnostic.
When the CLI cannot run
Some hosts have no shell, or a shell that cannot reach npm: in ChatGPT's sandbox npx only times
out, and a retry ends in ENOTCACHED. Stop after the first such failure and do not substitute
another PDF tool. With the ArchLang MCP tools:
- Set the plan's
paperandscale, then check it with thevalidatetool and render it with thecompiletool.W_SCALE_OVERFLOWmeans the sheet cannot hold the drawing at that scale: choose a smaller scale or a larger sheet, and say which. - For SVG,
compilereturns the drawing. - For PDF, PNG or DXF, call the
linktool and give the user itsplaygroundURL. In the Playground they open Share and press the format under Download. - Say plainly that the user downloads the file and that you wrote none. A Playground PDF is an image on a page of the sheet's paper size; a vector PDF needs the CLI.
When something goes wrong
- A missing optional package for PNG or PDF: repeat the command with
--install. - Exit code
2is a fault in the plan source, not in the export: read the diagnostic.3is a wrong flag: runarchlang compile --help. - Text or dimensions too small on the sheet: the scale is too small for the paper. Choose a
larger sheet or a larger scale in the plan, or let
archlang finish plan.arch --reissuechoose.
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.

