Skip to content
Closed
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.
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
26 changes: 26 additions & 0 deletions .github/prompts/plan-splitTvpTests.prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Plan: Split TvpTest.cs Into Independent Test Classes

The current `TestMain()` runs 500+ test cases sequentially via baseline comparison, making it slow, hard to debug, and retry-unfriendly. The tests are already logically grouped into helper classes (`StreamInputParam`, `SqlVariantParam`, `DateTimeVariantTest`, `OutputParameter`) plus inline methods, with no shared state between groups—making them ideal candidates for splitting.

### Steps (Each Step = One Git Commit)

1. ✅ **Add per-group baseline files and update `TestMain()` to validate using concatenated split files** — Extract sections from [SqlParameterTest_DebugMode.bsl](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/SqlParameterTest_DebugMode.bsl), [SqlParameterTest_ReleaseMode.bsl](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/SqlParameterTest_ReleaseMode.bsl), and Azure variants into new files (`StreamInputParameter_DebugMode.bsl`, `StreamInputParameter_ReleaseMode.bsl`, `TvpColumnBoundaries_DebugMode.bsl`, `TvpColumnBoundaries_ReleaseMode.bsl`, etc.). Modify `FindDiffFromBaseline()` to concatenate the split baseline files in order (selecting Debug or Release variants based on build configuration) and compare against test output instead of using the original combined file. **If the split is incorrect, `TestMain()` fails—proving equivalence when CI passes.**

2. ✅ **Add new test classes that run alongside `TestMain()`** — Create [StreamInputParameterTests.cs](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/), [TvpColumnBoundariesTests.cs](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/), [TvpQueryHintsTests.cs](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/), [SqlVariantParameterTests.cs](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/), [DateTimeVariantTests.cs](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/), [OutputParameterTests.cs](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/). Each class has its own baseline comparison method pointing to its split baseline files (Debug and Release variants), using `#if DEBUG` to select the appropriate baseline. Original `TestMain()` remains unchanged. **CI runs both old and new tests—all must pass.**

3. ✅ **Delete `TestMain()` and original combined baseline files** — Remove `TestMain()`, `RunTestCoreAndCompareWithBaseline()`, `RunTest()`, `FindDiffFromBaseline()` from [TvpTest.cs](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/TvpTest.cs). Delete [SqlParameterTest_*.bsl](src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/) files. Keep shared helper methods/classes in TvpTest.cs or move to a shared utilities file. Per-group Debug and Release baseline files remain. **Reviewer can verify deletion is safe since steps 1-2 already validated equivalence and new tests passed in CI.**

4. ✅ **[Repeatable per group] Migrate one test class from baseline comparison to xUnit assertions** — For each group (start with smallest, e.g., `OutputParameterTests`): replace `Console.WriteLine` comparisons with `Assert.Equal()`, `Assert.True()`, etc., then delete that group's Debug and Release baseline files. Use `[Theory]` with `[MemberData]` pointing to static methods that yield all test case permutations with unique identifiers (e.g., `"StreamInput_Sync_DataLen100000_ParamLen-1_OldFalse"`)—xUnit displays each identifier in test output, allowing reviewers to diff test names against baseline to verify completeness. For DEBUG-only test cases, use `#if DEBUG` or `[Trait("Configuration", "Debug")]` to conditionally include them. **Each migration is a separate commit; reviewer sees direct assertion logic instead of string comparison.**

### Baseline Section Boundaries

| Test Group | Start Marker | End Marker | Debug | Release | Debug Azure | Release Azure |
|------------|--------------|------------|-------|---------|-------------|---------------|
| **StreamInputParameter** | `Starting test 'TvpTest'` (line 1) | Line before `+++++++ Iteration 0 ++++++++` | 1–478 | 1–17 | 1–478 | 1–17 |
| **TvpColumnBoundaries** | `+++++++ Iteration 0 ++++++++` | Line before `------- Sort order + uniqueness #1` | 479–943 | 18–482 | 479–943 | 18–482 |
| **TvpQueryHints** | `------- Sort order + uniqueness #1: simple -------` | Last `-------------` line before empty line | 944–974 | 483–513 | 944–974 | 483–513 |
| **SqlVariantParameter** | Empty line + `Starting test 'SqlVariantParam'` | `End test 'SqlVariantParam'` (inclusive) | 975–1073 | 514–612 | 975–1073 | 514–612 |
| **DateTimeVariant** | Line after `End test 'SqlVariantParam'` | Line before `Starting 'OutputParameter' tests` | 1074–2231 | 613–1770 | 1074–2231 | 613–1770 |
| **OutputParameter** | `Starting 'OutputParameter' tests` | `Done` (end of file) | 2232–2235 | 1771–1774 | 2232–2235 | 1771–1774 |

**Note:** Azure baseline files have identical line numbers to their non-Azure counterparts—differences are in content (different error messages/behaviors on Azure SQL), not structure.
Loading
Loading