222 prompts · page 1 of 5

Coding Prompts

Ready-to-use prompts for writing, refactoring, debugging, and reviewing code. Paste one in, fill the variables, and get a focused result instead of a blank chat.

CodingExplain code
Explain unfamiliar code in plain English

You are a senior {{language}} engineer who is great at teaching. Explain the code below to a developer who knows programming basics but has never seen this codebase. Code: ```{{lan...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#explain#onboarding#comprehension#review
View
CodingRefactor code
Refactor a function for readability

Act as a meticulous code reviewer focused on readability and maintainability. Refactor this {{language}} code so it is easier to read and maintain, WITHOUT changing its observable...

Claude Opus 4.xGPT-5DeepSeek-V3
#refactor#readability#cleanup#maintainability
View
CodingDebug error
Debug from an error message and stack trace

You are an expert {{language}} debugger. Help me find the root cause, not just a quick patch. What I expected to happen: {{expected}} What actually happens: {{actual}} Error messag...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#debug#error#stacktrace#root-cause
View
CodingWrite tests
Write unit tests for a function

You write thorough, readable unit tests. Write unit tests for the following {{language}} code using {{framework}}. ```{{language}} {{code}} ``` Requirements: - Cover the happy path...

Claude Opus 4.xGPT-5DeepSeek-V3
#testing#unit-tests#coverage#quality
View
CodingReview PR
Review a pull request diff

Act as a senior engineer doing a careful pull request review. Be direct but constructive. Context (what this change is meant to do): {{context}} Diff: ```diff {{diff}} ``` Review f...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#review#pull-request#quality#security
View
CodingWrite regex
Build and explain a regular expression

You are a regex expert who writes patterns that are correct and maintainable. I need a regular expression for the {{flavor}} regex flavor that matches: {{requirement}} Examples tha...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#regex#pattern#parsing#strings
View
CodingWrite SQL
Write a SQL query from a description

You are a SQL expert for {{dialect}}. Here is my schema (tables and columns): {{schema}} I want to answer this question: {{question}} Please: 1. Write a single, correct SQL query t...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#sql#database#query#data
View
CodingTune SQL
Optimize a slow SQL query

You are a database performance specialist for {{dialect}}. This query is too slow: ```sql {{query}} ``` Relevant schema and existing indexes: {{schema}} Extra context (table sizes,...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#sql#performance#indexing#optimization
View
CodingPort code
Convert code from one language to another

You are fluent in both {{source_language}} and {{target_language}} and write idiomatic code in each. Translate this {{source_language}} code into {{target_language}}: ```{{source_l...

Claude Opus 4.xGPT-5DeepSeek-V3
#porting#translation#languages#migration
View
CodingDocument code
Add comments and docstrings to code

You document code clearly without stating the obvious. Add documentation to this {{language}} code. Do not change any logic. ```{{language}} {{code}} ``` Guidelines: - Add a docstr...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#documentation#docstrings#comments#readability
View
CodingWrite README
Generate a project README

You write clear, scannable README files that help people use a project fast. Project name: {{project_name}} What it does: {{description}} Tech stack: {{stack}} Primary audience: {{...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#documentation#readme#onboarding#open-source
View
CodingDesign API
Design a REST API for a feature

You are an API designer who values consistency, clarity, and good HTTP semantics. I am building this feature: {{feature}} Main resources and relationships: {{resources}} Design a R...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#api#rest#architecture#design
View
CodingDesign schema
Design a database schema

You are a database architect. Design a clean, normalized schema for {{dialect}}. What the application needs to store and how it is used: {{requirements}} Expected scale and read/wr...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#database#schema#modeling#architecture
View
CodingFix test
Diagnose a failing test

You are an expert at debugging test failures. Failing test: ```{{language}} {{test}} ``` Code under test: ```{{language}} {{code}} ``` Test runner output: ``` {{output}} ``` Please...

Claude Opus 4.xGPT-5DeepSeek-V3
#testing#debug#ci#flaky-tests
View
CodingImplement function
Implement a function from a spec

You are a careful {{language}} developer. Implement exactly what is specified, no more. Function purpose: {{purpose}} Inputs (names and types): {{inputs}} Output (type and meaning)...

Claude Opus 4.xGPT-5DeepSeek-V3
#implementation#spec#function#development
View
CodingOptimize code
Find and fix a performance bottleneck

You optimize code based on evidence, not guesses. This {{language}} code is too {{problem}} (slow / memory-heavy): ```{{language}} {{code}} ``` Context (input sizes, how often it r...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#performance#optimization#profiling#complexity
View
CodingGit help
Get the right git commands for a situation

You are a git expert who gives safe, correct commands and warns about destructive ones. My situation: {{situation}} What I want to end up with: {{goal}} Current state (branch, rece...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#git#version-control#workflow#recovery
View
CodingCommit message
Write a clear commit message from a diff

You write clear, conventional git commit messages. Here is the diff: ```diff {{diff}} ``` Optional context about why the change was made: {{context}} Write a commit message that: -...

Claude Opus 4.xGPT-5DeepSeek-V3
#git#commit#conventional-commits#workflow
View
CodingDecode error
Explain an error message to a beginner

You are a patient mentor teaching a beginner programmer. Use simple language and no unexplained jargon. I got this error and I do not understand it: ``` {{error}} ``` I was trying...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#beginner#errors#learning#debug
View
CodingTech decision
Compare architecture or tech choices

You are a pragmatic staff engineer who gives balanced, opinionated technical advice. I need to choose between these options: {{options}} For this use case: {{use_case}} My constrai...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#architecture#decision#trade-offs#planning
View
CodingHarden code
Add robust error handling to code

You make code resilient without making it noisy or over-engineered. Add proper error handling to this {{language}} code: ```{{language}} {{code}} ``` Consider these failure sources...

Claude Opus 4.xGPT-5DeepSeek-V3
#error-handling#robustness#reliability#validation
View
CodingImplement algorithm
Turn pseudocode or an algorithm into code

You implement algorithms correctly and explain the key steps. Implement this algorithm in {{language}}: {{algorithm}} Requirements: - Translate the logic faithfully; if the descrip...

Claude Opus 4.xGPT-5DeepSeek-V3
#algorithms#pseudocode#implementation#complexity
View
CodingWrite script
Write a safe shell script for a task

You write safe, portable shell scripts and explain the risky parts. Task to automate: {{task}} Target shell and OS: {{environment}} Inputs/arguments the script should accept: {{inp...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#shell#bash#automation#scripting
View
CodingUnblock thinking
Rubber-duck a problem when you are stuck

Be my rubber-duck debugging partner. Do NOT write the solution for me yet. Ask questions and challenge my assumptions so I find it myself. What I am trying to do: {{goal}} What I h...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#debug#thinking#socratic#problem-solving
View
CodingSecurity audit
Security review a code snippet

You are a security engineer doing a focused code audit. Be precise and avoid false alarms. Audit this {{language}} code for security issues: ```{{language}} {{code}} ``` Context (w...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#security#audit#vulnerabilities#review
View
CodingName things
Suggest better names for code

You have great taste in naming. Naming is one of the hardest parts of programming and you take it seriously. Here is the code and what each part actually does: ```{{language}} {{co...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#naming#readability#refactor#clean-code
View
CodingTeach concept
Learn a programming concept with examples

You are a great programming teacher. Explain concepts simply, then deepen. Teach me this concept: {{concept}} In the context of: {{language}} My current level: {{level}} Structure...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#learning#concept#examples#teaching
View
CodingSchedule job
Write and explain a cron or scheduler config

You are an expert in scheduling jobs and you double-check every cron field. I want to run this job: {{job}} On this schedule (in plain language): {{schedule}} Scheduler/system: {{s...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#cron#scheduling#devops#automation
View
CodingModernize code
Modernize a piece of legacy code

You modernize legacy code carefully, in safe steps, without breaking behavior. This {{language}} code uses outdated patterns: ```{{language}} {{code}} ``` Target: bring it up to {{...

Claude Opus 4.xGPT-5DeepSeek-V3
#legacy#modernization#refactor#migration
View
CodingWrite Dockerfile
Write an optimized Dockerfile

You write production-grade Dockerfiles that are small, secure, and fast to build. App details: - Language/runtime: {{runtime}} - Build and start commands: {{commands}} - Port and a...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#docker#devops#containers#deployment
View
CodingTransform data
Write a data transformation script

You write clean, robust data-processing code with sensible error handling. I need to transform data in {{language}}. Input format and a small sample: {{input_sample}} Desired outpu...

Claude Opus 4.xGPT-5DeepSeek-V3
#data#etl#scripting#transformation
View
CodingPlan feature
Break a feature into implementation steps

You are a tech lead who plans work before coding. Be concrete and realistic. Feature to build: {{feature}} Existing stack and relevant context: {{context}} Constraints (deadline, m...

Claude Opus 4.xGPT-5Gemini 2.5 Pro
#planning#feature#breakdown#workflow
View
CodingDecode error
Explain a confusing error message

You are a senior {{language}} engineer helping a teammate debug. Here is the full error message and stack trace: {{error_message}} Here is the relevant code: {{code}} Do the follow...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#debugging#errors#stacktrace
View
CodingWrite function
Write a function from a plain-English spec

Write a single {{language}} function that meets this specification. Specification: {{spec}} Requirements: - Function name and signature: {{signature}} - Handle edge cases (empty in...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#functions#implementation#clean-code
View
CodingWrite tests
Generate unit tests for a function

Act as a test engineer. Write unit tests for the function below using {{framework}}. Code under test: {{code}} Cover: - The normal happy path with realistic inputs. - Boundary valu...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#testing#unit-tests#coverage
View
CodingRefactor code
Refactor messy code for readability

Refactor the following {{language}} code for readability and maintainability without changing its behavior. Code: {{code}} Guidelines: - Keep the exact same inputs, outputs, and si...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#refactor#readability#clean-code
View
CodingCode review
Review a pull request diff

You are a thorough but pragmatic code reviewer. Review this diff. Diff: {{diff}} Context about the change: {{context}} Report findings in three sections: 1. Blocking issues (bugs,...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#code-review#pull-request#quality
View
CodingWrite SQL
Write a SQL query from a question

You are a SQL expert writing a query for {{dialect}}. Schema (tables and columns): {{schema}} The question to answer: {{question}} Write one query that answers it. Requirements: -...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#sql#database#query
View
CodingTune query
Optimize a slow SQL query

Act as a database performance engineer for {{dialect}}. Slow query: {{query}} Schema and existing indexes: {{schema}} Approximate table sizes: {{table_sizes}} Do the following: 1....

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#sql#performance#indexing
View
CodingWrite regex
Build a regular expression

Create a regular expression for {{regex_flavor}} that does the following: Goal: {{goal}} Should match these examples: {{should_match}} Should NOT match these: {{should_not_match}}...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#regex#pattern-matching#validation
View
CodingDocument code
Add docstrings and comments to code

Add documentation to the following {{language}} code. Code: {{code}} Rules: - Add a docstring or doc comment to every public function, class, and module using the {{doc_style}} sty...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#documentation#docstrings#comments
View
CodingPort code
Translate code between languages

Translate the following code from {{source_language}} to {{target_language}}. Source code: {{code}} Requirements: - Preserve the exact behavior and output. - Use idiomatic {{target...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#porting#translation#languages
View
CodingFind bug
Debug code that produces wrong output

Help me debug this {{language}} code. It runs without errors but produces the wrong output. Code: {{code}} Input I gave it: {{input}} Output I expected: {{expected_output}} Output...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#debugging#logic-error#troubleshooting
View
CodingExplain code
Explain what a code snippet does

Explain the following {{language}} code to someone at a {{skill_level}} level. Code: {{code}} Provide: 1. A one-sentence summary of what the code does overall. 2. A step-by-step wa...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#explanation#learning#code-reading
View
CodingWrite Dockerfile
Write a Dockerfile for an app

Write a production-ready Dockerfile for a {{stack}} application. Project details: - Entry point or start command: {{start_command}} - Build steps needed: {{build_steps}} - Listenin...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#docker#devops#containers
View
CodingWrite CI
Create a CI workflow with GitHub Actions

Write a GitHub Actions workflow file for a {{stack}} project. Requirements: - Trigger on push to {{main_branch}} and on pull requests. - Steps: install dependencies, run linter, ru...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#ci-cd#github-actions#devops
View
CodingCommit message
Write a clear git commit message

Write a git commit message for the following change. What changed: {{change_summary}} Diff (optional): {{diff}} Format: - A concise subject line in imperative mood, under 72 charac...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#git#commit#version-control
View
CodingDesign API
Design a REST API for a feature

Design a REST API for the following feature. Feature description: {{feature}} Main resources and their fields: {{resources}} Produce: 1. A table of endpoints: method, path, purpose...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#api#rest#architecture
View
CodingDesign schema
Design a database schema

Design a relational database schema for {{dialect}} based on these requirements. Requirements: {{requirements}} Deliver: 1. CREATE TABLE statements with appropriate types, primary...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#database#schema#data-modeling
View
CodingFix test
Fix a failing test

A test is failing. Help me figure out why and fix it. The test: {{test_code}} The code under test: {{source_code}} The failure output: {{failure_output}} Determine whether the bug...

Claude Opus 4.8GPT-5Gemini 2.5 Pro
#testing#debugging#fix
View

Browse other categories