webflow-code-component:convert-component
Convert an existing React component into a Webflow Code Component. Analyzes TypeScript props, maps to Webflow prop types, generates the .webflow.tsx definition file, and identifies required modifications.
What this skill does
# Convert Component
Convert an existing React component into a Webflow Code Component by analyzing its structure and generating the appropriate `.webflow.tsx` definition file.
## When to Use This Skill
**Use when:**
- User has an existing React component they want to use in Webflow
- User asks to "convert", "adapt", or "make this work with Webflow"
- User provides a React component file and wants a Webflow definition
- User is migrating components from another React project
**Do NOT use when:**
- Creating a component from scratch (use component-scaffold)
- User just wants to understand code components (answer directly)
- Component is already a Webflow code component (use component-audit)
## Instructions
### Phase 1: Analyze Existing Component
1. **Read the React component file**: Get the full source code
2. **Extract component information**:
- Component name (function/const name)
- Props interface or type definition
- Each prop's TypeScript type
- Default values if defined
- Whether component uses `children`
3. **Identify incompatible patterns**:
| Pattern | Issue | Resolution |
|---------|-------|------------|
| React Context usage | Context doesn't work across Webflow components | Refactor to props or use nano stores |
| `window`/`document` in render | SSR will fail | Wrap in useEffect or set `ssr: false` |
| `localStorage`/`sessionStorage` in render | SSR will fail | Wrap in useEffect or set `ssr: false` |
| Complex object props | Can't map to Webflow prop types | Break into individual props |
| Function props (callbacks) | Not supported in Webflow | Remove or internalize logic |
| `useContext` hook | Won't work across components | Use alternative state patterns |
| External CSS imports | May not work in Shadow DOM | Import in .webflow.tsx instead |
| CSS class references to global styles | Won't work in Shadow DOM | Use component-scoped styles |
| styled-components | Needs Shadow DOM decorator | Set up globals.ts with decorator |
| Emotion (@emotion/styled) | Needs Shadow DOM decorator | Set up globals.ts with decorator |
4. **Detect styling approach** and note required setup:
**If using styled-components:**
```bash
npm i @webflow/styled-components-utils styled-components
```
Create/update `globals.ts`:
```typescript
import { styledComponentsShadowDomDecorator } from "@webflow/styled-components-utils";
export const decorators = [styledComponentsShadowDomDecorator];
```
**If using Emotion:**
```bash
npm i @webflow/emotion-utils @emotion/cache @emotion/react
```
Create/update `globals.ts`:
```typescript
import { emotionShadowDomDecorator } from "@webflow/emotion-utils";
export const decorators = [emotionShadowDomDecorator];
```
**For both CSS-in-JS approaches**, update `webflow.json`:
styled-components:
```json
{
"library": {
"globals": "./src/globals.ts",
"renderer": {
"server": "@webflow/styled-components-utils/server"
}
}
}
```
Emotion:
```json
{
"library": {
"globals": "./src/globals.ts",
"renderer": {
"server": "@webflow/emotion-utils/server"
}
}
}
```
5. **Flag any dependencies** that might cause issues:
- Large libraries (bundle size concern)
- Browser-only libraries
- Libraries that manipulate DOM directly
### Phase 2: Map Props to Webflow Types
6. **Apply TypeScript → Webflow prop type mapping**:
| TypeScript Type | Webflow Prop | Notes |
|-----------------|--------------|-------|
| `string` | `props.Text()` | Default for short text |
| `string` (long/HTML content) | `props.RichText()` | If prop name suggests content/body/description |
| `React.ReactNode` / `children` | `props.Slot()` | For nested content |
| `number` | `props.Number()` | Numeric values |
| `boolean` | `props.Boolean()` | Toggles |
| `"option1" \| "option2"` | `props.Variant()` | String literal unions (requires `options` array) |
| `enum` | `props.Variant()` | Convert enum values to `options` array (required) |
| `{ href: string; ... }` | `props.Link()` | Returns `{ href, target?, preload? }` object — may need wrapper if component expects separate `href`/`target` props |
| Image-related types | `props.Image()` | Image src, url, etc. |
| `string` (canvas-editable text) | `props.TextNode()` | For text editable directly on canvas; has `multiline` param |
| `boolean` (show/hide) | `props.Visibility()` | Semantic show/hide toggle |
| `string` (for HTML id) | `props.Id()` | If prop is named "id" or used for accessibility |
| Complex objects | **SPLIT** | Break into multiple simple props |
| Functions/callbacks | **REMOVE** | Not supported |
| Arrays | **SPECIAL** | May need component redesign |
7. **Handle special cases**:
**Complex object props** - Break them down:
```typescript
// Original
interface Props {
author: {
name: string;
avatar: string;
bio: string;
}
}
// Converted to flat props
props: {
authorName: props.Text({ name: "Author Name" }),
authorAvatar: props.Image({ name: "Author Avatar" }),
authorBio: props.RichText({ name: "Author Bio" })
}
```
**Union types with more than simple strings**:
```typescript
// Original - complex union
type Size = "sm" | "md" | "lg" | { width: number; height: number };
// Convert to Variant with only string options
size: props.Variant({
name: "Size",
options: ["sm", "md", "lg", "custom"],
defaultValue: "md"
})
// Note: Custom size would need additional Number props
```
**Optional props** - Provide defaultValue for prop types that support it. Note: Link, Image, Slot, and Id do not accept defaultValue.
```typescript
// Original
interface Props {
title?: string;
}
// Converted - provide default for types that support it
title: props.Text({
name: "Title",
defaultValue: "" // Empty string or sensible default
})
```
### Phase 3: Check Project Setup
8. **Verify Webflow setup exists**:
- Check for `webflow.json` in project root
- Check for required dependencies (@webflow/webflow-cli, @webflow/data-types, @webflow/react)
- If using styled-components/Emotion, check for decorator packages
- If missing, offer to set up or direct to local-dev-setup skill
9. **Determine file locations**:
- Identify where the original component lives
- Determine where `.webflow.tsx` should be created (same directory)
- Check for existing styles that need to be imported
### Phase 4: Generate Definition File
10. **Create the `.webflow.tsx` file**:
```typescript
import { declareComponent } from "@webflow/react";
import { props } from "@webflow/data-types";
import { ComponentName } from "./ComponentName";
// Import styles if they exist
import "./ComponentName.module.css"; // or .css
export default declareComponent(ComponentName, {
name: "ComponentName",
description: "[Generated from component purpose]",
group: "[Appropriate category]",
props: {
// Mapped props here
},
// decorators: [], // Optional — per-component decorators (e.g., for CSS-in-JS Shadow DOM support)
options: {
applyTagSelectors: true, // Default is false. Set to true to apply Webflow's tag selectors (e.g., h1, p styles) inside the component.
ssr: true // or false if browser APIs detected
}
});
```
11. **Provide the complete file** with all props mapped
### Phase 5: Document Required Changes
12. **List modifications needed** to the original component:
```markdown
## Required Changes to [ComponentName].tsx
### Must Fix (Component won't work without these):
- [ ] Issue 1: [Description and how to fix]
- [ ] Issue 2: [Description and how to fix]
### Recommended (Will improve Webflow integration):
- [ ] Recommendation 1
- [ ] Recommendation 2
### Props Mapping Summary:
| Original Prop | WebflRelated 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.