Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
22
Guidelines for creating effective @copilot prompts.
Sign in to like and favorite skills
Guidelines for creating effective @copilot prompts.
GitHub Copilot is amnesiac. It has no memory of the codebase, PR context, or prior work. Every @copilot directive must be a complete, self-contained prompt.
Before posting any @copilot directive, use the prompt-builder agent to generate a high-quality prompt.
# Step 1: Gather context $pr = pwsh -NoProfile scripts/pr/Get-PRContext.ps1 -PullRequest 50 -IncludeChangedFiles | ConvertFrom-Json $threads = pwsh -NoProfile scripts/pr/Get-UnresolvedReviewThreads.ps1 -PullRequest 50 | ConvertFrom-Json # Step 2: Use prompt-builder agent to generate the directive # Pass context to prompt-builder, which will create an actionable, specific prompt # Step 3: Post the generated prompt pwsh -NoProfile scripts/issue/Post-IssueComment.ps1 -Issue 123 -Body "$generatedPrompt" # OR for PR comment reply: pwsh -NoProfile scripts/pr/Post-PRCommentReply.ps1 -PullRequest 50 -CommentId 123 -Body "$generatedPrompt"
Copilot prompts MUST include:
| Bad | Why |
|---|---|
| No specifics, no file paths |
| Vague scope, no constraints |
| Assumes context Copilot doesn't have |
Good example:
@copilot In src/Services/UserService.cs, refactor the GetUser method to use async/await. MUST maintain the existing interface signature. MUST add null checks for the userId parameter. Follow the pattern in src/Services/OrderService.cs line 45-60.
| Scenario | Tool | Rationale |
|---|---|---|
| Creating new @copilot prompt | prompt-builder | Builds from scratch with validation |
| Refining existing prompt template | prompt-optimizer | Applies research-backed improvements |
| Complex multi-step task | prompt-builder | Handles context gathering and structure |
The prompt-builder agent follows a structured process:
Invoke prompt-builder with the context you gathered:
Create a @copilot prompt for: - Task: [what Copilot should do] - Files: [which files to modify] - Context: [PR diff, review comments, error messages] - Constraints: [coding standards, patterns to follow]