component-spec

component-spec is a command for Claude Code from TheBeardedBearSAS/claude-craft. It costs 14 tokens per session (1,861 once invoked), scanned A, original, MIT.

A complete specification for a UI component covering user behaviour, visual structure, responsive states, and accessibility. It brings together UX, UI, and accessibility requirements before implementation.

In plain words
What is it for?
Use it to define components such as buttons or cards, including their purpose, use cases, interactions, variants, HTML semantics, keyboard controls, and screen-reader behaviour.
Why use it?
It prevents important interaction or accessibility details from being decided piecemeal during coding.

Command for Claude Code

Part of the claude-craft plugin — 56 skills, 94 commands, 47 agents, 5 hooks shipped together

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/thebeardedbearsas/claude-craft/component-spec
Clone the repo
git clone --depth 1 https://github.com/TheBeardedBearSAS/claude-craft

Made for: Claude Code.

Or install claude-craft, the plugin that ships this one along with the rest of its 56 skills, 94 commands, 47 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for component-spec

README.md
[![agentmods](https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/component-spec.svg)](https://agentmods.dev/commands/thebeardedbearsas/claude-craft/component-spec)
Your own site
<a href="https://agentmods.dev/commands/thebeardedbearsas/claude-craft/component-spec"><img src="https://agentmods.dev/badge/commands/thebeardedbearsas/claude-craft/component-spec.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,861 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.00014 $0.01861
Opus 5 $0.00007 $0.00931
Sonnet 5 $0.00003 $0.00372
Haiku 4.5 $0.00001 $0.00186

Measured yesterday against content hash 1595634ecc58, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

component-spec 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 yesterday.

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.

.claude/commands/uiux/component-spec.md · 265 lines

How it starts

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

Spécification Complète Composant UI/UX/A11y

Tu es l'Orchestrateur UI/UX. Tu dois produire une spécification complète d'un composant en mobilisant les 3 experts : UX pour le comportement, UI pour le visuel, A11y pour l'accessibilité.

Arguments

$ARGUMENTS

Arguments :

  • Nom du composant à spécifier
  • (Optionnel) Contexte d'usage

Exemple : /uiux:component-spec Button ou /uiux:component-spec "Card Séjour" contexte SaaS tourisme

MISSION

Étape 1 : Analyse UX (Expert UX)

Définir le comportement et l'usage :

  • Objectif du composant
  • Cas d'utilisation principaux
  • Interactions attendues
  • États fonctionnels

Étape 2 : Spécification UI (Expert UI)

Définir le visuel :

  • Anatomie et structure
  • Variantes
  • États visuels
  • Tokens utilisés
  • Responsive

Étape 3 : Spécification A11y (Expert A11y)

Définir l'accessibilité :

  • Sémantique HTML
  • Attributs ARIA
  • Navigation clavier
  • Annonces lecteur d'écran

Étape 4 : Synthèse

══════════════════════════════════════════════════════════════
📦 SPÉCIFICATION COMPOSANT : {NOM}
══════════════════════════════════════════════════════════════

Catégorie : Atom | Molecule | Organism
Date : {date}
Version : 1.0

──────────────────────────────────────────────────────────────
🧠 COMPORTEMENT (UX)
──────────────────────────────────────────────────────────────

### Objectif
{Description du rôle et de la valeur pour l'utilisateur}

### Cas d'utilisation
| Cas | Contexte | Comportement attendu |
|-----|----------|---------------------|
| Principal | {contexte} | {comportement} |
| Secondaire | {contexte} | {comportement} |

### États fonctionnels
| État | Déclencheur | Comportement |
|------|-------------|--------------|
| default | Initial | {comportement} |
| loading | Action en cours | {comportement} |
| success | Action réussie | {comportement} |
| error | Échec | {comportement} |
| empty | Pas de données | {comportement} |

### Feedback utilisateur
| Action | Feedback | Délai |
|--------|----------|-------|
| Click | {feedback} | Immédiat |
| Hover | {feedback} | Immédiat |
| Submit | {feedback} | < 200ms |

──────────────────────────────────────────────────────────────
🎨 VISUEL (UI)
──────────────────────────────────────────────────────────────

### Anatomie

┌─────────────────────────────────┐ │ [Icon] Label [Action] │ │ Description │ └─────────────────────────────────┘


- **Slot 1** : {description}
- **Slot 2** : {description}

### Dimensions
| Propriété | Mobile | Tablet | Desktop |
|-----------|--------|--------|---------|
| min-width | {val} | {val} | {val} |
| height | {val} | {val} | {val} |
| padding | {val} | {val} | {val} |

### Variantes
| Variante | Usage | Différences visuelles |
|----------|-------|----------------------|
| primary | CTA principal | {tokens} |
| secondary | Action secondaire | {tokens} |
| ghost | Action tertiaire | {tokens} |
| destructive | Suppression | {tokens} |

### États visuels
| État | Background | Border | Text | Autres |
|------|------------|--------|------|--------|
| default | --color-{x} | --color-{x} | --color-{x} | |
| hover | --color-{x} | --color-{x} | --color-{x} | cursor: pointer |
| focus | --color-{x} | --color-{x} | --color-{x} | outline: 2px |
| active | --color-{x} | --color-{x} | --color-{x} | transform |
| disabled | --color-{x} | --color-{x} | --color-{x} | opacity: 0.5 |
| loading | --color-{x} | --color-{x} | --color-{x} | spinner |

### Micro-interactions
| Trigger | Animation | Duration | Easing |
|---------|-----------|----------|--------|
| hover | {effect} | 150ms | ease-out |
| click | {effect} | 100ms | ease-in |
| focus | {effect} | 0ms | - |

### Tokens utilisés
```css
/* Couleurs */
--color-primary-500
--color-neutral-100
--color-error-500

Read the full file on GitHub · 265 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. yesterday First seen · 265 lines · 14 tokens per session scan A 1595634ecc58

Subscribe to this mod's changes

component-spec is a command published in the GitHub repository TheBeardedBearSAS/claude-craft (105 stars, last pushed 2d ago), licensed MIT. It adds 14 tokens to every session and 1,861 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-09-03.