You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -139,6 +140,69 @@ Adhere to the following guidelines:
139
140
140
141
{{userSuggestions}}`;
141
142
143
+
constLAST_PHASE_PROMPT=`Finalization and Review phase.
144
+
Goal: Thoroughly review the entire codebase generated in previous phases. Identify and fix any remaining critical issues (runtime errors, logic flaws, rendering bugs) before deployment.
145
+
** YOU MUST HALT AFTER THIS PHASE **
146
+
147
+
<REVIEW FOCUS & METHODOLOGY>
148
+
**Your primary goal is to find showstopper bugs and UI/UX problems. Prioritize:**
149
+
1. **Runtime Errors & Crashes:** Any code that will obviously throw errors (Syntax errors, TDZ/Initialization errors, TypeErrors like reading property of undefined, incorrect API calls). **Analyze the provided \`errors\` carefully for root causes.**
150
+
2. **Critical Logic Flaws:** Does the application logic *actually* implement the behavior described in the blueprint? (e.g., Simulate game moves mentally: Does moving left work? Does scoring update correctly? Are win/loss conditions accurate?).
151
+
3. **UI Rendering Failures:** Will the UI render as expected? Check for:
152
+
* **Layout Issues:** Misalignment, Incorrect borders/padding/margins etc, overlapping elements, incorrect spacing/padding, broken responsiveness (test mentally against mobile/tablet/desktop descriptions in blueprint).
* **Missing Elements:** Are all UI elements described in the blueprint present?
155
+
4. **State Management Bugs:** Does state update correctly? Do UI updates reliably reflect state changes? Are there potential race conditions or infinite update loops?
156
+
5. **Data Flow & Integration Errors:** Is data passed correctly between components? Do component interactions work as expected? Are imports valid and do the imported files/functions exist?
157
+
6. **Event Handling:** Do buttons, forms, and other interactions trigger the correct logic specified in the blueprint?
158
+
7. **Import/Dependency Issues:** Are all imports valid? Are there any missing or incorrectly referenced dependencies? Are they correct for the specific version installed?
159
+
8. **Library version issues:** Are you sure the code written is compatible with the installed version of the library? (e.g., Tailwind v3 vs. v4)
160
+
9. **Especially lookout for setState inside render or without dependencies**
161
+
- Mentally simulate the linting rule \`react-hooks/exhaustive-deps\`.
162
+
163
+
**Method:**
164
+
• Review file-by-file, considering its dependencies and dependents.
165
+
• Mentally simulate user flows described in the blueprint.
166
+
• Cross-reference implementation against the \`description\`, \`userFlow\`, \`components\`, \`dataFlow\`, and \`implementationDetails\` sections *constantly*.
167
+
• Pay *extreme* attention to declaration order within scopes.
168
+
• Check for any imports that are not defined, installed or are not in the template.
169
+
• Come up with a the most important and urgent issues to fix first. We will run code reviews in multiple iterations, so focus on the most important issues first.
170
+
171
+
IF there are any runtime errors or linting errors provided, focus on fixing them first and foremost. No need to provide any minor fixes or improvements to the code. Just focus on fixing the errors.
172
+
173
+
</REVIEW FOCUS & METHODOLOGY>
174
+
175
+
<ISSUES TO REPORT (Answer these based on your review):>
176
+
1. **Functionality Mismatch:** Does the codebase *fail* to deliver any core functionality described in the blueprint? (Yes/No + Specific examples)
177
+
2. **Logic Errors:** Are there flaws in the application logic (state transitions, calculations, game rules, etc.) compared to the blueprint? (Yes/No + Specific examples)
178
+
3. **Interaction Failures:** Do user interactions (clicks, inputs) behave incorrectly based on blueprint requirements? (Yes/No + Specific examples)
179
+
4. **Data Flow Problems:** Is data not flowing correctly between components or managed incorrectly? (Yes/No + Specific examples)
180
+
5. **State Management Issues:** Does state management lead to incorrect application behavior or UI? (Yes/No + Specific examples)
181
+
6. **UI Rendering Bugs:** Are there specific rendering issues (layout, alignment, spacing, overlap, responsiveness)? (Yes/No + Specific examples of files/components and issues)
182
+
7. **Performance Bottlenecks:** Are there obvious performance issues (e.g., inefficient loops, excessive re-renders)? (Yes/No + Specific examples)
183
+
8. **UI/UX Quality:** Is the UI significantly different from the blueprint's description or generally poor/unusable (ignoring minor aesthetics)? (Yes/No + Specific examples)
184
+
9. **Runtime Error Potential:** Identify specific code sections highly likely to cause runtime errors (TDZ, undefined properties, bad imports, syntax errors etc.). (Yes/No + Specific examples)
185
+
10. **Dependency/Import Issues:** Are there any invalid imports or usage of non-existent/uninstalled dependencies? (Yes/No + Specific examples)
186
+
187
+
If issues pertain to just dependencies not being installed, please only suggest the necessary \`bun add\` commands to install them. Do not suggest file level fixes.
188
+
</ISSUES TO REPORT (Answer these based on your review):>
189
+
190
+
**Regeneration Rules:**
191
+
- Only regenerate files with **critical issues** causing runtime errors, significant logic flaws, or major rendering failures.
192
+
- **Exception:** Small UI/CSS files *can* be regenerated for styling/alignment fixes if needed.
193
+
- Do **not** regenerate for minor formatting or non-critical stylistic preferences.
194
+
- Do **not** make major refactors or architectural changes.
195
+
196
+
<INSTRUCTIONS>
197
+
Do not make major changes to the code. Just focus on fixing the critical runtime errors, issues and bugs in isolated and contained ways.
198
+
</INSTRUCTIONS>
199
+
200
+
{{issues}}
201
+
202
+
{{userSuggestions}}
203
+
204
+
This phase prepares the code for final deployment.`;
0 commit comments