ワンクリックで
migration-documentation
// Phase 7 of 1st-gen to 2nd-gen component migration. Use to write JSDoc, Storybook stories, and usage docs so the component is usable and understandable by others.
// Phase 7 of 1st-gen to 2nd-gen component migration. Use to write JSDoc, Storybook stories, and usage docs so the component is usable and understandable by others.
Use when creating a per-component migration guide for application developers upgrading from Spectrum 1 Web Components to Spectrum 2 components.
Phase 5 of 1st-gen to 2nd-gen component migration. Use to migrate CSS to the 2nd-gen structure, apply Spectrum 2 tokens, and ensure stylelint passes.
Phase 2 of 1st-gen to 2nd-gen component migration. Use to create the 2nd-gen file and folder structure, wire up exports, and confirm the build passes before implementation begins.
Sub-task after Phase 6 of 1st-gen to 2nd-gen component migration. Use to verify all migrated files conform to the project style guides, run linters, and surface any guideline gaps as PR comment notes.
Phase 4 of 1st-gen to 2nd-gen component migration. Use to implement WCAG-aligned semantics, ARIA, keyboard support, and focus management, and document accessibility behavior.
Phase 8 of 1st-gen to 2nd-gen component migration. Use to run final checks, verify lint/tests/build/Storybook, update the workstream status table, and open a PR.
| name | migration-documentation |
| description | Phase 7 of 1st-gen to 2nd-gen component migration. Use to write JSDoc, Storybook stories, and usage docs so the component is usable and understandable by others. |
Phase 7 of the 1st-gen → 2nd-gen component migration. The goal is JSDoc on the public API and Storybook stories covering the main use cases.
See also: documentation for Adobe content writing standards to follow when writing usage docs.
You are writing for the next contributor, not for yourself. Every story and JSDoc line should answer the question a new engineer would ask six months from now. Avoid restating the implementation. Explain the intent and the constraints. Be sure to follow the documentation skill for writing style and content expectations.
Read the migration plan at CONTRIBUTOR-DOCS/03_project-planning/03_components/[component]/migration-plan.md when available before documenting the component. Use it to understand constraints, behavioral decisions, and deferred work. If it is missing, stale, or intentionally incomplete, derive the needed context from the implemented component and source material and call out the missing plan as a risk. See also migration-plan-contract.
Before writing anything, read the ### Documentation section of the migration plan at CONTRIBUTOR-DOCS/03_project-planning/03_components/[component]/migration-plan.md. Make a note of every unchecked item. These are the documentation gaps Phase 7 must close. Return to this checklist at the end and confirm which items are now covered by stories JSDoc and which remain outstanding.
Before writing any "when to use" or "why to use" descriptions for sizes, variants, states, or behaviors — stop and ask the user for the authoritative source. Acceptable sources include:
1st-gen/packages/[component]/README.md)If no source is available at authoring time, limit JSDoc to technically verifiable facts only (see What NOT to include below). Do not invent guidance. Implementors cannot easily distinguish AI-invented guidance from documented design decisions, which erodes trust in the documentation.
If Phase 5 (migration-styling) was completed, 2nd-gen/packages/swc/components/[component]/stories/[component].stories.ts likely already exists with Playground, Overview, Anatomy, Options, States, and Behaviors stories — all structurally correct but without JSDoc prose. Phase 7's job is to:
// TODO comment in Phase 5.UpcomingFeatures
story (tag: ['upcoming', 'description-only']). Keep it brief and
bullet-point style — the goal is to signal roadmap intent, not explain
scope decisions. Write from a consumer's perspective (what it does for
them) and omit internal framing like "not part of the initial scope" or
"deferred pending a decision". Do not include ticket numbers or TODO
language.If the stories document already exists, do not recreate the file from scratch. Augment what is already there.
Follow Phase 7: Documentation in the washing machine workflow doc — it covers what to do, what to check, common problems, and the quality gate for this phase.
If the docs need to describe behavior that differs from the approved migration plan, follow migration-plan-contract.
Follow the rules in What NOT to include strictly. Write JSDoc that is technically accurate and sourced. Where no source is available for usage guidance, describe what the attribute does (its effect) rather than when to use it.
Return to the list from Step 0. For each unchecked documentation item in the migration plan:
consumer-migration-guide skill — do not add it to the stories file.Verify @cssprop completeness and accuracy. Read the component's CSS file (2nd-gen/packages/swc/components/[component]/[component].css) and list every exposed --swc-* property. Then read the SWC class (2nd-gen/packages/swc/components/[component]/[Component].ts) and confirm:
@cssprop tag on the primary class export.--_swc-* private properties are tagged.Fix any missing or inaccurate @cssprop tags before marking Phase 7 complete. If Phase 5 was skipped or the tags were never added, add them now.
The following must never appear in .stories.ts files:
Do not include "Migration note:", "replaces legacy X", or "1st-gen vs 2nd-gen" content in story JSDoc. Migration guidance is for developers upgrading from 1st-gen and belongs in the dedicated consumer migration guide produced by the consumer-migration-guide skill. Stories are consumed by all users of the component, not only by people migrating.
Do not write "when to use" guidance without a verified source. Limit descriptions to:
outline is only supported with primary and secondary)// ❌ Bad — invented guidance
// Small (s): Compact areas, inline actions, or dense UIs
// Primary: Default neutral family for most actions (e.g., Save, Done, Next)
// ✅ Good — verifiable facts
// Buttons come in four sizes: small (s), medium (m), large (l), and extra-large (xl). Medium is the default.
// Four variants are available: primary (default), secondary, accent, and negative.
// accent and negative are fill-only; fill-style="outline" is not supported for these variants.
Em dashes, Jira ticket references, and filler closing sentences are prohibited by the shared formatting rules in .ai/rules/text-formatting.md and .ai/rules/stories-documentation.md. Those rules are active in context — apply them here.
The staticColorsDemo decorator (2nd-gen/packages/swc/.storybook/decorators/static-colors-demo.ts) applies backgrounds using > *:first-child (dark, for static-color="white") and > *:last-child (light, for static-color="black"). It expects exactly two direct children — one per color.
If a component supports both static-color values and multiple fill styles (e.g., fill + outline), render each color group inside its own wrapper <div> so the decorator sees two children, not four:
// ✅ Correct — two direct children, each color group in its own div
export const StaticColors: Story = {
render: (args) => html`
<div
style="display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;"
>
${FILL_STYLES.map((fillStyle) =>
template({ ...args, 'static-color': 'white', 'fill-style': fillStyle })
)}
</div>
<div
style="display: flex; gap: 16px; flex-wrap: wrap; justify-content: center;"
>
${FILL_STYLES.map((fillStyle) =>
template({ ...args, 'static-color': 'black', 'fill-style': fillStyle })
)}
</div>
`,
parameters: { staticColorsDemo: true },
tags: ['options', '!test'],
};
// ❌ Wrong — four flat siblings; middle two get no background
export const StaticColors: Story = {
render: (args) => html`
${STATIC_COLORS.flatMap((color) =>
FILL_STYLES.map((fillStyle) =>
template({ ...args, 'static-color': color, 'fill-style': fillStyle })
)
)}
`,
parameters: { staticColorsDemo: true },
tags: ['options', '!test'],
};
If the component only has one fill style (no outline variant), a single flat list of two elements is fine — the first will get the dark background and the last the light background automatically.