agentleFS
MicrosoftKnown publishermicrosoft/ai-dev-gallery/.github/copilot-instructions.md

ai-dev-gallery

Copilot instructions1.5k starsChanged 11 months agoMITView on GitHub

AI Dev Gallery is a WinUI 3 desktop application showcasing local AI capabilities for Windows developers. It features interactive samples powered by local AI models, and enables exporting standalone Visual Studio projects. Tech Stack: C#, WinUI 3, Windows App SDK, ONNX Runtime, WinML, .NET 9.0

Trending

Quiet since February.about the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 4 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the microsoft/ai-dev-gallery repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about microsoft/ai-dev-gallery

The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 15

Talked about on GitHub and Bluesky (15 times).

On GitHub · 11

6 more on GitHub

On Bluesky · 4

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

33 rules. About 0 are common, 16 are distinctive, and 17 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 17

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check for hardcoded secrets, API keys, or credentials

    line 12
  2. Distinctive:

    Verify Limited Access Features (LAF) tokens are not committed

    line 13
  3. Distinctive:

    Ensure model URLs point to trusted sources (HuggingFace, GitHub)

    line 14
  4. Distinctive:

    Verify telemetry events don't log sensitive data (user paths, usernames)

    line 15
  5. Very specific:

    Ensure model inference runs on background threads (Task.Run)

    line 18
  6. Very specific:

    Verify proper disposal of InferenceSession and other resources

    line 19
  7. Distinctive:

    Check for memory leaks in image processing code

    line 20
  8. Distinctive:

    When reviewing PRs that add or modify samples:

    line 23
  9. Very specific:

    Must inherit from BaseSamplePage

    line 26
  10. Very specific:

    Must have [GallerySample] attribute with all required properties

    line 27
  11. Very specific:

    Must override LoadModelAsync(SampleNavigationParameters) or LoadModelAsync(MultiModelSampleNavigationParameters)

    line 28
  12. Very specific:

    Must register Unloaded event handler for cleanup

    line 29
  13. Very specific:

    Call sampleParams.NotifyCompletion() when initialization finishes

    line 41
  14. Very specific:

    Use await sampleParams.GetIChatClientAsync() for language models

    line 42
  15. Very specific:

    Use sampleParams.WinMlSampleOptions for WinML EP configuration

    line 43
  16. Distinctive:

    When reviewing WinML samples:

    line 63
  17. Very specific:

    Use sessionOptions.GetCompiledModel() when CompileModel is true

    line 74
  18. Distinctive:

    Verify input dimensions match model expectations

    line 77
  19. Distinctive:

    Check batch size is set correctly

    line 78
  20. Distinctive:

    Ensure proper preprocessing (resize, normalize)

    line 79
  21. Very specific:

    When reviewing .model.json or .modelgroup.json:

    line 82
  22. Very specific:

    Must have PromptTemplate referencing promptTemplates.json

    line 92
  23. Very specific:

    When scenarios.json is modified:

    line 95
  24. Very specific:

    Verify the scenario has unique Id

    line 96
  25. Very specific:

    Check Name, Description, and Instructions are meaningful

    line 97
  26. Distinctive:

    Use pattern matching and modern C# features

    line 107
  27. Very specific:

    Use async/await for asynchronous operations

    line 108
  28. Distinctive:

    Follow accessibility guidelines (narrator support, keyboard navigation)

    line 117
  29. Very specific:

    Run with filter: --filter "FullyQualifiedName~UnitTests"

    line 124
  30. Distinctive:

    Verify sample appears in correct category

    line 127
  31. Distinctive:

    Test model loading and inference

    line 128
  32. Distinctive:

    Verify project export generates valid VS solution

    line 129
  33. Distinctive:

    Test on both x64 and ARM64 if possible

    line 130

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

AI Dev Gallery - GitHub Copilot Custom Instructions

Repository Overview

AI Dev Gallery is a WinUI 3 desktop application showcasing local AI capabilities for Windows developers. It features interactive samples powered by local AI models, and enables exporting standalone Visual Studio projects.

Tech Stack: C#, WinUI 3, Windows App SDK, ONNX Runtime, WinML, .NET 9.0

PR Review Focus Areas

Security

  • Check for hardcoded secrets, API keys, or credentials
  • Verify Limited Access Features (LAF) tokens are not committed
  • Ensure model URLs point to trusted sources (HuggingFace, GitHub)
  • Verify telemetry events don't log sensitive data (user paths, usernames)

Performance

  • Ensure model inference runs on background threads (Task.Run)
  • Verify proper disposal of InferenceSession and other resources
  • Check for memory leaks in image processing code

Sample Implementation Standards

When reviewing PRs that add or modify samples:

  1. Class Structure
    • Must inherit from BaseSamplePage
    • Must have [GallerySample] attribute with all required properties
    • Must override LoadModelAsync(SampleNavigationParameters) or LoadModelAsync(MultiModelSampleNavigationParameters)
    • Must register Unloaded event handler for cleanup
  2. [GallerySample] Attribute Requirements
    • Name: Display name (required)
    • Model1Types: Array of supported model types (required)
    • Scenario: Must reference a ScenarioType from scenarios.json
    • Id: Unique GUID (required)
    • Icon: Segoe MDL2 glyph (required)
    • NugetPackageReferences: Array of needed packages
    • SharedCode: Array of SharedCodeEnum values if using shared utilities
  3. Model Loading Pattern
    • Call sampleParams.NotifyCompletion() when initialization finishes
    • Use await sampleParams.GetIChatClientAsync() for language models
    • Use sampleParams.WinMlSampleOptions for WinML EP configuration
    • Handle exceptions with ShowException(ex, message)
  4. Resource Cleanup
    public MySample()
    {
        this.Unloaded += (s, e) => CleanUp();
        this.InitializeComponent();
    }
    
    private void CleanUp()
    {
        _session?.Dispose();
        _cts?.Cancel();
        _cts?.Dispose();
    }

WinML/ONNX Patterns

When reviewing WinML samples:

  1. EP Registration
    var catalog = Microsoft.Windows.AI.MachineLearning.ExecutionProviderCatalog.GetDefault();
    await catalog.EnsureAndRegisterCertifiedAsync();
  2. Session Options
    • Always call sessionOptions.RegisterOrtExtensions()
    • Honor WinMlSampleOptions.Policy or EpName/DeviceType
    • Use sessionOptions.GetCompiledModel() when CompileModel is true
  3. Tensor Handling
    • Verify input dimensions match model expectations
    • Check batch size is set correctly
    • Ensure proper preprocessing (resize, normalize)

Model Definition Files

When reviewing .model.json or .modelgroup.json:

  1. Required Fields
    • Unique Id for model family and individual models
    • Valid HuggingFace/GitHub Url
    • Correct Size in bytes
    • Valid License identifier
    • HardwareAccelerator: CPU, GPU, NPU, etc.
  2. For Language Models
    • Must have PromptTemplate referencing promptTemplates.json

Scenario Updates

When scenarios.json is modified:

  • Verify the scenario has unique Id
  • Check Name, Description, and Instructions are meaningful
  • Remember: rebuild required for changes to take effect

Code Style

C# Conventions

  • Use file-scoped namespaces
  • Copyright header: // Copyright (c) Microsoft Corporation. All rights reserved.
  • License header: // Licensed under the MIT License.
  • Enable nullable reference types
  • Use pattern matching and modern C# features
  • Use async/await for asynchronous operations

Naming Conventions

  • Sample classes: Descriptive name matching the feature (e.g., Chat, ImageClassification)
  • Private fields: _camelCase with underscore prefix
  • Public properties: PascalCase

XAML Conventions

  • Use WinUI 3 controls
  • Follow accessibility guidelines (narrator support, keyboard navigation)

Testing Requirements

Unit Tests

  • Location: AIDevGallery.Tests/UnitTests/
  • Framework: MSTest
  • Run with filter: --filter "FullyQualifiedName~UnitTests"

When Adding Samples

  • Verify sample appears in correct category
  • Test model loading and inference
  • Verify project export generates valid VS solution
  • Test on both x64 and ARM64 if possible

Common Issues to Flag

  1. Missing cleanup code - Unloaded handler not disposing resources
  2. Blocking UI thread - Model inference not on background thread
  3. Missing NotifyCompletion - Loading spinner never dismissed
  4. Invalid GUIDs - Duplicate or malformed sample IDs
  5. Missing NuGet references - SharedCode files require corresponding packages
  6. Incorrect HardwareAccelerator - Model won't run on intended hardware
  7. scenarios.json not rebuilt - New scenarios don't appear in app

Documentation References

  • Adding Samples Guide
  • WinML Beginner Guide
  • Telemetry Guide

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.