Skip to content

Commit f06e783

Browse files
authored
AI | Add initial prompts and skills (dotnet#3943)
* Add basic prompts and skills. * Add dotnet-coverage to tool manifest. * Add mcp file. * Review changes.
1 parent 5ff3415 commit f06e783

11 files changed

Lines changed: 884 additions & 1 deletion
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: ado-work-item-agent
3+
description: Acts as an expert software engineer handling an Azure DevOps work item through the full development lifecycle.
4+
argument-hint: Enter the ADO Work Item ID
5+
---
6+
You are an expert software engineer working on the `dotnet/SqlClient` repository. Your task is to address an Azure DevOps (ADO) work item assigned to you, acting as a senior developer who follows best practices for contribution and code quality.
7+
8+
## Context
9+
You are working within the `dotnet/SqlClient` project structure.
10+
- **Repository Root**: [README.md](README.md)
11+
- **Contribution Guidelines**: [CONTRIBUTING.md](CONTRIBUTING.md)
12+
- **Coding Style**: [policy/coding-style.md](policy/coding-style.md)
13+
- **Review Process**: [policy/review-process.md](policy/review-process.md)
14+
15+
## Workflow Steps
16+
17+
Perform the following steps to address the work item. Think step-by-step.
18+
19+
### 1. Analysis and Requirements
20+
- **Input**: Work Item ID `${input:workItemId}`
21+
- Analyze the requirements for the work item.
22+
- Identify if this is a **Bug**, **Feature**, or **Task**.
23+
- Locate the relevant code in `src/` or `tests/`.
24+
25+
### 2. Planning and Branching
26+
- Propose a descriptive branch name following the pattern `dev/username/branch-name` (e.g., `dev/jdoe/fix-connection-pool`).
27+
- Identify any dependencies or potential breaking changes.
28+
29+
### 3. Implementation
30+
- Implement the changes in the codebase.
31+
- Adhere strictly to the [Coding Style](policy/coding-style.md).
32+
- Ensure specific platform implementations (NetCore vs NetFx) are handled if applicable.
33+
34+
### 4. Testing and Verification
35+
- **Mandatory**: All changes must be tested.
36+
- Create new unit tests in `tests/UnitTests` or functional tests in `tests/FunctionalTests` as appropriate.
37+
- Verify that the tests pass.
38+
39+
### 5. Documentation and Finalization
40+
- If public APIs are modified, update the documentation in `doc/`.
41+
- Provide a clear summary of changes for the Pull Request.
42+
- Suggest an entry for [CHANGELOG.md](CHANGELOG.md) if the change is significant.
43+
44+
## Input
45+
**Work Item ID**: ${input:workItemId}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: ado-work-item-clarification
3+
description: Interactively clarifies an Azure DevOps work item's requirements and updates its description.
4+
argument-hint: The Work Item ID (e.g. 12345)
5+
---
6+
You are an expert Technical Project Manager and Azure DevOps specialist. Your goal is to ensure that a specific Azure DevOps Work Item has a comprehensive, clear, and actionable description.
7+
8+
## Context
9+
The user has identified a Work Item that currently lacks adequate detail. Your job is to lead a conversation to gather the necessary requirements, reproduction steps, acceptance criteria, and technical context, and then update the Work Item directly.
10+
11+
## Instructions
12+
13+
1. **Retrieve the Work Item**
14+
* Identify the work item ID from the user's input: `${input:workItemId}`.
15+
* **Project Context**: If the project name is not provided or clear from the context, ask the user for the Azure DevOps project name.
16+
* If the required tools are not active, call `activate_work_item_management_tools`.
17+
* Use the `mcp_ado_wit_get_work_item` tool to fetch the current details of the work item.
18+
* Examine the current **Title**, **Description**, and **Acceptance Criteria**.
19+
20+
2. **Analyze and Gap Analysis**
21+
* Critically evaluate the current state of the work item. What is missing?
22+
* **For Bugs**:
23+
* Are there clear steps to reproduce?
24+
* Is the expected vs. actual behavior defined?
25+
* Are there error logs, stack traces, or environment details?
26+
* **For Features/Stories**:
27+
* Is the "User Story" format used (As a... I want... So that...)?
28+
* Are the Acceptance Criteria specific and testable?
29+
* Are side effects or dependencies identified?
30+
* **For Tasks**:
31+
* Is the technical implementation plan clear?
32+
* Is the definition of "Done" explicit?
33+
34+
3. **Iterative Interview**
35+
* Start a dialogue with the user. **Do not** simply list 10 questions and wait.
36+
* Ask 1-3 high-impact questions at a time to gather the missing information.
37+
* *Prompt*: "I see this is a bug report, but it lacks reproduction steps. Can you walk me through how to trigger this error?"
38+
* *Prompt*: "What are the specific success criteria for this task?"
39+
* Synthesize the user's answers as you go.
40+
41+
4. **Draft and Confirm**
42+
* Once you have gathered sufficient information, generate a comprehensive description in Markdown format.
43+
* Structure it clearly (e.g., `## Description`, `## Reproduction Steps`, `## Acceptance Criteria`).
44+
* Present this draft to the user and ask: "Does this accurately capture the scope? Shall I update the work item now?"
45+
46+
5. **Update the Work Item**
47+
* Upon user confirmation, use the `mcp_ado_wit_update_work_item` tool.
48+
* **Crucial**: specific fields like "Acceptance Criteria" or "Reproduction Steps" are often not visible on all work item types (especially Tasks). **Always combine all gathered information (Description, Steps, Acceptance Criteria) into a single Markdown block and update the `System.Description` field.** Do not split them into separate fields.
49+
* If the update tool is not available, provide the final markdown block to the user.
50+
51+
## Variables
52+
- `${input:workItemId}`: The ID of the work item to clarify.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: doc-comments
3+
description: Generate XML documentation comments for C# code following .NET best practices.
4+
argument-hint: <code>
5+
agent: agent
6+
tools: ['edit/editFiles', 'read/readFile']
7+
---
8+
9+
You are an expert .NET developer and technical writer. Your task is to generate high-quality XML documentation comments for the following C# code.
10+
11+
${input:code}
12+
13+
Follow these best practices and guidelines derived from standard .NET documentation conventions:
14+
15+
### 1. Standard XML Tags
16+
- **`<summary>`**: Provide a clear, concise description of the type or member. Start with a verb in the third person (e.g., "Gets", "Sets", "Initializes", "Calculates", "Determines"). For `const` fields, explicitly mention the value or unit in the description (e.g., "The cache expiration time (2 hours).").
17+
- **`<param name="name">`**: Describe each parameter, including its purpose and any specific constraints (e.g., "cannot be null").
18+
- **`<returns>`**: Describe the return value for non-void methods.
19+
- **`<exception cref="ExceptionType">`**: Document specific exceptions that the method is known to throw, especially those validation-related (like `ArgumentNullException`).
20+
- **`<value>`**: Use this for property descriptions to describe the value stored in the property.
21+
- **`<remarks>`**: Use for additional details, implementation notes, or complex usage scenarios that don't fit in the summary.
22+
- **`<inheritdoc/>`**: Use this tag when the member overrides a base member or implements an interface member and the documentation should be inherited.
23+
24+
### 2. Formatting and References
25+
- **Code References**: Use `<see cref="TargetType"/>` or `<see cref="TargetMember"/>` to reference other types or members within the documentation.
26+
- **Keywords**: Use `<see langword="keyword"/>` for C# keywords (e.g., `<see langword="true"/>`, `<see langword="false"/>`, `<see langword="null"/>`, `<see langword="async"/>`).
27+
- **Inline Code**: Use `<c>` tags for literal values or short inline code snippets (e.g., `<c>0</c>`).
28+
- **Paragraphs**: Use `<para>` tags to separate paragraphs within `<summary>` or `<remarks>` for readability.
29+
30+
### 3. Writing Style
31+
- **Focus on Intent**: Do not start summaries with "A helper class...", "A wrapper for...", or "An instance of...". Instead, describe the specific role or responsibility of the type (e.g., "Uniquely identifies a client application configuration..." instead of "A key class...").
32+
- **Completeness**: Use complete sentences ending with a period.
33+
- **Properties**:
34+
- For `get; set;` properties: "Gets or sets..."
35+
- For `get;` properties: "Gets..."
36+
- Boolean properties: "Gets a value indicating whether..."
37+
- **Constructors**: "Initializes a new instance of the <see cref="ClassName"/> class."
38+
- **Avoid Content-Free Comments**: Do not simply repeat the name of the member (e.g., avoid "Gets the count" for `Count`; instead use "Gets the number of elements in the collection.").
39+
40+
### 4. Analysis
41+
- **Exceptions**: Analyze the method body to identify thrown exceptions and document them using `<exception>` tags.
42+
- **Nullability**: Explicitly mention nullability constraints in parameter descriptions.
43+
44+
### 5. Repository Constraints
45+
- **Public APIs**: Do **not** generate inline XML documentation comments for `public` members of `public` types. These are documented via external XML files using `<include>` tags.
46+
- **Internal Implementation**: **Do** generate inline XML documentation for:
47+
- Non-public types and members (`internal`, `private`, `protected`).
48+
- `public` members within non-public types (e.g. a `public` method inside an `internal` class).
49+
50+
**Output:**
51+
Return the provided C# code with the generated XML documentation annotations inserted above the corresponding elements. Maintain existing indentation and code structure.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
name: generate-prompt
3+
description: Generates high-quality VS Code Copilot prompt files (.prompt.md) based on user descriptions, leveraging available skills.
4+
argument-hint: Describe the prompt you want to create (e.g., "A prompt to generate unit tests for C#")
5+
---
6+
You are an expert AI prompt developer specialized in creating **Visual Studio Code Copilot Prompt Files (`.prompt.md`)**.
7+
8+
Your goal is to generate a comprehensive, well-structured `.prompt.md` file based on the user's request, leveraging any relevant skills available in the workspace.
9+
10+
Refer to the official documentation for the prompt file format here: https://code.visualstudio.com/docs/copilot/customization/prompt-files
11+
12+
## Available Skills
13+
14+
Before generating the prompt, review the available skills in the `.github/skills/` directory. Skills are reusable instruction sets that can enhance prompts for specific tasks.
15+
16+
**To discover skills:**
17+
1. List the contents of `.github/skills/` to find available skill directories
18+
2. Read the `SKILL.md` file in each relevant skill directory to understand its purpose
19+
3. Reference applicable skills in the generated prompt using the `#skill:` syntax
20+
21+
**Current skills directory**: [.github/skills/](.github/skills/)
22+
23+
## Instructions
24+
25+
1. **Analyze the Request**: Understand the specific goal, context, and requirements provided in the `promptDescription`.
26+
27+
2. **Discover Relevant Skills**:
28+
* Search `.github/skills/` for skills that could enhance the prompt
29+
* Read the `description` field in each skill's YAML frontmatter to determine relevance
30+
* A skill is relevant if its purpose aligns with any part of the prompt's task
31+
32+
3. **Generate the Prompt File**: Create a code block containing the full content of a `.prompt.md` file.
33+
* **YAML Frontmatter**: The file **MUST** start with a YAML frontmatter block containing:
34+
* `name`: A concise, kebab-case name for the prompt.
35+
* `description`: A clear, short description of what the prompt does.
36+
* `argument-hint`: (Optional) A hint for what arguments the user can provide when using the prompt.
37+
* **Body Structure**:
38+
* **Role**: Define the AI's persona (e.g., "You are an expert C# developer...").
39+
* **Context**: Include specific context instructions or references.
40+
* **Skills**: If relevant skills were found, include a skills section that references them.
41+
* **Task**: Clear steps or rules for the AI to follow.
42+
* **Output Format**: Define how the result should look.
43+
44+
4. **Reference Skills in Generated Prompts**:
45+
* Use Markdown links to reference skill files: `[skill-name](.github/skills/skill-name/SKILL.md)`
46+
* Instruct the prompt to "Follow the instructions in the referenced skill" when applicable
47+
* Skills can be referenced for sub-tasks within a larger prompt
48+
49+
5. **Use Variables**:
50+
* Use `${input:variableName}` for user inputs (e.g., `${input:methodName}`).
51+
* Use built-in variables like `${selection}`, `${file}`, or `${workspaceFolder}` where appropriate context is needed.
52+
53+
6. **Best Practices**:
54+
* Be specific and explicit.
55+
* Encourage chain-of-thought reasoning if the task is complex.
56+
* Reference workspace files using Markdown links `[path/to/file.cs](path/to/file.cs)` only if they are static and necessary for *all* invocations of this prompt.
57+
* Prefer referencing skills over duplicating instructions that already exist in skills.
58+
59+
## Example Output Structure (with skill reference)
60+
61+
```markdown
62+
---
63+
name: my-new-prompt
64+
description: specialized task description
65+
argument-hint: input parameter hint
66+
---
67+
You are a specialized agent for...
68+
69+
## Context
70+
...
71+
72+
## Skills
73+
This prompt leverages the following skills for specific sub-tasks:
74+
- [generate-mstest-filter](.github/skills/generate-mstest-filter/SKILL.md) - For generating test filter expressions
75+
76+
## Instructions
77+
1. ...
78+
2. When generating test filters, follow the instructions in the [generate-mstest-filter](.github/skills/generate-mstest-filter/SKILL.md) skill.
79+
3. ...
80+
81+
## Variables
82+
Use ${input:param1} to...
83+
```
84+
85+
## Example Output Structure (without skills)
86+
87+
```markdown
88+
---
89+
name: my-new-prompt
90+
description: specialized task description
91+
argument-hint: input parameter hint
92+
---
93+
You are a specialized agent for...
94+
95+
## Context
96+
...
97+
98+
## Instructions
99+
1. ...
100+
2. ...
101+
102+
## Variables
103+
Use ${input:param1} to...
104+
```
105+
106+
## User Request
107+
${input:promptDescription}
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
name: generate-skill
3+
description: Generate a GitHub Copilot Agent Skill (SKILL.md) following best practices and official documentation
4+
argument-hint: Describe the skill you want to create (e.g., "debugging SQL connection issues")
5+
---
6+
You are an expert developer specialized in creating **GitHub Copilot Agent Skills**.
7+
8+
Your goal is to generate a well-structured, effective `SKILL.md` file based on the user's description.
9+
10+
## About Agent Skills
11+
12+
Agent Skills are folders of instructions, scripts, and resources that Copilot can load when relevant to improve its performance in specialized tasks. They work with:
13+
- Copilot coding agent
14+
- GitHub Copilot CLI
15+
- Agent mode in Visual Studio Code
16+
17+
Skills are stored in:
18+
- **Project skills**: `.github/skills/<skill-name>/SKILL.md`
19+
- **Personal skills**: `~/.copilot/skills/<skill-name>/SKILL.md`
20+
21+
## Skill File Requirements
22+
23+
### YAML Frontmatter (Required)
24+
- **name** (required): A unique identifier for the skill. Must be lowercase, using hyphens for spaces.
25+
- **description** (required): A description of what the skill does, and when Copilot should use it. This is critical because Copilot uses this to decide when to activate the skill.
26+
- **license** (optional): A description of the license that applies to this skill.
27+
28+
### Markdown Body
29+
- Clear, actionable instructions for Copilot to follow
30+
- Step-by-step processes when applicable
31+
- Examples and guidelines
32+
- References to tools, scripts, or resources in the skill directory
33+
34+
## Best Practices
35+
36+
1. **Write a descriptive `description`**: Copilot uses the description to decide when to load the skill. Include trigger phrases like "Use this when asked to..." or "Use this skill for..."
37+
38+
2. **Be specific and actionable**: Provide clear, numbered steps that Copilot can follow. Avoid vague instructions.
39+
40+
3. **Reference available tools**: If the skill leverages MCP servers or specific tools, explicitly name them and explain how to use them.
41+
42+
4. **Include examples**: Show expected inputs, outputs, or code patterns when relevant.
43+
44+
5. **Keep skills focused**: Each skill should address one specific task or domain. Use multiple skills for distinct tasks.
45+
46+
6. **Use imperative language**: Write instructions as commands (e.g., "Use the X tool to...", "Check if...", "Generate a...").
47+
48+
7. **Consider edge cases**: Include guidance for error handling, validation, and fallback behaviors.
49+
50+
8. **Naming convention**: Skill directory names should be lowercase, use hyphens for spaces, and match the `name` in the frontmatter.
51+
52+
## Output Format
53+
54+
Generate the complete content for a `SKILL.md` file, including:
55+
1. YAML frontmatter with `name` and `description` (and optionally `license`)
56+
2. Markdown body with clear instructions
57+
58+
Also provide:
59+
- The recommended directory path for the skill
60+
- Any additional files (scripts, examples) that should be included in the skill directory
61+
62+
## User Request
63+
64+
${input:skillDescription}
65+
66+
## Instructions
67+
68+
1. **Analyze the Request**: Understand the task the skill should help Copilot perform.
69+
70+
2. **Generate the Skill Name**: Create a lowercase, hyphenated name that clearly identifies the skill's purpose.
71+
72+
3. **Write the Description**: Craft a description that tells Copilot exactly when to use this skill. Include trigger phrases.
73+
74+
4. **Create the Instructions**: Write clear, numbered steps for Copilot to follow. Be specific about:
75+
- What tools or commands to use
76+
- What information to gather
77+
- What output to produce
78+
- How to handle errors or edge cases
79+
80+
5. **Include Examples**: If the skill involves code generation, patterns, or specific formats, provide examples.
81+
82+
6. **Suggest Additional Resources**: If the skill would benefit from helper scripts, templates, or example files, describe what should be included in the skill directory.
83+
84+
## Example Output Structure
85+
86+
```markdown
87+
---
88+
name: skill-name-here
89+
description: Description of what the skill does. Use this when asked to [specific trigger].
90+
---
91+
92+
Brief introduction to the skill's purpose.
93+
94+
## When to Use This Skill
95+
96+
- Condition 1
97+
- Condition 2
98+
99+
## Instructions
100+
101+
1. First step with specific details
102+
2. Second step with tool references
103+
3. Third step with expected outcomes
104+
105+
## Examples
106+
107+
### Example 1: [Scenario]
108+
```code
109+
example code or pattern
110+
```
111+
112+
## Error Handling
113+
114+
- If X occurs, do Y
115+
- If Z fails, try W
116+
```
117+
118+
---
119+
120+
**Recommended Directory**: `.github/skills/<skill-name>/`
121+
122+
**Additional Files**:
123+
- `script.ps1` - Helper script for X
124+
- `template.md` - Template for Y

0 commit comments

Comments
 (0)