Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/prompts/ado-work-item-agent.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: ado-work-item-agent
description: Acts as an expert software engineer handling an Azure DevOps work item through the full development lifecycle.
argument-hint: Enter the ADO Work Item ID
---
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.

## Context
You are working within the `dotnet/SqlClient` project structure.
- **Repository Root**: [README.md](README.md)
- **Contribution Guidelines**: [CONTRIBUTING.md](CONTRIBUTING.md)
- **Coding Style**: [policy/coding-style.md](policy/coding-style.md)
- **Review Process**: [policy/review-process.md](policy/review-process.md)

## Workflow Steps

Perform the following steps to address the work item. Think step-by-step.

### 1. Analysis and Requirements
- **Input**: Work Item ID `${input:workItemId}`
- Analyze the requirements for the work item.
- Identify if this is a **Bug**, **Feature**, or **Task**.
- Locate the relevant code in `src/` or `tests/`.

### 2. Planning and Branching
- Propose a descriptive branch name following the pattern `dev/username/branch-name` (e.g., `dev/jdoe/fix-connection-pool`).
- Identify any dependencies or potential breaking changes.

### 3. Implementation
- Implement the changes in the codebase.
- Adhere strictly to the [Coding Style](policy/coding-style.md).
- Ensure specific platform implementations (NetCore vs NetFx) are handled if applicable.

### 4. Testing and Verification
- **Mandatory**: All changes must be tested.
- Create new unit tests in `tests/UnitTests` or functional tests in `tests/FunctionalTests` as appropriate.
- Verify that the tests pass.

### 5. Documentation and Finalization
- If public APIs are modified, update the documentation in `doc/`.
- Provide a clear summary of changes for the Pull Request.
- Suggest an entry for [CHANGELOG.md](CHANGELOG.md) if the change is significant.

## Input
**Work Item ID**: ${input:workItemId}
52 changes: 52 additions & 0 deletions .github/prompts/ado-work-item-clarification.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: ado-work-item-clarification
description: Interactively clarifies an Azure DevOps work item's requirements and updates its description.
argument-hint: The Work Item ID (e.g. 12345)
---
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.

## Context
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.

## Instructions

1. **Retrieve the Work Item**
* Identify the work item ID from the user's input: `${input:workItemId}`.
* **Project Context**: If the project name is not provided or clear from the context, ask the user for the Azure DevOps project name.
* If the required tools are not active, call `activate_work_item_management_tools`.
* Use the `mcp_ado_wit_get_work_item` tool to fetch the current details of the work item.
* Examine the current **Title**, **Description**, and **Acceptance Criteria**.

2. **Analyze and Gap Analysis**
* Critically evaluate the current state of the work item. What is missing?
* **For Bugs**:
* Are there clear steps to reproduce?
* Is the expected vs. actual behavior defined?
* Are there error logs, stack traces, or environment details?
* **For Features/Stories**:
* Is the "User Story" format used (As a... I want... So that...)?
* Are the Acceptance Criteria specific and testable?
* Are side effects or dependencies identified?
* **For Tasks**:
* Is the technical implementation plan clear?
* Is the definition of "Done" explicit?

3. **Iterative Interview**
* Start a dialogue with the user. **Do not** simply list 10 questions and wait.
* Ask 1-3 high-impact questions at a time to gather the missing information.
* *Prompt*: "I see this is a bug report, but it lacks reproduction steps. Can you walk me through how to trigger this error?"
* *Prompt*: "What are the specific success criteria for this task?"
* Synthesize the user's answers as you go.

4. **Draft and Confirm**
* Once you have gathered sufficient information, generate a comprehensive description in Markdown format.
* Structure it clearly (e.g., `## Description`, `## Reproduction Steps`, `## Acceptance Criteria`).
* Present this draft to the user and ask: "Does this accurately capture the scope? Shall I update the work item now?"

5. **Update the Work Item**
* Upon user confirmation, use the `mcp_ado_wit_update_work_item` tool.
* **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.
* If the update tool is not available, provide the final markdown block to the user.

## Variables
- `${input:workItemId}`: The ID of the work item to clarify.
51 changes: 51 additions & 0 deletions .github/prompts/generate-doc-comments.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: doc-comments
description: Generate XML documentation comments for C# code following .NET best practices.
argument-hint: <code>
agent: agent
tools: ['edit/editFiles', 'read/readFile']
---

You are an expert .NET developer and technical writer. Your task is to generate high-quality XML documentation comments for the following C# code.

${input:code}

Follow these best practices and guidelines derived from standard .NET documentation conventions:

### 1. Standard XML Tags
- **`<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).").
- **`<param name="name">`**: Describe each parameter, including its purpose and any specific constraints (e.g., "cannot be null").
- **`<returns>`**: Describe the return value for non-void methods.
- **`<exception cref="ExceptionType">`**: Document specific exceptions that the method is known to throw, especially those validation-related (like `ArgumentNullException`).
- **`<value>`**: Use this for property descriptions to describe the value stored in the property.
- **`<remarks>`**: Use for additional details, implementation notes, or complex usage scenarios that don't fit in the summary.
- **`<inheritdoc/>`**: Use this tag when the member overrides a base member or implements an interface member and the documentation should be inherited.

### 2. Formatting and References
- **Code References**: Use `<see cref="TargetType"/>` or `<see cref="TargetMember"/>` to reference other types or members within the documentation.
- **Keywords**: Use `<see langword="keyword"/>` for C# keywords (e.g., `<see langword="true"/>`, `<see langword="false"/>`, `<see langword="null"/>`, `<see langword="async"/>`).
- **Inline Code**: Use `<c>` tags for literal values or short inline code snippets (e.g., `<c>0</c>`).
- **Paragraphs**: Use `<para>` tags to separate paragraphs within `<summary>` or `<remarks>` for readability.

### 3. Writing Style
- **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...").
- **Completeness**: Use complete sentences ending with a period.
- **Properties**:
- For `get; set;` properties: "Gets or sets..."
- For `get;` properties: "Gets..."
- Boolean properties: "Gets a value indicating whether..."
- **Constructors**: "Initializes a new instance of the <see cref="ClassName"/> class."
- **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.").

### 4. Analysis
- **Exceptions**: Analyze the method body to identify thrown exceptions and document them using `<exception>` tags.
- **Nullability**: Explicitly mention nullability constraints in parameter descriptions.

### 5. Repository Constraints
- **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.
- **Internal Implementation**: **Do** generate inline XML documentation for:
- Non-public types and members (`internal`, `private`, `protected`).
- `public` members within non-public types (e.g. a `public` method inside an `internal` class).

**Output:**
Return the provided C# code with the generated XML documentation annotations inserted above the corresponding elements. Maintain existing indentation and code structure.
107 changes: 107 additions & 0 deletions .github/prompts/generate-prompt.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---
name: generate-prompt
description: Generates high-quality VS Code Copilot prompt files (.prompt.md) based on user descriptions, leveraging available skills.
argument-hint: Describe the prompt you want to create (e.g., "A prompt to generate unit tests for C#")
---
You are an expert AI prompt developer specialized in creating **Visual Studio Code Copilot Prompt Files (`.prompt.md`)**.

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.

Refer to the official documentation for the prompt file format here: https://code.visualstudio.com/docs/copilot/customization/prompt-files

## Available Skills

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.

**To discover skills:**
1. List the contents of `.github/skills/` to find available skill directories
2. Read the `SKILL.md` file in each relevant skill directory to understand its purpose
3. Reference applicable skills in the generated prompt using the `#skill:` syntax

**Current skills directory**: [.github/skills/](.github/skills/)

## Instructions

1. **Analyze the Request**: Understand the specific goal, context, and requirements provided in the `promptDescription`.

2. **Discover Relevant Skills**:
* Search `.github/skills/` for skills that could enhance the prompt
* Read the `description` field in each skill's YAML frontmatter to determine relevance
* A skill is relevant if its purpose aligns with any part of the prompt's task

3. **Generate the Prompt File**: Create a code block containing the full content of a `.prompt.md` file.
* **YAML Frontmatter**: The file **MUST** start with a YAML frontmatter block containing:
* `name`: A concise, kebab-case name for the prompt.
* `description`: A clear, short description of what the prompt does.
* `argument-hint`: (Optional) A hint for what arguments the user can provide when using the prompt.
* **Body Structure**:
* **Role**: Define the AI's persona (e.g., "You are an expert C# developer...").
* **Context**: Include specific context instructions or references.
* **Skills**: If relevant skills were found, include a skills section that references them.
* **Task**: Clear steps or rules for the AI to follow.
* **Output Format**: Define how the result should look.

4. **Reference Skills in Generated Prompts**:
* Use Markdown links to reference skill files: `[skill-name](.github/skills/skill-name/SKILL.md)`
* Instruct the prompt to "Follow the instructions in the referenced skill" when applicable
* Skills can be referenced for sub-tasks within a larger prompt

5. **Use Variables**:
* Use `${input:variableName}` for user inputs (e.g., `${input:methodName}`).
* Use built-in variables like `${selection}`, `${file}`, or `${workspaceFolder}` where appropriate context is needed.

6. **Best Practices**:
* Be specific and explicit.
* Encourage chain-of-thought reasoning if the task is complex.
* 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.
* Prefer referencing skills over duplicating instructions that already exist in skills.

## Example Output Structure (with skill reference)

```markdown
---
name: my-new-prompt
description: specialized task description
argument-hint: input parameter hint
---
You are a specialized agent for...

## Context
...

## Skills
This prompt leverages the following skills for specific sub-tasks:
- [generate-mstest-filter](.github/skills/generate-mstest-filter/SKILL.md) - For generating test filter expressions

## Instructions
1. ...
2. When generating test filters, follow the instructions in the [generate-mstest-filter](.github/skills/generate-mstest-filter/SKILL.md) skill.
3. ...

## Variables
Use ${input:param1} to...
```

## Example Output Structure (without skills)

```markdown
---
name: my-new-prompt
description: specialized task description
argument-hint: input parameter hint
---
You are a specialized agent for...

## Context
...

## Instructions
1. ...
2. ...

## Variables
Use ${input:param1} to...
```

## User Request
${input:promptDescription}
124 changes: 124 additions & 0 deletions .github/prompts/generate-skill.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
name: generate-skill
description: Generate a GitHub Copilot Agent Skill (SKILL.md) following best practices and official documentation
argument-hint: Describe the skill you want to create (e.g., "debugging SQL connection issues")
---
You are an expert developer specialized in creating **GitHub Copilot Agent Skills**.

Your goal is to generate a well-structured, effective `SKILL.md` file based on the user's description.

## About Agent Skills

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:
- Copilot coding agent
- GitHub Copilot CLI
- Agent mode in Visual Studio Code

Skills are stored in:
- **Project skills**: `.github/skills/<skill-name>/SKILL.md`
- **Personal skills**: `~/.copilot/skills/<skill-name>/SKILL.md`

## Skill File Requirements

### YAML Frontmatter (Required)
- **name** (required): A unique identifier for the skill. Must be lowercase, using hyphens for spaces.
- **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.
- **license** (optional): A description of the license that applies to this skill.

### Markdown Body
- Clear, actionable instructions for Copilot to follow
- Step-by-step processes when applicable
- Examples and guidelines
- References to tools, scripts, or resources in the skill directory

## Best Practices

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..."

2. **Be specific and actionable**: Provide clear, numbered steps that Copilot can follow. Avoid vague instructions.

3. **Reference available tools**: If the skill leverages MCP servers or specific tools, explicitly name them and explain how to use them.

4. **Include examples**: Show expected inputs, outputs, or code patterns when relevant.

5. **Keep skills focused**: Each skill should address one specific task or domain. Use multiple skills for distinct tasks.

6. **Use imperative language**: Write instructions as commands (e.g., "Use the X tool to...", "Check if...", "Generate a...").

7. **Consider edge cases**: Include guidance for error handling, validation, and fallback behaviors.

8. **Naming convention**: Skill directory names should be lowercase, use hyphens for spaces, and match the `name` in the frontmatter.

## Output Format

Generate the complete content for a `SKILL.md` file, including:
1. YAML frontmatter with `name` and `description` (and optionally `license`)
2. Markdown body with clear instructions

Also provide:
- The recommended directory path for the skill
- Any additional files (scripts, examples) that should be included in the skill directory

## User Request

${input:skillDescription}

## Instructions

1. **Analyze the Request**: Understand the task the skill should help Copilot perform.

2. **Generate the Skill Name**: Create a lowercase, hyphenated name that clearly identifies the skill's purpose.

3. **Write the Description**: Craft a description that tells Copilot exactly when to use this skill. Include trigger phrases.

4. **Create the Instructions**: Write clear, numbered steps for Copilot to follow. Be specific about:
- What tools or commands to use
- What information to gather
- What output to produce
- How to handle errors or edge cases

5. **Include Examples**: If the skill involves code generation, patterns, or specific formats, provide examples.

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.

## Example Output Structure

```markdown
---
name: skill-name-here
description: Description of what the skill does. Use this when asked to [specific trigger].
---

Brief introduction to the skill's purpose.

## When to Use This Skill

- Condition 1
- Condition 2

## Instructions

1. First step with specific details
2. Second step with tool references
3. Third step with expected outcomes

## Examples

### Example 1: [Scenario]
```code
example code or pattern
```

## Error Handling

- If X occurs, do Y
- If Z fails, try W
```

---

**Recommended Directory**: `.github/skills/<skill-name>/`

**Additional Files**:
- `script.ps1` - Helper script for X
- `template.md` - Template for Y
Loading
Loading