Skip to content

Commit 8d82204

Browse files
committed
chore(copilot): Add Copilot instructions file to improve its capabilities as far as possible
1 parent 1966171 commit 8d82204

File tree

1 file changed

+133
-0
lines changed

1 file changed

+133
-0
lines changed

.github/copilot-instructions.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,139 @@ Apps declare capabilities via `<UnoFeatures>`: Material, MVUX, Navigation, Hosti
161161
- Supported cultures in `appsettings.json`: `LocalizationConfiguration.Cultures`
162162
- Inject `IStringLocalizer` for translated strings
163163
- Documentation exists in `docs/articles/en/` and `docs/articles/de/`
164+
- **German documentation style**: Use informal "Du" form (duzen) instead of formal "Sie" form. Address readers directly and personally (e.g., "du kannst", "dein Model", "wenn du"). German docs should feel like peer-to-peer communication, not formal instruction.
165+
166+
## Documentation Guidelines
167+
168+
### DocFX Markdown Best Practices
169+
170+
#### Code Snippets and Regions
171+
- Use `<!-- #region RegionName -->` and `<!-- #endregion -->` in XAML files for DocFX code snippet references
172+
- Reference snippets in markdown: `[!code-xaml[](../../../../src/ProjectName/File.xaml#RegionName)]`
173+
- Use relative paths from the markdown file location (e.g., `../../../../src/...`) or tilde notation (`~/src/...`)
174+
- Never use `#region-Name` or `<!--region: Name-->` syntax - these are incorrect
175+
- Highlight specific lines: `[!code-xaml[](path#RegionName?highlight=15,18,22)]` where line numbers are relative to the region
176+
177+
#### Images and Attachments
178+
- Store images in `docs/articles/.attachments/` folder
179+
- Reference images using relative paths from the markdown file: `![](./.attachments/ImageName.png)`
180+
- **Always verify image paths are correct** relative to the markdown file location, not from `docfx.json`
181+
- DocFX resolves image paths relative to the markdown file itself, not from a central config
182+
183+
#### Formatting Rules
184+
- **Never use emoji in documentation** (✅, ❌, etc.) - DocFX may not render them correctly
185+
- Use plain markdown bullets, numbered lists, or bold text instead
186+
- **Never add inline comments in code samples** - they may not render properly in DocFX
187+
- Always place code explanations in separate text sections below code blocks
188+
- **Tab heading indentation**: When using DocFX tabs (`#### [Tab Name](#tab/tabid)`), ensure the tab heading level is **one level deeper** than its parent section heading
189+
- Example: If the parent section is `### Section Name`, tab headings should be `#### [Tab Name](#tab/tabid)`
190+
- Example: If the parent section is `## Section Name`, tab headings should be `### [Tab Name](#tab/tabid)`
191+
- **Markdown linting**: Pay attention to proper markdown formatting
192+
- Avoid extra blank lines between sections (use single blank line)
193+
- Ensure proper spacing around lists (blank line before and after list blocks)
194+
- No trailing whitespace at end of lines
195+
- Files should end with a single newline character
196+
- **MD028 - No blank lines between alert boxes**: When using consecutive alert boxes (e.g., `> [!WARNING]`, `> [!NOTE]`), do NOT add blank lines between them
197+
- Correct: Alert boxes directly after each other without blank lines
198+
- Incorrect: Blank line separating consecutive alert boxes
199+
- Example:
200+
```markdown
201+
> [!WARNING]
202+
> First warning message
203+
> [!NOTE]
204+
> Following note without blank line between
205+
```
206+
- Example:
207+
```markdown
208+
```csharp
209+
public IState<string> Name => State.Value(this, () => "default");
210+
```
211+
212+
This state holds the user's name with a default value.
213+
```
214+
215+
#### Alert Boxes (Callouts)
216+
Use alert boxes strategically to highlight important information without creating "rainbow docs":
217+
218+
- **When to use alert boxes:**
219+
- `> [!WARNING]` - Critical pitfalls that will cause errors or crashes (e.g., ListView ItemClickCommand conflicts)
220+
- `> [!TIP]` - Decision-making guidance or useful features (e.g., "When to use Value vs Async", FeedParameter benefits)
221+
- `> [!NOTE]` - Important design rationale or context (e.g., why button-triggered vs ForEach callbacks)
222+
- `> [!IMPORTANT]` - Essential requirements or prerequisites
223+
224+
- **When NOT to use alert boxes:**
225+
- For general explanations (use regular text)
226+
- For every bullet list (reserve for truly important items)
227+
- More than 3-4 alert boxes per tutorial page (avoid "rainbow docs")
228+
229+
- **Best practices:**
230+
- Limit to 3-4 strategically placed alert boxes per document
231+
- Use WARNING for errors/crashes, TIP for choices/features, NOTE for rationale
232+
- Convert existing bold text lists to alert boxes only if they represent critical decisions or warnings
233+
- Keep the content inside concise and focused
234+
235+
#### Tutorial Structure Pattern
236+
When creating tutorial documentation, follow this consistent structure:
237+
238+
1. **Overview Section**
239+
- Brief description of what will be built
240+
- Bullet list of key features/learning goals
241+
- Explanation of why this pattern/approach is needed
242+
243+
2. **Prerequisites Section**
244+
- List required prior knowledge or tutorials that should be completed first
245+
- Link to previous tutorials in the learning path using xref links (e.g., "Complete [Tutorial Name](xref:uid-of-tutorial) first")
246+
- For "getting started" tutorials at the beginning of a new chapter: link to general app setup guides
247+
- Use language-appropriate links: English docs (`/en/`) link to English guides, German docs (`/de/`) link to German guides
248+
- Prefer `xref:` links for internal documentation references instead of relative paths
249+
- Example: "Before starting this tutorial, ensure you have completed [How to: Basic MVUX Setup](xref:howto-basic-mvux-setup)"
250+
251+
**Common Getting Started Docs to Link:**
252+
253+
- **Root-level basics** (in `docs/articles/en/` or `docs/articles/de/`):
254+
- `HowTo-Setup-DevelopmentEnvironment-*.md` (UID: `DevTKSS.Uno.Setup.DevelopmentEnvironment.en` or `.de`) - For first-time setup prerequisites
255+
- `HowTo-CreateApp-*.md` (UID: `DevTKSS.Uno.Setup.HowTo-CreateNewUnoApp.en` or `.de`) - For app creation fundamentals
256+
- `HowTo-Adding-New-Pages-*.md` (UID: `DevTKSS.Uno.Setup.HowTo-AddingNewPages.en` or `.de`) - For basic page creation
257+
- `HowTo-Adding-New-VM-Class-Record-*.md` (UID: `DevTKSS.Uno.Setup.HowTo-AddingNew-VM-Class-Record.en` or `.de`) - For MVUX Model creation basics
258+
- `HowTo-Using-DI-in-ctor-*.md` (UID: `DevTKSS.Uno.Setup.Using-DI-in-ctor.en` or `.de`) - For dependency injection fundamentals
259+
- `Introduction-*.md` (UID: `DevTKSS.Uno.SampleApps.Intro.en` or `.de`) - For general project introduction
260+
261+
- **Topic-specific getting started** (in subdirectories like `Navigation/`, `Mvux-StateManagement/`):
262+
- `Navigation/Extensions-Navigation-*.md` - For navigation system fundamentals
263+
- `Navigation/HowTo-RegisterRoutes-*.md` - For route registration basics
264+
- `Navigation/HowTo-UpgradeExistingApp-*.md` - For adding navigation to existing apps
265+
- Link to these when starting a tutorial within that specific topic area
266+
- Check the `uid:` field in each markdown file's front matter for the correct xref link
267+
268+
3. **Visual Reference** (if available)
269+
- Screenshot or diagram showing the end result
270+
- Place after prerequisites, before implementation details
271+
272+
4. **Model/Backend Setup**
273+
- Show the data layer first (Model, services, states)
274+
- Use tabbed sections for alternative approaches (e.g., `.Async()` vs `.Value()`)
275+
- Explain key elements with bullet points below code samples
276+
277+
5. **View/UI Implementation**
278+
- Show XAML/UI code after the model is defined
279+
- Highlight key binding lines in code snippets
280+
- Add warning callouts for common pitfalls
281+
- Explain bindings in bullet points
282+
283+
6. **Command/Logic Implementation**
284+
- Show methods that handle user interactions
285+
- Explain the "why" behind design decisions
286+
- Use bullet points to highlight key API usage
287+
288+
7. **Advanced Topics** (optional)
289+
- Attributes, optimization techniques, alternatives
290+
- Show code variations with explanations
291+
292+
8. **Summary Section**
293+
- Numbered list of what was demonstrated (no emojis)
294+
- Key takeaway or pattern reinforcement
295+
296+
This flow follows: **Prerequisites → See what we're building → Build the foundation → Connect the UI → Add behavior → Master advanced techniques**
164297
165298
## Build & Development
166299

0 commit comments

Comments
 (0)