agentleFS
ResgridResgrid/Core/.github/copilot-instructions.md

Core

Copilot instructions229 starsChanged 3 months agoApache-2.0View on GitHub

This file provides guidelines for writing clean, maintainable, and idiomatic C# code with a focus on functional patterns and proper abstraction.

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

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write clear, self-documenting code

    line 16
  2. Distinctive:

    Keep abstractions simple and focused

    line 17
  3. Distinctive:

    Use modern C# features appropriately

    line 19
  4. Distinctive:

    Use repository pattern utilizing Dapper at the Repo layer for database communication for SQL Server and Postgresql

    line 20
  5. Distinctive:

    Use extension methods appropriately:

    line 58
  6. Distinctive:

    Prefer composition with interfaces:

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 3,669 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

Role Definition:

  • C# Language Expert
  • Software Architect
  • Code Quality Specialist

General:

Description: C# code should be written to maximize readability, maintainability, and correctness while minimizing complexity and coupling. Prefer functional patterns and immutable data where appropriate, and keep abstractions simple and focused.

Requirements:

  • Write clear, self-documenting code
  • Keep abstractions simple and focused
  • Minimize dependencies and coupling
  • Use modern C# features appropriately
  • Use repository pattern utilizing Dapper at the Repo layer for database communication for SQL Server and Postgresql

Code Organization:

  • Use meaningful names:
    // Good: Clear intent
    public async Task<Result<Order>> ProcessOrderAsync(OrderRequest request, CancellationToken cancellationToken)
    
    // Avoid: Unclear abbreviations
    public async Task<Result<T>> ProcAsync<T>(ReqDto r, CancellationToken ct)
  • Separate state from behavior:
    // Good: Behavior separate from state
    public sealed record Order(OrderId Id, List<OrderLine> Lines);
    
    public static class OrderOperations
    {
        public static decimal CalculateTotal(Order order) =>
            order.Lines.Sum(line => line.Price * line.Quantity);
    }
  • Prefer pure methods:
    // Good: Pure function
    public static decimal CalculateTotalPrice(
        IEnumerable<OrderLine> lines,
        decimal taxRate) =>
        lines.Sum(line => line.Price * line.Quantity) * (1 + taxRate);
    
    // Avoid: Method with side effects
    public void CalculateAndUpdateTotalPrice()
    {
        this.Total = this.Lines.Sum(l => l.Price * l.Quantity);
        this.UpdateDatabase();
    }
  • Use extension methods appropriately:
    // Good: Extension method for domain-specific operations
    public static class OrderExtensions
    {
        public static bool CanBeFulfilled(this Order order, Inventory inventory) =>
            order.Lines.All(line => inventory.HasStock(line.ProductId, line.Quantity));
    }
  • Design for testability:
    // Good: Easy to test pure functions
    public static class PriceCalculator
    {
        public static decimal CalculateDiscount(
            decimal price,
            int quantity,
            CustomerTier tier) =>
            // Pure calculation
    }
    
    // Avoid: Hard to test due to hidden dependencies
    public decimal CalculateDiscount()
    {
        var user = _userService.GetCurrentUser();  // Hidden dependency
        var settings = _configService.GetSettings(); // Hidden dependency
        // Calculation
    }

Dependency Management:

  • Minimize constructor injection:
    // Good: Minimal dependencies
    public sealed class OrderProcessor(IOrderRepository repository)
    {
        // Implementation
    }
    
    // Avoid: Too many dependencies
    // Too many dependencies indicates possible design issues
    public class OrderProcessor(
        IOrderRepository repository,
        ILogger logger,
        IEmailService emailService,
        IMetrics metrics,
        IValidator validator)
    {
        // Implementation
    }
  • Prefer composition with interfaces:
    // Good: Composition with interfaces
    public sealed class EnhancedLogger(ILogger baseLogger, IMetrics metrics) : ILogger
    {
    }

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.