ワンクリックで
documentation-robotics-viewer-patterns
Show coding patterns for React Flow nodes, Zustand, and Tailwind
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Show coding patterns for React Flow nodes, Zustand, and Tailwind
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Start Storybook server and list available stories
Sync OpenAPI specs and generate TypeScript types
Display architectural overview and critical file locations
Run Vite build and check bundle size
Build Docker image and run deployment checks
Run Playwright tests and Storybook validation
| name | documentation_robotics_viewer-patterns |
| description | Show coding patterns for React Flow nodes, Zustand, and Tailwind |
| user_invocable | true |
| args | ["nodes|stores|styles|accessibility"] |
| generated | true |
| generation_timestamp | "2026-02-23T16:11:03.139Z" |
| generation_version | 2.0 |
| source_project | documentation_robotics_viewer |
| source_codebase_hash | 00a2f9723e9a7f64 |
Quick-reference skill for documentation_robotics_viewer coding patterns and conventions.
/documentation_robotics_viewer-patterns [nodes|stores|styles|accessibility]
Args:
nodes - React Flow custom node pattern (CRITICAL - deviations cause rendering failures)stores - Zustand state management patternstyles - Tailwind CSS + Flowbite component patternaccessibility - WCAG 2.1 AA compliance patternDefault: Shows all patterns if no arg provided
Displays established coding patterns from the documentation_robotics_viewer codebase to ensure consistency and prevent common issues. This skill helps developers:
All patterns are extracted from production code in src/core/ and src/apps/embedded/.
nodes PatternRead these reference files:
# Example custom nodes showing the pattern
src/core/nodes/motivation/GoalNode.tsx
src/core/nodes/business/BusinessFunctionNode.tsx
src/core/nodes/c4/ContainerNode.tsx
# Registration files (where nodes must be added)
src/core/types/reactflow.ts
src/core/nodes/index.ts
src/core/services/nodeTransformer.ts
Display:
✅ Critical Node Requirements from CLAUDE.md:
YOUR_NODE_WIDTH, YOUR_NODE_HEIGHT)memo() wrapperrole="article" + aria-label for accessibilitydisplayName for React DevTools📝 Registration Checklist:
YourNodeData interface in src/core/types/reactflow.tssrc/core/nodes/<category>/index.tsnodeTypes map in src/core/nodes/index.tsnodeTransformer.ts in 3 places:
getNodeTypeForElement() - Map element type to node type stringextractNodeData() - Map element properties to node dataprecalculateDimensions() - Import and use dimension constants🔍 Example from GoalNode.tsx:
export const GOAL_NODE_WIDTH = 180;
export const GOAL_NODE_HEIGHT = 100;
export const GoalNode = memo(({ data, id: _id }: { data: GoalNodeData; id?: string }) => {
return (
<div
role="article"
aria-label={`Goal: ${data.label}`}
style={{
width: GOAL_NODE_WIDTH,
height: GOAL_NODE_HEIGHT,
/* ... inline styles ... */
}}
>
<Handle type="target" position={Position.Top} id="top" />
<Handle type="source" position={Position.Bottom} id="bottom" />
<Handle type="target" position={Position.Left} id="left" />
<Handle type="source" position={Position.Right} id="right" />
{/* content */}
</div>
);
});
GoalNode.displayName = 'GoalNode';
⚠️ Common Pitfalls:
nodeTransformer.ts mappingstores PatternRead these reference files:
# Core stores (framework-agnostic)
src/core/stores/modelStore.ts
src/core/stores/layerStore.ts
src/core/stores/elementStore.ts
# App stores (can use route context)
src/apps/embedded/stores/authStore.ts
src/apps/embedded/stores/viewPreferenceStore.ts
src/apps/embedded/stores/chatStore.ts
Display:
✅ Zustand Store Pattern (NO React Context):
import { create } from 'zustand';
interface YourStoreState {
data: YourData[];
isLoading: boolean;
error: string | null;
// Actions
fetchData: () => Promise<void>;
setData: (data: YourData[]) => void;
reset: () => void;
}
export const useYourStore = create<YourStoreState>((set, get) => ({
// Initial state
data: [],
isLoading: false,
error: null,
// Actions
fetchData: async () => {
set({ isLoading: true, error: null });
try {
const response = await fetch('/api/data');
const data = await response.json();
set({ data, isLoading: false });
} catch (err) {
set({ error: err.message, isLoading: false });
}
},
setData: (data) => set({ data }),
reset: () => set({ data: [], isLoading: false, error: null }),
}));
📂 Store Organization:
src/core/stores/) - NO route/app dependenciessrc/apps/embedded/stores/) - CAN use route context🎯 Usage in Components:
import { useYourStore } from '@/stores/yourStore';
function YourComponent() {
// Subscribe to specific state slices
const data = useYourStore((state) => state.data);
const fetchData = useYourStore((state) => state.fetchData);
// Or get multiple values
const { data, isLoading, error } = useYourStore();
}
⚙️ Store Features:
styles PatternRead these reference files:
# Flowbite components in use
src/apps/embedded/components/common/ErrorBoundary.tsx
src/apps/embedded/components/shared/ViewToggle.tsx
src/core/components/base/BaseControlPanel.tsx
# Tailwind configuration
tailwind.config.ts
src/theme/
Display:
✅ Tailwind + Flowbite Pattern:
import { Button, Card, Badge, Modal, ListItem } from 'flowbite-react';
// ❌ NEVER: import { List } from 'flowbite-react'; ... <List.Item>
// ✅ ALWAYS: import { ListItem } from 'flowbite-react'; ... <ListItem>
function YourComponent() {
return (
<Card className="dark:bg-gray-800">
<h2 className="text-lg font-semibold text-gray-900 dark:text-white">
Title
</h2>
<Button color="blue" size="sm" className="dark:bg-blue-600">
Action
</Button>
<Badge color="success">Active</Badge>
</Card>
);
}
🎨 Styling Rules:
List.Item → ListItemdark:bg-gray-800, dark:text-white🌙 Dark Mode Pattern:
<div className="bg-white dark:bg-gray-900">
<h1 className="text-gray-900 dark:text-white">Heading</h1>
<p className="text-gray-600 dark:text-gray-400">Text</p>
<button className="bg-blue-600 hover:bg-blue-700 dark:bg-blue-500 dark:hover:bg-blue-600">
Button
</button>
</div>
🧪 Test Selectors:
<Card data-testid="business-function-card">
<Button data-testid="edit-function-btn">Edit</Button>
</Card>
accessibility PatternRead these reference files:
# Node accessibility examples
src/core/nodes/motivation/GoalNode.tsx
src/core/nodes/business/BusinessFunctionNode.tsx
# Edge accessibility examples
src/core/edges/ElbowEdge.tsx
# Accessibility documentation
documentation/ACCESSIBILITY.md
Display:
✅ WCAG 2.1 AA Compliance Requirements:
Nodes:
<div
role="article" // ✓ Semantic role
aria-label={`Goal: ${data.label}`} // ✓ Descriptive label with type
style={{
border: `2px solid ${data.stroke}`, // ✓ 3:1 contrast minimum
backgroundColor: data.fill,
}}
>
{/* 4 Handles for keyboard navigation */}
<Handle type="target" position={Position.Top} id="top" />
<Handle type="source" position={Position.Bottom} id="bottom" />
<Handle type="target" position={Position.Left} id="left" />
<Handle type="source" position={Position.Right} id="right" />
</div>
Edges:
<path
d={edgePath}
role="img" // or "button" for interactive edges
aria-label={`Association: from ${sourceNode.label} to ${targetNode.label}`}
onClick={handleClick}
onKeyDown={handleKeyDown}
tabIndex={0} // if interactive
className="stroke-gray-600 dark:stroke-gray-400"
/>
🎨 Color Contrast Standards:
reviewOnFail: true for violations (marked for manual review)⌨️ Keyboard Navigation:
🧪 Testing Accessibility:
# Start Storybook
npm run storybook:dev
# Open http://localhost:61001
# Navigate to any story → Accessibility tab (bottom panel)
# Run automated a11y tests on all 578 stories
npm run test:storybook:a11y
# Full test suite (includes accessibility checks)
npm test
📋 Accessibility Checklist:
role="article" and descriptive aria-labelrole="button" or role="img"npm run test:storybook:a11y)# 1. See the node pattern
/documentation_robotics_viewer-patterns nodes
# 2. Read reference implementation
cat src/core/nodes/motivation/GoalNode.tsx
# 3. Follow the checklist to create your node
# 4. Test in Storybook
npm run storybook:dev
# 5. Validate accessibility
npm run test:storybook:a11y
# 1. See the store pattern
/documentation_robotics_viewer-patterns stores
# 2. Read reference implementation
cat src/core/stores/modelStore.ts
# 3. Create your store following the pattern
# 4. Test with unit tests
npm test -- tests/unit/stores/yourStore.spec.ts
# 1. See the style pattern
/documentation_robotics_viewer-patterns styles
# 2. Verify dark mode support
npm run storybook:dev
# Toggle dark mode in Storybook toolbar
# 3. Run full test suite
npm test
# 1. See accessibility requirements
/documentation_robotics_viewer-patterns accessibility
# 2. Run a11y tests
npm run test:storybook:a11y
# 3. Review detailed documentation
cat documentation/ACCESSIBILITY.md
CLAUDE.md (main development guide)documentation/ACCESSIBILITY.mdThis skill was automatically generated on 2026-02-23.