extract-ui-component

extract-ui-component is a skill for Claude Code, Codex from bitovi/convey. It costs 33 tokens per session (741 once invoked), scanned A, original, MIT.

A guide for turning repeated inline interface code into reusable UI components. UI components are shared building blocks such as buttons, cards, badges, and inputs.

In plain words
What is it for?
It helps find repeated patterns, design TypeScript props, extract components, refactor their usages, and make them keyboard-accessible.
Why use it?
It reduces duplicated code and helps ensure shared components have clear interfaces, correct types, accessibility, and safe integration.

Skill for Claude CodeCodex

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 skills/bitovi/convey/extract-ui-component
Any agent
npx skills add bitovi/convey --skill extract-ui-component
Clone the repo
git clone --depth 1 https://github.com/bitovi/convey

Made for: Claude Code, Codex.

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 extract-ui-component

README.md
[![agentmods](https://agentmods.dev/badge/skills/bitovi/convey/extract-ui-component.svg)](https://agentmods.dev/skills/bitovi/convey/extract-ui-component)
Your own site
<a href="https://agentmods.dev/skills/bitovi/convey/extract-ui-component"><img src="https://agentmods.dev/badge/skills/bitovi/convey/extract-ui-component.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 741 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.00033 $0.00741
Opus 5 $0.00016 $0.00370
Sonnet 5 $0.00007 $0.00148
Haiku 4.5 $0.00003 $0.00074

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

Security

Grade A, and why

extract-ui-component 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 5d 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.

.github/skills/extract-ui-component/SKILL.md · 103 lines

How it starts

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

Extract UI Component Skill

Purpose

Guide the extraction of reusable UI components from inline code patterns. This skill ensures components are:

  • Well-designed with flexible, composable APIs
  • Type-safe with proper TypeScript interfaces
  • Accessible and keyboard-navigable
  • Safely integrated through strategic refactoring

When to Use

  • Component Registry shows a pattern marked ⚠️ NEEDS EXTRACTION
  • You notice the same UI element used 2+ times in your feature
  • Creating generic UI primitives (Button, Card, Badge, Input, etc.)
  • Refactoring inline patterns into shared components

Workflow

1. Analyze Existing Patterns

Goal: Understand all variations before designing the component API.

  1. Review Component Registry for pattern locations
  2. Read through 3-5 examples of the pattern in actual code
  3. Identify variations: visual variants, size variants, state variants, content variants

2. Design Component API

Guidelines:

  • Props: Use TypeScript discriminated unions for variants
  • Composition: Accept children for content
  • Flexibility: Allow className override for edge cases
  • HTML attributes: Spread remaining props to underlying element
  • Defaults: Choose sensible defaults (variant="primary", size="md")
interface ComponentProps extends React.HTMLAttributes<HTMLElement> {
  variant?: 'primary' | 'secondary' | 'success' | 'danger';
  size?: 'sm' | 'md' | 'lg';
  disabled?: boolean;
  className?: string;
  children: React.ReactNode;
}

3. Implement Component

Location: /test-app/src/components/ComponentName.tsx

  • Use TypeScript for type safety
  • Export both the component and its props interface
  • Use string template for className composition
  • Preserve all HTML attributes with ...props
  • Allow className override but apply it last
  • Use semantic HTML elements

4. Refactor Existing Code

Strategy: Refactor incrementally, one file at a time.

  1. Pick one file from Component Registry locations
  2. Add import for the new component
  3. Replace ONE instance of inline pattern with component
  4. Test the page - verify it still works
  5. Replace remaining instances in that file
  6. Commit with descriptive message
  7. Repeat for next file

Read the full file on GitHub · 103 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. 5d ago First seen · 103 lines · 33 tokens per session scan A 15449030734a

Subscribe to this mod's changes

extract-ui-component is a skill published in the GitHub repository bitovi/convey (46 stars, last pushed 19d ago), licensed MIT. It adds 33 tokens to every session and 741 once invoked, about $0.0002 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-30.