Skip to content

Coding & Development prompts

Code generation, debugging and documentation

127 prompts

Implement [infinite scroll / cursor pagination] for a list of [items] in [framework] calling [API]. Handle loading and error states, avoid duplicate requests, preserve scroll position, and include the backend query for cursor pagination.

ChatGPT
Coding & Development

Infinite scroll or pagination

Efficient list loading for large datasets.

0

Build a file upload feature in [stack]. Show a progress bar, validate file type and size on client and server, store files in [storage], generate safe file names, and return a URL. Explain security considerations.

ChatGPT
Coding & Development

File upload with progress

Secure file uploads with progress bars and validation.

0

Implement a real-time [feature, e.g. chat / live notifications] using WebSockets in [stack]. Include server setup, client connection with reconnect logic, message format, authentication, and how to scale beyond one server.

ChatGPT
Coding & Development

WebSocket real-time feature

Adds real-time updates like chat or live notifications.

0

Add a dark mode toggle to my site built with [stack]. Use CSS variables, respect prefers-color-scheme by default, remember the user's choice, avoid a flash of the wrong theme on load, and keep it accessible.

ChatGPT
Coding & Development

Dark mode toggle

A dark mode switch that respects system settings.

0

Write a Node.js script that [task, e.g. reads a CSV and calls an API for each row]. Use async/await, limit concurrency to [n], retry failed requests with backoff, log progress, and handle errors without crashing. Include package.json dependencies.

ChatGPT
Coding & Development

Node.js script with async/await

A clean Node.js script with proper async error handling.

0

Build a [component, e.g. pricing table / navbar / testimonial slider] with Tailwind CSS. Make it responsive, accessible (keyboard and screen reader friendly), support dark mode, and use a [color] accent. Return the HTML and explain the key classes.

ChatGPT
Coding & Development

Tailwind CSS component

A polished, responsive UI component built with Tailwind classes.

0

Review this PostgreSQL schema. Check normalisation, data types, constraints, foreign keys, indexes for likely queries ([queries]), naming consistency, and future scaling issues. Suggest improvements with migration SQL. Schema: [paste schema]

Claude
Coding & Development

PostgreSQL schema review

Reviews a database schema for performance and integrity issues.

0

Design a GraphQL schema for [domain, e.g. a blog with posts, authors and comments]. Include types, queries with pagination, mutations, input types, and example resolvers in [language/framework]. Note how to avoid N+1 queries.

ChatGPT
Coding & Development

Write a GraphQL schema and resolvers

A GraphQL schema with queries, mutations and resolvers.

0

Refactor this callback-based code to use async/await. Keep the behaviour identical, add proper try/catch error handling, and explain any changes in execution order. Code: [paste code]

ChatGPT
Coding & Development

Convert callbacks to async/await

Modernises callback-based code to promises and async/await.

0

Write a Python class for [purpose, e.g. a shopping cart]. Include type hints, docstrings, validation, a clean public API, and pytest unit tests covering normal use and edge cases.

ChatGPT
Coding & Development

Write a Python class with tests

A well-designed Python class with type hints and unit tests.

0

My web page has these performance metrics and details: [Lighthouse results / stack / page description]. Identify the biggest causes of slow loading and poor Core Web Vitals, and give prioritised fixes with code examples (images, fonts, JS bundles, caching, rendering).

ChatGPT
Coding & Development

Web app performance audit

Finds and fixes slow page loads and poor Core Web Vitals.

0

Write Jest unit tests for this function/module. Cover normal cases, edge cases, error handling, and mock [dependencies]. Use descriptive test names and arrange-act-assert structure. Code: [paste code]

ChatGPT
Coding & Development

Unit tests in Jest

Thorough Jest tests with mocks and edge cases.

0