Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
docs(erd): align skill and contract with solid-rectangle domains
tt-a1i956f94fb2398
diff --git a/archify/SKILL.md b/archify/SKILL.mdindex 7025105a..f4e592d9 100644--- a/archify/SKILL.md+++ b/archify/SKILL.md@@ -28,7 +28,7 @@ Use this path for ordinary generation. Read branch references only when their st1. Choose `architecture`, `workflow`, `sequence`, `dataflow`, `lifecycle`, `erd`, `class`, `tree`, `timeline`, or `waterfall` from the question.2. Use the exact schema and example paths in the Type router without listing their directories. Read [Authoring defaults](references/authoring-defaults.md) and the mode's example in a bounded batch separate from project documents and complete schemas so neither is truncated; recover any missing section before writing. For Architecture, use the matching showcase example. For every mode except Architecture, also read the mode and common schemas. Read the relevant schema definition before choosing any new field, enum, or constrained text, especially boundary kinds. Examples teach shape, not facts. Use fresh IDs, wording, and layout. Go directly to the candidate without preliminary help, doctor, starter validation, temporary diagrams, or output-path listing. Query brands only for an explicitly requested mark; read [Brand marks](references/brand-marks.md) for an unknown mark with a user-provided URL.-3. Once the requested scope and, for a real codebase, [source evidence](references/repository-authoring.md) are covered, write the complete candidate directly without planning coordinates in prose. Choose Architecture abstraction and connected placement using Authoring defaults before coordinates: show the main user journey and necessary branches, preserve control roles and behavior-changing conditions, and leave enough room for actual relationship labels. No node, relationship, source, view, card, or boundary count is a target or ceiling. Use automatic routes first; add explicit routing only for necessary branch, return, supplied geometry, or measured repair. Set `meta.quality_profile` to `"showcase"` unless the user requests dense `standard`. For ERD, use a table-first layout: show every physical column in `entities[].attributes`, keep its SQL type and source comment, state every key role a column carries (`key` takes a role or a list, so a junction column is `["pk", "fk"]`, and every `fk` column also needs `references` like `"orders.id"`), and never move columns into cards as a substitute for the table. Classify tables into functional domains before placement, give each domain a concise `tag`, and place its members in one solid block of grid cells — a single row, a single column, or a full block. A tagged table always needs `row`/`col`, because absolute coordinates have no grid cells and a domain whose tables do not fill one block cannot be drawn as a band: the renderer reports `erd/domain-not-drawn` instead of publishing a diagram that cannot name the domain. A multi-domain schema reads best as one domain per column — each `tag` a vertical run — because the reader scales a wide canvas up to the reader width and shrinks a tall one until the page fits, so the wide arrangement is the one that stays complete and legible inside a laptop viewport. A schema-first ERD over roughly 8 tables or 50 fields is itself a dense map: author its first complete-field pass at `standard` and upgrade only once the layout still reads.+3. Once the requested scope and, for a real codebase, [source evidence](references/repository-authoring.md) are covered, write the complete candidate directly without planning coordinates in prose. Choose Architecture abstraction and connected placement using Authoring defaults before coordinates: show the main user journey and necessary branches, preserve control roles and behavior-changing conditions, and leave enough room for actual relationship labels. No node, relationship, source, view, card, or boundary count is a target or ceiling. Use automatic routes first; add explicit routing only for necessary branch, return, supplied geometry, or measured repair. Set `meta.quality_profile` to `"showcase"` unless the user requests dense `standard`. For ERD, use a table-first layout: show every physical column in `entities[].attributes`, keep its SQL type and source comment, state every key role a column carries (`key` takes a role or a list, so a junction column is `["pk", "fk"]`, and every `fk` column also needs `references` like `"orders.id"`), and never move columns into cards as a substitute for the table. Classify tables into functional domains before placement, give each domain a concise `tag`, and place its members in one solid rectangle of grid cells — a single row, a single column, or a filled rectangular block, not an L or diagonal. A tagged table always needs `row`/`col`, because absolute coordinates have no grid cells and a domain whose tables do not fill one rectangle cannot be drawn as a band: the renderer reports `erd/domain-not-drawn` instead of publishing a diagram that cannot name the domain. A multi-domain schema reads best as one domain per column — each `tag` a vertical run — because the reader scales a wide canvas up to the reader width and shrinks a tall one until the page fits, so the wide arrangement is the one that stays complete and legible inside a laptop viewport. A schema-first ERD over roughly 8 tables or 50 fields is itself a dense map: author its first complete-field pass at `standard` and upgrade only once the layout still reads.4. Once the complete first candidate is written, run `finalize` directly. Its first gate is showcase validation; successful first drafts need no separate pre-validation. Keep the candidate unchanged while the command runs:```bashdiff --git a/archify/references/authoring-contract.md b/archify/references/authoring-contract.mdindex ce8ba465..195202a3 100644--- a/archify/references/authoring-contract.md+++ b/archify/references/authoring-contract.md@@ -345,15 +345,17 @@ replace a field list.Before placing boxes, classify tables into functional domains using verified tablenames, comments, module paths, and foreign-key meaning. Put the domain name in-`tag` and give each domain one solid block of grid cells: a single row, a single-column, or a full block, with every cell of the block holding one of its tables.+`tag` and give each domain one solid rectangle of grid cells: a single row, a+single column, or a filled rectangular block — not an L or a diagonal — with+every cell of the rectangle holding one of its tables.All tables with the same tag stay together; do not interleave unrelated tables-between members. A domain that fills one such block is drawn as a labelled band-behind its tables, so the+between members. A domain that fills one such rectangle is drawn as a labelled+band behind its tables, so thegrouping is visible without reading every box;-a tag whose tables do not fill one block earns no band, and because the band is-the only place a domain name is drawn the renderer reports `erd/domain-not-drawn`-rather than publishing a diagram that cannot name the domain. Absolute+a tag whose tables do not fill one rectangle earns no band, and because the band+is the only place a domain name is drawn the renderer reports+`erd/domain-not-drawn` rather than publishing a diagram that cannot name the+domain. Absolutecoordinates have no grid cells at all, so a tagged table always needs `row`/`col`.Order parent/core tablestoward the shared boundary and@@ -363,7 +365,7 @@ straight corridor. Never place an unrelated entity between two aligned anchors;the router can detour around it, but the clear corridor is shorter and readsbetter. A junction table has two parents: put it in a cell beside or betweenboth, not beneath one of them with tables stacked between it and the other,-and keep every table that shares its domain tag in one solid block of cells. A relationship must connect two different entities; a self-reference such as manager_id stays as a foreign-key column (and optionally a card), not an `employees`→`employees` edge.+and keep every table that shares its domain tag in one solid rectangle of cells. A relationship must connect two different entities; a self-reference such as manager_id stays as a foreign-key column (and optionally a card), not an `employees`→`employees` edge.Use `row`/`col` for this normal grouped layout, and only use explicit`pos`/`via` after a diagnostic identifies a concrete geometry problem.@@ -457,8 +459,8 @@ invented or approximate times as observed, and never fill gaps with events theinput does not contain.Use `lanes` for sources or categories (release, monitoring, response); every-event then names one. `kind` (`change`, `alert`, `action`, `recovery`) only-colours the card. Events are drawn in time order whatever the authored order;+event then names one. `kind` (`default`, `change`, `alert`, `action`, `recovery`) only+colours the card; inventing values such as `milestone` fails schema validation. Events are drawn in time order whatever the authored order;simultaneous and close events stack. By default a quiet period longer than 8×the median gap and 10% of the span is drawn as a fixed-width break labelledwith the omitted duration; `layout.breaks: "none"` keeps one proportional axis.diff --git a/archify/renderers/erd/README.md b/archify/renderers/erd/README.mdindex 934f6265..295b1684 100644--- a/archify/renderers/erd/README.md+++ b/archify/renderers/erd/README.md@@ -113,19 +113,20 @@ text cannot fit inside the declared entity width.## Domain bands`tag` names a table's functional domain, and a domain is drawn as a band when the-tables carrying that tag fill a solid block of grid cells — every cell of their-bounding box holds one of them. A single row, a single column, and a block are-all that same claim, and a one-table domain is that claim at its smallest. The+tables carrying that tag fill a solid rectangle of grid cells — every cell of+their bounding box holds one of them. A single row, a single column, and a filled+rectangular block are all that same claim (an L or diagonal is not); a one-table+domain is that claim at its smallest. Theband is measured from the placed boxes and carries the tag as its caption, whichis what makes a grouped schema readable at a glance: the reader sees blocksinstead of six equally weighted boxes.-A tag whose members do not fill one block earns no band, because a band around-them would enclose cells the domain does not own and claim a grouping the+A tag whose members do not fill one rectangle earns no band, because a band+around them would enclose cells the domain does not own and claim a grouping theplacement contradicts. The band is the only place a domain name is drawn, so therenderer returns `erd/domain-not-drawn` rather than publishing a diagram whosetables are complete and whose domain cannot be named. Move the members into one-block, split the tag, or drop it. The same diagnostic covers the other ways the+rectangle, split the tag, or drop it. The same diagnostic covers the other ways thename can go missing: a member placed outside the grid, because a band is measuredfrom cells and absolute coordinates have none; two members in one cell, which thegrid placement check reports instead so the author gets the pair that has to move;diff --git a/archify/renderers/erd/render-erd.mjs b/archify/renderers/erd/render-erd.mjsindex 57868c15..73630166 100644--- a/archify/renderers/erd/render-erd.mjs+++ b/archify/renderers/erd/render-erd.mjs@@ -212,10 +212,10 @@ const DOMAIN_PAD_X = 12;const DOMAIN_PAD_TOP = 18;const DOMAIN_PAD_BOTTOM = 8;-// A domain is drawn as a band when its members fill a solid block of grid cells:-// every cell of the bounding box holds one of them, so the band encloses no cell-// the domain does not own. A single row or column, the common case, is that same-// claim with one dimension of one.+// A domain is drawn as a band when its members fill a solid rectangle of grid+// cells: every cell of the bounding box holds one of them, so the band encloses+// no cell the domain does not own. A single row or column, the common case, is+// that same claim with one dimension of one; an L or diagonal is not contiguous.function gridRunIsContiguous(members) {const cols = members.map((entity) => entity.col);const rows = members.map((entity) => entity.row);