Skip to main content
Bugs compete with feature work for engineering time, and they usually lose. The result is a growing list of known defects that erode user trust and compound into larger failures. Blitzy shifts the economics: feed it an error message and reproduction steps and it traces the root cause, implements a fix that addresses the underlying problem rather than the symptom, and generates regression tests so the issue stays resolved.

Ready to fix a bug?

Use the Bug Fix Template to get started with a structured prompt

When to Use This Approach

Fix issues with clear reproduction steps where expected and actual behavior diverge.

Prompt Structure

Follow the Golden Rules when writing your bug fix prompt. Focus especially on:
  • Reproduction Steps - Provide exact sequence to trigger the bug consistently
  • Error Messages - Include complete stack traces and error output
  • Behavioral Specification - Define expected vs actual behavior precisely
  • Test Requirements - Specify regression tests to prevent recurrence

Key Considerations

Reproduction Steps Are Essential

Document exact steps to trigger the failure consistently. Without reliable reproduction, fixes may address symptoms rather than root causes or introduce regressions.

Expected vs Actual Behavior Clarity

Clearly state what should happen versus what actually happens. Vague descriptions like “it’s broken” lead to superficial fixes that don’t address underlying issues.

Complete Error Context Matters

Include full stack traces, error messages, and relevant log entries. Partial error information leads to misdiagnosis and ineffective fixes.

Regression Tests Prevent Recurrence

Every bug fix must include tests that fail before the fix and pass after. Without regression tests, the same bug returns during future changes.

Common Patterns

Null/undefined handling - Add null checks for database lookups, API responses, and optional parameters. Define graceful defaults or appropriate error responses when values are missing. Error boundary failures - Wrap risky operations in try/catch blocks, define specific error types for different failure modes, and ensure error messages provide debugging context without exposing sensitive data. Race condition fixes - Add proper synchronization (locks, queues), implement idempotency for operations that may be retried, and add logging to track concurrent access patterns.

Troubleshooting

Root cause may be misidentified. Add more detailed logging to trace execution flow, use debugger to inspect state at failure point, and verify reproduction steps trigger the actual issue.
Test environment may differ from production. Review the Environment Configuration guide to align test and production environments, and add integration tests with production-like data.
Scope may be too broad. Add comprehensive regression tests before implementing fix, use feature flags for gradual rollout, and test against full suite of existing functionality.
Add detailed logging at suspected failure points, implement distributed tracing for multi-service bugs, and analyze patterns in production logs to identify triggering conditions.
Fix may be inefficient. Profile code before and after fix, add the Analyze Performance Impact rule to your project on the platform, and consider alternative implementation approaches.