component-designer
Component Designer
Design individual components (services, forms, entities, plugins) and document them.
Activation
Activate when you detect:
- "Design X component" or "Design the service"
- "Create spec for the form"
- Breaking down architecture into pieces
- Need detailed design for a single component
Workflow
1. Identify Component Type
Ask if unclear:
What type of component is this?
1. Service (business logic)
2. Form (user input)
3. Entity (data storage)
4. Plugin (extensible behavior)
5. Controller (routing)
2. Gather Component Details
Ask based on type:
For Services:
1. What operations does this service perform?
2. What other services does it need?
3. Should it dispatch events?
For Forms:
1. What type? (ConfigFormBase, FormBase, ConfirmFormBase)
2. What fields are needed?
3. What validation?
4. What happens on submit?
For Entities:
1. Content entity or config entity?
2. What fields/properties?
3. What relationships to other entities?
4. Access control needs?
For Plugins:
1. What plugin type?
2. What does each plugin variation do?
3. What configuration does it need?
3. Find Pattern Reference
Use core-pattern-finder skill to locate a reference implementation in core.
4. Create Component Document
Use Write tool to create {project_path}/architecture/{component_name}.md:
# Component: {ComponentName}
## Type
{Service | Form | Entity | Plugin | Controller}
## Purpose
{One paragraph from user input}
## Interface
### Public Methods
| Method | Parameters | Returns | Description |
|--------|------------|---------|-------------|
| methodName() | $param: Type | ReturnType | What it does |
### Events (if service)
| Event | When Dispatched |
|-------|-----------------|
| event.name | Condition |
## Dependencies
| Service | Purpose |
|---------|---------|
| entity_type.manager | {why needed} |
## Pattern Reference
Based on: `{path from core-pattern-finder}`
Apply from reference:
- {what to copy}
Adapt for our needs:
- {what to change}
## File Locations
- Class: `src/{Type}/{ComponentName}.php`
- Service definition: `my_module.services.yml`
- Routing: `my_module.routing.yml` (if controller)
## Acceptance Criteria
- [ ] {criterion 1}
- [ ] {criterion 2}
- [ ] {criterion 3}
5. Update Main Architecture
Use Edit tool to add component reference to architecture/main.md:
## Components
### {ComponentName}
Type: {type}
Purpose: {one line}
Design: See `architecture/{component_name}.md`
6. Confirm
Show user:
Component designed: {ComponentName}
Files created:
- architecture/{component_name}.md
Based on core pattern:
- {pattern_reference}
Ready for implementation in Phase 3.
Review the design? (yes/no)
Stop Points
STOP and wait for user:
- After asking component type
- After asking for details
- Before creating files
- After showing confirmation
More from camoa/claude-skills
html-generator
Use when generating branded HTML pages and components from a design system. Creates standalone HTML components and composes them into full pages with embedded CSS, responsive design, and brand integration.
43memory-manager
Use after completing any phase activity - updates project_state.md, project registry, ensures files are in correct locations, maintains lean memory
39diagram-generator
Use when visualizing architecture - generates Mermaid diagrams for data flow, service relationships, or entity structures. Trigger: 'draw diagram', 'visualize', 'show relationships', 'mermaid chart'.
31code-quality-audit
Use when checking code quality, running security audits, testing coverage, finding SOLID/DRY violations, or setting up quality tools. Use when user says "audit this code", "check security", "run PHPStan", "code quality", "find violations", "SOLID check", "DRY check", "test coverage", "lint this", "security review", "is this production ready", "check for vulnerabilities", "code review", "grade this code". Supports Drupal (PHPStan, PHPMD, Psalm, Semgrep, Trivy, Gitleaks via DDEV) and Next.js (ESLint, Jest, Semgrep, Trivy, Gitleaks). Use proactively before deployment or after significant code changes.
20requirements-gatherer
Use when gathering project requirements - asks structured questions about project type, scope, integrations, and constraints to populate project_state.md
17generating-infographics
Use when creating infographics, data visualizations, process diagrams, timelines, or comparisons - generates branded infographics using @antv/infographic with 114 templates across 7 categories. Triggers on "create infographic", "make infographic", "visualize data", "timeline", "process diagram".
17