Skip to content

Commit 04ee46d

Browse files
committed
Merge branch 'main' into target-single-platform/01-infrastructure-and-public-apis
2 parents 0d8e50a + 6db52a6 commit 04ee46d

171 files changed

Lines changed: 5817 additions & 7051 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ When a new issue is created, follow these steps:
129129
- Suggest release note entries for fixes by updating files under `release-notes/` or by using the `release-notes` prompt (instead of editing `CHANGELOG.md` directly).
130130
- Tag reviewers based on `CODEOWNERS` file
131131

132+
## 🌿 Branch Naming
133+
- All branches created by AI agents **must** use the `dev/automation/` prefix (e.g. `dev/automation/fix-connection-timeout`).
134+
- Do **not** create branches directly under `main`, `dev/`, or any other top-level prefix.
135+
132136
## 🧠 Contextual Awareness
133137
- All source code is in `src/Microsoft.Data.SqlClient/src/`. Do NOT add code to legacy `netfx/src/` or `netcore/src/` directories.
134138
- Only `ref/` folders in `netcore/ref/` and `netfx/ref/` remain active for defining the public API surface.

.github/prompts/code-review.prompt.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
---
22
name: code-review
3-
description: AI-assisted code review for a pull request in Microsoft.Data.SqlClient.
3+
description: AI-assisted code review for a pull request or branch in Microsoft.Data.SqlClient.
44
argument-hint: <PR number or branch name>
55
agent: agent
6-
tools: ['github/search_issues', 'read/readFile', 'codebase/search']
6+
tools: ['github/search_issues', 'github/pull_request_read', 'github/get_file_contents', 'github/run_secret_scanning', 'read/readFile', 'search']
77
---
88

9-
Review the pull request "${input:pr}" in `dotnet/SqlClient`.
9+
Review the changes in "${input:target}" for `dotnet/SqlClient`.
10+
11+
The target may be either a **PR number** (e.g., `4106`) or a **branch name** (e.g., `dev/user/my-feature`). Determine which by checking whether the value is purely numeric.
1012

1113
Follow this structured review process:
1214

1315
## 1. Understand the Change
14-
- Fetch the PR details: title, description, linked issue(s), and diff.
1516
- Read the PR description to understand the intent and scope of the change.
17+
- Check for linked issues referenced in the description (e.g., `Fixes #...`).
1618
- Check which files are modified and categorize them:
1719
- **Source code** (`src/Microsoft.Data.SqlClient/src/`) — the main review focus
1820
- **Tests** (`tests/`) — verify coverage

.github/prompts/generate-doc-comments.prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: doc-comments
2+
name: generate-doc-comments
33
description: Generate XML documentation comments for C# code following .NET best practices.
44
argument-hint: <code>
55
agent: agent

.github/prompts/generate-prompt.prompt.md

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name: generate-prompt
33
description: Generates high-quality VS Code Copilot prompt files (.prompt.md) based on user descriptions, leveraging available skills.
44
argument-hint: Describe the prompt you want to create (e.g., "A prompt to generate unit tests for C#")
5+
tools: [read, edit, search, todo]
56
---
67
You are an expert AI prompt developer specialized in creating **Visual Studio Code Copilot Prompt Files (`.prompt.md`)**.
78

@@ -34,6 +35,7 @@ Before generating the prompt, review the available skills in the `.github/skills
3435
* `name`: A concise, kebab-case name for the prompt.
3536
* `description`: A clear, short description of what the prompt does.
3637
* `argument-hint`: (Optional) A hint for what arguments the user can provide when using the prompt.
38+
* `tools`: (Recommended) A list of tool identifiers the prompt is allowed to use. See the **Tool Scoping** section below.
3739
* **Body Structure**:
3840
* **Role**: Define the AI's persona (e.g., "You are an expert C# developer...").
3941
* **Context**: Include specific context instructions or references.
@@ -50,19 +52,78 @@ Before generating the prompt, review the available skills in the `.github/skills
5052
* Use `${input:variableName}` for user inputs (e.g., `${input:methodName}`).
5153
* Use built-in variables like `${selection}`, `${file}`, or `${workspaceFolder}` where appropriate context is needed.
5254

53-
6. **Best Practices**:
55+
6. **Scope Tools**: Restrict the tools available to each prompt using the `tools` frontmatter field. See the **Tool Scoping** section below for detailed guidance.
56+
57+
7. **Best Practices**:
5458
* Be specific and explicit.
5559
* Encourage chain-of-thought reasoning if the task is complex.
5660
* 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.
5761
* Prefer referencing skills over duplicating instructions that already exist in skills.
5862

63+
## Tool Scoping
64+
65+
Every generated prompt **should** include a `tools` list in its YAML frontmatter. Scoping tools keeps the model focused by limiting it to approved, known-effective tools for the task. Without tool scoping, the model may invoke irrelevant tools, waste context, or produce unpredictable results.
66+
67+
### Why scope tools?
68+
- **Focus**: Fewer tools means the model spends less reasoning on tool selection and more on the task.
69+
- **Reliability**: Restricting to tested tools avoids unexpected side effects (e.g., a read-only review prompt shouldn't have edit tools).
70+
- **Safety**: Prevents prompts from accidentally running terminal commands or making file changes when they shouldn't.
71+
72+
### How to choose tools
73+
Apply the **principle of least privilege** — include only the tools the prompt actually needs:
74+
75+
| Prompt type | Recommended tools |
76+
|---|---|
77+
| **Read-only analysis** (review, triage, explain) | `read/readFile`, `search/codebase`, `search/textSearch` |
78+
| **Code editing** (bug fix, feature, refactor) | `edit/editFiles`, `edit/createFile`, `read/readFile`, `search/codebase` |
79+
| **Needs terminal** (build, test, scripts) | All of the above + `execute/runInTerminal`, `execute/getTerminalOutput` |
80+
| **Needs GitHub data** (triage, release notes) | All of the above + `github/search_issues` or other GitHub tools |
81+
| **Needs web content** (docs lookup) | `web/fetch` |
82+
83+
### Available built-in tool identifiers
84+
85+
You can specify individual tools or tool sets (which include all tools in that group).
86+
87+
**Tool sets** (use these to include all tools in a category):
88+
- `edit` — File creation and editing tools
89+
- `read` — File and notebook reading tools
90+
- `search` — Codebase, text, and file search tools
91+
- `execute` — Terminal, task, and notebook execution tools
92+
- `web` — Web content fetching tools
93+
94+
**Commonly used individual tools:**
95+
96+
| Tool identifier | Purpose |
97+
|---|---|
98+
| `edit/editFiles` | Apply edits to existing files |
99+
| `edit/createFile` | Create a new file |
100+
| `read/readFile` | Read file contents |
101+
| `read/problems` | Get workspace problems/diagnostics |
102+
| `search/codebase` | Semantic code search |
103+
| `search/textSearch` | Text/regex search in files |
104+
| `search/fileSearch` | Search for files by glob pattern |
105+
| `search/listDirectory` | List directory contents |
106+
| `search/usages` | Find references and implementations |
107+
| `execute/runInTerminal` | Run a shell command |
108+
| `execute/getTerminalOutput` | Get terminal output |
109+
| `execute/testFailure` | Get test failure details |
110+
| `web/fetch` | Fetch a web page |
111+
112+
**Extension / MCP tools** can also be included using their identifier (e.g., `github/search_issues`). Use `<server-name>/*` to include all tools from an MCP server.
113+
114+
### Frontmatter syntax
115+
```yaml
116+
tools: ['read/readFile', 'search/codebase', 'edit/editFiles']
117+
```
118+
59119
## Example Output Structure (with skill reference)
60120
61121
```markdown
62122
---
63123
name: my-new-prompt
64124
description: specialized task description
65125
argument-hint: input parameter hint
126+
tools: ['edit/editFiles', 'read/readFile', 'search/codebase', 'execute/runInTerminal']
66127
---
67128
You are a specialized agent for...
68129

@@ -89,6 +150,7 @@ Use ${input:param1} to...
89150
name: my-new-prompt
90151
description: specialized task description
91152
argument-hint: input parameter hint
153+
tools: ['read/readFile', 'search/codebase']
92154
---
93155
You are a specialized agent for...
94156

.github/prompts/generate-skill.prompt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name: generate-skill
33
description: Generate a GitHub Copilot Agent Skill (SKILL.md) following best practices and official documentation
44
argument-hint: Describe the skill you want to create (e.g., "debugging SQL connection issues")
5+
agent: agent
6+
tools: ['read/readFile', 'edit/createFile', 'search']
57
---
68
You are an expert developer specialized in creating **GitHub Copilot Agent Skills**.
79

.github/prompts/refine-test-overlap.prompt.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
name: test-minimize-overlap
2+
name: refine-test-overlap
33
description: Run coverage overlap analysis and suggest test suite optimizations
44
argument-hint: Test filter (e.g. FullyQualifiedName~MyTests) or describe the tests you want to analyze
5+
agent: agent
6+
tools: ['edit/editFiles', 'read/readFile', 'search/codebase', 'execute/runInTerminal', 'execute/getTerminalOutput']
57
---
68
You are an expert .NET Test Engineer specialized in optimizing test coverage and reducing technical debt.
79

@@ -10,19 +12,19 @@ Your task is to analyze the user's test suite using the `AnalyzeTestOverlap.ps1`
1012

1113
## Skills
1214
This prompt leverages the following skills for specific sub-tasks:
13-
- [generate-mstest-filter](../skills/generate-mstest-filter/SKILL.md) - For generating well-formed MSTest filter expressions
15+
- [generate-mstest-filter](.github/skills/generate-mstest-filter/SKILL.md) - For generating well-formed MSTest filter expressions
1416

1517
## Tools
16-
You have access to the analysis script at `[AnalyzeTestOverlap.ps1](./scripts/AnalyzeTestOverlap.ps1)`.
18+
You have access to the analysis script at [AnalyzeTestOverlap.ps1](.github/prompts/scripts/AnalyzeTestOverlap.ps1).
1719

1820
## Workflow
1921
1. **Parse or Generate Test Filter**:
2022
* If `${input:filter}` is a valid MSTest filter expression (e.g., `FullyQualifiedName~MyTests`), use it directly.
21-
* If `${input:filter}` is a loose description (e.g., "connection tests" or "SqlCommand class"), follow the instructions in the [generate-mstest-filter](../skills/generate-mstest-filter/SKILL.md) skill to generate a proper filter expression.
23+
* If `${input:filter}` is a loose description (e.g., "connection tests" or "SqlCommand class"), follow the instructions in the [generate-mstest-filter](.github/skills/generate-mstest-filter/SKILL.md) skill to generate a proper filter expression.
2224
* If `${input:filter}` is empty, ask the user for a test filter or description to target specific tests.
2325

2426
2. **Run Analysis**:
25-
* Run the script using the filter: `.\scripts\AnalyzeTestOverlap.ps1 -Filter "<filter>"`.
27+
* Run the script from the workspace root: `.\.github\prompts\scripts\AnalyzeTestOverlap.ps1 -Filter "<filter>"`.
2628
* *Note*: The script produces a console summary and a `test-coverage-analysis.json` file.
2729

2830
3. **Review Overlap**:

.github/prompts/update-build-pipelines.prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: update-build-pipelines
33
description: Guided workflow for updating Azure DevOps CI/CD pipelines for Microsoft.Data.SqlClient.
44
argument-hint: <describe the pipeline change needed>
55
agent: agent
6-
tools: ['edit/createFile', 'edit/editFiles', 'read/readFile', 'codebase/search']
6+
tools: ['edit/createFile', 'edit/editFiles', 'read/readFile', 'search']
77
---
88

99
Update the Azure DevOps build pipelines for: "${input:change}".

0 commit comments

Comments
 (0)