Repository avatar
Cloud Platforms
v0.1.1
active

grid-aec

io.github.gridsh/grid-aec

Reads, measures, checks, draws and changes floor plans kept in one plan file.

Documentation

Grid

npm downloads

Grid (grid-aec): floor plans for AI agents

Grid is a floor-plan toolkit built for AI agents. Describe a home or a building to your agent and it draws, measures, checks and changes the plan with Grid. Anyone can use it: homeowners, architects, builders, students.

One structured plan file (walls, rooms and openings) is the source of truth. It is stored in metres and shown in each person's own units: metres, centimetres, millimetres, or feet and inches. A geometry core reads it, validates it, draws it in 2D and 3D, and feeds the exporters.

Quick start

Grid is on npm as grid-aec and needs Node 22. Install it, then write a first plan.

  1. npm install -g grid-aec installs the grid command. From a copy of this repository instead: npm ci && npm run build, then alias grid="node $PWD/packages/cli/dist/grid.mjs".
  2. grid init my-home && cd my-home makes a project folder with a starter plan.json of two rooms.
  3. Write the rooms below in plan.rooms: each room with its use and inside size, the doors and windows by the rooms they join.
  4. grid write plan.rooms works out the walls into plan.json, grid check checks it, and grid draw --out plan.svg draws it.
  5. An agent gets the same as tools with claude mcp add grid -- npx -y grid-aec mcp (the other agents are in Installing Grid in an agent), and reads the guide for agents first.
room living  "Living room" living  4.0 x 3.5 at 0,0
room kitchen "Kitchen"     kitchen 2.5 x 3.5 east of living
door front in living south, centred, 0.9 wide, opens in
opening pass between living and kitchen, centred, 0.9 wide
window w-kitchen in kitchen east, centred, 1.2 wide

Write a plan rooms first, the main way to write one: name the rooms with their inside sizes and neighbours, and the doors and windows by the rooms they join, and grid_write_rooms works out the walls.

A room's size is to the inside faces of its walls, unless its line says centre or outside. A stair is a room used as stair on every floor it joins, in the same place (through writes it once); a lift is a room used as lift. A room's use is one of Grid's words: an office is office, a toilet or a WC is toilet, and the room's name keeps the person's own word. Where one open space has parts, such as a kitchen open to a living room, the line between them is a dividing line with no thickness: open on the room line, or a virtual wall. An L-shaped room is one room, written with polygon and its inside corners.

Status

Grid 0.1.0 is released: the package grid-aec on npm, and the GitHub release with the bundle for Claude's desktop app on a Mac with Apple silicon. CHANGELOG.md says what each release changed.

Layout

PathPackageContents
packages/floorplan@ongrid/floorplanPlan schema, geometry, validation, plan checks and exporters
packages/rules@ongrid/rulesChecks that apply figures from building codes, with each figure's source
packages/viewer@ongrid/viewer2D and 3D views of a plan, planToSvg (a picture of a plan as an SVG file) and planStill (a still of the 3D model as pixels), with no browser
packages/cligrid-aecThe grid command (grid-aec does the same): init, write, edit, check, describe, the reading commands (areas, find and the others), draw, export, sheet, tidy, mark, diff, preview (the preview page in a browser), serve (the tool server an agent uses), mcp (the same server) and batch. Also CAD program lookup, drawPlan (a plan as SVG or PNG) and drawStill (the 3D model as PNG)

Development

Grid needs Node 22 and npm.

npm install
npm run build
npm run typecheck
npm run lint
npm test

Running Grid from a copy of the repository

npm ci
npm run build
npx --no grid check packages/cli/fixtures/two-bed-flat.json

npx --no grid-aec runs the same command, and so does node packages/cli/dist/grid.mjs. Keep the --no: without it, npx fetches a package of the same name from the registry when the local one is missing.

Every command, with its options, is in docs/commands.md.

Installing Grid in an agent

Grid is on npm as grid-aec. One line starts its tool server for any agent that runs tools on the person's computer, and the lines below are the ones to type. They all come from one file, packages/cli/src/distribution/listing.ts, and a test fails when this list no longer matches it.

Every way below starts Grid's tool server with npx -y grid-aec mcp.

  • Claude Code: claude mcp add grid -- npx -y grid-aec mcp
  • Codex: codex mcp add grid -- npx -y grid-aec mcp
  • VS Code: code --add-mcp '{"name":"grid","type":"stdio","command":"npx","args":["-y","grid-aec","mcp"]}'
  • Copilot CLI: copilot mcp add grid -- npx -y grid-aec mcp
  • Cursor: Add to Cursor
  • Claude Code, as a plugin with a skill: /plugin marketplace add gridsh/grid-aec, then /plugin install grid@grid
  • Codex, as a plugin with a skill: codex plugin marketplace add gridsh/grid-aec
  • Claude's desktop app: open the .mcpb file for your computer and pick the project folder.

The plugin lines name this repository: its top holds the marketplaces for Claude Code (.claude-plugin/), Codex (.agents/plugins/) and Cursor (.cursor-plugin/), and the plugin they list, plugins/grid/. The plugin starts the same tool server and carries Grid's skill, which tells an agent when to reach for Grid and how to start, and four skills a firm can copy and make its own: its standards, a room programme, a table of options and dimensioning. server.json is the MCP Registry's entry. npm run listing --workspace grid-aec writes these files from the listing, and the release step raises their version.

To try a change before it is published, pack everything from a copy of the repository, and install from the tarball:

npm run build
npm run pack:local --workspace grid-aec
npx -y --package=./packages/cli/dist/release/grid-aec-<version>.tgz grid-aec mcp

pack:local publishes nothing. It writes into packages/cli/dist/release/ the npm package as a tarball (the bundled command and nothing else; the canvas that draws PNGs is an optional package), the registry's server.json, the plugin with a marketplace folder that lists it, install.md with the lines above, and a .mcpb bundle for Claude's desktop app that carries the canvas for the computer it was packed on.

Documentation

Each page answers one kind of question, so read only the one you need.

To…Read
Write a first plan as an agent: rooms first, the raw-wall form, and the answers to what agents ask (a stair, the use words, inside or outside, dividing lines, L-shaped rooms)docs/agent-guide.md
Know the plan file's conventions, each with a drawing: wall thickness, where an opening sits, room boundaries, coordinates and floorsdocs/conventions.md
Start from a realistic plan: a flat, a two-storey house and an open-plan home, as rooms text and as plan filesdocs/samples/
Write a plan: name the rooms, doors and windows, and let Grid work out the wallsdocs/rooms-first.md
Start from a task: a flat for a property listing, a house over three floors, a shop with zones, a plot with a building on itdocs/recipes.md
Run a command: init, write, edit, check, describe, draw, export, sheet, tidy, mark, diff, seats, preview, serve, batch; options, exit codes, the project folderdocs/commands.md
Call Grid as an agent: the grid_… tools, asking across the parts by their facts, measuring from faces, protocol versionsdocs/tool-server.md
Use Grid from a program: importing it in Node, the tool server from Python or Node, the commands that answer in JSON, exit codes, what a failure looks like, many calls quickly and the licencedocs/from-code.md
Know what a plan file may hold and what each drawing check's code means: floors, steps, overlapping rooms, holes, fixtures, facts of your own and room numbers, wall faults, inside and outside walls, and where people's names go insteaddocs/plan-file.md
Keep what the person asked for beside the plan, and read each line met or missed after a changedocs/brief.md
Hold one design in several sizes: one text with its figures, the types every size shares, one take-off table across the sizesdocs/sizes.md
Set a firm's own standards, such as corridors at least 1.5 m, against its plans, apart from the code figures; the skills a firm can owndocs/firm-standards.md
Set a document's access or small-home figures, with their clauses, against a plan, each not yet checked until a named person checks itdocs/figure-packs.md
Place a fixture, furniture or a typical room by name; keep an office's own library; add a kind of thingdocs/library.md
Know what an area figure means: net, gross internal and gross external, and which comes first where; the room schedule and the door and window scheduledocs/areas.md
Open a GLB or OBJ in a game engine, a renderer or a headset: its axes, units, node and object names, materials, normals and UVs, and leaving the roofs outdocs/3d-files.md
Read the plan's geometry as data (GeoJSON or JSON): rooms, doors and walls as coordinates in one frame, clear widths, swing areas, glass, door states and keep-out zonesdocs/plan-data.md
Know the figure behind a check, and when Grid asks whether a size is meantdocs/tolerances.md
Read what grid check and grid_check return: the record and every message codedocs/result-contract.md
Add or change a sentence Grid writes, or add a language: the message files, --lang, room uses by languagedocs/languages.md
Change Grid itselfAGENTS.md
Find where a part of Grid's code lives before changing it: each module, what it holds and the test that holds itdocs/architecture.md

Licence

Grid is licensed under the Apache License 2.0 (Apache-2.0). See also NOTICE. To suggest a change, see CONTRIBUTING.md.

NPM
grid-aec
Install Command
npm install grid-aec