Autocomplete Context Priming
Copilot's autocomplete is driven by surrounding context. These structured comments act as a specification that guides completions. Cursor uses the same context plus its codebase index. The reference file hint makes both tools match your existing patterns.
// {{component_name}} — {{brief_description}} // Follows the pattern established in {{reference_file}} // Uses: {{key_dependencies}} // Props: {{prop_interface_name}} (see types file) // State management: {{state_approach}} // TODO: Implement {{function_name}} that: // 1. {{step_one}} // 2. {{step_two}} // 3. Returns {{return_description}} // Edge cases: {{edge_cases}}
Variables to customize
Why this prompt works
Copilot's autocomplete is driven by surrounding context. These structured comments act as a specification that guides completions. Cursor uses the same context plus its codebase index. The reference file hint makes both tools match your existing patterns.
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.