Security review

No findings observed

No concerns were reported in the reviewed catalog files. This is not a safety guarantee.

1 of 1 catalog files reviewed · (UTC)

Review details

AI instruction review via GitHub Agentic Workflows. Reviews inspect a recorded catalog snapshot; they do not execute skill files. AI can miss risks or report false positives.

Coverage is limited to catalog files. External links and upstream files absent from the catalog were not inspected.

Model
copilot/gpt-5.1-codex-mini
Rubric
1.0.0
Catalog commit
fb330b0dca7042db9e26415893d94ecdea7e5677
Content hash
9d7774d31e7ab4ad024a8027b08f4139191a087f6fc09a7347cc9ee03e3819e9
Reviewed files (1)
  • SKILL.md
View full report (JSON)

Usage example

A .NET service’s new invoice handler mixes synchronous waits, broad exception catches, and inconsistent cancellation handling.

Try a prompt like this

Review the invoice handler against this .NET solution’s established best practices. Improve async and cancellation flow, exception handling, and dependency usage where the code warrants it. Explain the targeted changes and run focused tests, preserving business behavior and avoiding an unrelated style rewrite.

Illustrative request, not an executed example or a guarantee of activation or results. Adapt it to your task after reviewing the skill’s instructions, prerequisites, and security review. Tool access and permissions depend on your setup.

Installation

Install as Agent Plugin Recommended
copilot plugin marketplace add samueltauil/skills-hub
copilot plugin install dotnet-best-practices@skills-hub

Works with GitHub Copilot CLI and VS Code (enable chat.plugins.enabled). Plugin dotnet-best-practices v1.0.0 follows the Agent Plugins spec.

Install with the gh extension
gh skills-hub install dotnet-best-practices

Don't have the extension? Run gh extension install samueltauil/skills-hub first.

Download and extract to your repository:

.github/skills/dotnet-best-practices/

Extract the ZIP to .github/skills/ in your repo. The folder name must match dotnet-best-practices for Copilot to auto-discover it.

Skill Files (1)

SKILL.md 3.2 KB
---
name: dotnet-best-practices
description: 'Ensure .NET/C# code meets best practices for the solution/project.'
---

# .NET/C# Best Practices

Your task is to ensure .NET/C# code in ${selection} meets the best practices specific to this solution/project. This includes:

## Documentation & Structure

- Create comprehensive XML documentation comments for all public classes, interfaces, methods, and properties
- Include parameter descriptions and return value descriptions in XML comments
- Follow the established namespace structure: {Core|Console|App|Service}.{Feature}

## Design Patterns & Architecture

- Use primary constructor syntax for dependency injection (e.g., `public class MyClass(IDependency dependency)`)
- Implement the Command Handler pattern with generic base classes (e.g., `CommandHandler<TOptions>`)
- Use interface segregation with clear naming conventions (prefix interfaces with 'I')
- Follow the Factory pattern for complex object creation.

## Dependency Injection & Services

- Use constructor dependency injection with null checks via ArgumentNullException
- Register services with appropriate lifetimes (Singleton, Scoped, Transient)
- Use Microsoft.Extensions.DependencyInjection patterns
- Implement service interfaces for testability

## Resource Management & Localization

- Use ResourceManager for localized messages and error strings
- Separate LogMessages and ErrorMessages resource files
- Access resources via `_resourceManager.GetString("MessageKey")`

## Async/Await Patterns

- Use async/await for all I/O operations and long-running tasks
- Return Task or Task<T> from async methods
- Use ConfigureAwait(false) where appropriate
- Handle async exceptions properly

## Testing Standards

- Use MSTest framework with FluentAssertions for assertions
- Follow AAA pattern (Arrange, Act, Assert)
- Use Moq for mocking dependencies
- Test both success and failure scenarios
- Include null parameter validation tests

## Configuration & Settings

- Use strongly-typed configuration classes with data annotations
- Implement validation attributes (Required, NotEmptyOrWhitespace)
- Use IConfiguration binding for settings
- Support appsettings.json configuration files

## Semantic Kernel & AI Integration

- Use Microsoft.SemanticKernel for AI operations
- Implement proper kernel configuration and service registration
- Handle AI model settings (ChatCompletion, Embedding, etc.)
- Use structured output patterns for reliable AI responses

## Error Handling & Logging

- Use structured logging with Microsoft.Extensions.Logging
- Include scoped logging with meaningful context
- Throw specific exceptions with descriptive messages
- Use try-catch blocks for expected failure scenarios

## Performance & Security

- Use C# 12+ features and .NET 8 optimizations where applicable
- Implement proper input validation and sanitization
- Use parameterized queries for database operations
- Follow secure coding practices for AI/ML operations

## Code Quality

- Ensure SOLID principles compliance
- Avoid code duplication through base classes and utilities
- Use meaningful names that reflect domain concepts
- Keep methods focused and cohesive
- Implement proper disposal patterns for resources

License (MIT)

View full license text
MIT License

Copyright GitHub, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.