Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问clear审计异常

assembling-components组装部件

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

588

周安装

25

GitHub Stars

350

下载量

206
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:assembling-components(组装部件)
来源仓库:https://github.com/ancoleman/ai-design-components
仓库路径:skills/assembling-components
安装命令:
npx skills add https://github.com/ancoleman/ai-design-components --skill assembling-components
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ancoleman/ai-design-components --skill assembling-components

简介

assembling-components 用于将 AI 设计组件转化为生产就绪的前端应用结构。

  • 适用于 React、Next.js、Vue 等项目中整合主题、布局、数据可视化等模块。
  • 它提供框架特定的上下文与 token 系统集成方案,确保组件正确挂载与样式生效。
  • 输出包含脚手架生成与依赖注入指导,需配合本地预览验证视觉效果。
  • 涉及路由变更时应同步更新导航配置与构建脚本以避免运行时错误。

SKILL.md

Assembling Components

Purpose

This skill transforms the outputs of AI Design Components skills into production-ready applications. It provides library-specific context for our token system, component patterns, and skill chain workflow - knowledge that generic assembly patterns cannot provide. The skill validates token integration, generates proper scaffolding, and wires components together correctly.

When to Use

Activate this skill when:

  • Completing a skill chain workflow (theming → layout → dashboards → data-viz → feedback)
  • Generating new project scaffolding for React/Vite, Next.js, FastAPI, Flask, or Rust/Axum
  • Validating that all generated CSS uses design tokens (not hardcoded values)
  • Creating barrel exports and wiring component imports correctly
  • Assembling components from multiple skills into a unified application
  • Debugging integration issues (missing entry points, broken imports, theme not switching)
  • Preparing generated code for production deployment

Skill Chain Context

This skill understands the output of every AI Design Components skill:

┌──────────────────┐     ┌──────────────────┐     ┌──────────────────┐
│ theming-         │────▶│ designing-       │────▶│ creating-        │
│ components       │     │ layouts          │     │ dashboards       │
└──────────────────┘     └──────────────────┘     └──────────────────┘
        │                        │                        │
        ▼                        ▼                        ▼
    tokens.css               Layout.tsx             Dashboard.tsx
    theme-provider.tsx       Header.tsx             KPICard.tsx
        │                        │                        │
        └────────────────────────┴────────────────────────┘
                                 │
                                 ▼
                    ┌──────────────────────┐
                    │ visualizing-data     │
                    │ providing-feedback   │
                    └──────────────────────┘
                                 │
                                 ▼
                         DonutChart.tsx
                         Toast.tsx, Spinner.tsx
                                 │
                                 ▼
                    ┌──────────────────────┐
                    │ ASSEMBLING-          │
                    │ COMPONENTS           │
                    │ (THIS SKILL)         │
                    └──────────────────────┘
                                 │
                                 ▼
                       WORKING COMPONENT SYSTEM

Expected Outputs by Skill

SkillPrimary OutputsToken Dependencies
theming-componentstokens.css, theme-provider.tsxFoundation
designing-layoutsLayout.tsx, Header.tsx, Sidebar.tsx--spacing-*, --color-border-*
creating-dashboardsDashboard.tsx, KPICard.tsxAll layout + chart tokens
visualizing-dataChart components, legends--chart-color-*, --font-size-*
building-formsForm inputs, validation--spacing-*, --radius-*, --color-error
building-tablesTable, pagination--color-*, --spacing-*
providing-feedbackToast, Spinner, EmptyState--color-success/error/warning

Token Validation

Run Validation Script (Token-Free Execution)

# Basic validation
python scripts/validate_tokens.py src/styles

# Strict mode with fix suggestions
python scripts/validate_tokens.py src --strict --fix-suggestions

# JSON output for CI/CD
python scripts/validate_tokens.py src --json

Our Token Naming Conventions

/* Colors - semantic naming */
--color-primary: #FA582D;          /* Brand primary */
--color-success: #00CC66;          /* Positive states */
--color-warning: #FFCB06;          /* Caution states */
--color-error: #C84727;            /* Error states */
--color-info: #00C0E8;             /* Informational */

--color-bg-primary: #FFFFFF;       /* Main background */
--color-bg-secondary: #F8FAFC;     /* Elevated surfaces */
--color-text-primary: #1E293B;     /* Body text */
--color-text-secondary: #64748B;   /* Muted text */

/* Spacing - 4px base unit */
--spacing-xs: 0.25rem;   /* 4px */
--spacing-sm: 0.5rem;    /* 8px */
--spacing-md: 1rem;      /* 16px */
--spacing-lg: 1.5rem;    /* 24px */
--spacing-xl: 2rem;      /* 32px */

/* Typography */
--font-size-xs: 0.75rem;   /* 12px */
--font-size-sm: 0.875rem;  /* 14px */
--font-size-base: 1rem;    /* 16px */
--font-size-lg: 1.125rem;  /* 18px */

/* Component sizes */
--icon-size-sm: 1rem;      /* 16px */
--icon-size-md: 1.5rem;    /* 24px */
--radius-sm: 4px;
--radius-md: 8px;
--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);

Validation Rules

Must Use Tokens (Errors)Example Fix
Colors#FA582Dvar(--color-primary)
Spacing (≥4px)16pxvar(--spacing-md)
Font sizes14pxvar(--font-size-sm)
Should Use Tokens (Warnings)Example Fix
Border radius8pxvar(--radius-md)
Shadows0 4px...var(--shadow-md)
Z-index (≥100)1000var(--z-dropdown)

Framework Selection

React/TypeScript

Choose Vite + React when:

  • Building single-page applications
  • Lightweight, fast development builds
  • Maximum control over configuration
  • No server-side rendering needed

Choose Next.js 14/15 when:

  • Need server-side rendering or static generation
  • Building full-stack with API routes
  • SEO is important
  • Using React Server Components

Python

Choose FastAPI when:

  • Building modern async APIs
  • Need automatic OpenAPI documentation
  • High performance is required
  • Using Pydantic for validation

Choose Flask when:

  • Simpler, more flexible setup
  • Familiar with Flask ecosystem
  • Template rendering (Jinja2)
  • Smaller applications

Rust

Choose Axum when:

  • Modern tower-based architecture
  • Type-safe extractors
  • Async-first design
  • Growing ecosystem

Choose Actix Web when:

  • Maximum performance required
  • Actor model benefits your use case
  • More mature ecosystem

Implementation Approach

1. Validate Token Integration

Before assembly, check all CSS uses tokens:

python scripts/validate_tokens.py <component-directory>

Fix any violations before proceeding.

2. Generate Project Scaffolding

React/Vite:

// src/main.tsx - Entry point
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { ThemeProvider } from '@/context/theme-provider'
import App from './App'
import './styles/tokens.css'   // FIRST - token definitions
import './styles/globals.css'  // SECOND - global resets

createRoot(document.getElementById('root')!).render(
  <StrictMode>
    <ThemeProvider>
      <App />
    </ThemeProvider>
  </StrictMode>,
)

index.html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>{{PROJECT_TITLE}}</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>

3. Wire Components Together

Theme Provider:

// src/context/theme-provider.tsx
import { createContext, useContext, useEffect, useState } from 'react'

type Theme = 'light' | 'dark' | 'system'

const ThemeContext = createContext<{
  theme: Theme
  setTheme: (theme: Theme) => void
} | undefined>(undefined)

export function ThemeProvider({ children }: { children: React.ReactNode }) {
  const [theme, setTheme] = useState<Theme>('system')

  useEffect(() => {
    const root = document.documentElement
    const systemTheme = window.matchMedia('(prefers-color-scheme: dark)').matches
      ? 'dark' : 'light'
    root.setAttribute('data-theme', theme === 'system' ? systemTheme : theme)
    localStorage.setItem('theme', theme)
  }, [theme])

  return (
    <ThemeContext.Provider value={{ theme, setTheme }}>
      {children}
    </ThemeContext.Provider>
  )
}

export const useTheme = () => {
  const context = useContext(ThemeContext)
  if (!context) throw new Error('useTheme must be used within ThemeProvider')
  return context
}

Barrel Exports:

// src/components/ui/index.ts
export { Button } from './button'
export { Card } from './card'

// src/components/features/dashboard/index.ts
export { KPICard } from './kpi-card'
export { DonutChart } from './donut-chart'
export { Dashboard } from './dashboard'

4. Configure Build System

vite.config.ts:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'

export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'),
    },
  },
})

tsconfig.json:

{
  "compilerOptions": {
    "target": "ES2020",
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "moduleResolution": "bundler",
    "jsx": "react-jsx",
    "strict": true,
    "baseUrl": ".",
    "paths": { "@/*": ["./src/*"] }
  },
  "include": ["src"]
}

Cross-Skill Integration

Using Theming Components

// Import tokens first, components inherit token values
import './styles/tokens.css'

// Use ThemeProvider at root
<ThemeProvider>
  <App />
</ThemeProvider>

Using Dashboard Components

// Components from creating-dashboards skill
import { Dashboard, KPICard } from '@/components/features/dashboard'

// Wire with data
<Dashboard>
  <KPICard
    label="Total Threats"
    value={1234}
    severity="critical"
    trend={{ value: 15.3, direction: 'up' }}
  />
</Dashboard>

Using Data Visualization

// Charts from visualizing-data skill
import { DonutChart } from '@/components/charts'

// Charts use --chart-color-* tokens automatically
<DonutChart
  data={threatData}
  title="Threats by Severity"
/>

Using Feedback Components

// From providing-feedback skill
import { Toast, Spinner, EmptyState } from '@/components/feedback'

// Wire toast notifications
<ToastProvider>
  <App />
</ToastProvider>

// Use spinner for loading states
{isLoading ? <Spinner /> : <Dashboard />}

Integration Checklist

Before delivery, verify:

  • Token file exists (tokens.css) with all 7 categories
  • Token import order correct (tokens.css → globals.css → components)
  • No hardcoded values (run validate_tokens.py)
  • Theme toggle works (data-theme attribute switches)
  • Reduced motion supported (@media (prefers-reduced-motion))
  • Build completes without errors
  • Types pass (TypeScript compiles)
  • Imports resolve (no missing modules)
  • Barrel exports exist for each component directory

Bundled Resources

Scripts (Token-Free Execution)

  • scripts/validate_tokens.py - Validate CSS uses design tokens
  • scripts/generate_scaffold.py - Generate project boilerplate
  • scripts/check_imports.py - Validate import chains
  • scripts/generate_exports.py - Create barrel export files

Run scripts directly without loading into context:

python scripts/validate_tokens.py demo/examples --fix-suggestions

References (Detailed Patterns)

  • references/library-context.md - AI Design Components library awareness
  • references/react-vite-template.md - Full Vite + React setup
  • references/nextjs-template.md - Next.js 14/15 patterns
  • references/python-fastapi-template.md - FastAPI project structure
  • references/rust-axum-template.md - Rust/Axum project structure
  • references/token-validation-rules.md - Complete validation rules

Examples (Complete Implementations)

  • examples/react-dashboard/ - Full Vite + React dashboard
  • examples/nextjs-dashboard/ - Next.js App Router dashboard
  • examples/fastapi-dashboard/ - Python FastAPI dashboard
  • examples/rust-axum-dashboard/ - Rust Axum dashboard

Assets (Templates)

  • assets/templates/react/ - React project templates
  • assets/templates/python/ - Python project templates
  • assets/templates/rust/ - Rust project templates

Application Assembly Workflow

  1. Validate Components: Run validate_tokens.py on all generated CSS
  2. Choose Framework: React/Vite, Next.js, FastAPI, or Rust based on requirements
  3. Generate Scaffolding: Create project structure and configuration
  4. Wire Imports: Set up entry point, import chain, barrel exports
  5. Add Providers: ThemeProvider, ToastProvider at root
  6. Connect Components: Import and compose feature components
  7. Configure Build: vite.config, tsconfig, package.json
  8. Final Validation: Build, type-check, lint
  9. Document: README with setup and usage instructions

For library-specific patterns and complete context, see references/library-context.md.

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

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

平台分布

Claude Code

29.18%
按下载量换算60

Gemini CLI

22.42%
按下载量换算46

Cursor

17.15%
按下载量换算35

Antigravity

11.72%
按下载量换算24

OpenCode

6.7%
按下载量换算14

kiro-cli

3.52%
按下载量换算7

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills