Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 40 additions & 43 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
# GitHub Copilot Instructions (WindowsAppSDK-Samples)

Read scripts first; improve their headers instead of duplicating detail here.

## Build
Use only `build.ps1` / `build.cmd`. Read `build.ps1` before invoking. It auto: detects platform, picks solutions (current dir > selected sample > all), initializes VS DevShell, restores via local nuget, emits `.binlog` per solution. Do NOT hand-roll msbuild/nuget restore logic.

## Versions
Run `UpdateVersions.ps1` only after reading it. Get the WinAppSDK version string from: https://www.nuget.org/packages/Microsoft.WindowsAppSdk/ (stable/preview/servicing) and pass as `-WinAppSDKVersion`.

## Coding Guidelines
- Small, focused diffs; no mass reformatting; ensure SOLID principles.
- Preserve APIs, encoding, line endings, relative paths.
- PowerShell: approved verbs; each new script has Synopsis/Description/Parameters/Examples header.
- C#/C++: follow existing style; lean headers; forward declare where practical; keep samples illustrative.
- Minimal necessary comments; avoid noise. Centralize user strings for localization.
- Never log secrets or absolute external paths.

## Language style rules
- Always enforce repo analyzers: root `.editorconfig` plus any `stylecop.json`.
- C# code follows StyleCop.Analyzers and Microsoft.CodeAnalysis.NetAnalyzers.
- C++ code honors `.clang-format` plus `.clang-tidy` (modernize/cppcoreguidelines/readability).
- Markdown files wrap at 80 characters and use ATX headers with fenced code blocks that include language tags.
- YAML files indent two spaces and add comments for complex settings while keeping keys clear.
- PowerShell scripts use Verb-Noun names and prefer single-quoted literals while documenting parameters and satisfying PSScriptAnalyzer.

## PR Guidance
- One intent per PR. Update script README/header if behavior changes.
- Provide summary: what / why / validation.
- Run a targeted build (e.g. `pwsh -File build.ps1 -Sample AppLifecycle`).
- For version bumps: inspect at least one changed project file.
- No new warnings/errors or large cosmetic churn.

## Design Docs (Large / Cross-Sample)
Before broad edits create `DESIGN-<topic>.md`:
- Single sample: `Samples/<Sample>/DESIGN-<topic>.md`
- Multi-sample/shared: repo root.
Include: Problem, Goals/Non-Goals, Affected Areas, Approach, Risks, Validation Plan. Reference doc in PR.

## When Unsure
Draft a design doc or WIP PR summarizing assumptions—don't guess.

---
Keep this file lean; source-of-truth for behavior lives in script headers.
description: 'Windows App SDK Samples AI contributor guidance'
---

# Windows App SDK Samples – Copilot Instructions

Concise guidance for AI contributions to Windows App SDK Samples. For complete details, see [AGENTS.md](../AGENTS.md).

## Quick Reference

- **Build**: `build.ps1` / `build.cmd` (supports `-Sample <name>` for targeted builds)
- **Run**: Test on x64, x86, ARM64 in Debug and Release
- **Verify**: Run WACK on Release builds
- **Exit code 0 = success** – do not proceed if build fails

## Key Rules

- Samples should be **complete but simple** – demonstrate correct API usage
- Follow **scenario-based design** – one scenario per API usage pattern
- Support all platforms: x64, x86, ARM64 (Debug and Release)
- Minimum OS: Windows 10 version 1809 (build 17763)
- Include copyright headers; build clean with no warnings

## Style Enforcement

- **C#**: Follow `.editorconfig` at repo root
- **C++**: Use C++/WinRT; check `Samples/WindowsML/` for `.clang-format`

## When to Ask for Clarification

- Ambiguous sample requirements after reviewing docs
- Cross-feature impact unclear
- API usage patterns not well documented

## Detailed Documentation

- [AGENTS.md](../AGENTS.md) – Full AI contributor guide
- [Samples Guidelines](../docs/samples-guidelines.md) – Complete guidelines and checklist
- [Contributing](../CONTRIBUTING.md) – Contribution requirements
- [PR Template](../docs/pull_request_template.md) – Pull request checklist
- [Windows App SDK Docs](https://docs.microsoft.com/windows/apps/windows-app-sdk/) – Official documentation
Loading