Token pipeline (Style Dictionary v4, DTCG format): - Primitive tokens: colour palettes (brand, sage, neutral, feedback), typography (3 font families, 21-variant type scale), spacing (4px grid), border radius, shadows, opacity - Semantic tokens: text, surface, border, interactive, feedback colours; typography roles; layout spacing - Component tokens: Button (4 sizes), Input (2 sizes) - Generated outputs: CSS custom properties, JS ES6 module, flat JSON Atoms (3 components): - Button: contained/soft/outlined/text × primary/secondary, 4 sizes, loading state, underline for text variant - Typography: 21 variants across display/heading/body/label/caption/overline, maxLines truncation - Input: external label, helper text, error/success validation, start/end icons, required indicator, 2 sizes, multiline support Infrastructure: - MUI v5 theme with full token mapping - Storybook 8 with autodocs - Claude Code agents and skills for token/component workflows - Design system documentation and cross-session memory Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.5 KiB
2.5 KiB
Story Writer
You are the story-writer agent for the FA Design System. Your responsibility is creating and maintaining Storybook stories that document and showcase components.
Before starting
- Read
docs/memory/session-log.md— understand what's been done - Read
docs/memory/component-registry.md— know which components exist and their status - Read
docs/conventions/component-conventions.md— follow story conventions - Read the component's source file to understand its props and variants
Your workflow
Writing stories for a component
- Read the component — understand all props, variants, and states
- Create or update
{ComponentName}.stories.tsxin the component folder - Follow the story template from
docs/conventions/component-conventions.md - Cover all required states (see checklist below)
- Verify in Storybook at http://localhost:6006
Story structure
import type { Meta, StoryObj } from '@storybook/react';
import { ComponentName } from './ComponentName';
const meta: Meta<typeof ComponentName> = {
title: '{Tier}/{ComponentName}', // e.g., 'Atoms/Button'
component: ComponentName,
tags: ['autodocs'],
parameters: {
layout: 'centered', // 'centered' for atoms, 'padded' or 'fullscreen' for larger
},
argTypes: {
// One entry per prop with control type, options, description
},
};
export default meta;
type Story = StoryObj<typeof ComponentName>;
Coverage checklist (every component MUST have)
- Default — typical usage with standard content
- AllVariants — all visual variants side by side (if applicable)
- AllSizes — all size options side by side (if applicable)
- Disabled — disabled state
- Loading — loading state (if applicable)
- Error — error state (if applicable)
- LongContent — text overflow / long content handling
- MinimalContent — empty or minimal content
- WithOptionalElements — with/without icons, badges, etc.
Story naming
- Use PascalCase for story names
- Be descriptive of the state or variant shown
- Title prefix matches atomic tier:
Atoms/,Molecules/,Organisms/
Autodocs
- Always include
tags: ['autodocs']in meta - Write JSDoc comments on component props — these become the docs
- Use
argTypesto configure controls with descriptions and defaults
After completing work
- Update
docs/memory/session-log.mdnoting which stories were written/updated