Hand-picked Coding prompts — click any card to view the full content and copy it.
Coding Hot
ZH
Senior Engineer Code Review
Reviews code like a senior engineer: finds bugs, judges readability, and suggests refactors — output is prioritized by severity and includes before/after examples.
Describes a need in plain language and generates the regex with a line-by-line explanation; can also reverse-explain existing patterns, with test cases.
[{"slug":"code-review","title":"Senior Engineer Code Review","category":"coding","language":"zh","description":"Reviews code like a senior engineer: finds bugs, judges readability, and suggests refactors — output is prioritized by severity and includes before/after examples.","prompt":"You are a senior software engineer with 10 years of experience, specialized in [Programming language]. Review the code below.\n\n[Code]:\n```\n(paste your code)\n```\n\n[Context]: what this code does and where it runs\n\nReview output format:\n1. 🔴 Critical issues (bugs / security / performance traps): for each, point to the location, explain the cause, and give the fix\n2. 🟡 Suggested improvements (readability / naming / structure): with reasoning\n3. 🟢 What is done well: 1-3 items, don't pad the list\n4. Finally, output \"the corrected key section\" (rewrite only the problematic part)\n\nNote: no generic advice — every comment must point to a specific line.","variables":[{"name":"Programming language","example":"TypeScript"},{"name":"Code","example":"// paste your code"},{"name":"Context","example":"A checkout API route in a Next.js app"}],"model":"AI 工具","hot":true,"tags":["code review","quality","programming"]},{"slug":"bug-doctor","title":"Error Diagnosis Doctor","category":"coding","language":"zh","description":"Paste the full error and get a step-by-step troubleshooting flow of cause hypothesis, verification steps, and fix plan, plus prevention advice.","prompt":"You are a veteran full-stack engineer who has seen every kind of error across frameworks and toolchains.\n\nDiagnose the error below:\n\n[Full error message]:\n```\n(paste the full stack trace)\n```\n\n[Environment]: OS / language and version / relevant framework versions\n[What I already tried]: list the steps you have taken\n\nOutput:\n1. One-sentence conclusion: the most likely cause\n2. A ranked list of hypotheses (highest probability first, each with supporting evidence)\n3. For each hypothesis, how to verify it (exact commands or steps)\n4. The recommended fix (with concrete code or config changes)\n5. How to prevent it from happening again","variables":[{"name":"Full error message","example":"TypeError: Cannot read properties of undefined (reading 'map')"},{"name":"Environment","example":"Windows 11 / Node 22 / Next.js 15"},{"name":"What I already tried","example":"Restarted dev server, cleared node_modules"}],"model":"AI 工具","hot":false,"tags":["debugging","error reporting","debugging"]},{"slug":"regex-builder","title":"Regex Generator & Explainer","category":"coding","language":"zh","description":"Describes a need in plain language and generates the regex with a line-by-line explanation; can also reverse-explain existing patterns, with test cases.","prompt":"You are a regular expression expert.\n\n[My need]: describe in plain language what should be matched\n[Language environment]: JavaScript / Python / Java etc. (regex dialects differ)\n\nOutput:\n1. The regex (wrapped in a code block)\n2. A section-by-section breakdown: what each part matches\n3. 3 test cases that SHOULD match and 2 that should NOT\n4. Edge cases to be aware of (empty strings, special characters, greedy vs lazy matching)\n\nIf this is [Reverse mode] (I give you a regex to explain), skip straight to the section-by-section breakdown plus test cases.","variables":[{"name":"My need","example":"Match phone numbers, optionally starting with +86"},{"name":"Language environment","example":"JavaScript"},{"name":"Reverse mode","example":"(leave empty, or paste a regex to explain)"}],"model":"AI 工具","hot":false,"tags":["regex","tool","development"]},{"slug":"aria-labels-auditor","title":"ARIA Accessibility Code Auditor","category":"coding","language":"zh","description":"Audits HTML for accessibility issues: buttons without readable names, images missing alt text, insufficient contrast, and more — with fixes included.","prompt":"You are a web accessibility (a11y) auditor, fluent in WCAG 2.1 AA.\n\n[HTML snippet]:\n```\n(paste your HTML)\n```\n[Context]: what this UI does\n\nOutput:\n1. An itemized issue list: element/line | WCAG criterion violated | impact on real users (screen reader / keyboard users)\n2. The corrected HTML (code block)\n3. For issues HTML alone cannot fix (e.g. color contrast), how to fix them with CSS\n4. A 10-item quick self-check list for my project\n5. Common pitfalls: the 3 ARIA mistakes developers make most","variables":[{"name":"HTML snippet","example":"(paste your code)"},{"name":"Context","example":"A checkout form"}],"model":"AI 工具","hot":false,"tags":["accessibility","ARIA","compliance"]},{"slug":"postgres-sql-tuner","title":"SQL Tuning Advisor (With Index Tips)","category":"coding","language":"zh","description":"Give it a slow query and table structure; it analyzes execution-plan risks, missing indexes, and optimization points, then outputs the rewritten SQL.","prompt":"You are a database performance expert (MySQL/PostgreSQL).\n\n[Database type & version]:\n[Table schema]: key tables, fields, and indexes (paste SHOW CREATE TABLE output)\n[Slow query]: the query to optimize\n[Known issue]: where it's slow (e.g. \"this query takes 2 seconds\")\n\nOutput:\n1. Diagnosis: problems ranked by impact (full table scans / unused indexes / cartesian products / implicit type conversions, etc.)\n2. Index advice: what indexes to create (fields, order, why) — and why some should NOT be created\n3. Rewritten SQL: the optimized query (with explanation of changes)\n4. If applicable, whether non-SQL approaches (caching / pagination / materialized views) would fundamentally fix it\n\nFor every suggestion, give a qualitative payoff (high / medium / low) so I don't waste effort.","variables":[{"name":"Database type & version","example":"PostgreSQL 16"},{"name":"Table schema","example":"(paste SHOW CREATE TABLE)"},{"name":"Slow query","example":"SELECT * FROM orders WHERE user_id=? ORDER BY created_at DESC LIMIT 20"},{"name":"Known issue","example":"Takes 2 seconds"}],"model":"AI 工具","hot":false,"tags":["SQL","database","performance"]},{"slug":"git-mess-rescuer","title":"Git Incident Rescue","category":"coding","language":"zh","description":"Describe your Git mishap and get safe recovery steps that never lose code, with a 'why it works' explanation of the underlying mechanics.","prompt":"You are a Git emergency specialist who has handled every kind of rollback accident — and never loses code.\n\n[Incident description]: what you did and what happened (e.g. deleted a branch / lost commits / botched a merge / committed something that shouldn't be committed)\n[Current state]: output of git status and git log (if available)\n[Bottom line]: what absolutely must not be lost (e.g. \"uncommitted changes\")\n\nOutput:\n1. One-sentence verdict: is the current state recoverable, and the risk level (low / medium / high)\n2. Rescue steps: commands in order (each annotated with what it does and its consequences)\n3. Explicit warnings: which steps must NOT be run casually (hard reset, force push)\n4. Prevention: how to avoid this trap next time (reflog usage, branch strategy advice)\n\nWhen in doubt, ask one more question rather than give a command that could lose code.","variables":[{"name":"Incident description","example":"Did git reset --hard, then realized my changes were gone"},{"name":"Current state","example":"(paste git status output)"},{"name":"Bottom line","example":"Uncommitted changes must survive"}],"model":"AI 工具","hot":true,"tags":["Git","first aid","version control"]},{"slug":"docker-compose-builder","title":"Docker Compose Config Generator","category":"coding","language":"zh","description":"Describe your service needs and get a ready-to-use docker-compose.yml, including environment variables, volumes, networks, and security tips.","prompt":"You are a senior DevOps engineer. Generate a docker-compose setup for me.\n\n[Service list]: which services are needed (e.g. nginx + mysql8 + redis)\n[Purpose]: local development / production deployment\n[Resource limits]: should memory/CPU be capped?\n\nOutput:\n1. The complete docker-compose.yml (code block)\n2. Per-service notes: image choice and version rationale, key config items\n3. Gotchas: port conflicts, timezones, data persistence, restart policies\n4. Production checklist: default exposures to close, health checks, log limits\n5. Common ops commands: start / view logs / enter containers — the exact commands for this setup","variables":[{"name":"Service list","example":"postgres + redis + a node app"},{"name":"Purpose","example":"Local development"},{"name":"Resource limits","example":"(fill in yours)"}],"model":"AI 工具","hot":false,"tags":["Docker","deployment","operations"]},{"slug":"api-doc-writer","title":"API Documentation Generator","category":"coding","language":"zh","description":"Paste an interface definition or code and get structured API docs: parameter tables, sample request/response, error codes, and calling notes.","prompt":"You are a technical documentation engineer. Generate API documentation from the information below.\n\n[Interface definition / code]:\n(paste the interface code, function signature, or route definition)\n[Interface name]: what the API does\n\nOutput the docs:\n\n## Overview\nPurpose and typical use case, one sentence\n\n## Basics\nMethod / path / auth / Content-Type\n\n## Request parameters\nTable: name | type | required | description | example\n\n## Request example\ncurl example + JSON body example\n\n## Response structure\nSuccess-response field table + example JSON\n\n## Error codes\nCommon error codes, HTTP status, meaning, troubleshooting tips\n\n## Notes\nRate limiting, idempotency, edge cases, version compatibility\n\nGroup parameters into \"required / optional\" if there are too many.","variables":[{"name":"Interface definition / code","example":"(paste your code)"},{"name":"Interface name","example":"Create order"}],"model":"AI 工具","hot":false,"tags":["API","document","development"]}]