@chanmeng666/archlang

中文文档
1.49.0发布于 2026/11/01MITTypeScriptES Module零依赖构建来源已验证

An open-source DSL and compiler for floor plans: write .arch source and compile it to SVG, DXF or PDF with linting and geometric validation.

原始使用文档
文档目录6 节
  1. Floor plans as code.
  2. Send this to your agent
  3. Try it
  4. Why text
  5. New in 1.44 to 1.47
  6. For your agent
ArchLang

Floor plans as code.

Write a floor plan as text. Get a precise, dimensioned drawing back.

Playground Docs Gallery npm


Send this to your agent

Paste this into any coding agent. The skills are listed on skills.sh: https://skills.sh/ChanMeng666/archlang

1. Run: npx -y skills add ChanMeng666/archlang --yes
2. Run: npx -y @chanmeng666/archlang spec   (read it before writing anything)
3. Write my floor plan as plan.arch from this brief: <describe rooms, areas, adjacencies>
4. Run: npx -y @chanmeng666/archlang compile plan.arch -o plan.svg --json
   then describe plan.arch --json, validate plan.arch --strict --json (same prefix); fix, recompile
5. Run: npx -y @chanmeng666/archlang finish plan.arch, then compile again to export.

For MCP clients: claude mcp add archlang -- npx -y @chanmeng666/archlang-mcp.

ArchLang compiles plain-text source into floor plans. The card shows source being typed and the drawing compiling beside it: five example plans, one constant changed, and a lint finding raised and cleared.


https://github.com/user-attachments/assets/a60f3174-6a8c-4a42-b24a-fac030d39627

Try it

npx skills add ChanMeng666/archlang

Then ask your coding agent:

Design a one-bedroom flat of about 54 m², with the front door on the north wall.

It writes the plan, compiles it and checks it. This one is 57 lines of text:

A one-bedroom laneway house, compiled from 57 lines of ArchLang. Click to open it in the playground.

Click the drawing to open this exact plan in the playground. Change a number and it redraws.

Why text

  • Change one number, and one thing moves. Nothing else is redrawn.
  • The same source gives the same drawing, byte for byte.
  • An agent can check its own plan without ever looking at an image.
flowchart LR
    B([Brief]) --> W[Write .arch]
    W --> C{Compiles?}
    C -->|no| F[Apply the fix<br/>the error carries] --> C
    C -->|yes| V{Matches<br/>the brief?}
    V -->|no| W
    V -->|yes| O([SVG · DXF · PDF · PNG])

New in 1.44 to 1.47

Each links to a short section with an example, on archlang.uk/whats-new.

For your agent

This page is all a person needs. Everything else is written for agents: clone the repo and point yours at AGENTS.md, or give it the whole language in one call:

npx -y @chanmeng666/archlang context

Full overview · Language reference · Release notes (installed: node_modules/@chanmeng666/archlang/CHANGELOG.md) · Contributing · MIT

ArchLang is the engine behind ArchCanvas. Built by Chan Meng.

版本与发布记录

@chanmeng666/archlang 共发布 69 个版本,首次发布于 2026/06/24;过去 12 个月发布了 69 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.49.0latest2026/11/012 天前
1.48.02026/10/313 天前
1.47.02026/10/313 天前
1.46.02026/10/286 天前
1.45.02026/10/286 天前
1.44.02026/10/286 天前

关于 @chanmeng666/archlang 的常见问题

@chanmeng666/archlang 是什么?

楼面图的开源DSL和编译器:write。arch源代码,并将其编译为SVG, DXF或PDF与衬线和几何验证。

如何安装 @chanmeng666/archlang?

在项目目录运行 npm install @chanmeng666/archlang,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 arch、archlang,可以用 npx arch 直接运行。

@chanmeng666/archlang 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@chanmeng666/archlang 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@chanmeng666/archlang 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@chanmeng666/archlang 可以商用吗?

@chanmeng666/archlang 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chanmeng666/archlang 还在维护吗?

最新版本 1.49.0 发布于 2026/11/01(2 天前);至今共发布 69 个版本,其中过去 12 个月发布了 69 个;首次发布于 2026/06/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。