bug-hunt-fix
Skill2 starsChanged 35 days agoMITView on GitHub
Fix a bug from bug-hunt and verify the fix using Playwright browser automation
- Reads credentials
In this repository75 other files it gives its agents.
- acceptance-criteriaSkill
- architect-guideSkill
- architect-reviewSkill
- audit-fixerSkill
- avo-admin-expertSkill
- backend-services-expertSkill
- bug-hunt-allSkill
- bug-huntSkill
- build-feature-remoteSkill
- build-featureSkill
- codeSkill
- component-testSkill
- controller-expertSkill
- create-qa-documentSkill
- debugSkill
- devops-expertSkill
- execute-qaSkill
- feature-qaSkill
- fix-bug-indexSkill
- fix-honeybadgerSkill
- fix-spec-bugsSkill
- fix-system-testSkill
- frontend-expertSkill
- frontend-reviewSkill
- full-qa-fixSkill
- full-qaSkill
- full-reviewSkill
- green-ciSkill
- group-issuesSkill
- honeybadger-auditSkill
- ideateSkill
- impact-assessmentSkill
- improveSkill
- merge-mainSkill
- model-expertSkill
- model-testSkill
- native-bug-hunt-fixSkill
- native-bug-huntSkill
- page-speedSkill
- plan-questionsSkill
- planSkill
- plan-system-testsSkill
- policy-testSkill
- prdSkill
- prd-worktreeSkill
- product-questionSkill
- product-question-tldrSkill
- qa-branchSkill
- qa-testerSkill
- refactor-sweepSkill
- resolve-honeybadgerSkill
- resolve-issueSkill
- resolve-issuesSkill
- review-acceptance-criteriaSkill
- review-fixesSkill
- review-railsSkill
- rspec-test-expertSkill
- scale-reviewSkill
- service-testSkill
- settle-pr-reviewSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
33 rules. About 0 are common, 26 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈26
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Read the bug file provided and extract:
- Distinctive: line 26
Read all related files mentioned in the bug report
- Distinctive: line 27
Search for the error location in the codebase
- Distinctive: line 29
Check related models, controllers, views, and services
- Distinctive: line 30
Look for similar patterns or known issues in the codebase
- Distinctive: line 31
Check test files for expected behavior
- Distinctive: line 35
Before proposing any fix:
- Distinctive: line 38
Consider multiple possible causes
- Distinctive: line 44
Ensure your solution follows:
- Distinctive: line 54
Document your proposed fix:
- Distinctive: line 66
Follow existing code patterns and conventions
- Distinctive: line 67
Add appropriate error handling
- Very specific: line 70
Run linting after changes: bin/standardrb --fix
- Very specific: line 82
Use $BASE_URL for the server check and every browser_navigate.
- Distinctive: line 85
Ensure the development server is running:
- Very specific: line 91
If not running, start it with bin/dev (it reads PORT= from .env) and wait for it to be ready.
- Very specific: line 106
Use mcp__playwright__browser_snapshot to see the login form
- Distinctive: line 125
Follow the exact steps to reproduce from the bug report, navigating through the UI like a real user:
- Very specific: line 131
Use mcp__playwright__browser_snapshot for accessibility tree
- Very specific: line 132
Use mcp__playwright__browser_take_screenshot for visual state (save to .playwright-mcp/)
- Distinctive: line 137
After reproducing the steps:
- Distinctive: line 140
Verify no new console errors were introduced
- Distinctive: line 141
Verify no network errors occurred
- Distinctive: line 144
Test edge cases related to the bug
- Distinctive: line 145
Test that related functionality still works
- Distinctive: line 146
If the bug was about Turbo Streams, verify the DOM updates correctly
- Very specific: line 151
Add a "Fix Verification" section to the bug file (this is the ONLY edit allowed to /docs/bug-reports/):
- Distinctive: line 179
Run the test suite if relevant tests exist
- Distinctive: line 184
ALWAYS investigate thoroughly: before implementing any fix
- Distinctive: line 185
Understand the root cause: - don't just patch symptoms
- Distinctive: line 191
Document everything: - update the bug report with verification results
- Distinctive: line 192
Check for regressions: - ensure the fix doesn't break related functionality
- Distinctive: line 198
Document what happened in the bug report
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Verify Bug Fix Command
You are tasked with fixing a bug that was found by bug-hunt and verifying the fix using Playwright browser automation.
Bug File to Analyze
$ARGUMENTS
Phase 1: Bug Analysis
Step 1: Read and Understand the Bug
Read the bug file provided and extract:
- Summary: What is the bug?
- Steps to Reproduce: How to trigger it
- Expected vs Actual Behavior: What should happen vs what happens
- Related Files: Files mentioned in the bug report
- Technical Notes: Any hints about the cause
Step 2: Investigate the Codebase
Perform systematic investigation:
- Read all related files mentioned in the bug report
- Search for the error location in the codebase
- Examine the stack trace if provided
- Check related models, controllers, views, and services
- Look for similar patterns or known issues in the codebase
- Check test files for expected behavior
- Review Turbo Stream templates if it's a UI update issue
Step 3: Root Cause Analysis
Before proposing any fix:
- Identify the exact root cause
- Understand WHY the bug occurs, not just WHERE
- Consider multiple possible causes
- Document your findings
Phase 2: Solution Planning
Step 4: Best Practices Review
Ensure your solution follows:
- Rails 8 conventions and patterns from CLAUDE.md
- Service object patterns for complex business logic
- Proper error handling and user feedback
- Hotwire/Turbo best practices for dynamic updates
- ViewComponent patterns if UI components are involved
- Security considerations
- Performance implications
Step 5: Create Fix Plan
Document your proposed fix:
- Root cause analysis summary
- Proposed solution steps
- Files that need to be modified
- Potential side effects or risks
- Testing strategy to verify the fix
Phase 3: Implementation
Step 6: Implement the Fix
When implementing:
- Make minimal, targeted changes
- Follow existing code patterns and conventions
- Add appropriate error handling
- Include necessary validations
- For any front-end changes (views, partials, ViewComponents, Stimulus controllers, Turbo Stream templates, CSS/Tailwind, JavaScript): Use the
/frontend-expertskill to implement the changes. This ensures proper Hotwire patterns, accessibility, and Tailwind conventions are followed. - Run linting after changes:
bin/standardrb --fix
Phase 4: Verification with Playwright
Step 7: Resolve the Base URL
This checkout may be the main repo (default port) or a /build-feature worktree with its own
server and database (PORT= in .env). Resolve it before touching the browser:
BASE_URL="$(bin/dev-url)" # $PORT > PORT= in .env > 3000Use $BASE_URL for the server check and every browser_navigate. Never hardcode the port.
Step 7b: Prerequisites Check
Ensure the development server is running:
curl -sk -o /dev/null -w "%{http_code}" "$BASE_URL" 2>/dev/null || echo "not running"If not running, start it with bin/dev (it reads PORT= from .env) and wait for it to be ready.
Step 8: Authenticate
Use passwordless authentication:
Available Test Users:
| Role | |
| Admin | admin@example.com |
| Therapist | therapist@example.com |
| Coordinator | coordinator@example.com |
| Standard User | user@example.com |
Authentication Flow:
- Navigate to
$BASE_URL - Use
mcp__playwright__browser_snapshotto see the login form - Enter the appropriate test email
- Click "Send Magic Link"
- Get the magic link from logs:
tail -100 log/development.log | grep -A5 "magic_link" - Navigate to the magic link URL
- Confirm authentication succeeded
Step 9: Set Viewport
Based on the bug's URL:
- Staff/Admin routes (
/staff/*,/admin/*): Desktop viewport (1280x800)mcp__playwright__browser_resize(width: 1280, height: 800) - Client Portal: Mobile-first viewport (375x667)
mcp__playwright__browser_resize(width: 375, height: 667)
Step 10: Reproduce and Verify Fix
Follow the exact steps to reproduce from the bug report, navigating through the UI like a real user:
- After authentication, use the UI to navigate - click sidebar links, nav menus, and buttons to reach the page where the bug occurs. Do NOT navigate directly to URLs (except for initial load and magic link).
- Take initial snapshot with
mcp__playwright__browser_snapshot - Execute each reproduction step exactly as documented, clicking buttons and links as a user would
- Capture state at critical points:
- Use
mcp__playwright__browser_snapshotfor accessibility tree - Use
mcp__playwright__browser_take_screenshotfor visual state (save to.playwright-mcp/)
- Use
- Check for console errors:
mcp__playwright__browser_console_messageswith level "error" - Check network requests:
mcp__playwright__browser_network_requests
Step 11: Verify Expected Behavior
After reproducing the steps:
- Confirm the expected behavior now occurs (not the actual/buggy behavior)
- Take a screenshot showing the fix works (save to
.playwright-mcp/- will be deleted in cleanup) - Verify no new console errors were introduced
- Verify no network errors occurred
Step 12: Additional Verification
- Test edge cases related to the bug
- Test that related functionality still works
- If the bug was about Turbo Streams, verify the DOM updates correctly
Phase 5: Documentation
Step 13: Update Bug Report
Add a "Fix Verification" section to the bug file (this is the ONLY edit allowed to /docs/bug-reports/):
---
## Fix Applied
**Date:** [Current Date]
**Status:** VERIFIED FIXED
### Changes Made
- [File 1]: [Brief description of change]
- [File 2]: [Brief description of change]
### Verification Results
- [x] Followed reproduction steps
- [x] Bug no longer occurs
- [x] Expected behavior confirmed
- [x] No console errors
- [x] No network errors
- [x] Edge cases testedNote: Do NOT add screenshots to the bug-reports folder. Screenshots are for your verification during testing and should be deleted during cleanup.
Step 14: Clean Up
- Close the browser:
mcp__playwright__browser_close - Delete any screenshots you created during verification (in
.playwright-mcp/or elsewhere) - Run the test suite if relevant tests exist
- Ensure linting passes
Important Guidelines
- ALWAYS investigate thoroughly before implementing any fix
- Understand the root cause - don't just patch symptoms
- Make minimal changes - fix the bug without over-engineering
- Follow existing patterns - maintain consistency with the codebase
- Use
/frontend-expertfor front-end changes - Any changes to views, partials, ViewComponents, Stimulus controllers, Turbo Stream templates, CSS/Tailwind, or JavaScript MUST use the/frontend-expertskill - Navigate like a real user - During verification, click through the UI (sidebar, menus, buttons) to reach pages. Do NOT type URLs directly (except initial load and magic link).
- Verify with Playwright - actually reproduce and confirm the fix
- Document everything - update the bug report with verification results
- Check for regressions - ensure the fix doesn't break related functionality
- Bug reports folder policy - The ONLY edit you should make to
/docs/bug-reports/is updating the bug document itself to explain the fix. Do NOT create, modify, or add any other files in that folder (no screenshots, no new markdown files, no subfolders). Screenshots for verification should be saved elsewhere (e.g.,.playwright-mcp/) and deleted during cleanup.
Error Handling
If verification fails:
- Document what happened in the bug report
- Analyze why the fix didn't work
- Return to Phase 2 with new insights
- Iterate until the fix is verified
Begin by reading the bug file and understanding the issue thoroughly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

