akhaliq HF Staff commited on
Commit
51fb7e5
Β·
1 Parent(s): 71563bc

update prompt

Browse files
Files changed (1) hide show
  1. 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. Include Tailwind CSS for styling (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
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
- 🚨 CRITICAL JSX SYNTAX RULES:
283
- - Style objects and JSX props are SEPARATE - never mix them
284
- - Style objects use camelCase property names and end with a closing brace
285
- - Event handlers (onClick, onInput, onChange, etc.) are JSX props, NOT style properties
286
- - Correct syntax:
287
- ```jsx
288
- <textarea
289
- style={{
290
- width: '100%',
291
- padding: '12px',
292
- height: '48px'
293
- }}
294
- onInput={(e) => {
295
- // handler code
296
- }}
297
- placeholder="Type here"
298
  />
299
- ```
300
- - WRONG syntax (DO NOT DO THIS):
301
- ```jsx
302
- <textarea
303
- style={{
304
- width: '100%',
305
- height: '48px'
306
- onInput={(e) => { // ❌ WRONG - onInput inside style object
307
- ```
308
- - Always ensure proper closing braces for style objects BEFORE adding event handlers
309
- - Use proper indentation to keep JSX props at the same level
310
- - PREFER Tailwind CSS classes over inline styles to avoid syntax errors
311
- - If using inline styles, double-check closing braces before adding any event handlers
 
 
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
- - Style objects and JSX props must be SEPARATE - never mix them
390
- - Event handlers (onClick, onInput, onChange) are JSX props, NOT style properties
391
- - Always close style objects with }} BEFORE adding event handlers
392
- - PREFER Tailwind CSS classes over inline styles
393
- - Ensure all JSX is syntactically valid before outputting
 
 
 
 
 
 
 
 
 
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