๐ Debugging & Error Handling
Skip manual searching for cryptic errors.
Standard:
Why am I getting this error in my React component?
[insert error message + relevant code block]
Edge Case:
I'm getting a hydration error in Next.js 13 when using useEffect.
Here's the component, how can I fix it?
๐จ UI Component Scaffolding
Generate accessible and reusable UI components.
Standard UI:
Create a reusable React component for a dropdown menu with support
for keyboard navigation and accessibility. Use Tailwind CSS for styling.
Quick Layout:
Give me a React component for a tab layout using Tailwind.
โ๏ธ Contextual UX Content
Replace Lorem Ipsum with meaningful product content.
Pricing Copy:
Write placeholder text for a pricing section with 3 plans:
Free, Pro, and Enterprise. Keep it short and product-focused.
Social Proof:
Give me 5 example user testimonials for a productivity SaaS app.
๐ง Technical Concepts & Logic
Understand frameworks and architecture faster.
Comparison:
What's the difference between useMemo and useCallback in React?
Give examples.
Architecture:
How does Next.js handle server-side props in App Router?
๐งน Code Quality & Refactoring
Improve readability and reduce technical debt.
Structure:
Refactor this React component for better readability
and separation of concerns.
Clean Code:
Rewrite this function with early returns and type safety in mind.
โ๏ธ Workflow Automation
Automate repetitive development tasks.
Commit Messages:
Write a concise commit message for this change:
- Refactored useEffect logic in Dashboard
- Fixed loading state bug
- Added fallback UI
๐งฉ Component Generation
Go from a vague idea to a production-ready component.
Basic Prompt:
Create a responsive login component in React.
Better Prompt (Recommended):
Create a responsive login form using React + Tailwind.
Requirements:
- Email + password fields
- Real-time validation
- Loading state for submit
- "Remember me" checkbox
- Accessible labels
- TypeScript
- Keep component under 120 lines
๐ API Integration
Generate typed API layers and hooks from raw data.
Generate TypeScript types from this JSON.
Then create:
- api/users.ts for API calls
- useUsers() React hook with loading + error states
- Abort controller for cleanup
๐ Refactoring
Systematically improve existing code.
Refactor this component:
- Convert to a React Server Component (if possible)
- Reduce unnecessary re-renders
- Improve readability
- Use meaningful variable names
- Extract repeated logic
- Preserve existing functionality
๐ฑ UI/UX Improvement
Improve responsiveness and accessibility in one pass.
Responsiveness:
Improve responsiveness using Tailwind:
- Add sm/md/lg breakpoints
- Add spacing for better visual hierarchy
- Improve alignment and readability
- Add skeleton UI for loading states
Accessibility:
Improve accessibility:
- Add ARIA labels
- Keyboard navigation support
- Focus outlines
๐ฏ Tailwind & Styling
Clean up and optimize your utility classes.
Optimize Tailwind:
Optimize the Tailwind classes for readability.
Group related classes and remove redundant ones.
Convert CSS โ Tailwind:
Convert this CSS file into Tailwind utility classes.
๐๏ธ Multi-File Feature Prompting
Scaffold entire features across multiple files.
Example โ Notifications Feature:
Create a Notifications feature using TypeScript.
Files:
1. components/NotificationIcon.tsx
2. components/NotificationList.tsx
3. store/notifications.ts (Zustand)
4. services/notifications.ts
5. hooks/useNotifications.ts
Requirements:
- Mark as read
- Optimistic UI
- Real-time updates
- Accessible UI
๐งช Advanced Debugging
Get root cause analysis and multiple fix options.
Here is the error and the file.
1. Explain the root cause.
2. Propose 2 possible fixes.
3. Give me the corrected final code.
๐๏ธ End-to-End Feature Prompting
Build complete, production-ready features in a single prompt.
Example โ User Profile Feature:
Build a complete User Profile feature.
Include:
- ProfileView page
- EditProfile form
- API service
- useProfile hook
- Validation schema
- Responsive layout
- Skeleton UI for loading
- Error boundary
Stack: React, TypeScript, Tailwind
๐งฐ Universal Prompt Template
A reusable structure for any AI coding task.
[Task]
What you want to build or solve
[Tech Stack]
React / Angular / Next.js / Tailwind / TypeScript
[Requirements]
- Clear bullet points
- Constraints (performance, readability, line limits)
- Styling (responsive, spacing, accessibility)
- Behavior (loading, errors, state)
[Input Code]
Paste relevant code (if any)
[Output Format]
Define expected output (files, components, structure)
๐ก Tips for Better Prompts
- Be specific โ the more context you give, the better the output.
- Define constraints โ line limits, file structure, and tech stack all help narrow the scope.
- Specify behavior โ always mention loading states, error handling, and edge cases.
- Iterate โ treat AI output as a first draft; refine with follow-up prompts.
Built for developers working with React, Next.js, TypeScript, and Tailwind CSS.
Top comments (0)