Skip to content

Commit a9281c1

Browse files
authored
Update copilot-instructions.md to orchestrator mode (#28639)
1 parent 3dcb14b commit a9281c1

2 files changed

Lines changed: 113 additions & 235 deletions

File tree

.github/copilot-instructions.md

Lines changed: 111 additions & 234 deletions
Original file line numberDiff line numberDiff line change
@@ -1,269 +1,146 @@
1-
# Microsoft Graph REST API Documentation Review Guidelines
1+
# Microsoft Graph docs workflow guide
22

3-
You are a content reviewer for Microsoft Graph REST API reference documentation. Use these guidelines to review pull requests (PRs) against the Microsoft Graph documentation standards outlined in the Microsoft Graph Content Development Kit (CDK).
3+
This file is the top-level routing and standards guide for Microsoft Graph docs work in this repo. Before editing or reviewing files, use the workflow and path routing below to load the correct detailed instructions.
44

5-
## Additional Documentation Resources
5+
## Required workflow
66

7-
For comprehensive authoring and review guidance, reference these files located in the `.github/prompts/` folder:
7+
Before doing any docs work, determine the task type and read the matching prompt file first.
88

9-
- **[author-api-docs.prompt.md](prompts/author-api-docs.prompt.md)**: Complete authoring guidelines for creating and updating Microsoft Graph API reference documentation, including workflows for fresh APIs, promotions, and deprecations.
10-
- **[review-api-docs.prompt.md](prompts/review-api-docs.prompt.md)**: Detailed review process guidelines that combine authoring best practices with the content standards outlined below.
9+
- **Authoring or updating docs:** read `.github/prompts/author-api-docs.prompt.md`
10+
- **Reviewing docs changes:** read `.github/prompts/review-api-docs.prompt.md`
1111

12-
These files provide in-depth guidance on:
13-
- Documentation authoring workflows and scenarios
14-
- Content structure and organization requirements
15-
- Quality standards and validation processes
16-
- Common patterns and best practices specific to Microsoft Graph API documentation
12+
Then read the scenario-specific files that those prompt files direct you to use.
1713

18-
## File Type Classifications
14+
## Scenario routing
1915

20-
This repository contains several types of files with different review requirements:
16+
Use this table when deciding which detailed guidance to load.
2117

22-
### 1. API Reference Topics (api-reference/v1.0/api/ and api-reference/beta/api/)
23-
- **Metadata attribute**: `doc_type: apiPageType`
24-
- **Purpose**: Document individual API operations (GET, POST, PATCH, DELETE, etc.)
18+
| If the task is... | Read first | Then read |
19+
| --- | --- | --- |
20+
| New beta API docs or schema additions | `.github/prompts/author-api-docs.prompt.md` | `.github/prompts/author-api-docs/common.md`, `.github/prompts/author-api-docs/public-preview.md` |
21+
| GA promotion to v1.0 | `.github/prompts/author-api-docs.prompt.md` | `.github/prompts/author-api-docs/common.md`, `.github/prompts/author-api-docs/ga.md` |
22+
| Deprecation or retirement | `.github/prompts/author-api-docs.prompt.md` | `.github/prompts/author-api-docs/common.md`, `.github/prompts/author-api-docs/deprecate-retire.md` |
23+
| Cleanup, maintenance, backfill, or one-off docs tasks | `.github/prompts/author-api-docs.prompt.md` | `.github/prompts/author-api-docs/common.md`, `.github/prompts/author-api-docs/general.md` |
24+
| Reviewing a PR, branch, or changed files | `.github/prompts/review-api-docs.prompt.md` | `.github/prompts/author-api-docs/common.md` plus the scenario-specific checklist files it references |
2525

26-
### 2. Resource Topics (api-reference/v1.0/resources/ and api-reference/beta/resources/)
27-
- **Metadata attribute**: `doc_type: resourcePageType`
28-
- **Purpose**: Document resource types (entities and complex types)
26+
### Additive guidance
2927

30-
### 3. Changelog Files (changelog/)
31-
- **Purpose**: JSON files documenting schema changes and API updates
32-
- **Naming convention**: `{WorkloadArea}.json` (e.g., `Microsoft.AAD.LCM.json`)
28+
Read these additional files whenever they apply:
3329

34-
### 4. Conceptual Content (concepts/)
35-
- These guidelines DO NOT apply to files in the `concepts/` folder
30+
- **Enumeration work:** `.github/prompts/author-api-docs/enumerations.md`
31+
- **Manual changelog authoring:** `templates/changelog-patterns.md`
32+
- **RBAC include files:** `templates/rbac-for-apis-include.md`
3633

37-
## General Review Guidelines
38-
- All files must be in lowercase; otherwise, the PR will be blocked from review and approval.
39-
- Include `Namespace: microsoft.graph*` immediately after the H1 title.
34+
## Path-based routing
4035

41-
## API Reference Topics Review Guidelines
36+
Use this table when the changed file paths are already known.
4237

43-
### ✅ Required elements
38+
| Path or file type | Required detailed guidance |
39+
| --- | --- |
40+
| `api-reference/*/api/*.md` | `.github/prompts/author-api-docs/common.md#api-method-reference-files` |
41+
| `api-reference/*/resources/*.md` | `.github/prompts/author-api-docs/common.md#resource-reference-files` |
42+
| Enum additions, promotions, updates, or deprecations | `.github/prompts/author-api-docs/enumerations.md` |
43+
| `changelog/*.json` | `.github/prompts/author-api-docs/common.md#updating-the-changelog` |
44+
| `concepts/whats-new-overview.md` | `.github/prompts/author-api-docs/common.md#updating-whats-new` |
45+
| `api-reference/*/toc/toc.mapping.json` | `.github/prompts/author-api-docs/common.md#updating-the-table-of-contents-toc` |
46+
| `api-reference/*/includes/rbac-for-apis/*.md` | `.github/prompts/author-api-docs/common.md#permissions` and `templates/rbac-for-apis-include.md` |
47+
| `temp-docstubs/` inputs and cleanup | `.github/prompts/author-api-docs/common.md#temp-docstubs-folder` and `.github/prompts/review-api-docs.prompt.md` if reviewing |
4448

45-
**Titles:**
46-
- Begin with imperative verbs (e.g., "Get", "Create", "Update")
49+
## File classes
4750

48-
**Descriptions:**
49-
- Begin with imperative verbs (e.g., "Get", "Create", "Update")
50-
- Use active voice where possible
51-
- Link to referenced resource types
51+
This repo contains several docs surfaces with different expectations:
5252

53-
**Permissions:**
54-
- Must start with the standard boilerplate text
55-
- Must have include link to a permissions table
53+
1. **API reference topics**`api-reference/v1.0/api/` and `api-reference/beta/api/`
54+
- `doc_type: apiPageType`
55+
- Individual operations such as GET, POST, PATCH, PUT, DELETE, actions, and functions
56+
2. **Resource topics**`api-reference/v1.0/resources/` and `api-reference/beta/resources/`
57+
- Usually `doc_type: resourcePageType`, except for enum definition topics which are `doc_type: enumPageType`
58+
- Entity types, complex types, and enum topics
59+
3. **Changelog files**`changelog/`
60+
- JSON records for API changes
61+
4. **What's New**`concepts/whats-new-overview.md`
62+
- Monthly customer-facing release summary
63+
5. **TOC mapping files**`api-reference/*/toc/toc.mapping.json`
64+
- Discovery and navigation for API reference content
65+
6. **RBAC include files**`api-reference/*/includes/rbac-for-apis/`
66+
- Delegated-role guidance used by API topics
5667

57-
**HTTP request:**
58-
- Relative URL instead of absolute URL. For example `/users` instead of `https://graph.microsoft.com/beta/users`
59-
- Preceded by the HTML comment `<!-- { "blockType": "ignored" } -->`
60-
- Use format `{type-id}` for placeholders where there are more than 1 ID in the URL
68+
These instructions primarily govern API reference documentation. General conceptual docs in `concepts/` usually follow other workflows, but **`concepts/whats-new-overview.md` is explicitly in scope** for API change announcements.
6169

62-
**Optional query parameters**
63-
- References to OData query parameters and supported operators should be formatted in Markdown code font, for example, `$filter`, `$filter` (`eq`), `$select`, `$expand`, `$top`, `$orderby`, `$search`
70+
## Non-negotiable repo-wide rules
6471

65-
**Function parameters**
66-
- Description of the parameter must include whether the parameter is optional or required.
72+
These rules apply across authoring and review scenarios:
6773

68-
**Request Headers:**
69-
- Include Authorization header by default
70-
- Add Content-Type header for request body operations
74+
1. **All filenames must be lowercase.**
75+
2. **Namespace declaration is required** immediately after the H1 title: `Namespace: microsoft.graph*`.
76+
3. **Beta disclaimer is required for beta files** immediately after the namespace declaration and **must be absent in v1.0 files**.
77+
4. **Work on a branch, not `main`.**
78+
5. **Examples must use full `graph.microsoft.com` URLs** and **pseudo-values**, not data type names.
79+
6. **Only `v1.0` and `beta` are valid API versions in doc URLs and examples.** Do not use test or internal environment versions such as `ppe`, `ppe-beta`, `ppe-v1.0`, `staging`, `stagingbeta`, or similar variants.
80+
7. **HTTP request sections must use relative URLs** such as `GET /users`.
81+
8. **API and resource topics must keep the standard section order** for their file type.
82+
9. **Tables must preserve required ordering rules**, including alphabetical ordering where the detailed guidance requires it.
83+
10. **Enum changes must be checked across all exposed documentation surfaces**, not only the enum definition itself.
84+
11. **Customer-visible API changes require changelog review and may require What's New updates.**
7185

72-
**Response:**
73-
- Link to returned resource types
74-
- Include optional H3 errors section
86+
## Core standards
7587

76-
**Examples:**
77-
- Example URLs must be full URLs, for example, `https://graph.microsoft.com/v1.0/users`
78-
- Domain must be `graph.microsoft.com`
79-
- Use pseudo-values instead of data types in examples
80-
- Each example must contain "Request" and "Response" block
81-
- Use H3 structure for multiple examples: "Example 1: <Description>"
82-
- Must contain HTML comment block immediately preceding JSON block with at least blockType and name attributes
83-
- "name" attribute value must be unique in the file
84-
- Remove "shortened for readability" note if no response body (i.e. `204 No Content`)
88+
Use the linked prompt files for the full standards. The rules below are the most commonly missed and should be checked first.
8589

86-
Sample valid example - response object contains pseudo-values
90+
### API topics
8791

88-
### Request
89-
# [HTTP](#tab/http)
90-
<!-- {
91-
"blockType": "request",
92-
"name": "list_application"
93-
}-->
92+
- Titles and descriptions should begin with imperative verbs.
93+
- Include the standard permissions boilerplate and permissions include.
94+
- Include the `<!-- { "blockType": "ignored" } -->` comment before the HTTP request syntax.
95+
- Function parameter descriptions must say whether the parameter is required or optional.
96+
- Examples must include Request and Response blocks, with unique `name` values in block metadata.
97+
- Do not use custom H2 headings; keep the predefined API topic order.
9498

95-
```msgraph-interactive
96-
GET https://graph.microsoft.com/v1.0/applications
97-
```
99+
### Resource topics
98100

99-
# [C#](#tab/csharp)
100-
[!INCLUDE [sample-code](../includes/snippets/csharp/list-application-csharp-snippets.md)]
101-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
101+
- Descriptions should begin with present-tense verbs.
102+
- Properties and relationships must follow the ordering rules from the detailed guidance.
103+
- JSON representation must match the Properties section.
104+
- Keep resource naming consistent across YAML title, H1, and `@odata.type` references.
105+
- Use `author-api-docs/enumerations.md` whenever enum documentation is created, updated, promoted, or deprecated.
102106

103-
# [Go](#tab/go)
104-
[!INCLUDE [sample-code](../includes/snippets/go/list-application-go-snippets.md)]
105-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
107+
### Changelog
106108

107-
# [Java](#tab/java)
108-
[!INCLUDE [sample-code](../includes/snippets/java/list-application-java-snippets.md)]
109-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
110-
111-
# [JavaScript](#tab/javascript)
112-
[!INCLUDE [sample-code](../includes/snippets/javascript/list-application-javascript-snippets.md)]
113-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
114-
115-
# [PHP](#tab/php)
116-
[!INCLUDE [sample-code](../includes/snippets/php/list-application-php-snippets.md)]
117-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
118-
119-
# [PowerShell](#tab/powershell)
120-
[!INCLUDE [sample-code](../includes/snippets/powershell/list-application-powershell-snippets.md)]
121-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
122-
123-
# [Python](#tab/python)
124-
[!INCLUDE [sample-code](../includes/snippets/python/list-application-python-snippets.md)]
125-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
126-
127-
---
128-
129-
### Response
130-
131-
The following example shows the response.
132-
133-
> **Note:** The response object shown here might be shortened for readability.
134-
135-
<!-- {
136-
"blockType": "response",
137-
"truncated": true,
138-
"@odata.type": "Collection(microsoft.graph.application)"
139-
} -->
140-
```http
141-
HTTP/1.1 200 OK
142-
Content-type: application/json
143-
144-
{
145-
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications",
146-
"value": [
147-
{
148-
"appId": "00000000-0000-0000-0000-000000000000",
149-
"identifierUris": [ "http://contoso/" ],
150-
"displayName": "My app",
151-
"publisherDomain": "contoso.com",
152-
"signInAudience": "AzureADMyOrg"
153-
}
154-
]
155-
}
156-
```
157-
158-
Sample invalid example - response object contains data types instead of pseudo-values
159-
160-
### Request
161-
<!-- {
162-
"blockType": "request"
163-
}-->
164-
165-
```http
166-
GET https://graph.microsoft.com/v1.0/applications
167-
```
168-
169-
### Response
170-
171-
The following example shows the response.
172-
173-
> **Note:** The response object shown here might be shortened for readability.
174-
175-
```http
176-
HTTP/1.1 200 OK
177-
Content-type: application/json
178-
179-
{
180-
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#applications",
181-
"value": [
182-
{
183-
"appId": "String(identifier)",
184-
"identifierUris": [ String],
185-
"displayName": "String",
186-
"publisherDomain": "String",
187-
"signInAudience": "String"
188-
}
189-
]
190-
}
191-
```
109+
- Use the same `Id` value across related `ChangeList` items and the record-level `Id`.
110+
- Use valid `Cloud`, `Version`, and `CreatedDateTime` values.
111+
- Use full Learn URLs in descriptions.
112+
- For manual changelog authoring, use `templates/changelog-patterns.md`.
192113

193-
### Common Issues to Flag
114+
## Common change patterns
194115

195-
- TODO placeholders in descriptions
196-
- Missing permissions include statements
197-
- Missing HTTP request syntax
198-
- Custom H2 sections - only the following predefined H2 headings allowed, in order: Permissions, HTTP request, Function parameters, Optional query parameters, Request headers, Request body, Response, Examples, Related content
116+
- **New schema in beta:** update affected API/resource docs, enum docs, changelog, TOC, and What's New if the change is customer-visible.
117+
- **Promotion to v1.0:** use the GA workflow, keep beta and v1.0 aligned where intended, remove beta-only content, update changelog, and add a What's New entry.
118+
- **Enum member additions:** update the enum definition, any inline value listings, and every API/resource page that enumerates supported values.
119+
- **Deprecation or retirement:** update banners and table entries, related references, changelog, What's New, redirects, and TOC as applicable.
120+
- **Cleanup-only changes:** usually do not require changelog or What's New updates.
199121

200-
## Resource Topics Review Guidelines
122+
## Validation summary
201123

202-
### ✅ Required Elements
203-
204-
**Descriptions:**
205-
- Begin with present-tense verbs ("represents", "contains")
206-
- Use active voice where possible
207-
- Don't use resource name to describe purpose
208-
- Single sentence with additional context in separate paragraphs
209-
210-
**Methods Table:**
211-
- Use succinct method names (avoid repeating resource name)
212-
- CRUD operations: List, Create, Get, Update, Delete
213-
- Actions/functions: Use name without binding parameter
214-
215-
**Properties:**
216-
- List in alphabetical order
217-
- Use noun phrases with periods
218-
- If the table is empty but still shows the table header, replace the table with the text "None." to indicate no properties are defined at this level.
219-
- Style property references with **bold**
220-
- Style resource references with **bold** or link to resource
221-
- Style enum values with inline code (backticks)
222-
- Document filterable properties with `$filter` support
223-
224-
**Relationships:**
225-
- List in alphabetical order
226-
227-
**JSON representation:**
228-
- List of properties and return types must match the properties section
229-
230-
### ❌ Common Issues to Flag
231-
232-
- Resource names not in lower camel case
233-
- Properties not in alphabetical order
234-
- Custom H2 sections - only the following predefined H2 headings allowed, in order: Methods, Properties, Relationships, Related content
235-
- Resource name inconsistency: If a resource is named `resourceXyz`, the resource name must be an exact match (including casing) in all 4 locations: metadata page title, H1 page title, HTML comment block `@odata.type` in JSON representation section, and JSON `@odata.type` in JSON representation section. If these don't match, question whether the file was autogenerated by Graph Studio and advise the author to only use autogenerated doc stubs.
236-
237-
## Changelog Files Review Guidelines
238-
239-
### ✅ Required Elements
240-
241-
**ChangeList Record Properties:**
242-
- Same Id value across related changes
243-
244-
**Additional Properties:**
245-
- Allowed **Cloud** values: `Prod`
246-
- Allowed **Version** values: `v1.0` or `beta`
247-
- Proper UTC DateTime format for **CreatedDateTime** properties
248-
249-
**Link Format:**
250-
- Use full HTTP URLs with en-us locale
251-
- Include version parameter without preserve-view=true
252-
- Example: `https://learn.microsoft.com/en-us/graph/api/resources/call?view=graph-rest-beta`
253-
254-
### ❌ Common Issues to Flag
255-
256-
- Multiple API elements in single record
257-
- Missing or incorrect descriptions
258-
- Malformed links
259-
260-
## Version-Specific Guidelines
261-
262-
### v1.0 Endpoint Files
263-
- Remove beta disclaimer
264-
- URLs in API files should reference the `/v1.0` endpoint, not `/beta` endpoint
265-
266-
### Beta Endpoint Files
267-
- Must include beta disclaimer immediately after the namespace declaration
124+
Use the detailed prompt files for the complete validation workflow. At minimum:
268125

126+
- Validate changelog JSON when `changelog/*.json` changes.
127+
- Validate `temp-docstubs` cleanup when `temp-docstubs/` was used.
128+
- Apply the scenario-specific quality checklist from the prompt files you loaded.
129+
- Re-check enum consistency, beta vs v1.0 differences, and cross-file references when those surfaces changed.
130+
131+
## When multiple guides apply
269132

133+
- `.github/prompts/author-api-docs/common.md` applies to all authoring scenarios once you begin the workflow.
134+
- `.github/prompts/author-api-docs/enumerations.md` is additive whenever enums are created, changed, promoted, or deprecated.
135+
- `templates/changelog-patterns.md` is only needed for manual changelog authoring.
136+
- `templates/rbac-for-apis-include.md` is only needed when creating or updating RBAC include files.
137+
- `review-api-docs.prompt.md` should be treated as the review workflow authority when the task is review-focused.
138+
139+
## Use directive wording, not optional wording
140+
141+
Treat linked guidance as required when its trigger condition is met.
142+
143+
- **Before editing API reference docs, read the authoring prompt file first.**
144+
- **Before reviewing docs changes, read the review prompt file first.**
145+
- **If enum documentation is affected, also read the enum guidance file.**
146+
- **If changelog or What's New is in scope, follow the shared process rules in `common.md`.**

.github/prompts/author-api-docs/enumerations.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ Create a dedicated topic for the enumeration. This option is rarely applicable.
126126

127127
1. **Create enum topic:**
128128
- Title: "{enum-type} enum type"
129-
- Single sentence describing the enum's purpose
129+
- doc_type: "enumPageType"
130+
- Single sentence describing the enum's purpose, linking to consuming resource(s)
130131
- **For flagged enums:** Append "This flagged enumeration allows multiple members to be selected simultaneously." to the introductory text.
131132
- **For evolvable enums:** Mention it's an evolvable enumeration
132133

0 commit comments

Comments
 (0)