Skip to main content
Use Refine PR to iteratively improve generated code through targeted feedback. The approach and architecture are correct, but specific implementations need modification.
Post-Code-Generation Options: Merge | Close | Refine PR (this page)Choose Refine when: The generated code is fundamentally sound but has specific gaps that need addressing.

Refine PR Prompt Format

Structure your feedback using critical directives:
CRITICAL Directive: Verify all requested changes remain within the original request scope

CRITICAL Directive: Fix missing error handling in src/services/payment-processor.ts lines 145-167 by adding try-catch blocks around API calls and returning structured error responses

CRITICAL Directive: Achieve 100% test passing rate - currently 3 tests failing in tests/unit/payment-processor.test.ts due to unhandled promise rejections

CRITICAL Directive: Maintain existing authentication middleware in src/middleware/auth.ts unchanged - only modify payment processing logic

CRITICAL Directive: Reference error handling pattern from src/services/user-service.ts lines 89-112 for consistency with codebase standards

CRITICAL Directive: If architectural changes are needed beyond error handling improvements, close PR and create new request with revised scope

Decision Matrix

Apply this matrix to determine whether to refine or close:
CriteriaRefineClose & Restart
Scope alignmentChanges are within original request scopeChanges require scope expansion
ArchitectureApproach and structure are soundFundamental design flaws
Gap severitySpecific, addressable implementation gapsCritical gaps or broken core functionality
Iteration efficiencyFixes achievable through targeted refinementsComplete rework needed
If changes fall outside the scope of your original request, they belong in a separate run. Do not expand scope during refinement.

Refinement Workflow

1

Identify gaps

Review the generated code and document specific issues:
  • File locations - Exact paths and line numbers
  • Current behavior - What the code does now
  • Required behavior - What it should do
  • Acceptance criteria - How to verify the fix
Focus on whether gaps are in scope (original request) or out of scope (new requirements).
2

Submit Refine PR request

Paste your structured feedback into Blitzy using the Refine PR prompt format above. Blitzy updates the PR with targeted changes.

Best Practices

  • Reference exact file paths and line numbers
  • Describe concrete changes, not vague improvements
  • Provide measurable success criteria
  • Only request changes within original requirements
  • Flag scope creep as separate tasks
  • Use multiple refinements as needed to fill gaps
  • Point to existing code examples in your codebase
  • Specify architectural patterns to follow
  • Maintain consistency with current implementation

Submodule PRs During Refinement

Do not close or merge submodule PRs while refinement cycles are in progress. Refine PR reads from submodule branches - closing them causes build failures or incomplete refinements. Wait until all refinement rounds are complete and the main repository PR is merged before touching submodule PRs.
See Merge - Projects with Submodules for the correct merge order.

When to Close Instead

Choose Close over Refine when:
  • Architectural approach is fundamentally wrong
  • Scope has expanded beyond original request
  • Starting fresh would be faster than iterative fixes

Merge Pull Request

Criteria for accepting generated code

Close Pull Request

When to discard and restart