Build [feature] with the following:1. [First component/step] - Detail about first step - Another detail2. [Second component/step] - Detail about second step3. [Third component/step] - Detail about third stepThe flow should be: [describe how pieces connect]
Build a checkout flow with the following:1. Cart review screen - Show all items with images, names, quantities, prices - Allow quantity adjustments - Show subtotal, tax, and total2. Shipping screen - Form for address (name, street, city, state, zip) - Save address for future use - Validate required fields3. Payment screen - Integration with Stripe - Show order summary - Confirm button4. Confirmation screen - Order number - Estimated delivery - "Continue Shopping" buttonThe flow should be: Cart → Shipping → Payment → Confirmationwith a back button on each screen and progress indicator at the top.
Feature: [Name]Purpose: [What problem it solves]User flow:1. User does [action]2. App responds with [response]3. User can then [next action]Requirements:- [Requirement 1]- [Requirement 2]- [Requirement 3]Edge cases:- If [condition], then [behavior]- If [condition], then [behavior]Design:- [Visual requirement]- [Visual requirement]
Feature: User ProfilePurpose: Let users view and edit their personal informationUser flow:1. User taps profile tab2. App shows their current profile info3. User taps "Edit" to modify4. User saves changesRequirements:- Display avatar, name, email, bio- Avatar can be changed from camera or library- Name and bio are editable- Email is shown but not editable- Changes save to SupabaseEdge cases:- If no avatar, show initials- If save fails, show error and keep editing mode- If user cancels, restore previous valuesDesign:- Avatar should be 80pt circle- Use card style for profile sections- Edit mode shows inline text fields
For this app, always follow these patterns:Design:- Use 16pt padding as standard spacing- All buttons should have 12pt corner radius- Primary color is #007AFF, secondary is #5856D6- Use SF Symbols for all iconsBehavior:- Show loading states for all async operations- All destructive actions need confirmation- Save operations should show success feedback- Errors should display user-friendly messagesData:- All data should sync to Supabase- Support offline mode with local cache- Use SwiftData for local persistence
Now when you request features, the AI follows these patterns automatically.
Add a notifications screen. Use the same list style as themessages screen, but each item shows:- Icon representing notification type- Title and description- Timestamp- Unread indicator (blue dot)
The dashboard should show different content based on user type:If new user (no data):- Show onboarding prompt- Display sample data to demonstrate features- Show "Get Started" tutorialIf active user:- Show their actual data- Display recent activity- Show personalized recommendationsIf power user (many items):- Enable bulk actions- Show analytics section- Enable advanced filters
Adapt the layout for different devices:iPhone:- Single column layout- Tab bar navigation- Compact info cardsiPad:- Split view with sidebar- Master-detail navigation- Expanded info cards with more details
When the success screen appears:1. Checkmark icon scales in from 0 to 1 (0.3s, spring)2. Then "Success!" text fades in from below (0.2s)3. Then description text fades in (0.2s, 0.1s delay)4. Then buttons fade in (0.2s, 0.2s delay)
The card should respond to gestures:- Drag horizontally to reveal action buttons- If dragged >50%, snap to reveal actions- If dragged <50%, spring back to original- While dragging, background color shifts from white to light red- Action buttons slide in from the right as card moves
Data model:User- id, email, name, avatar- has many ProjectsProject- id, name, description, created_at- belongs to User- has many Tasks- has many Collaborators (other Users)Task- id, title, status, due_date- belongs to Project- assigned to User (optional)When displaying:- Project view shows all its tasks grouped by status- User profile shows all their projects- Task detail shows project name and assignee
Implement consistent error handling:Network errors:- Show "No connection" banner at top (not blocking)- Allow retry when connection returns- Cache last successful data for offline viewingValidation errors:- Show inline error under the field- Highlight field border in red- Clear error when field changesServer errors:- Show modal with "Something went wrong"- Include "Try Again" and "Contact Support" buttons- Log error details for debuggingAuthentication errors:- Redirect to login screen- Show "Session expired, please log in again"- Preserve intended destination for after login
Integrate with the Weather API:Endpoint: api.weather.com/v1/currentAuth: API key in header (X-API-Key)Request: GET with lat/long parametersExpected response:{ "temp": 72, "condition": "sunny", "humidity": 45, ...}Error handling:- If 401: API key invalid, show setup instructions- If 429: Rate limited, wait and retry- If 500: Server error, show "Weather unavailable"Caching:- Cache responses for 10 minutes- Show cached data if network fails- Display "Last updated X minutes ago"
Refactor the ProfileView to be more maintainable:- Extract the avatar section into AvatarView- Extract the info fields into ProfileInfoSection- Create a ProfileViewModel for the data logic- Keep the main ProfileView clean and composed
Optimize the feed loading:- Implement pagination (load 20 items at a time)- Add infinite scroll to load more- Cache images with proper memory management- Cancel in-flight requests when navigating away- Show skeleton loading states instead of spinners
Add test data for the following scenarios:Empty state:- New user with no itemsLight usage:- 3 items, one favoritedHeavy usage:- 100+ items across 5 categories- 10 items favorited- Some with long titles (50+ characters)Edge cases:- Item with no image- Item with very long description- Item with special characters in title
For this app, use this architecture:Views:- SwiftUI views for all UI- Keep views "dumb" — just display data- One view file per screenViewModels:- One ViewModel per screen- Handle all business logic- Observable for state updatesModels:- Plain structs for data- Codable for API/storage- Keep separate from ViewModelsServices:- Singleton services for cross-cutting concerns- AuthService for authentication- DataService for Supabase operations- ImageService for media handlingThis separation makes it easier to:- Test individual components- Modify one layer without affecting others- Understand where logic lives
The card must:- Never be wider than 400pt (even on iPad)- Always show at least the title (even if truncated)- Leave 16pt margin from screen edges- Stack vertically if content exceeds available height