|
| 1 | +--- |
| 2 | +applyTo: '.github/chatmodes/*.chatmode.md' |
| 3 | +description: Template and requirements for writing meta-chatmode definitions for Copilot. Every chatmode file must include a description in its front-matter, and follow the documented structure and best practices. |
| 4 | +--- |
| 5 | + |
| 6 | +# Meta-Chatmode Template |
| 7 | + |
| 8 | +## Purpose |
| 9 | +Describe the intent and scope of this chatmode meta-prompt. Explain what kind of chatmodes it is meant to generate or validate (e.g., assistant personas, interaction styles, specialized workflows). |
| 10 | + |
| 11 | +## Persona or Role Description |
| 12 | +Describe the intended persona, role, or behavior for this chatmode (e.g., "You are a helpful, encouraging code reviewer specializing in C#."). |
| 13 | + |
| 14 | +## File Naming and Title Conventions |
| 15 | +- Every meta-chatmode file must begin with a clear, descriptive title as the first heading (e.g., "Meta-Chatmode Template"). |
| 16 | +- The title must use sentence case and accurately reflect the file's purpose (e.g., "Meta-Chatmode Template"). |
| 17 | +- The filename must be clear, descriptive, in English, use hyphens, and end with the `.chatmode.md` extension. |
| 18 | +- The file must be placed in the `.github/chatmodes/` directory at the root of the repository. |
| 19 | +- The title and filename should be consistent with each other and with the file's content. |
| 20 | + |
| 21 | +## Structure |
| 22 | +- **Front-matter**: YAML block with at least `description` (short summary of the chatmode's intent). Optionally, a `tools` field can be included to specify which tools are allowed in this chatmode. |
| 23 | +- **Sections**: Each chatmode file should include the following sections: |
| 24 | + - Title |
| 25 | + - Purpose |
| 26 | + - Persona or Role Description |
| 27 | + - Interaction Guidelines |
| 28 | + - Best Practices |
| 29 | + - Example Dialogues or Scenarios |
| 30 | + - References (optional) |
| 31 | + |
| 32 | +## Rules |
| 33 | +- Chatmode definitions must be clear, actionable, and unambiguous. |
| 34 | +- Use imperative language for guidelines ("Respond as", "Avoid", "Always"). |
| 35 | +- Specify the intended persona, tone, and interaction style. |
| 36 | +- If the chatmode is technology- or domain-specific, state it explicitly in the front-matter and body. |
| 37 | +- Every chatmode front-matter **must** include a `description` field (short summary). |
| 38 | +- The `tools` field (optional) can be used to restrict or allow specific tools for this chatmode (e.g., `tools: ["terminal", "notebook"]`). |
| 39 | + |
| 40 | +## Best Practices |
| 41 | +- Keep chatmode definitions concise but comprehensive. |
| 42 | +- Use lists and example dialogues for clarity. |
| 43 | +- Provide rationale for guidelines when relevant. |
| 44 | +- Update chatmode definitions as needs evolve. |
| 45 | + |
| 46 | +## Example |
| 47 | +--- |
| 48 | +description: Friendly assistant for C# code reviews |
| 49 | +tools: ['terminal', 'notebook'] |
| 50 | +--- |
| 51 | +# C# Code Review Mode Instructions |
| 52 | +You are a helpful, encouraging code reviewer specializing in C#. Your task is to review C# code, provide constructive feedback, and suggest improvements. |
| 53 | + |
| 54 | +## Instructions |
| 55 | +Always: |
| 56 | +* Provide actionable, specific suggestions. |
| 57 | +* Use positive, supportive language. |
| 58 | +* Reference C# best practices and documentation when relevant. |
| 59 | +* Avoid harsh criticism; focus on improvement and learning. |
| 60 | + |
| 61 | +## Example interaction |
| 62 | +User: Can you review this method? |
| 63 | +Assistant: Sure! Here are a few suggestions to improve readability and performance... |
| 64 | + |
| 65 | +## References |
| 66 | +- [C# Coding Conventions](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions) |
0 commit comments