← スキル一覧に戻る

screenshots
by bas
A demo e-commerce webshop for Octocat stickers, built with Next.js 16 and Tailwind CSS v4
⭐ 0🍴 0📅 2026年1月14日
SKILL.md
name: screenshots description: Captures screenshots of web application pages using Playwright. Use when the user asks to take screenshots, capture page visuals, document UI states, or create design documentation. Supports full-page screenshots, element screenshots, and multiple page capture workflows. license: MIT metadata: author: octodeco version: "1.0"
Screenshot Capture
Capture screenshots of web application pages using Playwright.
When to Use
- User asks to "take screenshots" or "capture the UI"
- Documenting design states for review
- Creating visual documentation
- Capturing before/after comparisons
- Recording UI states for bug reports
Prerequisites
- Playwright must be installed:
npm install -D playwright - A running dev server (or use the
webapp-testingskill'swith_server.pyhelper)
Quick Start
For simple screenshot tasks, write a TypeScript script using Playwright:
import { chromium } from 'playwright';
async function takeScreenshots() {
const browser = await chromium.launch({
headless: true,
channel: 'chrome' // Use installed Chrome for stability
});
const context = await browser.newContext({
viewport: { width: 1280, height: 800 },
});
const page = await context.newPage();
await page.goto('http://localhost:3000');
await page.waitForLoadState('networkidle');
await page.screenshot({ path: 'screenshot.png', fullPage: true });
await browser.close();
}
takeScreenshots();
Run with: npx tsx scripts/your-screenshot-script.ts
Screenshot Options
Full Page Screenshot
await page.screenshot({ path: 'full-page.png', fullPage: true });
Viewport Only
await page.screenshot({ path: 'viewport.png', fullPage: false });
Element Screenshot
const element = page.locator('.hero-section');
await element.screenshot({ path: 'hero.png' });
With Quality Settings (JPEG)
await page.screenshot({
path: 'compressed.jpg',
type: 'jpeg',
quality: 80
});
Multi-Page Workflow
For capturing multiple pages (e.g., documenting a complete flow):
const pages = [
{ url: '/', name: '01-home' },
{ url: '/products', name: '02-products' },
{ url: '/products/example', name: '03-product-detail' },
{ url: '/checkout', name: '04-checkout' },
];
for (const { url, name } of pages) {
await page.goto(`http://localhost:3000${url}`);
await page.waitForLoadState('networkidle');
await page.screenshot({ path: `docs/design/${name}.png`, fullPage: true });
}
Tips
- Always wait for network idle before capturing to ensure all assets load
- Close modals/drawers with
page.keyboard.press('Escape')before full-page shots - Use a consistent viewport (1280x800 is standard for documentation)
- Create output directory first:
mkdir -p docs/design - Use
channel: 'chrome'in launch options to use installed Chrome for better stability
Example Script Location
See scripts/take-screenshots.ts in this skill directory for a complete example that captures multiple pages of the Octodeco webshop.
Run it with:
npx tsx .github/skills/screenshots/scripts/take-screenshots.ts
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です