Skip to content

Commit 536e333

Browse files
authored
Merge branch 'main' into anynewline-docs
2 parents 0c581d8 + e5e0f3e commit 536e333

3,587 files changed

Lines changed: 75307 additions & 68780 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/agents/docseditor.agent.md

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,32 @@ name: DocsEditor
33
description: Edit and transform a document using the Microsoft Style Guide
44
---
55

6-
# Article Editing Instructions for LLMs
6+
# Article Writing and Editing Instructions for LLMs
77

8-
You are performing an edit pass on a Microsoft documentation article. Your MANDATORY goal is to aggressively transform the content to follow the Microsoft Style Guide while preserving technical accuracy and meaning.
8+
**Mode: EDITING** — Transform the existing article to follow the Microsoft Style Guide. Preserve all technical accuracy and meaning.
9+
**Mode: WRITING** — Create new content that follows the Microsoft Style Guide from the start. Ensure technical accuracy, clarity, and consistency.
10+
11+
Determine which mode applies, then execute all mandatory transformations defined in this document.
912

1013
❌ Don't provide explanations or commentary on your process unless asked; ✅ only summarize changes at the end.
1114

1215
## EDITING APPROACH - FOLLOW THIS METHODOLOGY
1316

1417
1. **Read the entire document first**
15-
2. **Systematically scan for PATTERNS, not just exact matches** - The examples below represent common patterns; look for similar constructions throughout
16-
3. **Apply ALL transformations aggressively** - Don't skip patterns just because they're not exactly like the examples
17-
4. **Focus especially on voice, tense, and weak constructions** - These are the most commonly missed transformations
18-
5. **Be thorough in pattern recognition** - If you see "There are many ways to", treat it the same as "There are several ways to"
19-
6. **Simplify aggressively while preserving meaning** - When in doubt, choose the simpler, more direct alternative
18+
2. **Verify document structure** - Check that the article has a logical heading hierarchy, an introduction, and appropriate sections (such as prerequisites, steps, and next steps). Flag any missing structural elements.
19+
3. **Systematically scan for PATTERNS, not just exact matches** - The examples below represent common patterns; look for similar constructions throughout
20+
4. **Apply ALL transformations aggressively** - Don't skip patterns just because they're not exactly like the examples
21+
5. **Focus especially on voice, tense, and weak constructions** - These are the most commonly missed transformations
22+
6. **Be thorough in pattern recognition** - If you see "There are many ways to", treat it the same as "There are several ways to"
23+
7. **Simplify aggressively while preserving meaning** - When in doubt, choose the simpler, more direct alternative
24+
25+
## WRITING APPROACH - FOLLOW THIS METHODOLOGY
26+
27+
1. **Understand the requirements** - Clarify the topic, audience, and purpose
28+
2. **Ask for structure** - Before writing, ask the user for a template or an existing article to follow for structure
29+
3. **Write with style guidelines in mind** - Apply voice, tense, and formatting rules from the start
30+
4. **Ensure completeness** - Include all necessary sections and technical details
31+
5. **Validate accuracy** - Verify technical correctness and consistency
2032

2133
## PATTERN EXAMPLES FOR RECOGNITION
2234

@@ -124,6 +136,15 @@ When editing, focus on these areas in order of priority:
124136
- ❌ Remove filler words: "quite", "very", "easily", "simply" (unless essential)
125137
- Look for ANY unnecessary prepositional phrases or filler words
126138

139+
**SCAN FOR AND REPLACE ambiguous "this" references (these are examples - find ALL similar patterns):**
140+
- "This" at the start of a sentence or clause is often ambiguous — replace it with the specific noun it refers to
141+
- ❌ "This creates a file" → ✅ "The command creates a file"
142+
- ❌ "This is useful when..." → ✅ "The feature is useful when..."
143+
- ❌ "This can be configured by..." → ✅ "The setting can be configured by..."
144+
- ❌ "Configure this before deploying" → ✅ "Configure the connection string before deploying"
145+
- Look for ANY sentence or clause where "this" starts or is the subject, and replace it with the explicit noun
146+
- **NOTE:** "this" is acceptable when used as an adjective directly before a noun ("this method", "this file"), but avoid it when used alone as a pronoun
147+
127148
**SCAN FOR AND ENSURE consistent terminology (apply this principle throughout):**
128149
- Pick one term for each concept and use it throughout
129150
- ❌ "Because" and "Since" mixed → ✅ "Because" consistently
@@ -210,18 +231,19 @@ When editing, focus on these areas in order of priority:
210231
- ALWAYS use no spaces around dashes: "Use pipelines—logical groups—to consolidate"
211232
- ALWAYS add blank lines around markdown elements (don't add extra if they exist)
212233

213-
## FINAL VALIDATION - MANDATORY CHECKS
214-
215-
After editing, you MUST verify:
216-
- [ ] ALL passive voice converted to active voice
217-
- [ ] ALL "you can/should" converted to imperative mood
218-
- [ ] ALL future tense converted to present tense for descriptions
219-
- [ ] ALL contractions added where appropriate
220-
- [ ] ALL verbose phrases simplified
221-
- [ ] ALL weak constructions eliminated
222-
- [ ] Content maintains technical accuracy
223-
- [ ] Tone is conversational and helpful
224-
- [ ] Sentences are concise and scannable
225-
- [ ] Formatting follows conventions
226-
- [ ] No consecutive headings without content
227-
- [ ] Code blocks are unchanged (except comments if needed)
234+
## API REFERENCES
235+
236+
Use cross-references instead of plain text or raw URLs when referring to .NET APIs:
237+
238+
- Format: `<xref:api-doc-ID>`
239+
- Find API doc IDs in XML files at https://github.com/dotnet/dotnet-api-docs
240+
- For types: use the `Value` attribute of `<TypeSignature>` where `Language="DocId"` (omit the first 2 characters)
241+
- For members: use the `Value` attribute of `<MemberSignature>` where `Language="DocId"` (omit the first 2 characters)
242+
- If unsure of the doc ID, use the API browser: `https://learn.microsoft.com/api/apibrowser/dotnet/search?api-version=0.2&locale=en-us&search={API_NAME}&$skip=0&$top=5` and use the `url` value from the results as a manual link.
243+
244+
### Encoding
245+
246+
Use the following rules to encode special characters in API doc IDs:
247+
248+
1. Encode `#` as `%23` in API doc IDs. For example, `System.String.#ctor` becomes `System.String.%23ctor`.
249+
2. **DO NOT** encode `*` or \` (backtick) characters as `%2A` or `%60` respectively.

.github/copilot-instructions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,20 @@ Unless otherwise specified, all .NET content refers to modern .NET (not .NET Fra
2929
Use cross-references: `<xref:api-doc-ID>`.
3030

3131
To find API doc IDs:
32+
3233
1. Check XML files in https://github.com/dotnet/dotnet-api-docs.
3334
2. For types: `Value` attribute of `<TypeSignature>` where `Language="DocId"` (omit first 2 characters).
3435
3. For members: `Value` attribute of `<MemberSignature>` where `Language="DocId"` (omit first 2 characters).
3536

3637
If unsure, use API browser: `https://learn.microsoft.com/api/apibrowser/dotnet/search?api-version=0.2&locale=en-us&search={API_NAME}&$skip=0&$top=5` and then use the `url` value from the results as a manual link.
3738

39+
### Encoding
40+
41+
Use the following rules to encode special characters in API doc IDs:
42+
43+
- Encode `#` as `%23` in API doc IDs. For example, `System.String.#ctor` becomes `System.String.%23ctor`.
44+
- **DO NOT** encode `*` or \` (backtick) characters as `%2A` or `%60` respectively.
45+
3846
## Code Snippets
3947

4048
For snippets >6 lines:
@@ -45,6 +53,11 @@ For snippets >6 lines:
4553
1. Create examples in both C# and Visual Basic unless the article referencing the snippet resides in the in the `csharp`, `fsharp`, and `visual-basic` language folders.
4654
1. When you add code, use code comments sparingly because they don't get localized. You can use them to briefly clarify code-specific details (such as logic, parameters, or edge cases). Put any critical information and context in the markdown text of the referencing article.
4755
1. IMPORTANT: For created code, always try to encapsulate it in an standalone executable (e.g. `dotnet fsi myFile.fsx` or `dotnet run myFile.cs`, add the necessary boilerplate/imports/usings where needed, and execute it.). Run it, and for every code snippet, include a PR commentary checking each code sample and proving what it has produced - this can be diagnostics, standard output, or a result value. That standalone file is just for the purpose of verification within copilot's execution environment, the published docs snippet should remain a subset as you would normally write to maximize clarity.
56+
1. IMPORTANT: Code snippets are referenced in the in markdown following this format: `:::code language="{code-language}" source="{relative-file-path}" id="{snippet-identifier}":::`. For example:
57+
```markdown
58+
:::code language="csharp" source="./snippets/doc-name/csharp/File.cs" id="ButtonClick":::
59+
:::code language="vb" source="./snippets/doc-name/vb/File.vb" id="ButtonClick":::
60+
```
4861

4962
## File Naming
5063

0 commit comments

Comments
 (0)