💻
AI Prompts for Developers
Prompts for documentation, code review, testing, and project planning
20 copy-paste prompts
Documentation
Try with tool: 自述文件生成器 →
1
Write a README.md for [project name]: description, installation, usage examples, API reference, and contributing guidelines.
2
Generate API documentation for this endpoint: [method] [path] — describe request body, headers, response, and error codes.
3
Write an Architecture Decision Record (ADR) for choosing [technology/approach] over [alternative] for [use case].
4
Create a changelog entry for version [X.Y.Z] from these commits: [paste commit messages].
5
Write inline code comments for this function explaining the 'why' not the 'what': [paste function].
Code Quality
1
Review this code for bugs, performance issues, and security vulnerabilities. Suggest fixes: [paste code].
2
Write unit tests for this function using [Jest/pytest/JUnit]: [paste function]. Cover happy path, edge cases, and errors.
3
Explain this code in plain English — what it does, why, and how: [paste code].
4
Refactor this code for readability and maintainability. Explain each change you make: [paste code].
5
Find potential SQL injection, XSS, or CSRF vulnerabilities in this code and suggest fixes: [paste code].
Planning & Specs
Try with tool: 用户故事生成器 →
1
Write user stories with acceptance criteria for this feature: [describe feature]. Use 'As a... I want... So that...' format.
2
Create a technical specification for [feature] including architecture, data model, API design, and implementation phases.
3
Write a bug report for: [describe the bug]. Include steps to reproduce, expected vs actual behavior, and severity.
4
Estimate the effort for implementing [feature] — break it into subtasks with story points and dependencies.
5
Write a pull request description for these changes: [describe what you changed and why].
Debugging & Testing
Try with tool: 单元测试生成器 →
1
Write a complete unit test suite for this function: [paste function code] using [testing framework], covering the happy path, at least 3 edge cases, and error handling — with descriptive test names and arrange-act-assert structure.
2
Turn these rough notes into a professional bug report: [paste notes]. Include a one-line summary, environment ([OS/browser/app version]), numbered reproduction steps, expected vs. actual behavior, and a severity assessment.
3
Analyze this stack trace and error message: [paste stack trace]. Identify the most likely root cause, list 3 hypotheses ranked by probability, and suggest one specific debugging step to confirm or rule out each.
4
Given this bug description [describe bug] and the fix [paste diff or describe fix], write a regression test in [testing framework] that would have caught the bug, plus 2 related edge cases the fix might have missed.
5
This test fails intermittently: [paste test code]. Diagnose which common causes of flakiness it exhibits (timing, shared state, test ordering, async races), pinpoint the risky lines, and rewrite the test to be deterministic.
Related Workflows
Put these prompts to work in complete step-by-step workflows