Skip to content
Prompt

Gestionale-DotNet — Copilot Instructions

by christiantricarico

AI Summary

Copilot instructions for developers working with the Gestionale open-source .NET project, providing code style guidelines, C# 13 best practices, and project-specific rules to ensure consistent, high-quality contributions.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to add the "Gestionale-DotNet — Copilot Instructions" prompt rules to my project.
Repository: https://github.com/christiantricarico/Gestionale-DotNet

Please read the repo to find the rules/prompt file, then:
1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type)
2. If there's an existing rules file, merge the new rules in rather than overwriting
3. Confirm what was added

Description

Un gestionale open source sperimentale realizzato con tecnologia Microsoft .NET

General

• Make only high confidence suggestions when reviewing code changes. • Always use the latest version C#, currently C# 13 features. • Write code that is clean, maintainable, and easy to understand. • Only add comments rarely to explain why a non-intuitive solution was used. The code should be self-explanatory otherwise. • Don't add the UTF-8 BOM to files unless they have non-ASCII characters. • Never change global.json unless explicitly asked to. • Never change package.json or package-lock.json files unless explicitly asked to. • Never change NuGet.config files unless explicitly asked to.

Formatting

• Apply code-formatting style defined in .editorconfig. • Use primary constructors where applicable. • Prefer file-scoped namespace declarations and single-line using directives. • Insert a newline before the opening curly brace of any code block (e.g., after if, for, while, foreach, using, try, etc.). • Ensure that the final return statement of a method is on its own line. • Use pattern matching and switch expressions wherever possible. • Prefer using collection expressions when possible • Use is pattern matching instead of as and null checks • Use nameof instead of string literals when referring to member names. • Prefer ?. if applicable (e.g. scope?.Dispose()). • Use ObjectDisposedException.ThrowIf where applicable. • Use ArgumentNullException.ThrowIfNull to validate input parameters. • If you add new code files, ensure they are listed in the csproj file (if other files in that folder are listed there) so they build.

Nullable Reference Types

• Declare variables non-nullable, and check for null at entry points. • Always use is null or is not null instead of == null or != null. • Trust the C# null annotations and don't add null checks when the type system says a value cannot be null.

Asynchronous Programming

• Provide both synchronous and asynchronous versions of methods where appropriate. • Use the Async suffix for asynchronous methods. • Return Task or ValueTask from asynchronous methods. • Use CancellationToken parameters to support cancellation. • Avoid async void methods except for event handlers. • Call ConfigureAwait(false) on awaited calls to avoid deadlocks.

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 3mo ago
Stale
AdoptionUnder 100 stars
10 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars10
Issues1
Updated3mo ago
View on GitHub
AGPL-3.0 License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more