End-to-end bug fix workflow. Takes a bug file path, enriches it with user stories and test cases, implements the fix, and adds tests. Use with /bug-fix BUGS/BUG-X.md
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Instruções da origem · Visualização somente leitura
name
bug-fix
description
End-to-end bug fix workflow. Takes a bug file path, enriches it with user stories and test cases, implements the fix, and adds tests. Use with /bug-fix BUGS/BUG-X.md
argument-hint
BUGS/BUG-X.md
Bug Fix Workflow
Complete bug resolution from investigation to tested fix.
If no user story covers this bug's feature, use headsup-planner agent or create:
Location:qa/USER-STORY/US-XXX-[feature-slug].md
# US-XXX: [Feature Title]## User Story
As a [user type],
I want to [action related to bug],
So that [expected benefit].
## Acceptance Criteria- [ ] AC-1: [Criterion that bug violates]
- [ ] AC-2: [Additional criteria]
## User Types- [Affected user type]
## Priority
High (bug-related)
## Source- Bug: BUGS/BUG-X.md
- PRD: [from bug references]
## Linked Test Cases- [TC-XXX](../Test-Case/TC-XXX-description.md)
## Notes
Created during bug investigation for BUG-X.
Step 2.2: Create Missing Test Case (if needed)
If no test case covers the bug scenario, create:
Location:qa/Test-Case/TC-XXX-[test-slug].md
# TC-XXX: [Test Title - Bug Scenario]## Linked User Story- [US-XXX](../USER-STORY/US-XXX-feature.md)
## Test Type
E2E / LiveView
## Priority
Critical (regression test for BUG-X)
## Preconditions- [Setup from bug reproduction steps]
## Test Steps1. [Step from bug report]
2. [Step from bug report]
3. [Observe result]
## Expected Results- [Expected behavior - NOT the bug behavior]
## Test Data
| Field | Value |
|-------|-------|
| [field] | [value from bug] |
## Edge Cases- [Related edge case]
## Bug Reference- BUGS/BUG-X.md
## Automation Status- [ ] Automated in: `test/[path]/[file]_test.exs`
Step 2.3: Enrich Bug File
Update the bug file with investigation results:
# BUG-X: [Title from bug]## Status- [x] Investigating
- [x] Documented
- [ ] In Progress
- [ ] Fixed
- [ ] Verified
## References- PRD: [original PRD]
- User Story: [US-XXX](qa/USER-STORY/US-XXX.md)
- Test Case: [TC-XXX](qa/Test-Case/TC-XXX.md)
## Priority
[Determined priority]
---
## Summary
[Original TITLE]
## Steps to Reproduce
[Original STEPS formatted]
## Expected Result
[Original EXPECTED RESULT]
## Actual Result
[Original CURRENT]
---
## Investigation### Related Files-`lib/heads_up/[context].ex`-`lib/heads_up_web/live/[feature]_live.ex`-`lib/heads_up_web/controllers/[controller].ex`### Root Cause Analysis
[Analysis of why the bug occurs - fill after code investigation]
### Proposed Fix
[Description of fix approach]
Phase 3: Implementation
Use the headsup-implementer agent to fix the bug.
3.1: Locate Affected Code
Based on feature type:
Feature
Context
LiveView
Controller
Auth
accounts.ex
user_*_live.ex
user_session_controller.ex
Goals
goals.ex
goal_live/*
-
Social
social.ex
feed_live.ex, post_live.ex
-
Challenges
challenges.ex
challenge_live/*
-
Coach
coaching.ex
coach_center_live/*
-
Connections
connections.ex
people_live.ex, profile_live.ex
-
3.2: Implement Fix
Follow HeadsUp conventions:
Add ownership validation if missing
Add proper error handling
Use changesets for validation
Use PubSub for real-time updates if needed
Use timestamps(type: :utc_datetime) in migrations
3.3: Verify Fix
# Compile without warnings
mix compile --warnings-as-errors
# Run existing tests
mix test# Manual verification# Follow bug reproduction steps# Confirm expected behavior now occurs
Use the headsup-tester agent to add regression tests.
4.1: Create Regression Test
Add test that reproduces the bug scenario:
# test/heads_up/[context]_test.exs or
# test/heads_up_web/live/[feature]_live_test.exs
describe "BUG-X regression: [brief description]" do
test "verifies fix for: [bug title]" do
# Setup - create conditions from bug report
user = user_fixture()
# Action - perform steps that triggered bug
{:ok, result} = Context.action(user, params)
# Assert - verify expected behavior (not the bug)
assert result.field == expected_value
end
end
4.2: Add Edge Case Tests
test "edge case: [related scenario]" do
# Test boundary conditions
end
test "prevents regression: [specific condition]" do
# Ensure bug cannot recur
end
4.3: Run All Tests
# Run specific test file
mix testtest/heads_up/[context]_test.exs
# Run all tests
mix test# Run with coverage
mix test --cover