component-usage-analysis
Analyse component dependencies and usage patterns in a Drupal/Twig component library. Use when user asks to find where a component is used, check if a component can be safely removed, audit component dependencies, find components using specific properties, or analyse impact of refactoring a component.
What this skill does
# Component Usage Analysis
Analyse component dependencies and usage patterns to support safe refactoring and removal.
## Trigger Phrases
- "Find all usages of `<component>`"
- "Which components use `<component>`?"
- "Check if `<component>` can be safely removed"
- "Find components using `<component>` with property X"
- "Audit dependencies for `<component>`"
- "What would break if I change `<component>`?"
## Configuration
This skill assumes the component library structure:
```
apps/component-library/
├── src/components/
│ ├── elements/
│ ├── patterns/
│ ├── template-components/
│ └── templates/
```
## Analysis Methodology
### Step 1: Identify the Target
Clarify with the user:
1. **Target component**: Which component to analyse (e.g., `elements/image`)
2. **Properties of interest**: Specific properties to filter by (optional)
3. **Analysis goal**: Usage audit, removal check, or refactoring impact
### Step 2: Twig Include Analysis
Find all components that include the target via Twig.
**Search pattern:**
```bash
grep -rn "{% include \"@<tier>/<component>" src/components/
```
**Example for `elements/image`:**
```bash
grep -rn '{% include "@elements/image' src/components/
```
For each match:
1. Note the file path (consuming component)
2. Extract the `with {}` block to identify which properties are passed
3. Record whether target properties are present
**Extracting the `with` block:**
Twig includes may span multiple lines:
```twig
{% include "@elements/image/image.twig" with {
src: item.image.src,
alt: item.image.alt,
description: item.image.description
} %}
```
Use multi-line search or examine files directly when the `with` block is complex.
See [references/search-patterns.md](references/search-patterns.md) for detailed patterns.
### Step 3: Mock Reference Analysis
Find all components whose mocks reference the target component.
**Search pattern:**
```bash
grep -rn '\$ref: <tier>/<component>#' src/components/
```
**Example for `elements/image`:**
```bash
grep -rn '\$ref: elements/image#' src/components/
```
For each match:
1. Note the file path and variant name referenced
2. Look up the referenced variant in the target's `mocks.yaml`
3. Check if the variant includes the properties of interest
**Cross-referencing variants:**
If a mock uses `$ref: elements/image#with-caption`, check `elements/image/mocks.yaml` to see what properties that variant defines.
### Step 4: Categorise Results
Group findings into categories based on the analysis goal:
**For property-specific analysis:**
- **Uses WITH property X**: Components that pass/use the property
- **Uses WITHOUT property X**: Components that use the target but don't use property X
**For removal analysis:**
- **Direct Twig includes**: Would break immediately
- **Mock references only**: May need mock updates but won't break rendering
- **No dependencies**: Safe to remove
**For refactoring analysis:**
- **Affected by change**: Components using the property/feature being changed
- **Unaffected**: Components using the target but not the changed aspect
### Step 5: Verification
Ensure comprehensive coverage before reporting:
1. **Count total files:**
```bash
find src/components -name "*.twig" | wc -l
find src/components -name "mocks.yaml" | wc -l
```
2. **Verify search found expected files:**
- Spot-check known usages
- Confirm count matches expectations
3. **Check for alternative patterns:**
- Embedded includes: `{% include "@elements/image/image.twig" %}`
- Variable includes: `{% include image_template %}`
- Embed blocks: `{% embed "@elements/image/image.twig" %}`
4. **Report confidence level:**
- High: All patterns checked, counts verified
- Medium: Primary patterns checked
- Low: Quick scan only
## Output Format
Provide results in a clear structure:
```
## Component Usage Analysis: <component>
### Summary
- Total usages found: X
- Twig includes: Y
- Mock references: Z
### Uses WITH <property>
1. `patterns/card/card.twig` - passes description in with block
2. `patterns/teaser/mocks.yaml` - references variant with description
### Uses WITHOUT <property>
1. `patterns/hero/hero.twig` - only passes src, alt
2. `template-components/header/mocks.yaml` - references minimal variant
### Verification
- Searched X .twig files
- Searched Y mocks.yaml files
- Confidence: High
```
## Common Scenarios
### Scenario: Removing a Property
User: "Can I remove the `copyright` property from `elements/image`?"
1. Search for Twig includes passing `copyright`
2. Search for mock references to variants with `copyright`
3. Report which components would need updates
4. Recommend: Update consumers first, then remove property
### Scenario: Safe Component Removal
User: "Is `elements/legacy-button` used anywhere?"
1. Search for Twig includes of the component
2. Search for mock references
3. Search for library references in templates
4. If zero results across all searches → safe to remove
### Scenario: Refactoring Impact
User: "I want to rename `description` to `caption` in `elements/image`"
1. Find all usages passing `description`
2. Provide list of files requiring updates
3. Estimate scope of change
## Notes
- Always verify comprehensively before recommending removal
- Check both Twig files AND mocks.yaml files
- Consider indirect dependencies (component A uses B which uses C)
- Report confidence level with results
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.