xinetzone/SpecWeave / .agents/skills/trae-work-design
trae-work-design
UnverifiedUse this skill to generate well-branded interfaces and assets for TraeWork — a professional workspace design system. Contains tokens, component specs, and UI kit references. Use when the user needs TraeWork-style UI, dashboards, or design assets, or asks to apply the TraeWork tokens and components.
TraeWork Design System
Library Layout
TraeWork/
├── colors_and_type.css # Authoritative Light token source + compatibility aliases
├── css.json # Machine-readable token projection
├── scaffold.css # Reset, typography utilities, layout helpers, shared atoms
├── components.css # Aggregated component definitions from preview marker blocks
├── library-consumption.json # Downstream consumption contract
├── uikit-plan.json # Component whitelist + UIKit screen blueprint
├── assets/icons/ # Canonical bundled SVG icons
├── components/ # Component contracts with token, DOM, asset, and provenance metadata
├── preview/ # Component preview pages
└── ui_kits/ # Page-level Light-mode showcases
Source Boundary
This skill operates on the files shipped in this TraeWork package. Do not assume access to original Figma, product, or upstream design-source evidence unless the user explicitly provides it. Current component contracts use sourceKind: "preview-contract" and medium confidence, so treat preview pages, components.css, and component JSON as the executable contract, not as proof of original design intent.
Required Consumption Order
- Read
README.mdfirst for package scope, known limitations, and authoring rules. - Read
library-consumption.jsonto choose the correct layer for the task. - Read
uikit-plan.jsonfor the current component whitelist and UIKit blueprint. - Read
colors_and_type.cssandcss.jsonfor tokens. - Read
components/index.jsonandcomponents/{slug}.jsonfor component relationships. - Read
components.cssand the closestpreview/component-*.htmlfor reusable markup. - Use
ui_kits/*/index.htmlonly as page-level showcase evidence, not as a production page template.
Design Principles
- Light mode only: do not add Dark-mode token blocks, theme toggles, or
prefers-color-schemebehavior unless the project explicitly reopens Dark-mode migration. - Token-first: every color, radius, spacing, and typography choice must resolve to the existing TraeWork tokens or component classes.
- Quiet by default: neutral surfaces, restrained borders, and typography carry the hierarchy. Use brand color only when an action or status truly needs it.
- Type-first, decoration-last: solve hierarchy with copy, layout, font size, weight, and spacing before adding icons or illustrations.
- Keep the product baseline at
body-base(14px / 20px). Smaller text is reserved for existing micro or dense primitives only. - Use one locale per screen. If the prompt does not explicitly request Chinese, default to English copy.
Brand Essentials
- Theme scope: Light mode only for this migration.
- Brand accent:
--bg-brand. - Page surface:
--bg-base-default. - Card / panel surface:
--bg-base-secondary. - Body baseline:
--body-base-font-size,--body-base-line-height. - Default container radius:
--radius-8; default card/dialog radius:--radius-12. - Metric display numbers use
--font-family-metric; compact numeric values use--code-editor-font-family.
Token And Color Discipline
- Do not hardcode new palettes, raw status hues, or ad hoc alpha overlays. Use the semantic tokens in
colors_and_type.css. - Brand color is scarce: use it for the primary brand action, brand identity moments, and small meaningful status accents. Do not use brand color for generic hover rows, inactive borders, tab underlines, or decorative fills.
- Interactive neutral states should move through the overlay ladder: default surface,
--bg-overlay-l1,--bg-overlay-l2, then--bg-overlay-l3for pressed or selected states. - Status colors are semantic. Use
--status-*-defaultand matching--status-*-surface-*only for actual info, success, warning, alert, or error meaning. - When a token already encodes alpha, do not add extra
opacityon top of it.
Compatibility Contract
Standard variables remain available and must not be removed without a breaking-change note:
--radius-2 / 4 / 6 / 8 / 10 / 12 / 16 / 20 / 24 / 32--radius-xs / sm / md / lg / xl--color-*--bg-layout-1,--bg-layout-2,--border-1--brand-green-*--brand-1..4
The alias values intentionally resolve to the new Light-mode visual system.
Layout And Surface Discipline
- Default page background is
--bg-base-default; cards and panels use--bg-base-secondary; fields and inline controls use--bg-overlay-l1; floating menus use--bg-menu. - Step surface depth one level at a time. Do not place
--bg-base-defaultpanels inside--bg-base-secondarycontainers, because it visually cuts through the surface. - Page padding defaults to
--spacer-32on desktop and--spacer-16on mobile. - Inter-container gaps must breathe: use at least
--spacer-16between related cards,--spacer-24between different card groups,--spacer-32between page sections, and--spacer-48between major regions. - Do not use
--spacer-4,--spacer-6, or--spacer-8as the gap between containers. Those are for icon-label pairs, inline controls, and tight row internals. - Avoid nested bordered or filled containers. Do not put
.ds-cardinside.ds-card; use a single surface with internal dividers and spacing.
Typography And Data
- Use typography tokens as complete sets: family, size, line-height, weight, and letter-spacing should come from the same text style.
- Body copy, controls, list rows, table cells, form labels, helper text, tags, and chips default to
body-baseunless an existing component defines a denser style. - Compact numeric values, counts, IDs, table numbers, chart axes, code, and keyboard hints use
--code-editor-font-familywith tabular figures. - Large KPI, scorecard, analytics, revenue, usage, and conversion display numbers use
--font-family-metric, not mono. - Hero and marketing display text is typeset content, not data; do not apply mono or numeric utility styles to it.
Components
Use these classes as the stable component API:
| Group | Classes |
|---|---|
| Action | .ds-btn, .ds-btn-group |
| Form | .ds-input, .ds-textarea, .ds-select, .ds-check, .ds-radio, .ds-switch, .ds-slider |
| Display | .ds-card, .ds-tag, .ds-avatar, .ds-table, .ds-progress, .ds-code, .ds-kbd |
| Navigation | .ds-tabs, .ds-breadcrumb, .ds-pagination, .ds-menu |
| Overlay | .ds-dialog, .ds-popover |
| Feedback | .ds-notif, .ds-alert, .ds-skeleton |
The component inventory is TraeWork-specific. Do not add or infer components solely to match another design-system package; extend only when the TraeWork source evidence requires it.
Iconography
Icon dimensions refer to rendered width and height, regardless of the SVG viewBox.
- Use local TraeWork SVG assets from
assets/icons/; do not add external icon libraries, icon fonts, emoji icons, CDN icon packs, or runtime-generated icon packages. - Functional monochrome icons should use local SVG assets from
assets/icons/with reserved dimensions and decorativearia-hidden="true"when paired with visible text. Inside token-colored controls such as.ds-btn, prefercurrentColorCSS masks with verified local URLs so icons inherit the button variant color in directfile://previews. Resolve--icon-urlpaths against the CSS rule that consumes them:components.cssfor shared component rules, or the page file for page-local rules. Use<img>for multi-color brand artwork. - Preserve SVG geometry, viewBox, fill/stroke model, and visual proportions. Do not rewrite paths, normalize strokes, or hand-draw replacement glyphs.
- Default icons must render at
16pxby16px. - Compact icons may render at
14pxby14pxin dense controls, menus, input adornments, tags, and other tight UI rows. - Large supporting icons may render at
24pxby24pxon copy-led pages or cards where the icon is used as a stronger visual anchor. - Do not introduce other icon sizes unless the component explicitly requires an exception and the exception is documented with the component.
- Every icon placeholder must reserve its final width and height before the asset loads to avoid layout shift.
- Do not mix icon sources or visual styles in a single view.
- If a matching icon asset is missing, choose text, choose a semantically close local SVG, or remove the icon. Do not substitute an external glyph.
Component Usage Rules
- Compose new UI from
.ds-*primitives before adding page-local styles. - Use at most one brand CTA per view. If two actions have equal weight, demote both to neutral variants.
- Form focus uses contrast and neutral overlays, not brand glow or decorative rings.
- Cards use surface tint and borders for elevation. Avoid drop shadows unless an existing component already defines them.
- Selected rows, menu items, tabs, and pagination states use neutral overlays. Do not use brand fill for generic selection.
- Notifications and alerts keep body text neutral; status is conveyed through the icon and status surface/border tokens.
- Tables should use row dividers and inline status tags. Do not tint whole rows for status.
Visual Composition
- Prefer refined component composition over decorative illustration. Big visual cards should be assembled from
.ds-card,.ds-tag,.ds-avatar,.ds-progress,.ds-code,.ds-table, text styles, and 1px rule lines. - Avoid decorative SVG backgrounds, gradient blobs, icon clusters used as decoration, mascots, glow effects, fake charts, and arbitrary abstract shapes.
- If illustration is necessary, keep it flat, token-based, and restrained: use
currentColorplus at most one brand accent. - Charts must use chart and semantic tokens for series, axes, labels, legends, tooltips, and backgrounds. Do not introduce random chart palettes.
Motion And Interaction
- Keep motion short and functional: 120ms for hover or focus, 200ms for component state changes, and 300ms maximum for layout reveal.
- Prefer opacity and small translation. Translation should stay within 4px; avoid scale above 1.05.
- State changes must not shift layout geometry. Hover, active, selected, and disabled states should preserve component size.
- Respect
prefers-reduced-motionby removing nonessential transitions and translation.
Accessibility
- Maintain readable contrast: 4.5:1 for body text and at least 3:1 for icons and large text.
- Focus must remain visible. Do not remove focus rings without an equivalent.
- Interactive elements must be keyboard reachable in visual order.
- Icon-only buttons must provide an
aria-label. - Decorative icons and illustrations should use
aria-hidden="true"; meaningful SVGs need accessible text.
Authoring Rules
- Do not change file names or directory names.
- Do not hardcode a new palette. Use semantic tokens from
colors_and_type.css. - Keep old token aliases intact for downstream compatibility.
- Keep component CSS inside the matching
preview/component-*.htmlmarker block, then regeneratecomponents.cssfrom those blocks. - Keep preview-only layout, demo, and showcase helper styles outside component marker blocks so they do not enter
components.css. - When regenerating
components.css, normalize local asset URLs so paths remain valid fromcomponents.cssitself. - Update these maintenance notes when changing stable
.ds-*component APIs; call out any breaking change explicitly. - Use local TraeWork SVG assets from
assets/icons/, and follow the Iconography rules above; do not add external icon libraries. - Preserve Light-mode behavior unless the project explicitly reopens Dark-mode migration.
- Keep
components/{slug}.json,components/index.json,library-consumption.json,uikit-plan.json, andui_kits/*/quality-report.jsonsynchronized when component APIs or UIKit usage changes. - Before shipping, compare against the closest preview or UI kit and verify surface depth, icon size, typography scale, brand color usage, and accessibility labels.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |