skills/spectrum-2-web/SKILL.md
Design and build web UIs with Adobe Spectrum 2 design system. Applies S2 layout principles, visual hierarchy, spacing, and component composition to produce accessible interfaces. Outputs vanilla CSS with Spectrum tokens (static pages) or Spectrum Web Components (interactive apps). Recommends tier based on complexity. Covers sp-theme setup, side-effect imports, overlay system, form patterns, --mod-* token customization, and 14 critical gotchas. Use for: spectrum 2 web, SWC, sp-button, sp-theme, build UI with spectrum, S2 layout, spectrum application, adobe design system, web component form, spectrum overlay.
npx skillsauth add catalan-adobe/skills spectrum-2-webInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Design and build web UIs using Adobe Spectrum 2 with Spectrum Web Components (SWC) or vanilla CSS with Spectrum design tokens.
Read references from this skill's directory. If CLAUDE_SKILL_DIR is
available, references are at ${CLAUDE_SKILL_DIR}/references/. Otherwise,
use Glob to find skills/spectrum-2-web/SKILL.md and derive the path.
Always run this phase first. No reference files are needed yet.
Determine what the user is asking for:
| Intent | Signal | Phases | |--------|--------|--------| | Design + Build | User describes what they want ("build me a settings page", "create a dashboard") | Phase 2 then 3 | | Build only | User has a design, mockup, or specific layout ("implement this with SWC", "convert to Spectrum") | Phase 3 only | | Design only | User wants layout advice ("what layout for a dashboard?", "how should I structure this?") | Phase 2 only |
If ambiguous, ask one clarifying question. Do not over-ask.
Choose the output technology based on what's being built:
| Tier | When to use | Output |
|------|-------------|--------|
| Vanilla CSS + Spectrum tokens | Static/presentational content: landing pages, marketing, docs, no interactivity | Semantic HTML styled with --spectrum-* custom properties |
| Spectrum Web Components | Interactive UI: forms, overlays, navigation, tabs, pickers, data entry | <sp-*> custom elements with side-effect imports |
State your recommendation and rationale. The user can override — accept any explicit preference without pushback.
Check for an existing project:
package.json in the working directory and
parent directories.@spectrum-web-components in
dependencies or devDependencies.| Result | Mode | Output format |
|--------|------|---------------|
| SWC already in dependencies | Project-aware | Separate JS/TS + HTML/template + CSS files; npm imports |
| package.json exists but no SWC | Project-aware | Same, plus npm install instructions |
| No package.json | Self-contained | Single HTML file with CDN imports via JSPM; opens in browser |
Report your classification to the user:
"I'll design and build an interactive settings page using Spectrum Web Components in self-contained mode (single HTML file). Sound good?"
Proceed on confirmation (or immediately if the request is unambiguous).
Runs when intent includes design.
Read these two files before designing:
Select layout pattern. Match the user's request to the closest canonical pattern from the layout reference. If no pattern fits, compose from first principles using the design guide.
Apply S2 visual system. For each page region, specify:
Verify accessibility baseline.
aria-labelPresent the design. Describe to the user:
Wait for confirmation before proceeding to Phase 3. Incorporate feedback if the user suggests changes.
Runs when intent includes build.
Read all four of these before generating code:
Generate a single HTML file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page Title</title>
<script src="https://jspm.dev/@spectrum-web-components/bundle/elements.js"
type="module" async></script>
<style>
/* Layout using Spectrum tokens */
body { margin: 0; font-family: 'Adobe Clean', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, sans-serif; }
</style>
</head>
<body>
<sp-theme system="spectrum-two" color="light" scale="medium">
<!-- All content here -->
</sp-theme>
</body>
</html>
Use CSS Grid or Flexbox for layout, referencing --spectrum-spacing-*
and --spectrum-background-* tokens in the <style> block.
Generate separate files:
JavaScript/TypeScript imports — one side-effect import per component:
// theme (always required)
import '@spectrum-web-components/theme/sp-theme.js';
import '@spectrum-web-components/theme/spectrum-two/theme-light.js';
import '@spectrum-web-components/theme/spectrum-two/scale-medium.js';
// components (only what you use)
import '@spectrum-web-components/button/sp-button.js';
import '@spectrum-web-components/textfield/sp-textfield.js';
// ... one import per component
HTML/template with <sp-theme system="spectrum-two"> wrapper.
CSS file using Spectrum tokens for custom layout.
Install command listing every package needed:
npm install @spectrum-web-components/theme \
@spectrum-web-components/button \
@spectrum-web-components/textfield
# All packages must use the same version
Verify every item before delivering SWC output:
<sp-theme system="spectrum-two"> wraps all components<sp-*> tag has a matching side-effect importlabel="Description" attributetrigger="elementId@click" syntaxvariant on theme → use system="spectrum-two"href on <sp-button> → use <sp-link>variant="cta" → use variant="accent"--system-* CSS overrides (use --mod-* tokens instead)Verify every item before delivering vanilla CSS output:
<nav>, <main>, <section>, <header>,
<form>, proper heading levels--spectrum-* token custom properties@spectrum-css/tokens
or inline the needed variables)<label> elements, visible focus stylesThese rules apply across all phases:
Default to full S2 compliance. Use tokens for all spacing, color, and typography. Follow the visual hierarchy from the design principles.
Always use system="spectrum-two" unless the user explicitly
requests Spectrum 1 or Express theming.
Accept user overrides without blocking. If the user wants a custom color, non-standard spacing, or any deviation — apply it, then note the deviation concisely:
"Applied custom background
#FF5733. The S2-compliant alternative would be--spectrum-informative-background-color-defaultor--spectrum-accent-background-color-default."
Handle missing components gracefully. SWC does not include date pickers, tree views, or composite color pickers. When the design calls for one:
<input type="date">, custom
implementation, or React Spectrum S2 if the project uses React<sp-*> tagsFull details in Token reference and Component guide.
<sp-theme system="spectrum-two" color="light" scale="medium">
<!-- all content inside -->
</sp-theme>
Color options: light, dark. Scale options: medium, large.
import '@spectrum-web-components/theme/sp-theme.js';
import '@spectrum-web-components/theme/spectrum-two/theme-light.js';
import '@spectrum-web-components/theme/spectrum-two/scale-medium.js';
One import per component: @spectrum-web-components/<pkg>/<element>.js
| Intent | Token prefix | Use for |
|--------|-------------|---------|
| Accent/Informative | --spectrum-accent-*, --spectrum-informative-* | Primary actions, links, selection |
| Negative | --spectrum-negative-* | Errors, destructive actions, alerts |
| Notice | --spectrum-notice-* | Warnings, caution states |
| Positive | --spectrum-positive-* | Success, completion, valid states |
| Neutral | --spectrum-neutral-*, --spectrum-gray-* | Secondary actions, borders, muted text |
| Use | Token |
|-----|-------|
| Tight (inline, icon gaps) | --spectrum-spacing-75 to --spectrum-spacing-100 |
| Standard (form fields, list items) | --spectrum-spacing-200 |
| Section (card padding, group gaps) | --spectrum-spacing-300 to --spectrum-spacing-400 |
| Major (page sections, hero areas) | --spectrum-spacing-500 to --spectrum-spacing-600 |
| Need | SWC element |
|------|-------------|
| Button | <sp-button variant="accent\|primary\|secondary\|negative"> |
| Text input | <sp-textfield label="Name"> |
| Dropdown | <sp-picker label="Choose"> + <sp-menu-item> children |
| Checkbox | <sp-checkbox>Label</sp-checkbox> |
| Switch | <sp-switch>Label</sp-switch> |
| Link | <sp-link href="...">Text</sp-link> |
| Tabs | <sp-tabs> + <sp-tab> + <sp-tab-panel> |
| Dialog | <sp-dialog-wrapper> with overlay trigger |
| Toast | <sp-toast variant="info\|positive\|negative"> |
| Card | <sp-card heading="Title"> |
tools
Reduce a webpage to a structural skeleton with semantic tokens. Two-phase pipeline: Phase 1 injects a browser script that tokenizes content ({TEXT}, {HEADING:n}, {IMAGE:WxH}, {CTA:label}, {LINK:label}, {INPUT:type}, {VIDEO}, {ICON}). Phase 2 applies LLM structural reasoning to collapse repeated patterns ({REPEAT:N}), remove decorative wrappers, strip utility classes, and produce skeleton.html + manifest.json. Use when migrating pages to EDS, analyzing page structure, extracting page blueprints, or preparing input for GenAI block generation. Triggers on: reduce page, page skeleton, page blueprint, extract structure, tokenize page, page reduction, structural skeleton, reduce URL.
tools
Capture a spatial hierarchy of rendered DOM elements from any webpage. Injects a pre-built script via playwright-cli that walks the DOM, detects layout grids, extracts backgrounds, prunes invisible nodes, promotes elements rendered outside their DOM parent (overlays, fixed navs, modals), and tags overlay nodes with occlusion metadata. Returns three outputs: LLM-friendly indented text, structured JSON tree, and a nodeMap mapping positional IDs to CSS selectors with background and overlay data. Use before page decomposition, overlay detection, brand extraction, or any workflow that needs structured page analysis. Triggers on: visual tree, capture tree, page structure, page hierarchy, DOM tree, capture visual, page analysis, extract tree.
tools
Summarize any video by analyzing both audio and visuals. Downloads via yt-dlp, extracts transcript (YouTube captions or Whisper), pulls scene-detected keyframes, and produces a multimodal summary with clickable timestamped YouTube links. Use this skill whenever the user wants to summarize a YouTube video, digest a talk or tutorial, get notes from a video, extract key points from a recording, or says things like "tl;dw", "summarize this video", "what's in this video", or pastes a YouTube URL and asks for a summary. Also triggers for non-YouTube URLs that yt-dlp supports.
development
Control Slack via CDP or headless API tokens. Navigate channels, read/send messages, search conversations, check unreads, and manage status. Two modes: CDP (Slack desktop with --remote-debugging-port) for full UI control, or headless (xoxp/xoxb token) for data operations without Slack running. Triggers on: slack, read slack, search slack, slack unreads, send slack message, slack status, navigate slack, check slack, slack messages, go to channel, slack DM.