feat(skill): add swc-consumer-migration skill for Spectrum 1 to 2 upgrades#6233
feat(skill): add swc-consumer-migration skill for Spectrum 1 to 2 upgrades#6233blunteshwar wants to merge 1 commit into
Conversation
…rades Adds a consumer-facing skill under 2nd-gen/packages/.ai/skills/swc-consumer-migration/ that helps application developers migrate from @spectrum-web-components/* (1st-gen) to @adobe/spectrum-wc (2nd-gen). The skill collects per-component consumer migration guides shipped inside node_modules, detects which components the consumer uses from their package.json, and applies each migration component-by-component with explicit checkpoints. Includes: - SKILL.md with preflight, collect, detect, and per-component migration steps plus explicit stop conditions - scripts/collect-guides.mjs (zero-dep, Node 18+) that walks node_modules across both 1st-gen per-package and 2nd-gen single-package layouts and emits guides + manifest to <cwd>/.swc-migration/ - references/usage.md with guide parsing rules, a worked badge example, and a post-migration checklist - references/template.md as the canonical guide structure for component authors Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
Description
Adds a new skill at
2nd-gen/packages/.ai/skills/swc-consumer-migration/that helps consumers of Spectrum Web Components migrate their applications from 1st-gen (@spectrum-web-components/*) to 2nd-gen (@adobe/spectrum-wc).The skill is invoked from a consumer's project (via Claude Code, Cursor, or Codex) and:
node_modules, finds every Spectrum Web Components package, and copies each component'sconsumer-migration-guide.mdxinto<cwd>/.swc-migration/guides/. Amanifest.jsonlists every package found, withguidePath: nullfor packages that ship no guide. Supports both 1st-gen per-package layout and 2nd-gen single-package (@adobe/spectrum-wc) layout. Falls back to a local checkout via--repo=<path>when guides aren't shipped innode_modulesyet.package.json(and workspace package.jsons) to detect which Spectrum Web Components are in use, cross-references with the manifest, and surfaces the list for confirmation before any code changes.Files added (4):
SKILL.md— entry point with frontmatter, preflight, three numbered steps, stop conditions, failure modesscripts/collect-guides.mjs— Node 18+, zero deps, supports--help,--cwd,--repo,--quietreferences/usage.md— guide parsing rules, worked badge example, post-migration checklistreferences/template.md— canonical guide structure for component authorsMotivation and context
Consumers upgrading from Spectrum 1 to Spectrum 2 currently have to read each component's
consumer-migration-guide.mdxby hand and apply changes manually. This skill turns that into a guided, automatable workflow that reuses the per-component guides authors already write under2nd-gen/packages/swc/components/<name>/consumer-migration-guide.mdx(canonical location confirmed by inspectingbadge).The skill is opt-in and lives under
2nd-gen/packages/.ai/skills/, so it does not affect the published@adobe/spectrum-wcpackage or any component source.Related issue(s)
Screenshots (if appropriate)
N/A — no UI changes.
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeaturesManual review test cases
Help flag works
node 2nd-gen/packages/.ai/skills/swc-consumer-migration/scripts/collect-guides.mjs --help--help,--cwd,--repo,--quietand exit code 0.Repo-fallback collection works
node <repo>/2nd-gen/packages/.ai/skills/swc-consumer-migration/scripts/collect-guides.mjs --repo=<repo-checkout><temp>/.swc-migration/guides/badge.mdto exist (badge is the only component with a guide today).<temp>/.swc-migration/manifest.jsonto list the badge entry with a populatedguidePath.node_modules detection works
package.jsonlists@spectrum-web-components/badge, run the script with no flags.node_modules/@spectrum-web-components/badge/.Device review
N/A — CLI script and skill markdown only.
Accessibility testing checklist
Documentation/tooling only; no component, no DOM, no interactive surface ships from this PR.
aria-labelfor icon-only badges) per that component'sconsumer-migration-guide.mdx.references/usage.mdrequires that every accessibility delta listed in a component's guide is either applied or flagged with aTODO(swc-migration):comment.🤖 Generated with Claude Code