Test Generation
Specifies the framework, scopes coverage to public APIs, and tells Claude Code to match existing test patterns rather than inventing new conventions.
Generate tests for {{file_path}}. Testing requirements: - Framework: {{test_framework}} - Cover happy path, edge cases, and error handling - Mock external dependencies (DB, API calls, file system) - Follow the test patterns already used in this project (check existing test files first) - Each test should have a descriptive name explaining the scenario Do NOT test private implementation details — only test the public API/exports of the module.
Variables to customize
Why this prompt works
Specifies the framework, scopes coverage to public APIs, and tells Claude Code to match existing test patterns rather than inventing new conventions.
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.