/tsh-stack-frontend:implementing-frontendfrom TSH Stack: Frontend
TSH conventions for React frontend code: component composition, custom hooks, typed props, module boundaries, UI states, design tokens, and Figma-to-code workflow.
Ships in TSH Stack: Frontend. 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.
TSH conventions for frontend application code: how components are composed, where state and modules live, and — when the task has a design — the Figma-to-code workflow that comes before any markup.
This skill covers every change to frontend application code, with or without a design: a new screen from Figma, a custom hook, a store or API client, a refactor that moves modules, a data or logic change that renders nothing new. The rules scope themselves: the Figma gate applies only when the task has a design reference, the token and UI-state rules to code that renders, and the import, export, typing and module rules to all of it.
Local repository rules outrank this skill: the project's existing component
patterns, design system, and styling approach win over the defaults here. The design
and module rules are framework-agnostic; the React rules apply when package.json
depends on react, which is the only framework this plugin covers today.
The React rules target React 19 with the automatic JSX runtime
(jsx: react-jsx). Read the project's package.json before writing React code:
package.json yet — a greenfield app → install the latest stable release
(npm view react version), with react-dom on the same version and
@types/react / @types/react-dom on the same major.context7, which tsh-core bundles, or
react.dev — before applying this skill; where they disagree, the documentation
wins.jsx: react) → JSX needs
React in scope there, so import React from 'react' stays in files with JSX;
the rest of the import rule below still holds — hooks and types come in by name,
never as React.useState or React.FC. Say so, and treat the move to react-jsx
as its own change (configuring-typescript-for-frontend).| Severity | Rule |
|---|---|
| MUST | For a Figma-backed task, fetch and study the design through the Figma MCP before writing or editing any markup, layout, or styling. This pre-implementation design read is a hard gate, distinct from any post-implementation verification loop. |
| NEVER | Implement from assumptions. Design context, tokens, or specs missing or unclear → stop and raise it (as a subagent, report the blocker to the caller; in the main conversation, ask the user). Missing information produces wrong UI; asking produces correct UI. |
| MUST | Take every visual value (colors, spacing, typography, shadows, radii) from the project's design system tokens. No exact token match → use the closest existing token and document the deviation; a genuinely new value → flag it and ask before creating a token. |
| NEVER | Use export default, untyped or any props, or a component with more than ~7 props where composition (children, slots, compound components) would do. |
| MUST | Handle all three UI states in every data-dependent component: loading (progress indicator), error (meaningful message plus recovery action), empty (helpful message when no data). |
| MUST | Declare what the UI looks like from state; never imperatively manipulate the DOM. Compose complex UIs from small, single-responsibility components. |
| MUST | Import what you use from react by name: import { useState, type ReactNode } from 'react'. NEVER import * as React, import React, React.useState, React.memo or React.FC. A project that already uses the namespace style consistently keeps it; one that already mixes the two writes new code with named imports and converts a file only when it changes it anyway. |
| MUST | Add a barrel index.ts only at a public API boundary — a folder other modules consume — with named re-exports. A folder serving one parent is imported directly. |
| NEVER | Leave a pass-through file after moving or renaming a module. A file that only re-exports the new location is not a barrel: update every importer to the new path and delete the old file in the same change. The exceptions are the public API of a package other code consumes — kept and marked @deprecated — and a re-export the plan explicitly stages as transitional. |
Steps 1–2 apply when the task has a design reference. Without one — a hook, a refactor, a data or logic change — start at step 3.
ComponentName.types.ts; named exports and named react imports; the
framework's error-boundary mechanism around data-dependent sections; the three
UI states; tokens for every visual value.The same list is the frontend review checklist: when reviewing a frontend change, check the diff against it and the Non-negotiable Rules above.
- [ ] Single responsibility — one clear purpose
- [ ] Typed props — explicit types, sensible defaults
- [ ] Named export — no default exports
- [ ] Named react imports — no React namespace, no React.FC
- [ ] Design tokens — no hardcoded visual values
- [ ] Error state — handles failure gracefully
- [ ] Loading state — shows progress indicator
- [ ] Empty state — meaningful message when no data
- [ ] Composition — uses children/slots, not prop sprawl
- [ ] Modules — barrels only at public boundaries, no pass-through files after a move
| Reference | Load when | Covers |
|---|---|---|
| Component guidelines | Deciding where state lives, adding a barrel file, moving or splitting modules, or reviewing for anti-patterns | The state decision framework, barrel-file details, the anti-pattern table |
| React patterns | Before writing or reviewing React code | How React implements the composition, state, error-handling, and performance patterns above, plus the lint rule that enforces the import style |
configuring-typescript-for-frontend
— the compiler setup underneath these components.ensuring-accessibility — the a11y patterns
every component here must also satisfy.tsh-product-engineering plugin (reviewing-ui and its agents), which may not be
installed — name the gap rather than improvising verification here.What SKILL.md sets; muted values are Claude Code's defaults
Trigger on: writing or changing any code in a browser app — UI components, custom hooks, context providers, stores, API clients and utilities — translating a Figma design into code, frontend work with no design such as a refactor, data wiring or a logic change, moving or splitting modules and barrel files, choosing where state lives, wiring design tokens, or starting or upgrading a React app. Compiler setup is configuring-typescript-for-frontend; a11y implementation patterns are ensuring-accessibility.
Three short reads, in order
3 skills in this plugin
/configuring-typescript-for-frontendConfigures TypeScript for browser-targeted frontend projects: which version to pin, the tsconfig baseline for a bundler-resolved app, and the React + Vite project layout. Use when starting a frontend project, editing a frontend tsconfig, diagnosing JSX or module-resolution errors, or upgrading TypeScript in a browser app./ensuring-accessibilityWCAG 2.1 AA implementation patterns for building accessible frontend components: semantic HTML first, keyboard navigation and focus management, ARIA only where HTML falls short, contrast minimums, and an axe-core verification step. Use when implementing accessible components, adding keyboard or screen-reader support, or building inclusive forms and interactive widgets.npx claudepluginhub thesoftwarehouse/agentic-collections --plugin tsh-stack-frontendOther plugins' skills for the same job