Retext
Free Tool

GitHub Copilot Prompt Enhancer

Get better code suggestions from GitHub Copilot by writing clearer comments and prompts. Optimize for Copilot's inline and chat features.

0/5000 characters

Tips for GitHub Copilot Prompts

  • Write descriptive function comments before the function
  • Include parameter types and return types in comments
  • Provide example inputs and outputs
  • Use consistent naming conventions
  • Break complex logic into well-named helper functions

Example Enhancement

Before

Function to validate email addresses

After

/** * Validates an email address format and checks for common issues. * * @param email - The email address string to validate * @returns An object with isValid boolean and error message if invalid * * @example * validateEmail("user@example.com") // { isValid: true } * validateEmail("invalid-email") // { isValid: false, error: "Invalid format" } * * Checks performed: * - Valid email format (regex) * - No spaces or invalid characters * - Has valid TLD */ function validateEmail(email: string): { isValid: boolean; error?: string }

Frequently Asked Questions

How do comments help Copilot?

Copilot uses comments as context to understand what code you want. Detailed comments with examples, types, and edge cases lead to more accurate suggestions.

Does this work with Copilot Chat?

Yes! For Copilot Chat, you can use even more detailed prompts. The enhanced version includes all the context Copilot needs.

Save Your Enhanced Prompts

Turn your best GitHub Copilot prompts into reusable snippets with Retext. Type a short trigger and instantly expand.