craft

A command for building one user-interface component from start to finish using a set of design and accessibility rules.

In plain words
What is it for?
Use it to create components such as buttons, forms, navigation, or dialogs with keyboard, screen-reader, touch, loading, error, and other states considered.
Why use it?
It provides a structured path through semantics, layout, typography, color, interaction states, responsiveness, and motion so important details are not missed.

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/craft
Clone the repo
git clone --depth 1 https://github.com/Dragoon0x/canon
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 500 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.00019 $0.00500
Opus 5 $0.00010 $0.00250
Sonnet 5 $0.00004 $0.00100
Haiku 4.5 $0.00002 $0.00050

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

Security

Grade A, and why

craft 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/craft.md · 72 lines

What it actually says

/craft

The full workflow. Build one component correctly rather than five components sloppily.

Phases

1. Intent

  • What is this component for?
  • Who uses it, in what state, with what input mode (pointer, touch, keyboard, screen reader)?
  • What is the smallest useful version?

2. Structure

  • Semantic HTML first (<button>, <form>, <nav>, <dialog>) — apply canon-accessibility.
  • ARIA only when HTML alone can't express the role/state.
  • Focus order matches visual order.

3. Layout

  • Apply canon-spatial, canon-responsive.
  • Base grid, container behavior, breakpoints, touch targets (44px floor).

4. Typography

  • Apply canon-typography.
  • Scale, line-height, tracking, weight pairing.

5. Color

  • Apply canon-color.
  • Semantic tokens only, WCAG AA enforced, dark mode paired.

6. Depth

  • Apply canon-depth.
  • Shadow elevation or border, rarely both. Z-index from the scale.

7. States

  • Apply canon-states, canon-interaction.
  • Default, hover, active, focus-visible, disabled, loading, empty, error.
  • Every interactive state has a visible treatment.

8. Motion

  • Apply canon-motion.
  • Duration, easing, reduced-motion fallback.

9. Content

  • Apply canon-ux-writing.
  • Verbs on buttons, labels above inputs, errors that say what/why/how.

10. Performance

  • Apply canon-performance.
  • LCP image hints, no layout shift, light bundle impact.

11. Forms (if applicable)

  • Apply canon-forms.
  • 16px mobile input font, autocomplete, validation timing, Submit is a verb.

12. Audit

  • Run /audit on the result.
  • Fix every critical and warn-level finding.

Output

  • Final component code.
  • Test coverage for each state.
  • Design decisions log: one sentence per decision, tagged to the skill that governed it.

Success criteria

The component survives an audit from a designer, a developer, and an accessibility specialist with zero rework needed.

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 · 72 lines · 19 tokens per session scan A 4f57a665684d

Subscribe to this mod's changes

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