Agent Skillsbitjaru/styleseed › ss-component

ss-component

GitHub

生成符合 StyleSeed 设计规范的 React UI 组件,严格遵循设计令牌、语义化属性及无障碍标准。

skills/ss-component/SKILL.md bitjaru/styleseed

Trigger Scenarios

需要创建新的 UI 组件 遵循 StyleSeed 规范生成前端代码

Install

npx skills add bitjaru/styleseed --skill ss-component -g -y
More Options

Use without installing

npx skills use bitjaru/styleseed@ss-component

指定 Agent (Claude Code)

npx skills add bitjaru/styleseed --skill ss-component -a claude-code -g -y

安装 repo 全部 skill

npx skills add bitjaru/styleseed --all -g -y

预览 repo 内 skill

npx skills add bitjaru/styleseed --list

SKILL.md

Frontmatter
{
    "name": "ss-component",
    "description": "Generate a new UI component following the StyleSeed design conventions",
    "allowed-tools": "Read, Write, Edit, Grep, Glob, Bash",
    "argument-hint": "[component-name] [description]"
}

UI Component Generator

Registry-first artifact boundary

When .styleseed/project.json and .styleseed/artifacts/index.json exist, resolve the requested artifact ID first, then read only .styleseed/bundles/<artifact-id>.md and .styleseed/manifests/<artifact-id>.json. Never fall back to the global legacy bundle for a registry project. Legacy projects may use .styleseed/effective-rules.md only when no registry exists.

When NOT to use

  • For full-page scaffolding → use /ss-page
  • For composed multi-component patterns → use /ss-pattern
  • For tweaking an existing component — just edit the file directly
  • For non-StyleSeed projects (no components/ui/ directory or no Tailwind v4)

Generate a new component: $0 Description: $ARGUMENTS

Instructions

  1. First, read the compiled design method:

    • Read .styleseed/effective-rules.md and .styleseed/manifest.json; resolve if stale
    • Read css/theme.css for available design tokens
    • Read css/recipes.css for morphology variables and helper classes
    • Read components/ui/button.tsx as a reference pattern
  2. Follow these conventions strictly:

    • Use function declaration (not const)
    • Add data-slot="component-name" attribute
    • Use cn() from @/components/ui/utils for all className merging
    • Use React.ComponentProps<> for prop typing
    • Always support className prop for overrides
    • Use CVA (class-variance-authority) if the component has variants
    • Use semantic color tokens (bg-card, text-foreground) — never inline hex
  3. Design token usage:

    • Colors: text-foreground, bg-card, text-brand, text-muted-foreground, border-border
    • Pattern surfaces: ss-pattern-surface; insets/controls/icons use the matching ss-* class
    • Primitives use the project token scale; do not hardcode one radius or shadow personality
    • Spacing follows one repeatable selected-recipe rhythm
    • Motion: duration-[var(--duration-fast)], ease-[var(--ease-default)]
  4. Typography rules:

    • Display (36-48px): leading-none tracking-[-0.02em]
    • Heading (18-24px): leading-snug tracking-[-0.01em]
    • Body (14-17px): leading-normal (default tracking)
    • Caption uppercase (10-13px): tracking-[0.05em]
    • Use size-* shorthand instead of w-* h-*
    • Use ms-*/me-* instead of ml-*/mr-* (logical properties)
  5. Accessibility requirements:

    • Minimum touch target: 44x44px (min-h-11 min-w-11)
    • Support aria-* attributes passthrough
    • Use focus-visible:ring-2 focus-visible:ring-ring for keyboard focus
    • Respect prefers-reduced-motion for animations
  6. Export the component as a named export (not default)

  7. Place the file in the appropriate directory:

    • Primitive/reusable → src/components/ui/
    • Composed pattern → src/components/patterns/

Version History

  • bfd06d8 Current 2026-08-19 16:29

    新增基于 registry-first 的工件边界验证逻辑,确保优先读取注册表配置而非全局遗留配置。

  • c414969 2026-08-13 14:12

Same Skill Collection

engine/.claude/skills/ss-a11y/SKILL.md
engine/.claude/skills/ss-audit/SKILL.md
engine/.claude/skills/ss-build/SKILL.md
engine/.claude/skills/ss-component/SKILL.md
engine/.claude/skills/ss-copy/SKILL.md
engine/.claude/skills/ss-dial/SKILL.md
engine/.claude/skills/ss-feedback/SKILL.md
engine/.claude/skills/ss-flow/SKILL.md
engine/.claude/skills/ss-learn/SKILL.md
engine/.claude/skills/ss-lint/SKILL.md
engine/.claude/skills/ss-motion/SKILL.md
engine/.claude/skills/ss-page/SKILL.md
engine/.claude/skills/ss-pattern/SKILL.md
engine/.claude/skills/ss-reference/SKILL.md
engine/.claude/skills/ss-resolve/SKILL.md
engine/.claude/skills/ss-restyle/SKILL.md
engine/.claude/skills/ss-review/SKILL.md
engine/.claude/skills/ss-score/SKILL.md
engine/.claude/skills/ss-setup/SKILL.md
engine/.claude/skills/ss-studio/SKILL.md
engine/.claude/skills/ss-tokens/SKILL.md
engine/.claude/skills/ss-verify/SKILL.md
engine/.claude/skills/styleseed/SKILL.md
extensions/learning/skills/ss-learn/SKILL.md
skills/ss-a11y/SKILL.md
skills/ss-audit/SKILL.md
skills/ss-build/SKILL.md
skills/ss-copy/SKILL.md
skills/ss-dial/SKILL.md
skills/ss-feedback/SKILL.md
skills/ss-flow/SKILL.md
skills/ss-learn/SKILL.md
skills/ss-lint/SKILL.md
skills/ss-motion/SKILL.md
skills/ss-page/SKILL.md
skills/ss-pattern/SKILL.md
skills/ss-reference/SKILL.md
skills/ss-resolve/SKILL.md
skills/ss-restyle/SKILL.md
skills/ss-review/SKILL.md
skills/ss-score/SKILL.md
skills/ss-setup/SKILL.md
skills/ss-studio/SKILL.md
skills/ss-tokens/SKILL.md
skills/ss-verify/SKILL.md
skills/styleseed-design-review/SKILL.md
skills/styleseed/SKILL.md
engine/.claude/skills/ss-update/SKILL.md
skills/ss-update/SKILL.md

Metadata

Files
0
Version
bfd06d8
Hash
ef3259b0
Indexed
2026-08-13 14:12

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 09:03
浙ICP备14020137号-1 $Carte des visiteurs$