dennisonbertram/steal-react-component
Claude Code skill to extract React components from any production website
Deep Analysis
Claude Code skill suite for extracting React components, design systems, and cloning entire sites from any production website
Core Features
Extract single React component props, hooks, HTML, and source by accessing React Fiber internals
Extract complete design systems using StyleStealer with direct Tailwind config generation
End-to-end website cloning process generating complete Next.js projects
Visual Navigator UI for interactive component browsing
Format extracted component info into LLM-processable format
Technical Implementation
- Innovative dual-file subagent architecture for context isolation
- Direct access to React Fiber internals for deep component analysis
- Style extraction directly generates Tailwind config
- Complete end-to-end workflow
- ReactStealer and StyleStealer provide rich APIs
- Parallel subagents for code deobfuscation
- Quickly extract UI components from competitor sites for learning
- Clone existing site design systems to generate Tailwind config
- Extract specific React components for reverse engineering
- Rapid prototyping
- Design system migrations
- Animation states may not capture correctly
- Some component names may be obfuscated
- React Server Components may lack client-side Fiber data
- Requires Claude-in-Chrome extension installed
Steal React Component
A Claude Code skill suite for extracting and reconstructing React components and entire websites using browser automation.
Features
Component Extraction (steal-react-component)
Extract individual React components from any production website by accessing React Fiber internals.
Design System Extraction (css-extractor)
Extract complete design systems including CSS variables, typography, colors, and spacing.
Full Site Cloning (copy-site)
Clone entire websites by combining component extraction, style extraction, and automatic project scaffolding.
Quick Start
Extract a Single Component
/steal-react-component https://example.com
Clone an Entire Site
/copy-site https://example.com
Installation
This skill suite uses a two-file architecture for context isolation:
| Skill | Dispatcher | Agent | Purpose |
|---|---|---|---|
| steal-react-component | SKILL.md (~300 tokens) | AGENT.md (~4k tokens) | Extract individual components |
| copy-site | COPY-SITE.md (~400 tokens) | COPY-SITE-AGENT.md (~6k tokens) | Clone entire websites |
Why Subagent Architecture?
The subagent runs in isolated context, keeping the main agent's context clean. A typical site clone:
- Main agent: ~6k tokens (dispatcher + subagent response summary)
- Subagent: ~50k tokens internally (browser automation, style extraction, component de-minification, project scaffolding)
Without subagents, all ~50k tokens would accumulate in the main agent's context, quickly filling it up.
Step 1: Install the Agents (Required)
Copy agent files to your Claude Code agents directory:
# User-level (available in all projects)
cp AGENT.md ~/.claude/agents/steal-react-component.md
cp COPY-SITE-AGENT.md ~/.claude/agents/copy-site.md
# Or project-level
cp AGENT.md .claude/agents/steal-react-component.md
cp COPY-SITE-AGENT.md .claude/agents/copy-site.md
Step 2: Install the Skills
Copy skill files to enable slash commands:
# User-level
mkdir -p ~/.claude/skills/steal-react-component
cp SKILL.md CSS-EXTRACTOR.md COPY-SITE.md ~/.claude/skills/steal-react-component/
# Or project-level
mkdir -p .claude/skills/steal-react-component
cp SKILL.md CSS-EXTRACTOR.md COPY-SITE.md .claude/skills/steal-react-component/
Optional: Install as Commands
Create slash commands for site cloning:
mkdir -p ~/.claude/commands
cp COPY-SITE.md ~/.claude/commands/copy-site.md
Now use /copy-site https://target-site.com to clone any site.
Components
SKILL.md + AGENT.md - ReactStealer
The core component extraction tool (split for token efficiency):
- Access React Fiber internals via
__reactFiber$*keys - Extract component props, hooks, HTML, and minified source
- Visual Navigator UI for interactive component browsing
- LLM-formatted output for clean code reconstruction
// Inject ReactStealer, then:
ReactStealer.summary() // List all components
ReactStealer.getForLLM('Button') // Get reconstruction prompt
CSS-EXTRACTOR.md - StyleStealer
Design system extraction tool:
- CSS custom properties (design tokens)
- Typography system (fonts, sizes, weights)
- Color palette with semantic naming
- Direct Tailwind config generation
// Inject StyleStealer, then:
StyleStealer.extractAll() // Get full design system
StyleStealer.toTailwindConfig() // Generate Tailwind config
StyleStealer.toCSSVariables() // Export as CSS file
COPY-SITE.md + COPY-SITE-AGENT.md - Full Site Cloning
End-to-end site cloning workflow (split for context isolation):
- Screenshot and document the site
- Extract design system with StyleStealer
- Extract components with ReactStealer
- De-minify with parallel subagents
- Scaffold Next.js project
- Verify the clone matches original
templates/ - Project Scaffolding
Ready-to-use project templates:
- Next.js 14 with App Router
- TypeScript configuration
- Tailwind CSS with design token placeholders
- Component structure
Requirements
- Claude Code CLI (started with
claude --chrome) - Chrome browser with Claude-in-Chrome extension
- Target website (React apps work best, any site works for style extraction)
How It Works
The Technique
- Two Trees - React maintains a Fiber tree parallel to the DOM
- Fiber Access - React attaches Fiber nodes via
__reactFiber$*keys - Data Extraction - Extract component type, props, hooks, rendered HTML
- Style Extraction - Pull CSS variables, computed styles, typography
- Example Collection - Gather multiple propβHTML mappings
- LLM Reconstruction - Feed examples + minified source to LLM
- Project Scaffolding - Generate complete Next.js project
- Verification - Compare rendered output until it matches
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Main Agent (opus/sonnet) β
β β
β Dispatcher loaded (~300-400 tokens) β
β ββ Pre-flight check (Chrome MCP available?) β
β ββ Dispatch to appropriate subagent β
β β
β βββββββββββββββββββββββββ ββββββββββββββββββββββββββββββ β
β β steal-react-component β β copy-site β β
β β Subagent (sonnet) β β Subagent (sonnet) β β
β β β β β β
β β AGENT.md (~4k tokens) β β COPY-SITE-AGENT.md (~6k) β β
β β ββ Navigate β β ββ Screenshot site β β
β β ββ Inject ReactStealerβ β ββ Extract design system β β
β β ββ Extract component β β ββ Extract components β β
β β ββ Reconstruct code β β ββ De-minify (parallel) β β
β βββββββββββββββββββββββββ β ββ Scaffold Next.js β β
β β ββ Test & verify β β
β ββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Workflow Comparison
| Feature | steal-react-component | copy-site |
|---|---|---|
| Scope | Individual components | Entire site |
| Output | Component code | Full Next.js app |
| Design System | Optional | Always extracted |
| Automation | Interactive | End-to-end |
| Use Case | Grab specific components | Clone entire UI |
Limitations
- Animations - Snapshots may not match animated state
- Interactive State - Dropdowns, modals may not capture correctly
- Minification - Some component names are minified (e.g.,
Hc,qv) - Server Components - RSC may not have client-side Fiber data
- Authentication - Protected pages require manual login first
- Non-React Sites - Only style extraction works
Example Output
Component Extraction
// After injection, use ReactStealer API:
// Get component summary
ReactStealer.summary()
// β { totalComponents: 89, components: [{ name: "Button", count: 15 }, ...] }
// Extract specific component for LLM
ReactStealer.getForLLM('Button')
// β Formatted prompt with source + examples
// Target specific element
ReactStealer.getBySelector('button.primary')
// β { name, props, hooks, renderedHTML, source }
Site Cloning
After running /copy-site https://x.com:
sites/
βββ x.com/
βββ README.md # Site documentation
βββ style-guide.md # Design system reference
βββ app/
βββ package.json
βββ tailwind.config.ts
βββ app/
β βββ layout.tsx
β βββ page.tsx
β βββ globals.css
βββ components/
βββ index.ts
βββ Sidebar.tsx
βββ Tweet.tsx
βββ TweetComposer.tsx
βββ RightSidebar.tsx
License
MIT
Credits
- Technique inspired by fant.io/react - "How to Steal Any React Component"
- Built for Claude Code

