I used to spend 30% of my day on repetitive coding tasks and writing docs nobody read. Now, I use a few quick prompts that handle the boring stuff so I can focus on the hard engineering problems.
Here are 5 you can use right now:
1. The Super-Detailed Doc Generator
Your code is clean, but the documentation is always a rush job. This fixes that by forcing a complete output.
π Prompt:
You are a Senior Technical Writer. Write JSDoc-style documentation for the following JavaScript function. The documentation must include:
- A clear, one-sentence purpose of the function.
- A detailed, multi-step explanation of the algorithm or logic flow.
- For every parameter: the type, a description of its role, and an example of a valid input.
- For the return value: the type, a description of what is returned, and a description of what is returned in an edge-case scenario (e.g., if an error occurs).
- A small code example showing how to call the function and what the expected output is.
- An
@author
tag with the text "AI-Powered Technical Assistant".
π‘ Example: Dropped in a complex utility function $\rightarrow$ got a professional doc block that included logic flow steps and clear examples, passing review on the first try.
2. The Comprehensive Code Review Helper
Skip the common mistakes that clutter up pull requests by getting a multi-layered review.
π Prompt:
Act as a Staff Software Engineer specializing in performance and security. Review this code snippet for the following three areas:
- Performance & Complexity: Identify the current time complexity (e.g., $O(n)$, $O(n^2)$). If it's worse than $O(n)$, suggest a specific refactoring to improve it, explaining why the suggestion is better.
- Security: Point out any potential security vulnerabilities (e.g., injection risks, improper validation, exposed secrets). For each vulnerability, provide a concrete, line-by-line fix.
- Modern Idioms: Suggest ways to make the code more concise and idiomatic for the language (e.g., list comprehensions in $Python$,
map/filter/reduce
in $JavaScript$).
π‘ Example: Pasted a $Python$ script with a nested loop $\rightarrow$ ChatGPT pointed out a $O(n^2)$ complexity issue, suggested an $O(n \log n)$ replacement, and flagged a missing input validation.
3. The Full-Coverage Test Case Generator
Get 80% of your unit tests written in seconds by covering all possible paths.
π Prompt:
Generate a complete set of unit test cases for the following function using the [Framework Name, e.g., Jest, Pytest] framework. The test cases must cover the following categories:
- Happy Path: $2$ distinct tests using valid, expected inputs.
- Edge Cases: Tests for null/undefined input, empty strings or arrays, and boundary values (e.g., min/max allowed length, zero).
- Error Handling: Tests that specifically check if the function throws the correct error for invalid data types or out-of-range values.
- Side Effects (if applicable): A test to ensure that any external state or mock calls are correctly made and reset.
π‘ Example: For a user validation function $\rightarrow$ it generated tests for min/max length, data type errors, and ensured it handled null input without crashing.
4. The Legacy Code Deep Dive
Tired of trying to understand that 5-year-old function? Get a complete breakdown.
π Prompt:
You are a Technical Architect tasked with documenting old systems. Analyze and explain the following code block. Your response must be structured as follows:
- Overall Purpose: A single-paragraph summary of what the code achieves at a high level.
- Detailed Flow: A numbered list tracing the execution of the code line-by-line, explaining why each step is taken.
- Dependencies: List all external functions, classes, or database queries the code relies on.
- Risks/Assumptions: List 3 potential failure points (e.g., what happens if a dependency fails, if input is $X$) and the key assumptions the original author made.
π‘ Example: Dropped in 15 lines of dense $SQL$ logic $\rightarrow$ got a summary, a step-by-step breakdown of the query execution, and a warning about potential deadlocks.
5. The Config-to-Config Expert
Moving between environments or trying a new language's config file? Don't memorize every setting.
π Prompt:
You are a DevOps Engineer. Convert this configuration file from [Format 1, e.g., YAML] to [Format 2, e.g., JSON]. Ensure all settings are preserved and apply the following best practices:
- Data Type Integrity: Explicitly check and ensure that numbers remain numbers and booleans remain booleans during the conversion.
- Comment Conversion: For any inline comments in the original format, capture the intent and add them as an
_notes
key at the most relevant level of the new JSON object (or as comments if the new format supports them). - Formatting: The output must be minified (no extra whitespace or newlines) unless the target format requires pretty printing.
π‘ Example: Switched a complex $Docker$ Compose $YAML$ file to a $Kubernetes$ $JSON$ config $\rightarrow$ the conversion was perfect, and the original comments were neatly preserved in the $JSON$.
β The truth: Being a great developer isn't about typing faster. It's about spending your time on high-impact problems. Let the machine handle the routine stuff with this level of detail.
π Iβve collected dozens more prompts like these (for marketing, social media and more).
You can save them or even create your own advanced prompts at AISuperHub Prompt Hub.
Top comments (0)