adapt

A command for adapting a layout or component to different screen sizes, spacing densities, input methods, and display modes. It considers phones, tablets, desktops, touch screens, and mouse or trackpad use.

In plain words
What is it for?
Use it to adapt responsive layouts, choose breakpoints, handle variable containers, adjust touch targets, and avoid hover behaviour on touch screens.
Why use it?
It helps prevent layouts that work at one screen size but break, become cramped, or behave poorly elsewhere.

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/adapt
Clone the repo
git clone --depth 1 https://github.com/Dragoon0x/canon
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 517 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.00021 $0.00517
Opus 5 $0.00010 $0.00259
Sonnet 5 $0.00004 $0.00103
Haiku 4.5 $0.00002 $0.00052

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

Security

Grade A, and why

adapt 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/adapt.md · 45 lines

How it starts

The opening of the file, as written. The whole thing — 45 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/adapt

Take a design that works at one breakpoint and make it work at all of them. Not "add a few media queries" — think about the content's shape, not the viewport's.

What this does

  1. Load canon-responsive, canon-spatial, canon-interaction.
  2. Identify the base viewport (where the design was built) and the actual range it needs to support.
  3. Work through each surface:
    • Phone portrait (320–480px): single column, 16px gutters, bottom-sheet for heavy interactions.
    • Phone landscape (480–768px): still single column, but reconsider fixed headers (they eat too much vertical).
    • Tablet portrait (768–1024px): hybrid; sidebar may collapse, grid goes 2-column.
    • Tablet landscape / small desktop (1024–1280px): multi-column settles in.
    • Desktop (1280–1920px): intended layout.
    • Wide (1920px+): cap container width, don't let lines of text stretch past 75ch.
  4. Container queries for components in variable containers (the sidebar card that also appears in a 12-col grid).
  5. Touch vs pointer:
    • Wrap hover effects in @media (hover: hover). Hover on touch devices sticks and looks broken.
    • Touch targets: 44×44px floor, 8px spacing between.
    • Pointer: tighter spacing OK, but don't go below 24×24px for icon buttons.
  6. Density modes (optional): compact / default / comfortable. Scale spacing, not font size, to change density.
  7. Dark mode: verify every color token has a dark-mode counterpart. Check contrast in both.
  8. Input modes: keyboard-only nav works end-to-end, focus-visible rings visible in both themes.

Output

  • Breakpoint strategy in 3 sentences.
  • Changes per breakpoint, specific.
  • Any container queries introduced.
  • Touch target audit.
  • Dark mode verification note.

Success criteria

  • No horizontal scroll at 320px.
  • Nothing truncated awkwardly at 768–1024px (the "forgotten" range).
  • Text never exceeds 75ch on ultra-wide.
  • Touch targets hit 44px on phone.
  • Keyboard nav works across all sizes.

Read the full file on GitHub · 45 lines

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 · 45 lines · 21 tokens per session scan A b574de3bd596

Subscribe to this mod's changes

adapt is a command published in the GitHub repository Dragoon0x/canon (5 stars, last pushed 4mo ago), licensed MIT. It adds 21 tokens to every session and 517 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.