Randy Pagels explores ‘Promptception’—how to use GitHub Copilot itself to create, rewrite, and optimize prompts for Copilot Chat, Edit, and Agent Mode, sharing actionable examples for developers.

Promptception – Improve Prompts with Copilot

Author: Randy Pagels

Prompt engineering is a crucial part of making the most out of AI-assisted coding tools like GitHub Copilot. In this article, Randy Pagels introduces the concept of Promptception—using Copilot’s own capabilities to help you write better prompts for itself. It’s a practical and accessible trick for developers looking to improve the quality and relevance of Copilot’s suggestions.

What is Promptception?

Promptception is about leveraging GitHub Copilot Chat, Edit, or Agent Mode to help you create, refine, or optimize prompts. Instead of jumping straight into coding, you ask Copilot to generate, revise, or improve a prompt before using it for code generation, review, or automation tasks.

Examples of Promptception in Action

1. Chat Mode: Prompt to Build a Prompt

  • Scenario: Testing a checkout flow using Playwright
  • Prompt Example: “Help me write a Copilot Chat prompt to generate this test.”
  • Use: Get a clear, actionable prompt for Copilot to generate end-to-end test code.

2. Edit Mode: Prompt Rewrite Assistance

  • Scenario: Enhancing a code comment into a specific Copilot Edit instruction
  • Prompt Example: “Rewrite the comment to be more specific, including a retry step and network mock.”
  • Use: Refine prompts directly in code for improved Copilot Edit output.

3. Agent Mode: Meta-Prompt for Actions

  • Scenario: Creating a custom action for PR title validation in Agent Mode
  • Prompt Example: “Act as a Copilot Agent. Write a prompt I can use to create a custom action that validates PR titles.”
  • Use: Generate meta-prompts for automation.

4. Chat Mode: Style-Guided Prompt

  • Scenario: Instructing Copilot to generate code using async/await and avoid callbacks
  • Prompt Example: “Suggest a prompt that tells Copilot Chat to generate code with async/await.”
  • Use: Influence code style of generated output.

5. Chat or Edit Mode: Prompt for Visual Review

  • Scenario: Streamlining code reviews
  • Prompt Example: “Help me write a prompt for reviewing this code for clarity and comments.”
  • Use: Prepare prompts for Copilot-driven code review.

6. Chat Mode: Document Review Promptception

  • Scenario: Document validation for grammar and structure
  • Prompt Example: “Create a short prompt to review a document for grammar, detail duplication, and flow.”

7. Chat Mode: README Generation

  • Scenario: Generating a README.md template
  • Prompt Example: “Create a prompt to summarize this project—purpose, domain, tech stack, functionality.”

Key Takeaway

Promptception is about improving your development workflow by asking Copilot to help formulate better instructions before running them. This simple but powerful approach enables more precise, repeatable, and structured results from AI tools.


Summary:

  • Use Copilot’s own features to write and refine prompts.
  • Try prompt engineering in Chat, Edit, and Agent Modes.
  • Focus on clarity, specificity, and style in your prompts.
  • Let Copilot assist with code, documentation, and reviews—starting with the prompt itself.

This post appeared first on “Randy Pagels’s Blog”. Read the entire article here