home / skills / ratacat / claude-skills / reproduce-bug

reproduce-bug skill

/skills/reproduce-bug

This skill reproduces and investigates bugs by analyzing logs, console output, and Playwright screenshots to identify root causes.

npx playbooks add skill ratacat/claude-skills --skill reproduce-bug

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.9 KB
---
name: reproduce-bug
description: Reproduce and investigate a bug using logs, console inspection, and browser screenshots
---

## Arguments
[GitHub issue number]

# Reproduce Bug Command

Look at github issue #$ARGUMENTS and read the issue description and comments.

## Phase 1: Log Investigation

Run the following agents in parallel to investigate the bug:

1. Task rails-console-explorer(issue_description)
2. Task appsignal-log-investigator(issue_description)

Think about the places it could go wrong looking at the codebase. Look for logging output we can look for.

Run the agents again to find any logs that could help us reproduce the bug.

Keep running these agents until you have a good idea of what is going on.

## Phase 2: Visual Reproduction with Playwright

If the bug is UI-related or involves user flows, use Playwright to visually reproduce it:

### Step 1: Verify Server is Running

```
mcp__plugin_compound-engineering_pw__browser_navigate({ url: "http://localhost:3000" })
mcp__plugin_compound-engineering_pw__browser_snapshot({})
```

If server not running, inform user to start `bin/dev`.

### Step 2: Navigate to Affected Area

Based on the issue description, navigate to the relevant page:

```
mcp__plugin_compound-engineering_pw__browser_navigate({ url: "http://localhost:3000/[affected_route]" })
mcp__plugin_compound-engineering_pw__browser_snapshot({})
```

### Step 3: Capture Screenshots

Take screenshots at each step of reproducing the bug:

```
mcp__plugin_compound-engineering_pw__browser_take_screenshot({ filename: "bug-[issue]-step-1.png" })
```

### Step 4: Follow User Flow

Reproduce the exact steps from the issue:

1. **Read the issue's reproduction steps**
2. **Execute each step using Playwright:**
   - `browser_click` for clicking elements
   - `browser_type` for filling forms
   - `browser_snapshot` to see the current state
   - `browser_take_screenshot` to capture evidence

3. **Check for console errors:**
   ```
   mcp__plugin_compound-engineering_pw__browser_console_messages({ level: "error" })
   ```

### Step 5: Capture Bug State

When you reproduce the bug:

1. Take a screenshot of the bug state
2. Capture console errors
3. Document the exact steps that triggered it

```
mcp__plugin_compound-engineering_pw__browser_take_screenshot({ filename: "bug-[issue]-reproduced.png" })
```

## Phase 3: Document Findings

**Reference Collection:**

- [ ] Document all research findings with specific file paths (e.g., `app/services/example_service.rb:42`)
- [ ] Include screenshots showing the bug reproduction
- [ ] List console errors if any
- [ ] Document the exact reproduction steps

## Phase 4: Report Back

Add a comment to the issue with:

1. **Findings** - What you discovered about the cause
2. **Reproduction Steps** - Exact steps to reproduce (verified)
3. **Screenshots** - Visual evidence of the bug (upload captured screenshots)
4. **Relevant Code** - File paths and line numbers
5. **Suggested Fix** - If you have one

Overview

This skill automates reproducing and investigating a bug by combining log analysis, console inspection, and browser-driven screenshots. It orchestrates targeted agents to find relevant logs, uses Playwright to reproduce UI or flow issues, and produces a concise report with evidence, file references, and a suggested fix. The goal is to turn an issue description into verified reproduction steps and actionable findings.

How this skill works

Start by reading the issue description and comments. Parallel agents search codepaths and logging (console, AppSignal, Rails logs) to identify where failures or unexpected behavior may originate. If the bug involves UI or user flows, the skill launches Playwright to navigate the app, execute the reproduction steps, capture screenshots, and collect console errors. Finally, it compiles findings, file paths, screenshots, and a recommended remediation into a comment for the issue.

When to use it

  • You need a verified reproduction for a GitHub issue.
  • Logs are unclear and you need targeted log locations to inspect.
  • A UI flow fails and you need step-by-step screenshots and console traces.
  • You want a reproducible set of steps plus file-level pointers for a fix.
  • You need to add a technical comment to the issue with evidence and suggested remediation.

Best practices

  • Provide the GitHub issue number and any reproduction steps or environment notes up front.
  • Run the skill against a local dev server; ensure bin/dev or equivalent is running before Playwright steps.
  • Iterate log discovery: run log investigators multiple times to narrow down useful messages.
  • Capture screenshots and console errors at each step, label files with the issue number and step.
  • Document exact file paths and line numbers where the root cause or suspects appear.

Example use cases

  • Reproduce a JavaScript error that appears only in a specific user flow and gather console errors and screenshots.
  • Find the backend service or controller causing a 500 error by searching logs and tracing request handling.
  • Verify a UI regression reported after a deploy by reproducing steps and capturing visual evidence.
  • Locate a flaky test or intermittent crash by correlating AppSignal logs with user actions and code locations.

FAQ

What do I need to run this skill?

A local development server with the app running (start with bin/dev), access to logs (AppSignal or local logs), and Playwright available for browser automation.

Can it modify the codebase or open PRs?

No. The skill only inspects logs, runs automated browser reproduction, captures evidence, and posts findings and suggestions to the GitHub issue. Code changes must be made separately.