layout

A layout-design command for pages and interface components. It chooses between flexbox and grid, defines responsive behavior, and applies consistent spacing, sizing, and typography rules.

In plain words
What is it for?
Use it to structure responsive pages or components, define mobile-first breakpoints, choose fixed, fluid, or content-driven layouts, and check the result at common screen widths.
Why use it?
It helps prevent cramped layouts, excessive line lengths, incorrect breakpoint behavior, and spacing that changes without a clear system.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/dragoon0x/canon/layout
Clone the repo
git clone --depth 1 https://github.com/Dragoon0x/canon
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 425 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.00425
Opus 5 $0.00008 $0.00212
Sonnet 5 $0.00003 $0.00085
Haiku 4.5 $0.00002 $0.00042

Measured 2d ago against content hash 57d527aa512b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

layout scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

source/commands/layout.md · 39 lines

What it actually says

/layout

Take a layout request (page, section, component) and produce a grid-honest, breakpoint-correct, density-appropriate structure.

What this does

  1. Pull canon-spatial and canon-responsive.
  2. Classify the layout:
    • Fixed: component with predictable content (card, toolbar).
    • Fluid: page-level, container-width capped.
    • Intrinsic: grid-auto, content-driven.
  3. Pick the right primitive. Flexbox for 1D, grid for 2D. Not the other way around.
  4. Apply the 4px/8px base grid. All spacing uses tokens: --space-1 through --space-14.
  5. Set container widths from the scale (max 640/768/1024/1280/1440). Never 100% on text-heavy pages at desktop width — line length breaks past 75ch.
  6. Define breakpoints mobile-first. Write the phone layout, then add @media (min-width: 768px). Not the reverse.
  7. Use container queries for components that live in variable containers (sidebars, cards in grids).
  8. Fluid type via clamp(min, preferred, max) where type should scale.
  9. Test at 320px, 375px, 768px, 1024px, 1280px, 1536px before declaring done.

Output

  • Semantic HTML shell.
  • CSS with design tokens (no raw values).
  • Breakpoint strategy explained in 2–3 lines.
  • Container query usage noted if applied.
  • Touch target floor (44px) verified for any tappable element.

Success criteria

  • No horizontal scrollbars at 320px.
  • No lines wider than 75 characters for body text.
  • Every spacing value traces to a token.
  • Resizing the window feels continuous, not staircase-y.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 39 lines · 16 tokens per session scan A 57d527aa512b

Subscribe to this mod's changes

layout is a command published in the GitHub repository Dragoon0x/canon (5 stars, last pushed 4mo ago), licensed MIT. It adds 16 tokens to every session and 425 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.