Write documentation, a README, or API docs
Generates clear technical documentation from your code or notes.
The prompt
Role: Act as an engineer writing clear developer documentation.
Context: The API / module (code or signatures): [CODE]. Who will use it and their level: [AUDIENCE]. Common tasks they need to accomplish: [COMMON_TASKS]. Conventions / doc style: [DOC_STYLE]. Things that trip people up: [GOTCHAS].
Task: Produce: a reference section (each endpoint/function: purpose, parameters with types and constraints, return value, errors, and one example); a short how-to guide covering the common tasks with runnable examples; and a 'gotchas' section. Keep it accurate to the code provided.
Format: Sections: Reference | How-to guide | Gotchas. Code and examples in fenced blocks.
Highlighted [brackets] are blanks to replace with your own details.
Fill in the blanks and use this promptMore Software Development prompts
What to fill in
- CODE
- AUDIENCE
- COMMON_TASKS
- DOC_STYLE
- GOTCHAS
How this prompt is built
This prompt follows the RCTF structure (Role, Context, Task, Format). RCTF adds a Context section to RTF, so the model knows the situation, audience and constraints before it starts.
Related prompts
- Convert code to another language or frameworkIdiomatic translation of code between languages or frameworks, with notes on differences.
- Write unit tests for my codeComprehensive unit tests covering happy paths, edge cases, and failures.
- Write a script to automate a repetitive taskBash, Python, or PowerShell scripts that automate a task safely, with instructions to run them.
- Write precise TypeScript types for my data and APIsSafer, readable TypeScript types that rule out impossible states, replace unsafe casts, and come with compile-time tests.