reproduce-bug
This skill should be used when reproducing and investigating a bug using logs, console inspection, and browser screenshots. It systematically investigates GitHub issues through log analysis, code inspection, and visual reproduction with Playwright.
Reproduce Bug
Look at github issue #$ARGUMENTS and read the issue description and comments.
Phase 1: Log Investigation
Think about the places it could go wrong looking at the codebase. Look for logging output to search for.
Search application logs, error tracking, and recent git history for clues:
- Check recent commits related to the affected area
- Search for error messages or stack traces in logs
- Inspect the relevant code paths for potential failure points
Keep investigating until a good understanding of the situation is reached.
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_soleur_pw__browser_navigate({ url: "http://localhost:3000" })
mcp__plugin_soleur_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_soleur_pw__browser_navigate({ url: "http://localhost:3000/[affected_route]" })
mcp__plugin_soleur_pw__browser_snapshot({})
Step 3: Capture Screenshots
Take screenshots at each step of reproducing the bug:
mcp__plugin_soleur_pw__browser_take_screenshot({ filename: "bug-[issue]-step-1.png" })
Step 4: Follow User Flow
Reproduce the exact steps from the issue:
-
Read the issue's reproduction steps
-
Execute each step using Playwright:
browser_clickfor clicking elementsbrowser_typefor filling formsbrowser_snapshotto see the current statebrowser_take_screenshotto capture evidence
-
Check for console errors:
mcp__plugin_soleur_pw__browser_console_messages({ level: "error" })
Step 5: Capture Bug State
When the bug is reproduced:
- Take a screenshot of the bug state
- Capture console errors
- Document the exact steps that triggered it
mcp__plugin_soleur_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:
- Findings - What was discovered about the cause
- Reproduction Steps - Exact steps to reproduce (verified)
- Screenshots - Visual evidence of the bug (upload captured screenshots)
- Relevant Code - File paths and line numbers
- Suggested Fix - If one exists
Phase 5: Cleanup
After uploading screenshots to the issue comment, remove local screenshot artifacts. Playwright MCP writes to the main repo root when invoked from a worktree.
# Remove bug reproduction screenshots from current working directory
rm -f bug-*.png
# If in a worktree, also clean the main repo root
MAIN_REPO=$(git rev-parse --show-superproject-working-tree 2>/dev/null)
if [[ -n "$MAIN_REPO" ]]; then
rm -f "$MAIN_REPO"/bug-*.png
fi