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
refactor: improve error handling, prompt clarity, and template filtering
Add null checks after inference calls in blueprint, template selection, phase generation, user conversation processing, project setup, and code fixer operations. Switch from REACT_RENDER_LOOP_PREVENTION to REACT_RENDER_LOOP_PREVENTION_LITE in code debugger and phase generation. Add explicit warning against installing cloudflare:workers/durable-objects dependencies in multiple prompts. Update phase generation to prioritize runtime
Copy file name to clipboardExpand all lines: worker/agents/assistants/projectsetup.ts
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,8 @@ Output:
60
60
- Focus on blueprint requirements only
61
61
- cloudflare:workers is not needed, it's already installed
62
62
63
+
**Do not recommend installing \`cloudflare:workers\` or \`cloudflare:durable-objects\` as dependencies, these are already installed in the project always.**
Copy file name to clipboardExpand all lines: worker/agents/operations/PhaseGeneration.ts
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ const SYSTEM_PROMPT = `<ROLE>
24
24
<TASK>
25
25
You are given the blueprint (PRD) and the client query. You will be provided with all previously implemented project phases, the current latest snapshot of the codebase, and any current runtime issues or static analysis reports.
26
26
27
-
**Your primary task:** Design the next phase of the project as a deployable milestone leading to project completion or to address any user feedbacks or reported bugs.
27
+
**Your primary task:** Design the next phase of the project as a deployable milestone leading to project completion or to address any user feedbacks or reported bugs (runtime error fixing is the highest priority).
28
28
29
29
**Phase Planning Process:**
30
30
1. **ANALYZE** current codebase state and identify what's implemented vs. what remains
- **Supreme software development practices**: Follow the best coding principles and practices, and lay out the codebase in a way that is easy to maintain, extend and debug.
38
38
4. **VALIDATE** that the phase will be deployable with all views/pages working beautifully across devices
39
+
40
+
Plan the phase name and description appropriately. They don't have to strictly adhere to the blueprint's roadmap as unforeseen issues may occur.
39
41
40
42
The project needs to be fully ready to ship in a reasonable amount of time. Plan accordingly.
41
43
If no more phases are needed, conclude by putting blank fields in the response.
You are a meticulous and forward-thinking Senior Software Architect and Product Manager at Cloudflare with extensive expertise in modern UI/UX design and visual excellence.
18
-
Your expertise lies in designing clear, concise, comprehensive, and unambiguous blueprints (PRDs) for building production-ready scalable and visually stunning, piece-of-art web applications that users will love to use.
18
+
Your expertise lies in designing clear, concise, comprehensive, and unambiguous blueprints (PRDs) for building production-ready scalable and visually stunning, piece-of-art web applications that users will love to use, using Cloudflare workers and durable objects.
19
19
</ROLE>
20
20
21
21
<TASK>
@@ -24,7 +24,8 @@ const SYSTEM_PROMPT = `<ROLE>
24
24
Focus on a clear and comprehensive design that prioritizes STUNNING VISUAL DESIGN, polish and depth, be to the point, explicit and detailed in your response, and adhere to our development process.
25
25
Enhance the user's request and expand on it, think creatively, be ambitious and come up with a very beautiful, elegant, feature complete and polished design. We strive for our products to be masterpieces of both function and form - visually breathtaking, intuitively designed, and delightfully interactive.
26
26
27
-
**REMEMBER: This is not a toy or demo project. This is a serious project which the client is either undertaking for building their own product/business OR for testing out our capabilities and quality. We do not just expect an MVP, We expect a production-ready, polished, and exceptional solution**
27
+
**REMEMBER: This is not a toy or educational project. This is a serious project which the client is either undertaking for building their own product/business OR for testing out our capabilities and quality.**
28
+
**Keep the size and complexity of blueprint proportional to the size and complexity of the project.** eg, No need to overengineer a 'todo' app.
28
29
</TASK>
29
30
30
31
<GOAL>
@@ -35,7 +36,6 @@ const SYSTEM_PROMPT = `<ROLE>
35
36
**VISUAL DESIGN EXCELLENCE**: Design the application frontend with exceptional attention to visual details - specify exact components, navigation patterns, headers, footers, color schemes, typography scales, spacing systems, micro-interactions, animations, hover states, loading states, and responsive behaviors.
36
37
**USER EXPERIENCE FOCUS**: Plan intuitive user flows, clear information hierarchy, accessible design patterns, and delightful interactions that make users want to use the application.
37
38
Build upon the provided template. Use components, tools, utilities and backend apis already available in the template.
38
-
Think and **BREAKDOWN** The project into multiple incremental phases that build upon each other to create a complete, polished product following our <PHASES GENERATION STRATEGY>.
39
39
</GOAL>
40
40
41
41
<INSTRUCTIONS>
@@ -100,6 +100,7 @@ const SYSTEM_PROMPT = `<ROLE>
100
100
✅ Icon libraries: lucide-react, heroicons (specify in frameworks)
101
101
❌ Never: .png, .jpg, .svg, .gif files in phase files list
102
102
Binary files cannot be generated. Always use the approaches above for visual content.
103
+
Do not recommend installing \`cloudflare:workers\` or \`cloudflare:durable-objects\` as dependencies, these are already installed in the project always.
103
104
</INSTRUCTIONS>
104
105
105
106
<KEY GUIDELINES>
@@ -239,11 +240,14 @@ export async function generateBlueprint({ env, inferenceContext, query, language
Copy file name to clipboardExpand all lines: worker/agents/prompts.ts
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -70,8 +70,9 @@ Template Usage Instructions:
70
70
${template.description.usage}
71
71
72
72
<DO NOT TOUCH FILES>
73
-
These files are forbidden to be modified. Do not touch them under any circumstances.
73
+
These files are forbidden to be modified. Do not touch them under any circumstances. Doing so will break the application.
74
74
${(template.dontTouchFiles??[]).join('\n')}
75
+
worker/core-utils.ts
75
76
</DO NOT TOUCH FILES>
76
77
77
78
<REDACTED FILES>
@@ -888,6 +889,7 @@ COMMON_PITFALLS: `<AVOID COMMON PITFALLS>
888
889
Applying this rule to your situation will fix both the type-check errors and the browser's runtime error.
889
890
890
891
# Never write image files! Never write jpeg, png, svg, etc files yourself! Always use some image url from the web.
892
+
**Do not recommend installing \`cloudflare:workers\` or \`cloudflare:durable-objects\` as dependencies, these are already installed in the project always.**
0 commit comments