All skills
simota avatar

/vector

@e307415
by shingo imotasimota/agent-skills85 stars
15

Automating browsers via Playwright and Chrome DevTools for data collection, form interaction, screenshot capture, and network monitoring. Task completion focus (vs Voyager for E2E testing).

Use this Skill: https://skilld.dev/gh/simota/agent-skills/vector

This session only. Nothing lands on disk.

referencevideo-recording.md

≈929 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Video Recording Reference

Recording patterns for browser task evidence and documentation.


Playwright Video Recording

Context-level Recording (Recommended for task flows)

const context = await browser.newContext({
  recordVideo: {
    dir: '.vector/videos/',
    size: { width: 1280, height: 720 },
  },
});
const page = await context.newPage();

// Perform operations
await page.goto('https://example.com');
await page.fill('[data-testid="search"]', 'keyword');
await page.click('[data-testid="submit"]');

// Get video path after closing
await page.close();
const videoPath = await page.video()?.path();
console.log(`Video saved: ${videoPath}`);

// IMPORTANT: Close context to finalize video
await context.close();

CDP Screen Recording (Advanced, fine-grained control)

const client = await page.context().newCDPSession(page);

// Start screencast
await client.send('Page.startScreencast', {
  format: 'jpeg',
  quality: 80,
  everyNthFrame: 2,
});

// Collect frames
const frames: Buffer[] = [];
client.on('Page.screencastFrame', async (event) => {
  frames.push(Buffer.from(event.data, 'base64'));
  await client.send('Page.screencastFrameAck', { sessionId: event.sessionId });
});

// Perform operations...

// Stop and process
await client.send('Page.stopScreencast');
// Convert frames to video using ffmpeg or similar

Video Configuration Options

// playwright.config.ts or context options
const videoOptions = {
  size: { width: 1280, height: 720 },  // 720p (recommended)
  // size: { width: 1920, height: 1080 }, // 1080p (larger files)
  dir: '.vector/videos/',
};

// Per-task recording control
async function recordTask(task: () => Promise<void>, name: string) {
  const context = await browser.newContext({
    recordVideo: { dir: '.vector/videos/' },
  });
  const page = await context.newPage();

  try {
    await task();
  } finally {
    await page.close();
    const video = page.video();
    if (video) {
      const originalPath = await video.path();
      const newPath = `.vector/videos/${name}_${Date.now()}.webm`;
      await fs.rename(originalPath, newPath);
    }
    await context.close();
  }
}

Best Practices

Practice Description
Start recording before navigation Capture complete flow including initial load
Use 720p resolution Balance between clarity and file size
Close page/context to finalize Video file is incomplete until closed
Rename files meaningfully task_checkout_20250127.webm not random-uuid.webm
Record only when necessary Videos consume storage; be selective
Include in task report Reference video path in final report
Clean up old videos Implement retention policy (e.g., 7 days)

Video File Management

.vector/videos/
├── task_[name]_[timestamp].webm      # Completed task videos
├── error_[name]_[timestamp].webm     # Error reproduction videos
└── evidence_[name]_[timestamp].webm  # Evidence videos

Integration with Task Report

## Task Report: Checkout Flow Verification

### Evidence
- **Screenshots**: `.vector/screenshots/checkout_*.png`
- **Video**: `.vector/videos/task_checkout_20250127_143022.webm`
- **HAR**: `.vector/har/checkout_20250127.har`

### Video Timestamps
- 0:00 - Page load
- 0:15 - Form filling
- 0:45 - Submit and confirmation

Cross-Reference Links

Reference Content
execution-templates.md Execution phase templates, wait strategies, error handling
playwright-cdp.md MCP server operations, CDP methods, connection patterns

Source: SKILL.md on GitHub

1 alert13d3 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    This skill provides advanced browser automation and web crawling capabilities, including techniques for bypassing bot detection. While feature-rich and documented with ethical guidelines, it presents an inherent risk of indirect prompt injection due to its core function of processing untrusted web content and provides tools for dynamic code execution within browser environments.

  • Socket13d

    3 alerts: gptAnomaly, gptMalware

  • Snyk13d

    Risk: MEDIUM · 1 issue

Signed by skilld at e307415. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 2 weeks ago

README badge

README badge for simota/agent-skills/vector