スキル一覧に戻る
pentaxis93

screenshot

by pentaxis93

AI and I - a blog about human-AI collaboration

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: screenshot description: "Capture screenshots of aiandi.dev for visual verification. Puppeteer-based, outputs to /tmp. Foundation for the design-loop skill."

Screenshot Skill

Purpose: Capture screenshots of the blog for visual verification, documentation, or as part of the design-loop refinement process.


When to Use

  • Standalone: Quick visual verification before commit
  • With design-loop: Iterative design refinement (see design-loop skill)
  • Documentation: Capturing UI states for discussion
  • Debugging: Layout or styling issues

Quick Start

# 1. Ensure dev server is running
bun run dev --host 0.0.0.0 &
sleep 5

# 2. Capture screenshot
cat << 'EOF' | bun run -
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  headless: true,
  args: ['--no-sandbox', '--disable-setuid-sandbox']
});

const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 800 });

// Note: Check server output for actual port (4321 or 4322)
await page.goto('http://localhost:4321/', { waitUntil: 'networkidle0' });

const path = `/tmp/aiandi-${Date.now()}.png`;
await page.screenshot({ path, fullPage: false });

await browser.close();
console.log(path);
EOF

# 3. IMMEDIATELY read the image with Read tool (don't wait for human)
# The Read tool can display images - call it right after capturing
# Read /tmp/aiandi-TIMESTAMP.png

Configuration

Viewport Sizes

DeviceWidthHeightUse Case
Monitor19201080Realistic desktop (recommended)
Desktop1280800Smaller screens
Tablet7681024Responsive testing
Mobile375667Mobile-first verification

Important: Use 1920x1080 to verify centering and layout on realistic monitors. Smaller viewports may hide centering issues.

Screenshot Options

// Full page (scrolls entire content)
await page.screenshot({ path, fullPage: true });

// Specific element
const element = await page.$('.hero');
await element.screenshot({ path });

// With transparency
await page.screenshot({ path, omitBackground: true });

// After hover state
await page.hover('.button');
await page.screenshot({ path });

// After waiting for animation
await page.waitForTimeout(300);
await page.screenshot({ path });

Common Pages

PagePath
Home/
Blog index/blog
About/about
Blog post/blog/[slug]

Multiple Screenshots

const browser = await puppeteer.launch({
  headless: true,
  args: ['--no-sandbox', '--disable-setuid-sandbox']
});

const page = await browser.newPage();
const ts = Date.now();

const routes = [
  { path: '/', name: 'home' },
  { path: '/blog', name: 'blog' },
  { path: '/about', name: 'about' }
];

for (const { path, name } of routes) {
  await page.setViewport({ width: 1280, height: 800 });
  await page.goto(`http://localhost:4321${path}`, { waitUntil: 'networkidle0' });
  await page.screenshot({ path: `/tmp/aiandi-${name}-${ts}.png` });
  console.log(`Captured: ${name}`);
}

await browser.close();

Cleanup

Screenshots in /tmp auto-clean on system restart. For immediate cleanup:

rm /tmp/aiandi-*.png

Troubleshooting

IssueSolution
Port in useCheck server output for actual port (4321 or 4322)
Blank screenshotIncrease sleep time or use waitUntil: 'networkidle0'
Browser launch failsEnsure --no-sandbox flag is included
Element not foundUse await page.waitForSelector('.element')
Stale contentAdd await page.reload() before capture

Important Notes

  • Always use /tmp - Never save screenshots in the repo
  • Never commit screenshots - They're for verification only
  • Check the port - Server may use 4321 or 4322
  • Kill server when done - pkill -f "astro dev" if needed
  • Read immediately - After capturing, call Read /tmp/path.png in the same response to avoid human gate
  • Use 1920x1080 - Realistic monitor size catches centering/layout issues

SkillRelationship
design-loopUses screenshot as part of iterative refinement
web-designProvides the design system for what you're capturing

Visual verification catches what code review misses.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です