component-design-patterns
About
This Claude skill helps developers design UI components by first analyzing functionality requirements and user flows before creating the component hierarchy. It proactively maps features to component needs and provides specific designs with examples aligned with project patterns. Use it during feature planning to create components that directly enable the required functionality.
Documentation
Component Design Patterns - Context-Aware & Functionality First
Purpose
This skill provides context-aware component design that understands component requirements from flows before designing. It maps functionality to components and designs components to support functionality, providing specific component designs with examples aligned with project component patterns.
Functionality First Mandate
CRITICAL: Before designing components, complete context-dependent functionality analysis.
Core Principle: Understand functionality requirements first, then understand project component patterns, then design components to support functionality.
Quick Start
Design components by first understanding functionality, then mapping to component needs.
Example:
- Understand functionality: File upload feature (User Flow: select → upload → confirm)
- Understand project patterns: React functional components, TypeScript interfaces
- Map to components: UploadForm (select), ProgressBar (upload), SuccessMessage (confirm)
- Design hierarchy: UploadForm contains ProgressBar and SuccessMessage
Result: Component hierarchy designed to support functionality using project patterns.
Quick Decision Tree
COMPONENT DESIGN NEEDED?
│
├─ Understand Functionality First
│ ├─ Context-dependent analysis complete? → Continue
│ └─ Not complete? → STOP, complete functionality analysis first
│
├─ Understand Project Patterns
│ ├─ Component patterns identified? → Continue
│ └─ Not identified? → Analyze project component patterns first
│
└─ Design Components
├─ Map flows to components? → Design component hierarchy
└─ Flows not mapped? → STOP, map flows to components first
When to Use
Use PROACTIVELY when:
- Planning features that need UI components
- Designing component architecture
- Reviewing component interfaces
Core Process Overview
Phase 1: Context-Dependent Functionality Analysis (MANDATORY FIRST STEP)
Before any component design, complete functionality analysis:
- Load Functionality Analysis Template: Reference
plugins/cc10x/skills/cc10x-orchestrator/templates/functionality-analysis.md - Complete Phase 1: Universal Questions (especially Constraints - component constraints)
- Complete Phase 2: Context-Dependent Flow Questions (UI Features - User Flow, Admin Flow, System Flow)
- Understand Component Requirements: What UI components are needed? (from User Flow, Admin Flow, System Flow)
Reference: references/functionality-mapping.md for detailed functionality analysis and component requirement mapping.
Phase 2: Understand Project's Component Patterns (MANDATORY SECOND STEP)
Before designing components, understand how this project designs components:
- Load Project Context Understanding: Load
project-context-understandingskill - Map Component Patterns: Component structure, naming, props, state management, UI library, composition patterns
- Document Project's Component Patterns: Structure, naming, props, state, UI library, composition
Reference: references/project-patterns.md for detailed project component pattern analysis.
Phase 3: Component Design (Design to Support Functionality)
After understanding functionality and project component patterns, design components:
- Map Functionality to Components: For each functionality flow, identify component needs
- Design Component Hierarchy: Parent-child relationships aligned with functionality flows
- Design Component Interfaces: Props, state, events aligned with functionality needs
- Design Component Contracts: Input contracts, output contracts, state contracts
Reference: references/component-design.md for detailed component design patterns, examples, and checklist.
Component Design Pattern Library
Reference: See PATTERNS.md for detailed component design patterns including:
- Component structure (props, hierarchy, composition)
- State management patterns
- Component checklist
Quick Reference
| Phase | Key Activities | Success Criteria |
|---|---|---|
| 1. Functionality Analysis | Context-dependent analysis, flow questions | Component requirements identified |
| 2. Project Patterns | Analyze component patterns, conventions | Project patterns understood |
| 3. Component Design | Map flows to components, design hierarchy | Components designed to support functionality |
Reference Files
For detailed component design guidance, see:
- PATTERNS.md: Component design patterns, structure, state management, component checklist
references/functionality-mapping.md: Functionality analysis, component requirement mapping, flow-to-component mapping, examplesreferences/project-patterns.md: Project component pattern analysis, structure patterns, naming conventions, state management patterns, UI library patterns, composition patternsreferences/component-design.md: Component design patterns, hierarchy design, interface design, contract design, examples, checklist
Priority Classification
Critical (Must Have - Core Functionality):
- Components support core functionality (user flow, admin flow)
- Blocks functionality if missing
- Required for functionality to work
Important (Should Have - Supporting Functionality):
- Components support functionality growth
- Components support functionality changes
- Components support functionality accessibility
Minor (Can Defer - Pattern Compliance):
- Perfect component structure (if functionality is supported)
- Ideal composition patterns (if functionality is supported)
- Perfect prop types (if functionality is supported)
Output Format
MANDATORY TEMPLATE - Use this exact structure:
# Component Design Report
## Functionality Analysis Summary
[Brief summary of functionality from Phase 1]
## Project Component Patterns Summary
[Brief summary of project component patterns from Phase 2]
## Component Design
### Components
[For each component: Name, Purpose, Props, State, Hierarchy, Flow Step, Example, Priority]
### Component Hierarchy
[Component hierarchy mapped from functionality flows]
### Component Contracts
[Component interfaces and contracts aligned with functionality]
## Recommendations
[Prioritized list - Critical first, then Important, then Minor]
Key Principles
- Functionality First: Always understand functionality before designing components
- Context-Aware: Understand project component patterns before designing
- Map Flows to Components: Map functionality flows to component hierarchy
- Specific Designs: Provide specific component designs with examples aligned with project patterns
- Prioritize by Impact: Critical (core functionality) > Important (supporting functionality) > Minor (pattern compliance)
Common Mistakes to Avoid
- Skipping Functionality Analysis: Don't jump straight to component design
- Ignoring Project Patterns: Don't design without understanding project component patterns
- Generic Component Patterns: Don't apply generic patterns - design to support functionality
- Missing Specific Designs: Don't just describe components - provide specific code examples aligned with project patterns
- No Flow Mapping: Don't just list components - map them to functionality flows
- Wrong Priority: Don't prioritize pattern compliance over functionality support
Integration with Orchestrator
This skill is loaded by orchestrator workflows when component design is detected. The orchestrator coordinates:
- Functionality analysis (Phase 0)
- Skill loading (Phase 2)
- Component design execution
CRITICAL: Maintain functionality-first approach. Component design must follow functionality analysis.
Troubleshooting
Common Issues:
-
Component design without understanding functionality
- Symptom: Components designed but don't support functionality flows
- Cause: Skipped functionality analysis
- Fix: Complete functionality analysis first, then design components
- Prevention: Always understand functionality before component design
-
Generic component patterns instead of functionality-focused
- Symptom: Components follow generic patterns but don't support functionality
- Cause: Didn't map functionality flows to component needs
- Fix: Map flows to components, design to support flows
- Prevention: Always map functionality to component needs first
-
Component designs not aligned with project patterns
- Symptom: Components don't match project's component patterns
- Cause: Didn't understand project component patterns
- Fix: Understand project patterns, align component design
- Prevention: Always understand project patterns first
If issues persist:
- Verify functionality analysis was completed first
- Check that functionality flows were mapped to components
- Ensure component designs align with project patterns
- Review reference files for detailed guidance
This skill enables context-aware component design that understands component requirements from flows and designs components to support functionality, providing specific component designs with examples aligned with project component patterns.
Quick Install
/plugin add https://github.com/romiluz13/cc10x/tree/main/component-design-patternsCopy and paste this command in Claude Code to install this skill
GitHub 仓库
Related Skills
langchain
MetaLangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.
Algorithmic Art Generation
MetaThis skill helps developers create algorithmic art using p5.js, focusing on generative art, computational aesthetics, and interactive visualizations. It automatically activates for topics like "generative art" or "p5.js visualization" and guides you through creating unique algorithms with features like seeded randomness, flow fields, and particle systems. Use it when you need to build reproducible, code-driven artistic patterns.
webapp-testing
TestingThis Claude Skill provides a Playwright-based toolkit for testing local web applications through Python scripts. It enables frontend verification, UI debugging, screenshot capture, and log viewing while managing server lifecycles. Use it for browser automation tasks but run scripts directly rather than reading their source code to avoid context pollution.
requesting-code-review
DesignThis skill dispatches a code-reviewer subagent to analyze code changes against requirements before proceeding. It should be used after completing tasks, implementing major features, or before merging to main. The review helps catch issues early by comparing the current implementation with the original plan.
