Skip to content

Commit bf7d009

Browse files
committed
added moniker support
1 parent ac15b5c commit bf7d009

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

.github/chatmodes/dev-focused.chatmode.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Otherwise proceed with best-effort assumptions (state them briefly).
8080
• Technical Accuracy: Validate code examples and technical content
8181
• Accessibility: Ensure content is accessible to all users
8282
• Consistency: Align with existing Microsoft Learn patterns
83+
• Version-Specific Content: Identify moniker ranges (:::moniker range="<version>" ... :::moniker-end) and ensure edits respect version boundaries
8384

8485
### Code Change Process
8586
• Analyze the code's purpose and context

.github/instructions/dev-focused.instructions..md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,87 @@ Instructions for Foundry Dev-Focused Chat Mode
2727
* Always include prerequisites: Add bullet lists with dependencies and assumptions for each code section
2828
* Clearly explain the input and output of an example; in some cases, the input is "bad" data or the expected output is an error. Call these out so the user understands what the example does and the output to expect. Also to reduce change requests to "fix" bad data.
2929

30+
# Version-Specific Content (Monikers)
31+
32+
Some articles contain version-specific content using moniker ranges. Monikers allow a single article to serve multiple product versions by tagging sections that apply only to specific versions.
33+
34+
## Understanding Monikers
35+
36+
### Moniker Metadata
37+
Articles that support multiple versions declare this in the YAML frontmatter:
38+
```yaml
39+
monikerRange: '<version 1> || <version 2>'
40+
```
41+
42+
### Moniker Range Blocks
43+
Version-specific content is wrapped in moniker range tags:
44+
```markdown
45+
:::moniker range="<version 1>"
46+
[Content that applies ONLY to version 1]
47+
:::moniker-end
48+
```
49+
50+
### Untagged Content
51+
Any content NOT wrapped in moniker tags applies to ALL versions listed in the document's `monikerRange` metadata.
52+
53+
## Critical Moniker Editing Rules
54+
55+
When reviewing or editing articles with monikers, you MUST:
56+
57+
1. **Identify all moniker ranges** before suggesting any edits. Scan the article for `:::moniker range="<version>"` and `:::moniker-end` pairs.
58+
59+
2. **Preserve moniker syntax exactly**. Never:
60+
- Delete or malform `:::moniker range="<version>"` opening tags
61+
- Delete or malform `:::moniker-end` closing tags
62+
- Break the pairing between opening and closing tags
63+
- Introduce typos in the version identifiers
64+
65+
3. **Respect version boundaries**. When editing content:
66+
- Content inside a moniker block applies ONLY to that version
67+
- Do NOT move content out of a moniker block unless explicitly instructed
68+
- Do NOT add content inside a moniker block if it should apply to all versions
69+
- Do NOT duplicate content across multiple moniker blocks unless intentional
70+
71+
4. **Treat each moniker range as a discrete unit**:
72+
- Edits to version 1-specific content must stay within the `:::moniker range="<version 1>"` block
73+
- Edits to version 2-specific content must stay within the `:::moniker range="<version 2>"` block
74+
- Edits to shared content must remain OUTSIDE any moniker blocks
75+
76+
5. **Flag version-specific concerns** in your recommendations:
77+
- Note when suggested changes affect only one version
78+
- Identify when similar changes might be needed across multiple version blocks
79+
- Warn if moving content would change its version applicability
80+
81+
## Common Moniker Patterns
82+
83+
- **Next steps sections**: Often version-specific with different links for each API version
84+
- **Code examples**: May differ significantly between versions, requiring separate moniker blocks
85+
- **Deprecated features**: Typically wrapped in the older version's moniker range with deprecation notices
86+
- **New features**: Often in newer version moniker blocks only
87+
88+
## Example: Safe Edit Within Monikers
89+
90+
**Before:**
91+
```markdown
92+
:::moniker range="<version 1>"
93+
To deploy the model, use the `AciWebservice.deploy_configuration()` method.
94+
:::moniker-end
95+
```
96+
97+
**Safe Edit (preserves moniker boundary):**
98+
```markdown
99+
:::moniker range="<version 1>"
100+
To deploy the model, use the `AciWebservice.deploy_configuration()` method. For more information, see [Deploy models](./v1/how-to-deploy-and-where.md).
101+
:::moniker-end
102+
```
103+
104+
**Unsafe Edit (breaks moniker):**
105+
```markdown
106+
To deploy the model, use the `AciWebservice.deploy_configuration()` method. For more information, see [Deploy models](./v1/how-to-deploy-and-where.md).
107+
:::moniker-end
108+
```
109+
*(The opening tag was deleted - content now incorrectly applies to all versions)*
110+
30111
# Pattern and schema compliance
31112

32113
Ensure that the article complies with the relevant patterns, as listed below. Instructions for the pattern are contained in comments in the referenced file.

.github/prompts/dev-focused.prompt.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ description: 'Evaluate Markdown documentation for developer audiences and produc
55

66
Evaluate a Markdown article and produce a prioritized edit plan. Do not apply changes. Follow behavioral rules defined in the paired chatmode; this prompt adds task-specific evaluation criteria and output expectations.
77

8+
## Referenced Instruction Files
9+
10+
Reference the instruction files below for detailed guidance. Make sure your recommendations incorporate this information.
11+
12+
- .github/copilot-instructions.md
13+
- .github/instructions/dev-focused.instructions.md
14+
- .github/instructions/foundry-branding.instructions.md
15+
816
## Goals
917

1018
### Core goals
@@ -91,6 +99,7 @@ Assess along these dimensions:
9199
8. References: Each snippet followed by a references line to official docs only.
92100
9. Visual aids: Suggest a diagram when multi-service architecture or >3 conceptual steps.
93101
10. Language & style: Active voice, second person, sentence case headings.
102+
11. Version-specific content: Identify moniker ranges (`:::moniker range="<version>"` ... `:::moniker-end`) and ensure all edits preserve moniker boundaries and respect version applicability. See `.github/instructions/dev-focused.instructions.md` for details.
94103

95104
### Content & code best practices
96105

0 commit comments

Comments
 (0)