USE THIS when asked to work on a new or existing (WEB) CDS React component in packages/web
npx skills add https://github.com/coinbase/cds --skill dev.cds-web
<!-- TODO: nested AGENTS.md files should work but they seem a little flaky at the moment. Intelligent mdc files are working better -->
Use this guidance when adding ComponentConfigProvider defaults for the specific component you are editing.
packages/web/src/core/componentConfig.ts using its *BaseProps:import type { MyComponentBaseProps } from '../category/MyComponent';
export type ComponentConfig = {
MyComponent?: ConfigResolver<MyComponentBaseProps>;
};
useComponentConfig in the component and destructure from merged props:import { useComponentConfig } from '../hooks/useComponentConfig';
export const MyComponent = memo((_props: MyComponentProps) => {
const mergedProps = useComponentConfig('MyComponent', _props);
const { className, style, ...props } = mergedProps;
return <Box className={className} style={style} {...props} />;
});
_props as the input variable and mergedProps as the configured output.*BaseProps (not polymorphic/full *Props).Use Linaria for zero-runtime CSS. Always use CDS theme CSS variables for colors, spacing, typography, and other design tokens.
Reference packages/web/src/core/theme.ts:53-119 for the CSS variable naming pattern.
import { css, cx } from '@linaria/core';
const containerCss = css`
/* Spacing tokens */
padding: var(--space-2);
gap: var(--space-1);
/* Color tokens */
background: var(--color-bgPrimary);
color: var(--color-fgPrimary);
border: 1px solid var(--color-line);
/* Border radius tokens */
border-radius: var(--borderRadius-400);
/* Typography tokens */
font-size: var(--fontSize-body);
&:hover {
background: var(--color-bgPrimaryHover);
}
`;
// Merge classNames with cx utility **in CORRECT ORDER**
<div
className={cx(
containerCss, // Base styles first
isCompact && conditionClassToApply, // Conditional computed styles
className, // User-provided className prop
classNames.root, // granular overrides last
)}
/>;
IMPORTANT: Using CSS variables ensures components respond correctly to theme changes (light/dark mode, brand themes).
Design tokens from packages/common/src/core/theme.ts map to CSS variables:
--color-{tokenName} (e.g., --color-bgPrimary, --color-fgMuted)--space-{scale} (e.g., --space-2 = 16px, --space-3 = 24px)--fontSize-{font}, --fontWeight-{font}, --lineHeight-{font}, --fontFamily-{font}--borderRadius-{size}, --borderWidth-{size}--iconSize-{size}, --avatarSize-{size}, --controlSize-{name}--shadow-{level}Reference packages/web/src/styles/media.ts for breakpoint values:
Use the Box component's responsive prop API for responsive values:
<Box padding={{ base: 2, phone: 1, desktop: 3 }} />
classNames object prop for granular overrides on child elements within the component.classNames object are specific to the component they should never be on the *BaseProps typedata-active, data-disabled, data-variant, data-filledstyle and styles object props for overriding inline styles.style and styles props should never be on the *BaseProps type.useMemo hook and applied in the correct order (default styles => style prop => styles[ELEMENT_NAME] prop).Example:
type ComponentProps = ComponentBaseProps & {
style?: React.CSSProperties;
styles?: { root?: React.CSSProperties; label?: React.CSSProperties };
};
Use Framer Motion for complex animations:
import { m as motion, AnimatePresence } from 'framer-motion';
<AnimatePresence>
{visible && (
<motion.div
initial={{ opacity: 0, y: -8 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: -8 }}
/>
)}
</AnimatePresence>;
For simple transitions, prefer CSS transitions in Linaria.
Use ARIA attributes:
<div role="group" aria-roledescription="carousel" aria-live="polite">
<button aria-pressed={isActive} tabIndex={isVisible ? 0 : -1} />
</div>
className?: string - CSS class always applied to root elementstyle?: React.CSSProperties - inline styles always applied to root elementas prop for element type (where applicable e.g. see Box)Use Expo DOM components to run web code in a webview on native and as-is on web. Migrate web code to native incrementally.
Frontend development guidelines for React/TypeScript applications. Modern patterns including Suspense, lazy loading, useSuspenseQuery, file organization with features directory, MUI v7 styling, TanStack Router, performance optimization, and TypeScript best practices. Use when creating components, pages, features, fetching data, styling, routing, or working with frontend code.
Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag
| Build Shopify apps, extensions, themes using GraphQL Admin API, Shopify CLI, Polaris UI, and Liquid. "shopify theme", "liquid template", "polaris", "shopify graphql", "shopify webhook", "shopify billing", "app subscription", "metafields", "shopify functions"
Build Gradio web UIs and demos in Python. Use when creating or editing Gradio apps, components, event listeners, layouts, or chatbots.
MANDATORY prerequisite — load this skill BEFORE every `generate_diagram` tool call. NEVER call `generate_diagram` directly without loading this skill first. Trigger whenever the user asks to create, generate, draw, render, sketch, or build a diagram — flowchart, architecture diagram, sequence diagram, ERD or entity-relationship diagram, state diagram or state machine, gantt chart, or timeline. Also trigger when the user mentions Mermaid syntax or wants a system architecture, decision tree, dependency graph, API call flow, auth handshake, schema, or pipeline visualized in FigJam. Routes to type-specific guidance, sets universal Mermaid constraints, and tells you when to use a different diagram type or skip the tool entirely (mindmaps, pie charts, class diagrams, etc.).
Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (LCP, INP, CLS) and supplementary metrics (FCP, TBT, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.
Algorithmic philosophies are computational aesthetic movements that are then expressed through code. Output .md files (philosophy), .html files (interactive viewer), and .js files (generative algorithms).
Take coinbase/dev.cds-web from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.