Spaces:
Running
Running
update prompt
Browse files- anycoder_app/prompts.py +73 -37
anycoder_app/prompts.py
CHANGED
|
@@ -267,48 +267,75 @@ Output format (CRITICAL):
|
|
| 267 |
CRITICAL Requirements:
|
| 268 |
1. Always include a Dockerfile configured for Node.js deployment (see Dockerfile Requirements below)
|
| 269 |
2. Use Next.js with TypeScript/JSX (.jsx files for components)
|
| 270 |
-
3.
|
| 271 |
4. Create necessary components in the components/ directory
|
| 272 |
5. Create API routes in pages/api/ directory for backend logic
|
| 273 |
6. pages/_app.js should import and use globals.css
|
| 274 |
7. pages/index.js should be the main entry point
|
| 275 |
8. Keep package.json with essential dependencies
|
| 276 |
9. Use modern React patterns and best practices
|
| 277 |
-
10. Make the application fully responsive
|
| 278 |
11. Include proper error handling and loading states
|
| 279 |
12. Follow accessibility best practices
|
| 280 |
13. Configure next.config.js properly for HuggingFace Spaces deployment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 281 |
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
width: '100%',
|
| 291 |
-
padding: '12px',
|
| 292 |
-
height: '48px'
|
| 293 |
-
}}
|
| 294 |
-
onInput={(e) => {
|
| 295 |
-
// handler code
|
| 296 |
-
}}
|
| 297 |
-
placeholder="Type here"
|
| 298 |
/>
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
-
|
| 311 |
-
-
|
|
|
|
|
|
|
| 312 |
|
| 313 |
next.config.js Requirements:
|
| 314 |
- Must be configured to work on any host (0.0.0.0)
|
|
@@ -385,12 +412,21 @@ The user wants to apply changes based on their request.
|
|
| 385 |
You MUST output ONLY the changes required using the following SEARCH/REPLACE block format. Do NOT output the entire file.
|
| 386 |
Explain the changes briefly *before* the blocks if necessary, but the code changes THEMSELVES MUST be within the blocks.
|
| 387 |
|
| 388 |
-
π¨ CRITICAL JSX SYNTAX RULES:
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
|
| 395 |
Format Rules:
|
| 396 |
1. Start with <<<<<<< SEARCH
|
|
|
|
| 267 |
CRITICAL Requirements:
|
| 268 |
1. Always include a Dockerfile configured for Node.js deployment (see Dockerfile Requirements below)
|
| 269 |
2. Use Next.js with TypeScript/JSX (.jsx files for components)
|
| 270 |
+
3. **USE TAILWIND CSS FOR ALL STYLING** - Avoid inline styles completely (in postcss.config.js and tailwind.config.js)
|
| 271 |
4. Create necessary components in the components/ directory
|
| 272 |
5. Create API routes in pages/api/ directory for backend logic
|
| 273 |
6. pages/_app.js should import and use globals.css
|
| 274 |
7. pages/index.js should be the main entry point
|
| 275 |
8. Keep package.json with essential dependencies
|
| 276 |
9. Use modern React patterns and best practices
|
| 277 |
+
10. Make the application fully responsive using Tailwind classes
|
| 278 |
11. Include proper error handling and loading states
|
| 279 |
12. Follow accessibility best practices
|
| 280 |
13. Configure next.config.js properly for HuggingFace Spaces deployment
|
| 281 |
+
14. **NEVER use inline style={{}} objects - always use Tailwind className instead**
|
| 282 |
+
|
| 283 |
+
π¨ CRITICAL JSX SYNTAX RULES - FOLLOW EXACTLY:
|
| 284 |
+
|
| 285 |
+
**RULE 1: Style objects MUST have proper closing braces }}**
|
| 286 |
+
Every style={{ must have a matching }} before any other props or />
|
| 287 |
+
|
| 288 |
+
**RULE 2: ALWAYS use Tailwind CSS classes instead of inline styles**
|
| 289 |
+
- Use className="..." for styling
|
| 290 |
+
- Only use inline styles if absolutely necessary
|
| 291 |
+
- Inline styles are error-prone and should be avoided
|
| 292 |
+
|
| 293 |
+
**CORRECT Examples:**
|
| 294 |
+
```jsx
|
| 295 |
+
// β
Using Tailwind (PREFERRED)
|
| 296 |
+
<textarea
|
| 297 |
+
className="w-full p-3 min-h-[48px] max-h-[120px] rounded-lg border"
|
| 298 |
+
value={message}
|
| 299 |
+
onChange={(e) => setMessage(e.target.value)}
|
| 300 |
+
placeholder="Type here"
|
| 301 |
+
/>
|
| 302 |
+
|
| 303 |
+
// β
Inline style (if needed) - note the }} before other props
|
| 304 |
+
<textarea
|
| 305 |
+
style={{
|
| 306 |
+
width: '100%',
|
| 307 |
+
padding: '12px',
|
| 308 |
+
minHeight: '48px'
|
| 309 |
+
}}
|
| 310 |
+
value={message}
|
| 311 |
+
onChange={(e) => setMessage(e.target.value)}
|
| 312 |
+
/>
|
| 313 |
+
```
|
| 314 |
|
| 315 |
+
**WRONG Examples:**
|
| 316 |
+
```jsx
|
| 317 |
+
// β WRONG - Missing closing braces }}
|
| 318 |
+
<textarea
|
| 319 |
+
style={{
|
| 320 |
+
minHeight: '48px',
|
| 321 |
+
maxHeight: '120px'
|
| 322 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
/>
|
| 324 |
+
|
| 325 |
+
// β WRONG - Event handler inside style object
|
| 326 |
+
<textarea
|
| 327 |
+
style={{
|
| 328 |
+
width: '100%'
|
| 329 |
+
onChange={(e) => {}} // Missing }}
|
| 330 |
+
/>
|
| 331 |
+
```
|
| 332 |
+
|
| 333 |
+
**RULE 3: Validation Checklist**
|
| 334 |
+
Before outputting JSX code, verify:
|
| 335 |
+
- [ ] All style={{ have matching }}
|
| 336 |
+
- [ ] No event handlers inside style objects
|
| 337 |
+
- [ ] Prefer Tailwind classes over inline styles
|
| 338 |
+
- [ ] All JSX elements are properly closed
|
| 339 |
|
| 340 |
next.config.js Requirements:
|
| 341 |
- Must be configured to work on any host (0.0.0.0)
|
|
|
|
| 412 |
You MUST output ONLY the changes required using the following SEARCH/REPLACE block format. Do NOT output the entire file.
|
| 413 |
Explain the changes briefly *before* the blocks if necessary, but the code changes THEMSELVES MUST be within the blocks.
|
| 414 |
|
| 415 |
+
π¨ CRITICAL JSX SYNTAX RULES - FOLLOW EXACTLY:
|
| 416 |
+
|
| 417 |
+
**RULE 1: Style objects MUST have proper closing braces }}**
|
| 418 |
+
Every style={{ must have a matching }} before any other props or />
|
| 419 |
+
|
| 420 |
+
**RULE 2: ALWAYS use Tailwind CSS classes instead of inline styles**
|
| 421 |
+
- Use className="..." for styling
|
| 422 |
+
- Only use inline styles if absolutely necessary
|
| 423 |
+
- When replacing inline styles, use Tailwind classes
|
| 424 |
+
|
| 425 |
+
**RULE 3: Before outputting, verify:**
|
| 426 |
+
- [ ] All style={{ have matching }}
|
| 427 |
+
- [ ] No event handlers inside style objects
|
| 428 |
+
- [ ] Prefer Tailwind classes over inline styles
|
| 429 |
+
- [ ] All JSX elements are properly closed
|
| 430 |
|
| 431 |
Format Rules:
|
| 432 |
1. Start with <<<<<<< SEARCH
|