Generates reusable Prompt Template files (.github/prompts/*.prompt.md) with variable substitution for ad-hoc, high-frequency tasks. Use when the user needs quick, repeatable prompts for common operations (explain code, fix bug, add tests, refactor, document). Creates templates with handlebars variables, optimized context structure, and strict output constraints. Not for complex workflows (use skills) or persistent roles (use agents).
80
—
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
This skill generates Prompt Template files that are pure text templates optimized for:
Key distinction:
Example prompts:
Confirm the user wants a Prompt Template (not a skill, agent, or instruction).
Decision tree:
generate-agent-skills insteadgenerate-agent insteadgenerate-path-instructions or generate-repo-instructionsProceed only if creating a simple, reusable prompt template.
Goal: Understand what the prompt does and when it's used.
Load the task analysis checklist:
cat references/task_analysis_checklist.mdWork through the checklist to define:
Example outputs:
"Explain Code" Prompt:
"Fix Bug" Prompt:
Goal: Identify dynamic inputs that change per invocation.
Load the variable identification guide:
cat references/variable_identification_guide.mdCommon variable types:
Editor Context:
{{selected_code}} - Currently selected text{{current_file}} - Full current file path{{file_content}} - Entire file content{{cursor_line}} - Line number at cursorUser Inputs:
{{language}} - Programming language{{framework}} - Framework in use{{error_message}} - Error text{{description}} - User-provided descriptionProject Context:
{{project_name}} - Repository name{{tech_stack}} - Technologies used{{conventions}} - Project standardsNaming conventions:
{{snake_case}} for variables{{error_message}} not {{err}}Example variable sets:
Explain Code:
{{selected_code}} - The code to explain{{language}} - Programming language (optional, can infer)Fix Bug:
{{error_message}} - The error text{{broken_code}} - Code that's failing{{language}} - Programming languageAdd Tests:
{{function_code}} - Function to test{{framework}} - Test framework (pytest, jest, etc.){{language}} - Programming languageGoal: Structure the prompt for maximum effectiveness.
Load context optimization patterns:
cat references/context_optimization_patterns.mdNeedle in a Haystack Principle:
Prompt structure:
# {{Prompt Title}}
## System Context (Front)
{{Task description}}
{{Output format requirements}}
{{Constraints and rules}}
## Data (Back)
{{User-provided variables}}
{{Selected code / error messages}}Examples:
Good structure:
# Explain Code
Explain what the following code does in plain English.
**Output format:**
- Start with one-sentence summary
- Explain key concepts
- Include example usage if helpful
**Constraints:**
- Keep explanation concise (under 200 words)
- Assume beginner-level understanding
- Avoid jargon without explaining it
---
**Code to explain:**
```{{language}}
{{selected_code}}**Bad structure (data front-loaded):**
```markdown
Here's some code:
{{selected_code}}
Please explain it simply.Goal: Define strict output requirements to ensure consistent, useful results.
Common constraint types:
Format Constraints:
Length Constraints:
Tone Constraints:
Behavioral Constraints:
Example constraints:
Explain Code:
Fix Bug:
Goal: Create the prompt file using the template.
Load prompt template:
cat assets/prompt_template.mdPopulate these sections:
YAML Frontmatter:
name: kebab-case prompt name (e.g., explain-code)description: One-sentence summary of what it doesvariables: List of variable names (for documentation)Prompt Title:
System Context:
Variable Placeholders:
{{variable_name}} syntaxFile naming convention:
.github/prompts/{{task-name}}.prompt.mdexplain-code.prompt.md, fix-bug.prompt.md, add-tests.prompt.mdValidate the generated prompt file:
# 1. Check YAML frontmatter is valid
head -10 .github/prompts/{{prompt-name}}.prompt.md
# 2. Verify variable syntax (all {{variables}} have closing braces)
grep -o "{{[^}]*}}" .github/prompts/{{prompt-name}}.prompt.md
# 3. Test manually with sample data
# Replace variables with real values and test the promptFinal checklist:
{{snake_case}} syntax{{var}} not {{var})Output to user:
✅ Created: .github/prompts/{{prompt-name}}.prompt.md
📋 Variables: {{var1}}, {{var2}}, {{var3}}
🎯 Use case: {{one-sentence description}}
💡 To use: Open prompt in editor, replace variables, submit to CopilotUsage guidance:
{{variables}} with actual valuesGuides LLM through understanding the prompt's purpose and requirements.
Common variable types, naming conventions, and examples.
"Needle in a Haystack" principle and prompt structure best practices.
Complete prompt file template with handlebars variables and structure.
{{var}}c5644f6
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.