/pothos:component-designfrom pothos
Designs, builds, reviews and audits UI components (React, React Native or any component technology) as composable puzzle pieces: dependencies that point one way, business-agnostic primitives in product language, clean platform-standard APIs with consistent names, closed states, accessibility designed in, and contracts with one test per line so components stay easy to test, extend and maintain. Ships scripts that check dependency direction, names, contract-to-test coverage, and run type-check and tests in a scratch copy. Use it when designing, implementing, reviewing or auditing a component, a design-system primitive or a feature module.
Ships in pothos. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Components are puzzle pieces: small, honest about what they need, and joined by composition rather than hidden behind configuration. Design them so they are easy to test, extend and maintain, and so anyone can verify them by reading the contract next to the tests. This file is the judgment; references/ holds examples and rules; scripts/ checks what can be checked mechanically. Planning and sequencing a migration across a codebase is a process concern and stays out of this skill.
author, body, action, media); a feature component renders one concept of one product (JobCard) by composing primitives. Asked for something reusable with no design system: build both, the primitive and a thin feature on top.references/mechanics.md, Project plumbing): a second button costs every future consumer a choice. Then read one component and one test next to where yours goes. With no project, write your assumptions at the top of each file.references/contract.md) before the code.scripts/verify.sh, scripts/lint.py and scripts/check_contract.py, and fix until they pass. Render the preview and look at it.Read references/examples.md first: most decisions below are shown there as a good and a bad version side by side.
media, title, meta, not listing, price, bedrooms). A feature reaches another feature only through its public entry. Data flows down as props; what happens flows up as events.disabled, open, value, onClick). A URL change is a link. Invent a name only where the platform has none.references/naming.md), checked by scripts/lint.py.| Decide | Options | Rule | Example |
|---|---|---|---|
| Each piece of content | slot prop · part · typed data | Slot prop for a fixed region the component places (column, corner, wrapper): avatar={…}. Part for what varies, repeats or grows: <Comment.Meta>. Typed data only when the component operates on the items (orders, derives state, counts): steps={[…]} | Comment, Stepper |
| A part every consumer would add | default · explicit part | Render it by default; replaceable with a slot, removable with null. Native structures (tables) keep their HTML parts | Callout |
| Nesting | nested part · composed component | Nest only when it reads root values or the root lays it out. One dot level | Chat |
| Many items | children · owned iteration · typed data | Children by default. Owned iteration for virtualization, select-all or items the component computes. Neighbor-dependent layout is a grouping part, never a per-item flag | Chat, Stepper |
| Each state | controlled · uncontrolled with default · by presence · internal · derived | Controlled (value + onValueChange, open + onOpenChange) by default. Transient UI is controlled by presence and asks to leave with onDismiss. Hover, focus and timers are internal. A value that follows from props or other state is derived at render, never stored (references/mechanics.md, State) | Tabs, Workbench |
| A value several parts need | root value · part prop | Root only when several parts need it or it is a whole-component state (readOnly) | Chat |
| States that exclude each other | union · booleans | One union per independent axis, each member carrying its data; exhaustive switch with never | Stepper |
| Names | see references/naming.md | Platform words for platform states (open, checked, disabled); item identity value; aria-label when the name lands on the root; handlers named by where they land; never default as a union value | Tag, Tabs |
| Optional capabilities | handler presence | A capability exists only when its handler is passed: no onWidthChange, no resize handle | Workbench |
| Layout panes on narrow screens | derived · separate state | Derive the visible pane from the selection (nothing selected shows the list; Back clears it); never a second pane state that can contradict it. Escape is handled by the innermost layer and stopped | Workbench |
| Where code lives | primitive · feature · screen | Primitives in the shared UI folder with no business imports; business rules, data and copy in the feature; routing and wiring in the screen. scripts/lint.py checks the direction | Card in two layers |
| Extracting a piece | private file · shared · inline | A piece with one coherent job, a name a consumer would look for and tests of its own may be a file of its own, private to the feature; it moves to the shared UI or hooks folder only when a second consumer appears. Never for length alone, or because the design file has a layer with that name. State ownership is the "Each state" row, whatever the request says | Extracting a piece |
| Outer layout | none | No outer margin, width or self-positioning; overlaid parts offer an Anchor and placement | Comment |
| Copy | consumer's | A primitive holds no copy, numbers or units; accessible names content can't provide are required props | AvatarGroup |
| Files and exports | namespace with Root · plain export | Parts make a namespace (<Tabs.Root>); no parts, a plain export. Project conventions win | Tabs |
| Change to an existing API | additive · migration | Optional part, then optional prop, then union value. Otherwise migrate every consumer in one change; pin current behavior with tests first | — |
Anything the input doesn't settle is written in the contract's Decisions with its reason. When the input asks for something these principles reject (reading the URL), satisfy it from the consumer side, show the recipe and record the deviation. When it contradicts a documented spec or a design decision, keep the documented behavior and ask. A visual change to a shared primitive (weight, size, color across every use) is a design question, not a fix.
scripts/check_contract.py <README.md> <test files…> lists the lines with no matching test.describe('given …'), one plain sentence per it (it('sends it again when the reader presses Retry')), with setup, action and check separated by blank lines. Names use the product's words so a non-technical person understands them.scripts/lint.py <src> --business-words <the domain's words> flags imports that point the wrong way (a primitive importing a feature, domain, DTO or data module; a feature reaching into another feature's internals), business words in primitive props, and names off the vocabulary (isOpen, onSelect, selectedId, default as a value, id as an item's identity).scripts/verify.sh <project> [overlay-dir] runs the project's type-check and tests in a scratch copy, so the project is never modified; with an overlay, its src/ is laid over the copy and only the overlay's test files run (every test when the overlay has none). Without a project, scripts/verify.sh --minimal <dir> builds a minimal one.Details and tooling: references/testing.md. How to write the tests themselves (test data, what to replace, timers, async): the testing standards listed under Coding standards in the session context (standards/testing.md in this plugin).
| File | Read when |
|---|---|
references/examples.md | Always, first: good and bad versions of the decisions above |
references/naming.md | Naming anything |
references/accessibility.md | Roles, names, keyboard, focus, announcements per pattern |
references/contract.md | Writing the contract |
references/testing.md | Writing and running tests |
references/mechanics.md | React mechanics: context, registration, defaults, pass-through, hosts, layouts, scroll containers, sortable lists |
references/feature-components.md | Building a feature component |
references/audit.md | Reviewing a folder of existing components |
evals/ | Changing this skill: run the fixed eval set and compare scores before and after |
evals/README.md (opens in a new tab)evals/evals.json (opens in a new tab)evals/fixture.py (opens in a new tab)evals/fixtures/reuse-existing/AGENTS.md (opens in a new tab)evals/fixtures/reuse-existing/env.d.ts (opens in a new tab)evals/fixtures/reuse-existing/package.json (opens in a new tab)evals/fixtures/reuse-existing/setup.ts (opens in a new tab)evals/fixtures/reuse-existing/src/features/projects/ProjectActions.test.tsx (opens in a new tab)evals/fixtures/reuse-existing/src/features/projects/ProjectActions.tsx (opens in a new tab)evals/fixtures/reuse-existing/src/hooks/useControllableState.ts (opens in a new tab)evals/fixtures/reuse-existing/src/ui/Button/Button.module.css (opens in a new tab)evals/fixtures/reuse-existing/src/ui/Button/Button.test.tsx (opens in a new tab)evals/fixtures/reuse-existing/src/ui/Button/Button.tsx (opens in a new tab)evals/fixtures/reuse-existing/src/ui/Button/README.md (opens in a new tab)evals/fixtures/reuse-existing/src/ui/TextField/README.md (opens in a new tab)evals/fixtures/reuse-existing/src/ui/TextField/TextField.module.css (opens in a new tab)evals/fixtures/reuse-existing/src/ui/TextField/TextField.test.tsx (opens in a new tab)evals/fixtures/reuse-existing/src/ui/TextField/TextField.tsx (opens in a new tab)evals/fixtures/reuse-existing/src/ui/index.ts (opens in a new tab)evals/fixtures/reuse-existing/src/ui/tokens.css (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub devictoribero/pothos --plugin pothos29 skills in this plugin
/archifyCreate validated architecture, workflow, sequence, data-flow, lifecycle/state, ERD, class, tree, timeline, and waterfall diagrams as explorable standalone HTML with dark/light themes, motion and image/SVG/WebM export. Accept requirements or Mermaid; inspect repository evidence for code-backed diagrams. Use when visualizing systems, API calls, pipelines, schemas, histories, timings, or everyday steps, parts, relationships and states. Also turn an answer into a one-page explainer, with the conclusion first, structured panels, native diagrams and charts, when the user asks for a page, an explainer or an answer to share (做成一页, 用页面讲), or proactively when the user's rules opt in with an [archify explainer: ...] line. Not for dashboards./codebase-designShared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary./code-reviewReview the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding standards?) and Spec (does the code match what the originating issue/spec asked for?). Runs both reviews in parallel sub-agents and reports them side by side. Use when the user wants to review a branch, a PR, work-in-progress changes, or asks to "review since X".