Documentation from Code
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.
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
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 Optimization
One-click improvement with structure analysis and pattern suggestions.
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
$ npm i -g @promptingbox/mcpUse 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.