hermes

Build a reusable UI component

Builds a typed, accessible UI component from a description or screenshot, with loading, empty and error states and a usage example. Use when adding a component to a frontend.

context

Components built from a mock-up usually cover only the state in the mock-up. In production the data is late, empty, failing, or three times longer than the design assumed, and someone is using a keyboard or a screen reader. A reusable component also needs an API other engineers can guess: typed props, sensible defaults, composition instead of a pile of boolean flags, and no hard-coded copy.

task

Build a component from this description:

Styling: (when it says "match project", find and use the project's existing approach and design tokens).

  1. If you were given an image, list what you can read from it (layout, hierarchy, text, controls) separately from what you are guessing (exact spacing, colours, hover states). Map colours and spacing to the nearest existing tokens instead of hard-coding values.
  2. Find two existing components in the repo and copy their file layout, naming, prop style, styling method and test approach.
  3. Design the API: typed props with defaults; controlled and uncontrolled use if it holds state; slots or children for content that varies; callbacks named for intent (onSelect, not onClick2). Expose a ref to the root element (a ref prop in React 19, forwardRef before it) and pass remaining attributes and class names through where the framework allows it.
  4. Implement every state that applies: default, loading (skeleton or spinner with aria-busy), empty (message plus a next action), error (message plus retry), disabled, and overflow (long text, many items, narrow viewport).
  5. Build accessibility in: native elements first (button, a, input, dialog), an accessible name for every control, full keyboard operation, visible focus, contrast from the tokens, and respect for prefers-reduced-motion.
  6. Take all user-visible text through props or the project's i18n layer. Hard-code no copy.
  7. Write tests in the project's framework for each state, the main interactions (including by keyboard), and the callbacks. Add an automated accessibility check if the project already uses one. Add a story or demo entry if the project has Storybook or similar.
constraints
  • No new dependencies unless the description requires one; prefer what the project has.
  • Do not change shared tokens, global styles or other components.
  • If the description and existing design-system components overlap, reuse or extend the existing one and say so instead of building a duplicate.
  • Do only what was asked. If you notice something else worth changing, mention it in one line at the end instead of changing it.
  • Keep the change as small as it can be while still being correct.
  • Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
  • If the information you need is not available, say what is missing and how to get it instead of inventing it.
output format

Assumptions

What you inferred or guessed, one line each.

API

| Prop | Type | Default | Description |

Code

Each file in its own code block, headed by its path.

Tests

One line per test: what it proves.

Usage

A short example covering the default and error states.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Implementation
level
Intermediate
made for
Frontend engineer, Full-stack engineer
needs
repo-read, file-write
risk
edits-files
version
v1.0.0 · incubating
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install build-ui-component --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill build-ui-component -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Implementation
PersonaAccessibility

Accessibility specialist

Accessibility specialist who builds and reviews with WCAG, the ARIA Authoring Practices and real assistive-technology behaviour in mind, ranking barriers by who is blocked.

accessibility-specialist
PromptImplementation

Put a change behind a feature flag

Wraps new behaviour behind a feature flag with a safe default, a kill switch, tests for both paths and a cleanup ticket. Use when shipping a risky change incrementally.

add-feature-flag
PromptImplementation

Add rate limiting to an API

Adds rate limiting to API endpoints with a fitting algorithm, keys, per-tier limits, standard headers, 429 responses and tests. Use when protecting endpoints from abuse or overload.

add-rate-limiting
PersonaImplementation

Backend engineer

Acts as a backend engineer focused on correct data handling, clear API contracts, explicit failure modes and services that are easy to operate. Use as a builder or reviewer persona for server code.

backend-engineer
PromptImplementation

Build a REST endpoint end to end

Implements one HTTP endpoint with route, input validation, handler, error mapping and tests in the project's own framework and conventions. Use when adding an API route.

build-rest-endpoint
PromptImplementation

Build a webhook handler

Implements a webhook receiver with signature checks, replay protection, idempotent processing, fast acknowledgement, async work, retries and tests. Use when integrating Stripe, GitHub or similar.

build-webhook-handler