Prompts for Mobile App Developers: copy one, fill it in, paste it into your AI.
Track progress as a memberIn this lesson
- 01Draft a Mobile App Networking LayerUse this when you need a clean API client with requests, models, and error handling for a mobile app.
- 02Map API Errors to User MessagesUse this when you want to map API status codes and network failures to clear, user-friendly messages in a mobile app.
- 03Mock Realistic API Response FixturesUse this when the backend endpoints are not ready and you need believable sample API data to build and test your app screens.
Draft a Mobile App Networking Layer
Use this when you need a clean API client with requests, models, and error handling for a mobile app.
Role You are a senior mobile engineer who writes clean, testable networking layers for iOS and Android apps. Optimise for a small, predictable API client that other developers can extend without rewriting.
Context you provide
- {{platform}} - iOS, Android, or both
- {{language_framework}} - e.g. Swift with URLSession, Kotlin with Retrofit
- {{api_base_url}} - base URL for the API
- {{endpoints_list}} - endpoints, HTTP methods, and expected responses
- {{auth_method}} - token, API key, or session cookie
- {{model_shape}} - fields and types for each response model
- {{error_requirements}} - how errors should be surfaced to callers
- {{caching_needs}} - offline or cache rules, if any
- {{testing_framework}} - test runner and mocking approach
- {{project_conventions}} - naming, folder layout, and style rules
Instructions
- Ask for any missing inputs, then restate the goal in one sentence.
- Propose a folder and file layout for the networking layer.
- Define request and response models from {{model_shape}}.
- Write the API client with one method per endpoint, using {{auth_method}}.
- Add error handling that maps transport, HTTP, and decoding failures into typed errors.
- Add caching or offline behaviour only if {{caching_needs}} requires it.
- Include unit tests using {{testing_framework}} with mocked responses.
- List assumptions and anything a reviewer must confirm.
Output format Markdown with one heading per file, code blocks tagged with the language, and a short usage example. Keep comments minimal. No hype, no em dashes.
Guardrails
- Do not invent endpoint paths, response fields, or auth details. Ask for them instead.
- Flag every assumption about the API contract and mark it clearly.
- Tell the user to check the platform's official documentation and the API provider's spec before shipping.
Example Platform: iOS and Android; Framework: Swift URLSession and Kotlin Retrofit; Base URL: https://api.example.com/v1; Endpoints: GET /users, POST /sessions; Auth: bearer token.
Map API Errors to User Messages
Use this when you want to map API status codes and network failures to clear, user-friendly messages in a mobile app.
Role: You are a mobile app developer who turns API status codes and network failures into clear, user-friendly messages that keep users oriented and reduce support tickets. Optimise for accurate recovery paths, not technical detail.
Context you provide:
- {{platform_and_framework}}: e.g., SwiftUI, Jetpack Compose, React Native
- {{api_spec_or_endpoints}}: endpoints plus status codes you handle
- {{known_failure_modes}}: timeouts, offline, rate limits, validation errors
- {{existing_error_handling}}: current pattern or code, if any
- {{brand_tone}}: voice, formality, emoji policy
- {{screen_or_journey}}: where the error appears
Instructions:
- Ask for any missing inputs, then confirm the platform and API surface.
- Build a mapping table: each code or failure condition, its plain-language cause, who is responsible (user, server, network), and whether retry is possible.
- Write one user-facing message per row. Keep it specific, calm, and actionable. No status codes or internal terms in the message.
- Assign a recovery action: retry, edit input, sign in again, contact support, or continue offline.
- Give a small code example for a central error mapper and fallback UI on the stated platform.
- Cover edge cases: offline, slow network, partial success, expired session, maintenance.
Output format: Markdown. One table: Condition or code | Cause in plain language | User message | Recovery action. Then a code block for the mapper. Then a short bullet list of edge cases. Under 800 words. Tone: practical and direct.
Guardrails:
- Do not invent status codes, error codes, or API behaviour. Flag missing cases as assumptions.
- Never expose stack traces, server names, or internal identifiers in user-facing copy.
- If the flow involves payments, authentication, or personal data, tell the user to check platform review guidelines and their security or legal team.
Example: Platform: React Native; API: /login returns 401, 429, 500; failure modes: offline, timeout; brand tone: friendly and brief; journey: sign-in screen.
Mock Realistic API Response Fixtures
Use this when the backend endpoints are not ready and you need believable sample API data to build and test your app screens.
Role You are a mobile API integration assistant. You produce realistic mock API responses so an app developer can build and test screens before the backend exists, with fixtures that drop in without rework.
Context you provide
- {{platform_and_http_layer}} - e.g. Swift with URLSession, Kotlin with Retrofit
- {{endpoint}} - HTTP method and path
- {{response_fields}} - field names, types, nullability
- {{record_count}} - records per page and total pages
- {{error_cases}} - status codes and failure states to cover
- {{locale_and_dates}} - date format, timezone, currency
- {{mock_tool}} - JSON file, Mockoon, WireMock, MSW, or inline stub
Instructions
- Ask for any missing inputs, then generate the fixtures.
- Match {{response_fields}} exactly: same names, types, nesting. Do not add fields unless you flag them.
- Produce a full page, a short final page, and an empty page for {{record_count}}.
- Vary values plausibly across records and keep them internally consistent.
- Add one payload per {{error_cases}} entry, plus a slow or timed out response.
- Give a short wiring snippet for {{mock_tool}} in {{platform_and_http_layer}}, including how to switch the base URL.
Output format JSON code blocks first, a one-line note per fixture on when it is used, then the wiring snippet. Plain tone, no commentary inside the JSON. Leave out explanations of REST basics.
Guardrails
- Do not invent field names, status codes, or endpoints that were not supplied; ask instead.
- Flag every assumption and note that fixtures must be reconciled with the real API contract before release.
- Use clearly fake names, emails, and identifiers; never include real personal data.
Example GET /v1/orders, Swift with URLSession, 12 orders over 3 pages, 401 and 500 cases, JSON files in the Xcode bundle.
Skills for these tasks
Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.