Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计未展示

css-development%3acreate-componentCSS 开发 3acreate component

Agent Skill

css-development%3acreate-component 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

312

周安装

13

GitHub Stars

31

下载量

104
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:css-development%3acreate-component(CSS 开发 3acreate component)
来源仓库:https://github.com/2389-research/claude-plugins
仓库路径:skills/css-development%3Acreate-component
安装命令:
npx skills add https://github.com/2389-research/claude-plugins --skill css-development:create-component
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/2389-research/claude-plugins --skill css-development:create-component

简介

用于创建新的 CSS 组件,遵循语义化命名和 Tailwind @apply 组合。

  • 自动添加深色模式支持和静态测试覆盖,优先复用现有类。
  • 作为 css-development 子技能,通常由主技能自动调用。
  • 安装命令:npx skills add https://github.com/2389-research/claude-plugins --skill css-development:create-component
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

CSS Development: Create Component

Overview

Guides you through creating new CSS components following established patterns:

  • Semantic class naming
  • Tailwind utility composition via @apply
  • Dark mode support by default
  • Test coverage (static CSS + component rendering)
  • Composition over creation (reuse existing classes)

This is a sub-skill of css-development - typically invoked automatically via the main skill.

When This Skill Applies

Use when:

  • Creating a new styled component (button, card, form field, etc.)
  • Adding new semantic CSS classes to components.css
  • Building reusable UI patterns
  • Need to ensure dark mode support and test coverage

Pattern Reference

This skill follows the patterns documented in the main css-development skill. Key patterns:

Semantic naming: .button-primary not .btn-blue Tailwind composition: Use @apply to compose utilities Dark mode: Include dark: variants by default Composition first: Check if existing classes can be combined Test coverage: Static CSS tests + component rendering tests

Workflow

When this skill is invoked, create a TodoWrite checklist and work through it step-by-step.

Announce Usage

First, announce that you're using this skill:

"I'm using the css-development:create-component skill to guide creating this new CSS component."

Create TodoWrite Checklist

Use the TodoWrite tool to create this checklist:

Creating CSS Component:
- [ ] Survey existing components (read components.css)
- [ ] Check if composition solves it (can existing classes combine?)
- [ ] Identify component type (atom/molecule/organism if new class needed)
- [ ] Choose semantic name (follow existing naming patterns)
- [ ] Write component class (use @apply, include dark: variants)
- [ ] Create markup integration (show React/HTML usage)
- [ ] Write static CSS test (verify class exists)
- [ ] Write component rendering test (verify className application)
- [ ] Document component (add usage comment)

Step-by-Step Details

Step 1: Survey Existing Components

Action: Use the Read tool to read styles/components.css

Purpose: Understand what already exists to ensure consistency and identify reuse opportunities

What to look for:

  • Similar components that could be composed
  • Existing naming patterns to follow
  • Common patterns (button variants, card styles, etc.)

Mark as in_progress before starting, mark as completed when done.


Step 2: Check if Composition Solves It

Action: Analyze if combining existing classes achieves the goal

Examples:

  • Want a "primary button with icon"? → Combine .button-primary + spacing utilities
  • Want a "card with shadow"? → Use .card if it exists, add utility class if needed
  • Want a "highlighted badge"? → Combine .badge + color utilities

YAGNI principle: Only create a new class if composition doesn't work or creates excessive duplication in markup.

Decision:

  • If composition works: Document the combination and SKIP remaining steps (no new class needed)
  • If new class needed: Continue to Step 3

Mark as completed when decision is made.


Step 3: Identify Component Type

Action: Determine atomic design level (if creating new class)

Atoms - Basic building blocks:

  • Single-purpose elements
  • Examples: .button, .input, .badge, .spinner, .link

Molecules - Composed components:

  • Combine multiple atoms
  • Examples: .card, .form-field, .empty-state, .alert

Organisms - Complex components:

  • Multiple molecules + atoms
  • Examples: .page-layout, .navigation, .session-card, .conversation-timeline

Why this matters: Helps scope complexity and dependencies

Mark as completed when type is identified.


Step 4: Choose Semantic Name

Action: Choose a descriptive, semantic class name following existing patterns

Naming patterns from reference codebase:

  • Base + variant: .button-primary, .button-secondary, .button-danger
  • Component + sub-element: .card-title, .card-description, .form-field
  • Context + component: .session-card, .marketing-hero, .dashboard-layout
  • State modifiers: .session-card-active, .button-disabled

Anti-patterns (avoid):

  • Utility names: .btn-blue, .card-sm, .text-big
  • Abbreviations: .btn, .hdr, .desc
  • Generic: .component, .item, .thing

Validation: Name should clearly indicate purpose and fit existing patterns

Mark as completed when name is chosen.


Step 5: Write Component Class

Action: Create the CSS class in styles/components.css using Edit tool

Template:

/* [Component name] - [Brief description]
   Usage: <[element] className="[class-name]">[content]</[element]> */
.[class-name] {
  @apply [background-utilities] [dark-variants];
  @apply [spacing-utilities];
  @apply [typography-utilities];
  @apply [transition-utilities];
}

Required elements:

  1. Documentation comment - What it is, how to use it
  2. Dark mode variants - Include dark: for colors/backgrounds
  3. Logical grouping - Group related utilities (background, spacing, typography, transitions)
  4. Interactive states - Include hover/focus/active if applicable

Example:

/* Primary button - Main call-to-action button with hover lift effect
   Usage: <button className="button-primary">Click me</button> */
.button-primary {
  @apply bg-indigo-500 hover:bg-indigo-700 dark:bg-indigo-600 dark:hover:bg-indigo-800;
  @apply px-6 py-3 rounded-lg font-medium text-white;
  @apply transition-all duration-200 hover:-translate-y-0.5;
  @apply focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2;
}

Use Edit tool to add to existing file (don't overwrite entire file)

Mark as completed when class is written to file.


Step 6: Create Markup Integration

Action: Document how to use the component in different frameworks

Show usage examples for:

  • React (if project uses React)
  • Vanilla HTML (always show this)
  • Vue or other frameworks (if project uses them)

Example documentation:

## Using the button-primary Component

**React:**

const Button = ({ variant = 'primary', className = '', children, ...props }) => { const classes = button-${variant} ${className}.trim(); return <button className={classes} {...props}>{children}</button>; };

// Usage <Button variant="primary">Click me</Button> <Button variant="primary" className="w-full">Full width</Button>


**Vanilla HTML:**

<button class="button-primary">Click me</button> <button class="button-primary custom-class">With custom class</button>

Where to put this: In project documentation, README, or as a comment in the component file

Mark as completed when markup examples are documented.


Step 7: Write Static CSS Test

Action: Add test to styles/__tests__/components.test.ts (or create if doesn't exist)

Purpose: Verify the CSS class exists in the components.css file

Test pattern:

import { readFileSync } from 'fs';
import { describe, it, expect } from 'vitest';

describe('components.css', () => {
  const content = readFileSync('styles/components.css', 'utf-8');

  it('should have button-primary component class', () => {
    expect(content).toContain('.button-primary');
  });

  it('should have button-primary dark mode variants', () => {
    expect(content).toContain('dark:bg-indigo');
  });
});

Key checks:

  • Class exists in file
  • Dark mode variants present (search for dark:)
  • Documentation comment exists (optional but good)

Run test:

npm test styles/__tests__/components.test.ts
# or
vitest styles/__tests__/components.test.ts

Expected: Test passes (green)

Mark as completed when test is written and passing.


Step 8: Write Component Rendering Test

Action: Add component rendering test (framework-specific)

Purpose: Verify className application works in actual components

React example:

import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { Button } from '@/components/atoms/Button';

describe('Button component', () => {
  it('applies button-primary class', () => {
    render(<Button variant="primary">Click</Button>);
    expect(screen.getByRole('button')).toHaveClass('button-primary');
  });

  it('accepts and applies custom className', () => {
    render(<Button variant="primary" className="custom-class">Click</Button>);
    const button = screen.getByRole('button');
    expect(button).toHaveClass('button-primary', 'custom-class');
  });
});

Key checks:

  • Semantic class is applied
  • Custom className can be added
  • Classes don't conflict

Run test:

npm test components/atoms/Button.test.tsx
# or
vitest components/atoms/Button.test.tsx

Expected: Test passes (green)

Mark as completed when test is written and passing.


Step 9: Document Component

Action: Ensure component has usage documentation

Documentation should include:

  1. Comment in CSS - Already done in Step 5
  2. Markup examples - Already done in Step 6
  3. Component API (for framework components) - Props, variants, etc.

Additional documentation (optional but recommended):

  • Add to component style guide if project has one
  • Add to Storybook if project uses it
  • Add visual examples or screenshots

Minimum requirement: CSS comment + markup examples exist

Mark as completed when documentation is verified.


Completion

When all checklist items are completed:

  1. Run all tests to ensure everything passes: npm test
  2. Show summary of what was created:

- Component class name and file location - Test file locations - Documentation locations

  1. Suggest next steps:

- Commit the changes - Create related variants if needed - Use the component in actual UI

Example summary:

Created button-primary component!

Files created/modified:
- styles/components.css (added .button-primary)
- styles/__tests__/components.test.ts (added static CSS test)
- components/atoms/Button.test.tsx (added rendering test)
- components/atoms/Button.tsx (markup integration)

Next steps:
- Commit these changes: git add . && git commit -m "feat: add button-primary component"
- Use in your UI: <Button variant="primary">Click me</Button>
- Create variants if needed: button-secondary, button-danger, etc.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.82%
按下载量换算34

Claude

31.37%
按下载量换算33

Cursor

20.38%
按下载量换算21

Gemini CLI

10.33%
按下载量换算11

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills