Writing prompts
Writing prompt

Docs from working code

You have functioning code and need to write docs another developer can actually use.

Works best in: Claude

Generate documentation for this code. Useful, not decorative.

```{{language}}
{{paste code, function, or module}}
```

Audience: {{who reads this — junior on team, external API consumer, future me?}}

Output sections (skip any that don't apply):
1. **What it does** — one sentence, no marketing
2. **When to use it** — and when NOT to (link to alternative if there is one)
3. **Quick example** — the simplest realistic call, with sample input and output
4. **Parameters** — table format, only ones non-obvious from the type signature
5. **Common pitfalls** — what trips people up
6. **What it doesn't do** — explicit non-goals

Skip:
- "This function takes X and returns Y" (that's the signature, the reader can read)
- "Powerful and flexible" or other marketing words
- Examples that are obvious from the function name

If there's no real reason to document this beyond the type signature, tell me and stop.
·Open in·Share
documentationtechnical writing

More writing prompts

All writing prompts