Agent skill
screenshot-to-code
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/screenshot-to-code
SKILL.md
📸 Screenshot to Code Skill
name: screenshot-to-code description: Convert UI screenshots or design mockups into working code
🎯 Purpose
แปลง screenshots หรือ design mockups เป็น working code (HTML/CSS/React)
📋 When to Use
- Implement designs from Figma/Sketch
- Clone existing UI
- Rapid prototyping
- Design handoff
🔧 Process
1. ANALYZE screenshot
- Layout structure
- Components
- Colors, fonts
- Spacing
2. IDENTIFY patterns
- Grid/Flexbox
- Component library matches
- Responsive behavior
3. GENERATE code
- HTML structure
- CSS/Tailwind styles
- React components
4. REFINE
- Pixel perfect adjustments
- Responsive tweaks
- Interactions
📝 Example Workflow
Input: Card Component Screenshot
Output:
function ProductCard({ product }) {
return (
<div className="card">
<img
src={product.image}
alt={product.name}
className="card-image"
/>
<div className="card-content">
<h3 className="card-title">{product.name}</h3>
<p className="card-price">฿{product.price}</p>
<button className="card-button">
Add to Cart
</button>
</div>
</div>
);
}
.card {
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
background: white;
}
.card-image {
width: 100%;
height: 200px;
object-fit: cover;
}
.card-content {
padding: 16px;
}
.card-title {
font-size: 18px;
font-weight: 600;
margin-bottom: 8px;
}
.card-price {
color: #10b981;
font-weight: 700;
margin-bottom: 12px;
}
.card-button {
width: 100%;
padding: 12px;
background: #3b82f6;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
}
📊 Analysis Checklist
| Element | Extract |
|---|---|
| Layout | Grid, Flex, positioning |
| Colors | Primary, secondary, text |
| Typography | Fonts, sizes, weights |
| Spacing | Margins, padding, gaps |
| Borders | Radius, width, color |
| Shadows | Box-shadow values |
| Images | Aspect ratios, fit |
✅ Quality Checklist
- Matches original visually
- Responsive behavior
- Semantic HTML
- Accessible
- Clean code structure
- Reusable components
🔗 Related Skills
vision-to-code- Similar, image inputdesign-mastery- Premium designsui-first-builder- UI development
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?