You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+40-42Lines changed: 40 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,32 @@ ms.date: 07-29-2025
9
9
## Introduction
10
10
This document contains repository-specific instructions for GitHub Copilot when assisting with the `dotnet/AspNetCore.Docs` repository. **Unless otherwise specified, all ".NET" references refer to modern .NET, not .NET Framework.**
11
11
12
+
## General Guidelines
13
+
14
+
### Issue Handling
15
+
When creating a PR for an issue:
16
+
1. Read the full issue and all linked references
17
+
2. Study code samples from linked PRs for pre-release features
18
+
3. For labeled issues:
19
+
-**new-feature:** State which version introduced the feature
20
+
-**bug:** Focus on correcting technical inaccuracies
21
+
4. When you're assigned an issue, after you've completed your work and the workflows (status checks) have run, check to make sure there are no build warnings under the OpenPublishing.Build status check. If there are, open the build report (under View Details) and resolve any build warnings you introduced.
22
+
23
+
### Markdown File Naming and Organization
24
+
- If you're adding a new Markdown file, it should be named in all lowercase with hyphens separating words. Also, omit any filler words such as "the" or "a" from the file name.
25
+
26
+
### API References and Verification
27
+
- Never guess API documentation IDs, always verify. If unable to verfy, say so.
28
+
- Check if features were introduced after .NET Core 3.1
29
+
- Default to most compatible syntax when uncertain
30
+
31
+
### Links and References
32
+
- Use relative links for files within this repo
33
+
- When adding external links into a document, strip out the language/culture segment of the URL if present (example: remove the `en-us` or `en` part of links to English versions of webpages)
34
+
- For learn.microsoft.com links, remove `https://learn.microsoft.com/en-us` from URLs
35
+
- Use cross-references for APIs: `<xref:api-doc-ID>`
36
+
- Get doc ID from the relevant XML doc in dotnet-api-docs, and omit the first two characters of the doc ID
37
+
12
38
## Repository-Specific Guidelines
13
39
- Follow the [Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/welcome/)
14
40
-**Repository Exceptions**:
@@ -21,30 +47,13 @@ This document contains repository-specific instructions for GitHub Copilot when
21
47
- The correct order of metadata lines is to place the title (`title`) first and the rest of the metadata lines in alphabetical order. Example: `title`, `author`, `description`, `monikerRange`, `ms.author`, `ms.custom`, `ms.date`, `uid`, `zone_pivot_groups`
22
48
- Metadata `ms.date: <today's date>` with a format of MM-DD-YYYY. If the file already has a `ms.date` metadata, update it to today's date if more than 50 characters are changed in the file.
- Never guess API documentation IDs, always verify. If unable to verfy, say so.
34
-
- Check if features were introduced after .NET Core 3.1
35
-
- Default to most compatible syntax when uncertain
36
-
37
-
## Links and References
38
-
- Use relative links for files within this repo
39
-
- When adding external links into a document, strip out the language/culture segment of the URL if present (example: remove the `en-us` or `en` part of links to English versions of webpages)
40
-
- For learn.microsoft.com links, remove `https://learn.microsoft.com/en-us` from URLs
41
-
- Use cross-references for APIs: `<xref:api-doc-ID>`
42
-
- Get doc ID from the relevant XML doc in dotnet-api-docs, and omit the first two characters of the doc ID
43
-
44
-
## Markdown File Naming and Organization
45
-
- If you're adding a new Markdown file, it should be named in all lowercase with hyphens separating words. Also, omit any filler words such as "the" or "a" from the file name.
46
-
47
-
## Code Snippets
56
+
### Code Snippets
48
57
- For snippets **longer than 6 lines**:
49
58
- Place in separate `.cs` file in a `snippets` folder next to the Markdown file
50
59
- Create a subfolder named after the document
@@ -66,21 +75,20 @@ This document contains repository-specific instructions for GitHub Copilot when
66
75
```
67
76
- Use the latest, non-preview C# coding patterns in non-preview code examples
68
77
- Use the latest preview C# coding patterns in preview code examples
78
+
- Use the following code language and indentation standards for markdown code blocks or the `language` attribute of code snippets:
69
79
70
-
The following table indicates the code language to use for markdown code blocks or the `language` attribute of a code snippet and the amount of indentation to use.
80
+
Content of the snippet | Code language | Indentation in spaces
81
+
:---: | :---: | :---:
82
+
C# | csharp | 4
83
+
HTML | html | 4
84
+
CSS | css | 4
85
+
JavaScript | javascript | 2 (4 spaces for line continuation)
86
+
XML | xml | 2
87
+
JSON | json | 2
88
+
Console | console | 2
89
+
Text | - | 2
71
90
72
-
Content of the snippet | Code language | Indentation in spaces
73
-
:---: | :---: | :---:
74
-
C# | csharp | 4
75
-
HTML | html | 4
76
-
CSS | css | 4
77
-
JavaScript | javascript | 2 (4 spaces for line continuation)
78
-
XML | xml | 2
79
-
JSON | json | 2
80
-
Console | console | 2
81
-
Text | - | 2
82
-
83
-
## ASP.NET Core Specific Guidelines
91
+
### ASP.NET Core Specific Guidelines
84
92
- Use the latest supported version for examples unless otherwise specified
85
93
- Title and section header casing is sentence case (capitalize the first word and any proper nouns)
86
94
- For parts of a title or section header that normally use code style in article text (backticks around the content), also use code style in the title or section header (example H1 header: "# Modify the `Program.cs` file")
@@ -90,13 +98,3 @@ Text | - | 2
90
98
- Lead with Microsoft recommended approaches
91
99
- Include differences between Minimal API and controller-based approaches when relevant
92
100
- For middleware content and examples, use the middleware class approach
93
-
94
-
## Issue Handling
95
-
When creating a PR for an issue:
96
-
1. Read the full issue and all linked references
97
-
2. Study code samples from linked PRs for pre-release features
98
-
3. For labeled issues:
99
-
- **new-feature:** State which version introduced the feature
100
-
- **bug:** Focus on correcting technical inaccuracies
101
-
4. When you're assigned an issue, after you've completed your work and the workflows (status checks) have run, check to make sure there are no build warnings under the OpenPublishing.Build status check. If there are, open the build report (under View Details) and resolve any build warnings you introduced.
0 commit comments