pp-design-system
Use when a new project needs a domain-specific design system (B2B Admin or Hotel/Travel) before specification and UI design work.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- pp-design-system
- description
- Use when a new project needs a domain-specific design system (B2B Admin or Hotel/Travel) before specification and UI design work.
- allowed-tools
- Read, Write, Glob, Grep
- argument-hint
- [--domain=b2b-admin|hotel-travel] [--query="context"]
- user-invocable
- true
03 SKILL.md 正文
You are executing the design-system skill for the Planning Plugin. Generate a comprehensive, domain-specific design system by reading curated CSV databases, applying domain filtering and industry reasoning rules, and writing Markdown output files.
Step 0: Verify Configuration
- Read
.claude/planning-plugin.json - If it does not exist, inform the user:
⚠️ Planning plugin is not initialized. Run
/planning-plugin:pp-initfirst to set up project configuration. - Stop execution if config is missing.
Step 1: Parse Arguments
Parse the skill arguments. Expected format: [--domain=b2b-admin|hotel-travel] [--query="context"]
--domain(required): Must beb2b-adminorhotel-travel--query(optional): Additional context for prioritizing results (e.g.,"hotel booking CRM")
If --domain is not provided, ask the user to choose:
Which domain is this project for?
- b2b-admin — Admin panels, dashboards, data management, internal tools
- hotel-travel — Hotel booking, travel platforms, hospitality management
Step 2: Auto-Detect Context
Gather project context automatically:
- Project name: Read
package.json→ usenamefield. If not found, readCLAUDE.mdor ask the user. - Existing specs: Check
docs/specs/for any feature specs. If found, note them for context. - Existing design system: Check if
design-system/already exists.- If it exists, ask the user:
A design system already exists at
design-system/. Do you want to regenerate it? This will overwrite existing files. - Stop if user declines.
- If it exists, ask the user:
Step 3: Read CSV Data
Read all 7 CSV files from ${CLAUDE_PLUGIN_ROOT}/data/design-system/ using the Read tool:
colors.csv— columns:id,domain,palette_name,role,hex,hsl,tailwind_name,contrast_ratio,description,tagstypography.csv— columns:id,domain,scale_name,element,font_family,font_size,line_height,font_weight,letter_spacing,tailwind_class,description,tagsstyles.csv— columns:id,domain,category,name,description,css_values,use_case,tagscomponents.csv— columns:id,domain,category,component_name,variant,use_case,props_config,companion_components,description,tagspatterns.csv— columns:id,domain,category,name,description,page_layout,components_used,user_flow,best_practices,tagsindustry-rules.csv— columns:id,domain,category,rule,rationale,priority,applies_to,tagsicons.csv— columns:id,domain,context,concept,lucide_name,alternatives,description,tags
Read all 7 files in parallel for efficiency.
Step 4: Filter and Apply Reasoning
For each CSV (except industry-rules.csv):
- Domain filter: Keep only rows where
domainmatches the selected domain ORdomainisgeneral - If
--querywas provided, prioritize rows whosetags,description, or name fields are more relevant to the query
For industry-rules.csv:
- Filter to rows where
domainmatches ORdomainisgeneral - Extract design principles: all rows with
priority=criticalorrecommended - These principles will be used in MASTER.md and as reasoning notes in each page
Apply reasoning rules to each page's data:
- Critical rules (
priority=critical): If a rule'sapplies_tofield contains the CSV category name (e.g.,colors,components) or isall, note matching items with[CRITICAL] {rule}reasoning note - Recommended rules (
priority=recommended): Note matching items with[RECOMMENDED] {rule}reasoning note - Optional rules (
priority=optional): Note matching items with[OPTIONAL] {rule}reasoning note - Match rules to data rows by checking for token overlap between the rule's
rule+tagsfields and the row's text content
Step 5: Write Markdown Files
Create 7 files using Write. The output directory is design-system/ at the project root (not inside the plugin).
Use the domain label mapping:
b2b-admin→B2B Admin / Dashboardhotel-travel→Hotel / Travel
Use an ISO-8601 UTC timestamp for generation time.
5.1: design-system/MASTER.md
# {project_name} — Design System
> **Domain**: {domain_label}
> **Generated**: {timestamp}
> **Generator**: planning-plugin:pp-design-system
## Design Principles
### Critical
- **{rule}**
- _{rationale}_
### Recommended
- **{rule}**
- _{rationale}_
## Pages
| Page | Description |
|------|-------------|
| [Colors](pages/colors.md) | Color system with palettes, roles, and accessibility info |
| [Typography](pages/typography.md) | Type scale, font families, and text styles |
| [Spacing & Layout](pages/spacing-layout.md) | Spacing system, grid layouts, and page patterns |
| [Components](pages/components.md) | Component library recommendations with props and variants |
| [Patterns](pages/patterns.md) | UX patterns, page templates, and user flows |
| [Icons](pages/icons.md) | Icon guidelines with Lucide icon mappings |
## Integration Guide
This design system is intended to be used with:
- **`/planning-plugin:pp-design`** — The `dsl-generator` agent reads `pages/components.md`, `pages/icons.md`, `pages/patterns.md`, and `MASTER.md` to inform component selection, icon mapping, layout validation, and design constraints. The `stitch-wireframe` agent reads `pages/colors.md`, `pages/typography.md`, `pages/patterns.md`, and `MASTER.md` to inform wireframe color/font context and layout validation. The `prototype-generator` agent reads `pages/colors.md`, `pages/typography.md`, and `pages/spacing-layout.md` to configure Tailwind theme.
### Tailwind Theme Config
Apply the color tokens from `pages/colors.md` to your `tailwind.config.js`:
\```js
// See pages/colors.md for full palette
module.exports = {
theme: {
extend: {
colors: {
// Import from design system color tokens
}
}
}
}
\```
---
_Generated by planning-plugin:pp-design-system at {timestamp}_
5.2: design-system/pages/colors.md
# Color System — {domain_label}
> Part of [{project_name} Design System](../MASTER.md)
## Color Palette
| Role | Name | Hex | HSL | Tailwind | Contrast | Description |
|------|------|-----|-----|----------|----------|-------------|
| {role} | {palette_name} | `{hex}` | `{hsl}` | `{tailwind_name}` | {contrast_ratio} | {description} |
## CSS Custom Properties
\```css
:root {
--color-{role}: {hex};
}
\```
## Tailwind Mapping
\```js
colors: {
'{role}': '{hex}', // {tailwind_name}
}
\```
## Reasoning Notes
> These notes explain why specific items were selected or prioritized.
- {deduplicated reasoning notes}
---
_Generated at {timestamp}_
5.3: design-system/pages/typography.md
# Typography System — {domain_label}
> Part of [{project_name} Design System](../MASTER.md)
## Type Scale
| Element | Font Family | Size | Line Height | Weight | Letter Spacing | Tailwind Class |
|---------|-------------|------|-------------|--------|----------------|----------------|
| {element} | {font_family} | {font_size} | {line_height} | {font_weight} | {letter_spacing} | `{tailwind_class}` |
## Font Families
- `{unique_font_family}`
## CSS Custom Properties
\```css
:root {
--font-size-{element}: {font_size};
--line-height-{element}: {line_height};
--font-weight-{element}: {font_weight};
}
\```
## Reasoning Notes
> These notes explain why specific items were selected or prioritized.
- {deduplicated reasoning notes}
---
_Generated at {timestamp}_
5.4: design-system/pages/spacing-layout.md
# Spacing & Layout — {domain_label}
> Part of [{project_name} Design System](../MASTER.md)
## Spacing Scale
| Token | Value | Usage |
|-------|-------|-------|
| `space-1` | 4px | Tight inline spacing |
| `space-2` | 8px | Default inline gap |
| `space-3` | 12px | Compact section gap |
| `space-4` | 16px | Default section gap |
| `space-5` | 20px | Comfortable padding |
| `space-6` | 24px | Card/panel padding |
| `space-8` | 32px | Section separation |
| `space-10` | 40px | Major section spacing |
| `space-12` | 48px | Page-level spacing |
## Layout Patterns
### {name}
**Category**: {category} | **Domain**: {domain}
{description}
\```css
{css_values}
\```
**Use case**: {use_case}
## Reasoning Notes
> These notes explain why specific items were selected or prioritized.
- {deduplicated reasoning notes}
---
_Generated at {timestamp}_
5.5: design-system/pages/components.md
# Component Library — {domain_label}
> Part of [{project_name} Design System](../MASTER.md)
## Component Inventory
| Component | Variant | Category | Use Case | Companions |
|-----------|---------|----------|----------|------------|
| **{component_name}** | {variant} | {category} | {use_case} | {companion_components} |
## Component Details
### {component_name} ({variant})
{description}
**Category**: {category}
**Use case**: {use_case}
**Props config**:
\```json
{props_config}
\```
**Companion components**: {companion_components}
## Reasoning Notes
> These notes explain why specific items were selected or prioritized.
- {deduplicated reasoning notes}
---
_Generated at {timestamp}_
5.6: design-system/pages/patterns.md
# UX Patterns — {domain_label}
> Part of [{project_name} Design System](../MASTER.md)
## Pattern Index
| Pattern | Category | Components Used |
|---------|----------|-----------------|
| **{name}** | {category} | {components_used} |
## Pattern Details
### {name}
**Category**: {category} | **Domain**: {domain}
{description}
**Page layout**:
> {page_layout}
**Components used**: {components_used}
**User flow**:
> {user_flow}
**Best practices**:
> {best_practices}
## Reasoning Notes
> These notes explain why specific items were selected or prioritized.
- {deduplicated reasoning notes}
---
_Generated at {timestamp}_
5.7: design-system/pages/icons.md
# Icon Guidelines — {domain_label}
> Part of [{project_name} Design System](../MASTER.md)
## Icon Library: Lucide
This design system uses [Lucide](https://lucide.dev) icons via `lucide-react`.
\```bash
npm install lucide-react
\```
## Icon Mapping
| Context | Concept | Lucide Icon | Alternatives | Description |
|---------|---------|-------------|-------------|-------------|
| {context} | {concept} | `{lucide_name}` | {alternatives} | {description} |
## Usage Guidelines
- **Size**: Use `h-4 w-4` for inline icons, `h-5 w-5` for buttons, `h-6 w-6` for navigation
- **Color**: Icons inherit text color by default; use `text-muted-foreground` for secondary icons
- **Accessibility**: Add `aria-label` on icon-only buttons; use `aria-hidden="true"` on decorative icons
- **Consistency**: Use the primary Lucide name from the mapping above; fall back to alternatives only when context demands it
## Import Pattern
\```tsx
import { IconName } from "lucide-react";
// Inline usage
<IconName className="h-4 w-4" />
// Button with icon
<Button size="icon" aria-label="Description">
<IconName className="h-4 w-4" />
</Button>
\```
## Reasoning Notes
> These notes explain why specific items were selected or prioritized.
- {deduplicated reasoning notes}
---
_Generated at {timestamp}_
Step 6: Review and Summarize
Present a summary to the user:
✅ Design System Generated
Project: {project_name} Domain: {domain_label} Output:
design-system/
Page Items Colors {count} tokens Typography {count} scales Spacing & Layout {count} patterns Components {count} recommendations UX Patterns {count} patterns Icons {count} mappings Would you like to customize any section?
If the user wants to customize, read the specific page file and offer to adjust:
- Add/remove items
- Adjust color values
- Modify component recommendations
- Edit the page content directly
Step 7: Update Progress (if in feature context)
If this skill was invoked from within a feature context (i.e., a feature progress file exists at docs/specs/{feature}/.progress/{feature}.json):
- Read the progress file
- Add or update the
designSystemfield:{ "designSystem": { "status": "generated", "domain": "{domain}", "outputDir": "design-system", "generatedAt": "{ISO-8601 timestamp}" } } - Write the updated progress file
Step 8: Next Steps
Present next steps to the user:
Next Steps
- Review: Browse the generated pages in
design-system/and customize as needed- Spec → Design: Run
/planning-plugin:pp-design {feature}— the DSL generator will referencedesign-system/pages/components.mdfor component selectionThe design system files are plain Markdown — feel free to edit them directly.
Important Rules
- Always use
${CLAUDE_PLUGIN_ROOT}to reference plugin-relative paths for CSV data files - The generated
design-system/directory is at the project root (not inside the plugin) - Do not modify the CSV data files — they are the curated source of truth
- If the user asks about a domain not in the list, suggest the closest match or explain that only
b2b-adminandhotel-travelare currently supported - Omit the "Reasoning Notes" section from a page if there are no applicable reasoning notes for that page's data
- Deduplicate reasoning notes within each page — do not repeat the same note
04 同仓库更多 Skills
hp-shared
Shared conventions for every homepage-plugin agent and skill — stack, code conventions, state-file writes, check commands and how to report them. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
fe-shared
Shared conventions for every frontend-react-plugin agent and skill — code conventions, state files and locks, accepted deviations, design principles, build working directory, router-mode command matrix, TypeScript check. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
be-spring-shared
Shared conventions for every backend-springboot-plugin agent and skill — tech stack, CQRS architecture, naming, coding standards, TDD, commit and build rules, state files. Preloaded into agents through their `skills:` frontmatter; not meant to be invoked by hand.
pp-translate
Use after directly editing the working language spec to sync changes to other supported languages.
pp-sync-stitch
Use when wireframes were manually edited on the Stitch website and need to be re-fetched to the local project.
pp-sync-notion
Use when a specification needs to be published or re-synced to Notion after finalization or manual edits.