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.
npx agentmods add skills/sawrus/agent-guides/component-designnpx skills add sawrus/agent-guides --skill component-designgit clone --depth 1 https://github.com/sawrus/agent-guidesWrote 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.
[](https://agentmods.dev/skills/sawrus/agent-guides/component-design)<a href="https://agentmods.dev/skills/sawrus/agent-guides/component-design"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/component-design.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00061 | $0.01514 |
| Opus 5 | $0.00030 | $0.00757 |
| Sonnet 5 | $0.00012 | $0.00303 |
| Haiku 4.5 | $0.00006 | $0.00151 |
Grade A, and why
component-design 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Component Design Patterns Skill
Expertise: Compound components, controlled/uncontrolled, render props, component API design, accessibility requirements.
When to load
When creating, refactoring, or reviewing React components — especially when choosing between compound, controlled/uncontrolled, or headless patterns, designing typed prop APIs, or implementing accessible interactive widgets.
Component Design Workflow
- Choose pattern — use the decision tree below to select the right component pattern
- Define typed props — follow the Props API Design Rules (explicit variants, no boolean explosion)
- Implement all states — loading, error, empty, success for any async data
- Add accessibility — use the ARIA requirements table to add correct roles and keyboard support
- Verify — confirm keyboard navigation works, screen reader announces states, and TypeScript compiles with
--strict
Pattern Selection Guide
Multiple visual zones in one component? → Slot / Children Props
Coordinated subcomponents sharing state? → Compound Components
Works with react-hook-form / external control? → Controlled/Uncontrolled Hybrid
Self-contained widget with internal state? → Uncontrolled with defaults
Highly customizable rendering? → Render Props / Headless
Pattern 1: Compound Components
Use when: a component has multiple coordinated parts sharing implicit state.
// Context shared between sub-components
const MenuContext = createContext<{ open: boolean; toggle: () => void } | null>(null);
const Menu = ({ children }: { children: React.ReactNode }) => {
const [open, setOpen] = useState(false);
return (
<MenuContext.Provider value={{ open, toggle: () => setOpen(o => !o) }}>
<div role="menu" aria-expanded={open}>{children}</div>
</MenuContext.Provider>
);
};
Menu.Trigger = function MenuTrigger({ children }: { children: React.ReactNode }) {
const ctx = useContext(MenuContext)!;
return (
<button onClick={ctx.toggle} aria-haspopup="true" aria-expanded={ctx.open}>
{children}
</button>
);
};
Menu.Items = function MenuItems({ children }: { children: React.ReactNode }) {
const { open } = useContext(MenuContext)!;
if (!open) return null;
return <ul role="listbox">{children}</ul>;
};
// Usage — caller controls structure
<Menu>
<Menu.Trigger>Options</Menu.Trigger>
<Menu.Items>
<li role="option">Edit</li>
<li role="option">Delete</li>
</Menu.Items>
</Menu>
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.
- 4d ago First seen · 184 lines · 61 tokens per session scan A c9bff1cd0d25
component-design is a skill published in the GitHub repository sawrus/agent-guides (17 stars, last pushed 4d ago), licensed MIT. It adds 61 tokens to every session and 1,514 once invoked, about $0.0003 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.
Other skills, from other repositories
frontend-ui-engineering
Builds production-quality, accessible, responsive user-facing UIs. Use when building or modifying interfaces and pages, creating components, implementing layouts, meeting WCAG accessibility requirements, managing state, or when the output needs to look and feel production-quality rather than AI-generated.
3d-web-experience
Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.
accesslint-scan
Audit a live page for accessibility issues, locate each WCAG violation precisely, and return a selector-grounded fix worklist without editing.
accessibility-compliance-accessibility-audit
You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.
excalidraw-architect
Choose and compose the right Excalidraw diagram - architecture, flowchart, sequence, state, ER, swimlane, process, timeline, quadrant, pyramid, venn, loop, gantt, bar, line, scatter, and more - using the excalidraw-architect-mcp server. Use whenever a reader would learn more from a picture than from prose, or when…
excalidraw-diagram-design
Guide for structuring graph input (nodes and edges) for the Excalidraw Architect MCP tool to produce clean, readable diagrams. Use when generating architecture diagrams, flow diagrams, or any visual diagram via creatediagram or mermaidtoexcalidraw.