anthropics/skills180kwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
浏览器与测试
搜索文档、Skill 和 MCP
Clone any website into a pixel-perfect single-file HTML prototype. Extracts design tokens, assets, CSS computed styles, interaction patterns, and content via Playwright. Outputs a self-contained HTML file with real data injection. Use when the user wants to clone, replicate, reverse-engineer, or create a pixel-perfect copy of any website or web app. Provide one or more target URLs as arguments.
把这段话发给 Claude Code、Codex 或 Cursor。智能体会先检查安全性,你确认后才安装。
读取 https://funcoding.ai/skills/coco-research/coco/clone-website/install.md ,按里面的步骤帮我安装这个 Skill。
You are about to reverse-engineer $ARGUMENTS into a pixel-perfect single-file HTML prototype.
This is adapted from the ai-website-cloner-template approach but optimized for rapid prototyping workflows: single self-contained HTML files (no build system, no CDN dependencies, opens directly in a browser).
Unlike the original repo (Next.js + shadcn/ui), our output is:
<style> + <body> + <script> sectionsdesign-system.json colocated with the projectnpx playwright --version. If not installed, ask the user to run npm i -D playwright.$ARGUMENTS as one or more URLs. Validate each is accessible.{project}/Screenshots-clone/ for captured assets.--extract): capture design tokens, screenshots, and component specs without building--sections "header,table,sidebar"): clone only named sectionsUse Playwright to capture:
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto(URL);
// Full page screenshot
await page.screenshot({ path: 'full-desktop.png', fullPage: true });
// Viewport screenshot
await page.screenshot({ path: 'viewport-desktop.png' });
// Mobile
await page.setViewportSize({ width: 390, height: 844 });
await page.screenshot({ path: 'viewport-mobile.png', fullPage: true });
Run this in Playwright's page.evaluate() to extract the complete design system:
const tokens = await page.evaluate(() => {
// Colors
const colorMap = new Map();
document.querySelectorAll('*').forEach(el => {
const cs = getComputedStyle(el);
['color','backgroundColor','borderColor','borderTopColor','borderBottomColor'].forEach(p => {
const v = cs[p];
if (v && v !== 'rgba(0, 0, 0, 0)' && v !== 'transparent') colorMap.set(v, (colorMap.get(v)||0)+1);
});
});
// Typography
const fontMap = new Map();
document.querySelectorAll('*').forEach(el => {
const cs = getComputedStyle(el);
const key = `${cs.fontFamily}|${cs.fontSize}|${cs.fontWeight}|${cs.lineHeight}`;
fontMap.set(key, (fontMap.get(key)||0)+1);
});
// Spacing
const spacingSet = new Set();
document.querySelectorAll('*').forEach(el => {
const cs = getComputedStyle(el);
['padding','margin','gap'].forEach(p => {
const v = cs[p]; if (v && v !== '0px') spacingSet.add(v);
});
});
// Shadows
const shadowSet = new Set();
document.querySelectorAll('*').forEach(el => {
const v = getComputedStyle(el).boxShadow;
if (v && v !== 'none') shadowSet.add(v);
});
// Radius
const radiusSet = new Set();
document.querySelectorAll('*').forEach(el => {
const v = getComputedStyle(el).borderRadius;
if (v && v !== '0px') radiusSet.add(v);
});
return {
colors: [...colorMap.entries()].sort((a,b) => b[1]-a[1]).slice(0,30),
typography: [...fontMap.entries()].sort((a,b) => b[1]-a[1]).slice(0,20),
spacing: [...spacingSet].sort(),
shadows: [...shadowSet],
radii: [...radiusSet].sort()
};
});
For each major component/section, extract exact computed styles:
// Run per component container
const componentCSS = await page.evaluate((selector) => {
const el = document.querySelector(selector);
if (!el) return null;
const props = [
'fontSize','fontWeight','fontFamily','lineHeight','letterSpacing','color',
'textTransform','textDecoration','backgroundColor','background',
'padding','paddingTop','paddingRight','paddingBottom','paddingLeft',
'margin','marginTop','marginRight','marginBottom','marginLeft',
'width','height','maxWidth','minWidth','display','flexDirection',
'justifyContent','alignItems','gap','gridTemplateColumns',
'borderRadius','border','boxShadow','overflow','position',
'top','right','bottom','left','zIndex','opacity','transform','transition'
];
function extract(element, depth) {
if (depth > 4) return null;
const cs = getComputedStyle(element);
const styles = {};
props.forEach(p => {
const v = cs[p];
if (v && v !== 'none' && v !== 'normal' && v !== 'auto' && v !== '0px' && v !== 'rgba(0, 0, 0, 0)')
styles[p] = v;
});
return {
tag: element.tagName.toLowerCase(),
classes: element.className?.toString().split(' ').slice(0,5).join(' '),
text: element.childNodes.length === 1 && element.childNodes[0].nodeType === 3
? element.textContent.trim().slice(0,200) : null,
styles,
children: [...element.children].slice(0,20).map(c => extract(c, depth+1)).filter(Boolean)
};
}
return extract(el, 0);
}, selector);
Use Playwright to discover behaviors:
// Scroll sweep
for (let y = 0; y < await page.evaluate(() => document.body.scrollHeight); y += 300) {
await page.evaluate(y => window.scrollTo(0, y), y);
await page.waitForTimeout(200);
// Check for sticky header changes, scroll-triggered animations, etc.
}
// Hover sweep --- hover over interactive elements
const interactiveEls = await page.$$('button, a, [role="tab"], .nav-item, .card');
for (const el of interactiveEls.slice(0, 30)) {
await el.hover();
await page.waitForTimeout(100);
}
// Click sweep --- test tabs, dropdowns, etc.
const tabs = await page.$$('[role="tab"], .tab-item, .nav-tab');
for (const tab of tabs) {
await tab.click();
await page.waitForTimeout(300);
}
// Extract all SVG icons as inline code
const svgs = await page.evaluate(() =>
[...document.querySelectorAll('svg')].map(s => ({
html: s.outerHTML,
parent: s.parentElement?.className?.toString().split(' ')[0] || 'unknown',
width: s.getAttribute('width'),
height: s.getAttribute('height')
}))
);
// Extract all image URLs for download
const images = await page.evaluate(() =>
[...document.querySelectorAll('img')].map(i => ({
src: i.src, alt: i.alt, w: i.naturalWidth, h: i.naturalHeight
}))
);
Convert extracted tokens into CSS custom properties:
:root {
/* Colors --- from extraction, mapped to semantic names */
--color-bg: {extracted};
--color-text: {extracted};
--color-text-muted: {extracted};
--color-accent: {extracted};
--color-border: {extracted};
/* ... */
/* Typography */
--font-family: {extracted};
--font-size-body: {extracted};
/* ... */
/* Shadows */
--shadow-sm: {extracted};
--shadow-md: {extracted};
/* ... */
}
For each major section of the page, dispatch a builder agent:
Complexity budget: If a section spec exceeds ~150 lines, split it.
Merge all sections into one self-contained HTML file:
<script> blockUse Playwright to:
When a design-system.json exists in the project:
anthropics/skills180kToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
浏览器与测试
addyosmani/agent-skills104kEstablishes a project's quality bar as a written contract and stops agents quietly lowering it. Interviews the user on which dimensions matter, supplies sane default thresholds when they have no number in mind, records everything in CONSTRAINTS.md, and watches the diff for a weakened bar — new @ts-ignore or eslint-disable suppressions, skipped or deleted tests, assertions stripped out, unimplemented stubs, thresholds edited down. Use when no quality bar is written down, when the user says "set up constraints" or "define our standards", when the user wants dimensions they care about — accessibility, web performance, coverage — set up as enforced constraints, when an agent keeps silencing checks or skipping tests to get to green, when you need a coverage or performance threshold and don't know what number to pick, or when an agent writes more code than anyone will read.
浏览器与测试
addyosmani/agent-skills104kDrives development with tests using the red-green-refactor loop. Use when implementing any logic, fixing any bug, or changing any behavior. Use when you need to prove that code works, when a bug report arrives, or when you're about to modify existing functionality.
浏览器与测试
addyosmani/agent-skills104kRefines raw ideas into sharp, actionable concepts through structured divergent and convergent thinking. Use when an idea is still vague, when you need to stress-test assumptions before committing to a plan, or when you want to expand options before converging on one. Triggers on "ideate", "refine this idea", or "stress-test my plan".
浏览器与测试
addyosmani/agent-skills104kTests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured.
浏览器与测试
ComposioHQ/awesome-claude-skills77kToolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
浏览器与测试