Docstring & JSDoc Generator
Constraining Copilot to 'do not modify implementations' prevents accidental code changes. The structured JSDoc format with @example produces documentation that doubles as inline tests for reviewers.
Add comprehensive JSDoc documentation to every exported function in #file:{{filePath}}.
For each function include:
- @description — one sentence explaining what it does and why
- @param — each parameter with type and description
- @returns — what is returned and when
- @throws — any errors that can be thrown
- @example — one realistic usage example
Do not modify the function implementations. Preserve existing inline comments.Variables to customize
Why this prompt works
Constraining Copilot to 'do not modify implementations' prevents accidental code changes. The structured JSDoc format with @example produces documentation that doubles as inline tests for reviewers.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Get thorough code reviews with actionable feedback tailored to your language, framework, and standards.
Context-Aware Code CompletionProviding the surrounding code and project context lets the model match existing patterns exactly. The constraint against modifying existing code prevents unwanted side effects.
Inline Code SuggestionConstraining suggestions to match existing style and scope produces insertions that feel native to the codebase. The 'no explanation' rule mimics real inline completion behavior.
Code ExplanationThe audience level parameter adjusts complexity automatically. Requiring a usage example ensures the explanation is practical, not just theoretical.