ワンクリックで
modify-db-component
Modifies an existing DB UX Design System Mitosis component (add variants, update props, change styles).
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Modifies an existing DB UX Design System Mitosis component (add variants, update props, change styles).
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Creates a new DB UX Design System component with Mitosis source, SCSS, typed model, and Playwright tests.
Implements production-ready UI using DB UX Design System v3 components, tokens, and icons with a discovery-first approach.
Migrates legacy DB UI v2 code (cmp-*, elm-*, rea-* classes, <db-*> Web Components, db-color-* tokens) to DB UX Design System v3.
Runs, analyzes, and fixes Playwright and accessibility tests for a specific DB UX component.
| name | modify-db-component |
| description | Modifies an existing DB UX Design System Mitosis component (add variants, update props, change styles). |
| triggers | ["modify component","change component","update component","add variant to component","add prop to component","edit component","refactor component"] |
| inputs | [{"name":"component_slug","type":"string","required":true,"description":"Component directory name in kebab-case (e.g. 'button', 'navigation-item')"},{"name":"component_name","type":"string","required":false,"description":"Optional PascalCase symbol name (e.g. 'Button'). If omitted, derive it from component_slug."},{"name":"instruction","type":"string","required":true,"description":"What to change (e.g. 'add a new variant called outline')"},{"name":"figma_file_key","type":"string","required":false,"description":"Figma file key. Required for visually-driven changes (new variant, layout, spacing). Not needed for purely technical refactorings."},{"name":"figma_node_id","type":"string","required":false,"description":"Figma node ID of the target component/frame. Required together with figma_file_key for visual changes."}] |
| requires | [{"context":"context/architecture.md","autoLoad":true}] |
| tools | ["db-ux/list_components","db-ux/get_component_props","db-ux/get_component_details","db-ux/get_example_code","db-ux/get_design_tokens","db-ux/list_design_token_categories","db-ux/list_icons","db-ux/docs_search","figma/get_figma_data","figma/download_figma_images"] |
| outputs | ["packages/components/src/components/{component_slug}/model.ts","packages/components/src/components/{component_slug}/{component_slug}.lite.tsx","packages/components/src/components/{component_slug}/{component_slug}.scss","packages/components/src/components/{component_slug}/{component_slug}.spec.tsx"] |
| on_error | {"max_retries":3,"actions":[{"log":"Review the shell output (lint/test/build) and fix reported errors before retrying."},{"fallback":"If errors persist after 3 retries, report to user with full error output."}]} |
Throughout this skill:
{component_slug} = kebab-case directory/file name (e.g. navigation-item){component_name} = PascalCase symbol name derived from {component_slug} (e.g. navigation-item -> NavigationItem)DB{component_name} = full component class name (e.g. DBNavigationItem).db-{component_slug} = CSS class (e.g. .db-navigation-item)context/architecture.md IS in context.@db-ux/mcp-server) IS connected.component_slug IS provided by user. Derive component_name from component_slug unless explicitly provided.list_components).figma_file_key and figma_node_id SHOULD be provided. If missing for a visual change, ask user before proceeding.list_components to confirm the component exists.get_component_props with the component name to load the current model.ts.get_component_details to understand the current examples and showcase structure.packages/components/src/components/{component_slug}/model.tspackages/components/src/components/{component_slug}/{component_slug}.lite.tsxpackages/components/src/components/{component_slug}/{component_slug}.scsspackages/components/src/components/{component_slug}/{component_slug}.spec.tsxBased on the user's instruction, update {component_slug}.spec.tsx:
Rules:
toHaveScreenshot() tests..db-{component_slug}) remains unchanged.After updating the spec, build the project, generate outputs, and run the component tests from output/react:
pnpm run build && pnpm run build-outputs &&
cd output/react && pnpm run test:components
The RED phase is only complete if:
If the spec has syntax errors, fix them first and re-run until you get clean "missing implementation" failures.
model.tsmodel.ts to understand the current type definitions and prop structure.DB{component_name}DefaultProps with a JSDoc comment.{component_slug}.lite.tsx.lite.tsx to understand the current component structure and patterns.model.ts update, following the patterns already used in the component.packages/components/src/styles/internal/ for shared internal styles and mixins. Also review other components for similar patterns that could be combined or reused, and suggest those..lite.tsx components.id={props.id ?? props.propOverrides?.id} pattern.cls('db-{component_slug}', props.className) usage.{component_slug}.scss.scss to understand the current styling patterns.list_design_token_categories then get_design_tokens for relevant categories.variables.$db-*) from @db-ux/core-foundations/build/styles/variables. Only use CSS custom properties (var(--db-*)) as a fallback when no SCSS variable is available.@use. NO hardcoded values. NO !important. Max 3 levels of nesting.If the change introduces a new visual variant or feature, update files inside packages/components/src/components/{component_slug}/ (NOT in showcases/):
examples/<feature>.example.lite.tsx.examples/_{component_slug}.arg.types.ts with new control options.showcase/{component_slug}.showcase.lite.tsx to include the new example.agent/{component_slug}.agent.lite.tsx with new usage example.Showcase files in showcases/ are generated from these and must not be edited manually.
pnpm run build. MUST SUCCEED.pnpm run test. ALL MUST PASS.Build framework outputs:
pnpm run build-outputs
This MUST succeed.
Create changeset:
pnpm changeset
Select @db-ux/core-components (only if the changes also affect styling: SCSS/CSS) and all JavaScript framework output packages.
Bump type:
patch for bug fixes.minor for new features (new variant, new prop).major if a prop was renamed, removed, or had its type changed.list_componentstest command, non-zero exit capturedmodel.ts updated.lite.tsx updated (no inline styles, propOverrides preserved).scss updated (tokens only)pnpm run build passespnpm run test passespnpm run build-outputs passespnpm changeset| Thought | Response |
|---|---|
| "Edit React output directly" | STOP. .lite.tsx ONLY. |
| "Hardcoded color for this variant" | STOP. Use var(--db-*). |
| "Tests can wait" | STOP. Update tests FIRST. TDD is mandatory. |
| "I know the token name" | STOP. ALWAYS query MCP. |
| "Removing this prop is fine" | STOP. Breaking change. Confirm with user. |
| "Skip showcase update" | STOP. New visual feature = showcase update. |
| "Skip changeset" | STOP. Governance requires it. |
| "build-outputs is optional" | STOP. It is mandatory. |