Documentation from Code

Developer Toolsgithub-copilot-vs-cursormodule_or_componentsource_filesdoc_format

Copilot can read open files for context. Cursor's @codebase index finds real usage patterns across the project. The 'search for import statements' instruction produces documentation based on actual usage, not assumed usage.

Prompt
Generate documentation for {{module_or_component}} by reading the source code.

Files to read: {{source_files}}
Documentation format: {{doc_format}}
Audience: {{audience}}

Generate:

**1. Overview** (one paragraph)
What this module does, when to use it, and what problem it solves.

**2. Quick Start**
Minimal working example with realistic data (not "foo" and "bar"). Show the import, basic usage, and expected output.

**3. API Reference**
For each exported function/component/type:
- Signature with types
- Description (what it does, not how — implementation details go in code comments)
- Parameters table: name | type | required | default | description
- Return value description
- Example usage

**4. Common Patterns**
3-5 real-world usage patterns with code examples, based on how the module is actually used in the codebase (search for import statements to find real usage).

**5. Gotchas**
Things that aren't obvious from the API — side effects, performance considerations, common mistakes.

Do not document private/internal functions. If a function's purpose is unclear from its name and types, flag it as [NEEDS CLARIFICATION] rather than guessing.

Variables to customize

{{module_or_component}}{{source_files}}{{doc_format}}{{audience}}

Why this prompt works

Copilot can read open files for context. Cursor's @codebase index finds real usage patterns across the project. The 'search for import statements' instruction produces documentation based on actual usage, not assumed usage.

What you get when you save this prompt

Your workspace unlocks powerful tools to iterate and improve.

AI OPTIMIZE

AI Optimization

One-click improvement with structure analysis and pattern suggestions.

VERSION DIFF

Version History

Track every edit. Compare versions side-by-side with word-level diffs.

ORGANIZE
Development
Code Review
Testing
Marketing

Folders & Tags

Organize your library with nested folders, tags, and drag-and-drop.

MCP
$ npm i -g @promptingbox/mcp
Claude · Cursor · ChatGPT

Use Everywhere

Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.

Your prompts, organized

Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.