Skip to content

Coding & Development prompts

Code generation, debugging and documentation

127 prompts

Act as a JavaScript expert. What should happen: [expected behaviour] What actually happens: [bug] Code: ```js [paste] ``` Explain the async flow step by step, identify the bug (race condition, missing await, unhandled rejection, etc.), provide fixed code, and suggest patterns to prevent it (Promise.all, AbortControlle…

ChatGPT
Coding & Development

Debug async JavaScript

Fix race conditions, unhandled promises and ordering bugs in async JavaScript.

0

You are a performance engineer. Platform: [browser app, Node.js, Python, mobile] Symptoms: [memory grows over time, crashes after X hours] Suspicious code: ``` [paste] ``` Explain common leak causes for this platform, how to profile and capture heap snapshots step by step, what to look for, likely culprits in my code,…

Claude
Coding & Development

Investigate a memory leak

Find and fix memory leaks in web apps, Node.js services or mobile apps.

0

Turn this code into documentation. Code: ``` [paste] ``` Provide: a plain-English step-by-step description, a Mermaid flowchart (or sequence diagram if it involves multiple services), the inputs and outputs, and any edge cases visible in the logic.

ChatGPT
Coding & Development

Turn code into a flowchart

Visualise how a function or process works with a Mermaid flowchart and plain-English steps.

0

Analyse the time and space complexity of this code. ``` [paste] ``` Explain the Big-O line by line in simple terms, identify the bottleneck, describe what happens with 10× and 1000× more data, and suggest a more efficient approach if one exists, with code.

ChatGPT
Coding & Development

Explain the complexity of my code

Understand your code's time and space complexity and where it will slow down at scale.

0

You are a software architect and teacher. Problem I'm facing: [e.g. many if/else branches for payment types, objects hard to test] Code: ``` [paste] ``` Suggest 1–2 design patterns that fit (and one that doesn't, with why), explain them simply, show my code refactored with the pattern, and discuss trade-offs. Avoid ov…

Claude
Coding & Development

Design patterns applied to your code

Learn which design pattern fits your problem and see it applied to your code.

0

Act as a senior software architect. Project type: [web app, API, mobile app, library] Stack: [details] Team size and expected growth: [details] Features: [list] Propose a folder structure (with explanation of each folder), layering (e.g. routes, services, data access), naming conventions, where tests live, configurati…

ChatGPT
Coding & Development

Project folder structure and architecture

Organise a new or growing project with a clean, scalable folder structure and conventions.

0

Act as a senior Next.js developer. Next.js version and router: [e.g. 15, App Router] Page: [purpose] Data source: [API/database] Styling: [Tailwind / CSS modules] Write the page using server components where appropriate, a client component for interactivity, loading and error UI, metadata for SEO, caching/revalidation…

ChatGPT
Coding & Development

Next.js page with data fetching

Build a Next.js page or route with data fetching, loading and error states and SEO metadata.

0

You are a Node.js backend engineer focused on security. Requirements: [user fields, roles, routes] Database: [details] Write an Express app with: password hashing (bcrypt/argon2), login returning a short-lived access token plus refresh token handling, auth middleware, role checks, input validation, rate limiting on lo…

Claude
Coding & Development

Express API with JWT authentication

Build a secure Node.js/Express API with sign-up, login, protected routes and token handling.

0

You are an identity and security engineer. App type: [web, SPA, mobile] Providers: [Google, Microsoft, GitHub] Stack: [details] Explain the right flow (e.g. authorization code with PKCE), step by step, with a sequence diagram in Mermaid, how to handle state and nonce, token storage, account linking, logout, and common…

Claude
Coding & Development

Design an OAuth login flow

Plan a 'Sign in with Google/Microsoft/GitHub' flow securely, with the right OAuth/OIDC settings.

0

Act as a senior Laravel developer. Laravel version: [version] Resource: [name and fields with types/rules] Relationships: [details] UI: [Blade / Inertia / API only] Generate: migration, model with fillable and casts, form request validation, resource controller, routes, policy for authorisation, views or API resources…

ChatGPT
Coding & Development

Laravel CRUD feature

Generate a complete Laravel CRUD feature: migration, model, controller, routes, validation and views.

0

Act as a senior Django developer. Django version: [version] Feature: [description] Models and fields: [details] Users and permissions: [details] Generate: models with Meta options and __str__, admin with list_display/filters/search, forms with validation, class-based views, URLs, templates outline, and tests. Explain…

ChatGPT
Coding & Development

Django model, admin and views

Create Django models, admin configuration, forms and views for a new feature.

0

You are a database performance expert. Database: [PostgreSQL / MySQL / SQL Server] Query: ```sql [paste] ``` Table sizes and existing indexes: [details] EXPLAIN output (if available): [paste] Explain why it's slow, suggest indexes (with trade-offs), rewrite the query if helpful, and estimate the improvement. Mention h…

Claude
Coding & Development

Optimise a slow SQL query

Speed up a slow query with index suggestions, rewrites and an explanation of the query plan.

0