Refactoring Hint Comment

Developer Toolscopilot-promptslogicDescriptionnewFunctionNameparams

Copilot's autocomplete engine uses surrounding comments to predict the next edit. This structured refactoring hint tells Copilot exactly where to extract, what to name it, and where to put it — turning a manual refactor into a single Tab accept.

Prompt
// REFACTOR: Extract the {{logicDescription}} below into a pure function
// called {{newFunctionName}}({{params}}): {{returnType}}
// Move to {{targetFile}}
// Reason: {{reason}}
// Keep the call site here, just replace inline logic with the function call

Variables to customize

{{logicDescription}}{{newFunctionName}}{{params}}{{returnType}}{{targetFile}}{{reason}}

Why this prompt works

Copilot's autocomplete engine uses surrounding comments to predict the next edit. This structured refactoring hint tells Copilot exactly where to extract, what to name it, and where to put it — turning a manual refactor into a single Tab accept.

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.