agentleFS
devloopeddevlooped/moq/.github/copilot-instructions.md

moq

Copilot instructions6.4k starsChanged 34 days agoMITView on GitHub

Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. Project implemention details, design and key decisions should be documented in a top-level AGENTS.md file at the repo root. Keep this file updated whenever you make change significant chang

  • Reads credentials
  • Installs packages

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If tests fail due to Azure Storage, run the following commands and retry: npm install azurite and npx azurite &

    line 14
  2. Very specific:

    Type references: Prefer language keywords over framework type names (int vs Int32)

    line 37
  3. Distinctive:

    Modern C# features: Use object/collection initializers, coalesce expressions when possible, use var when the type is apparent from the …

    line 38
  4. Very specific:

    Visibility modifiers: only explicitly specify visibility when different from the default (e.g.

    line 39
  5. Very specific:

    Add to appropriate .csproj file

    line 62
  6. Very specific:

    Run dotnet restore to update dependencies

    line 63
  7. Distinctive:

    Ensure version consistency across projects where applicable

    line 64
  8. Distinctive:

    All PRs must pass format validation

    line 85
  9. Distinctive:

    Follow existing patterns and conventions in the codebase

    line 87
  10. Distinctive:

    Keep this file updated whenever you make change significant changes for future reference.

    line 92

≈ “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

.NET Repository

Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.

Working Effectively

Essential Build Commands

  • Restore dependencies: dotnet restore
  • Build the entire solution: dotnet build
  • Run tests: dnx --yes retest
    • Runs all unit tests across the solution
    • If tests fail due to Azure Storage, run the following commands and retry: npm install azurite and npx azurite &

Build Validation and CI Requirements

  • Always run before committing:
    • dnx --yes retest
    • dotnet format whitespace -v:diag --exclude ~/.nuget
    • dotnet format style -v:diag --exclude ~/.nuget

Project Structure and Navigation

DirectoryDescription
src/Contains the repo source code.
bin/Contains built packages (if any)

Code Style and Formatting

EditorConfig Rules

The repository uses .editorconfig at the repo root for consistent code style.

  • Indentation: 4 spaces for C# files, 2 spaces for XML/YAML/JSON
  • Line endings: LF (Unix-style)
  • Sort using directives: System.* namespaces first (dotnet_sort_system_directives_first = true)
  • Type references: Prefer language keywords over framework type names (int vs Int32)
  • Modern C# features: Use object/collection initializers, coalesce expressions when possible, use var when the type is apparent from the right-hand side of the assignment
  • Visibility modifiers: only explicitly specify visibility when different from the default (e.g. public for classes, no internal for classes or private for fields, etc.)

Formatting Validation

  • CI enforces formatting with dotnet format whitespace and dotnet format style
  • Run locally: dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget
  • Fix formatting: dotnet format (without --verify-no-changes)

Testing Practices

Test Framework

  • xUnit for all unit and integration tests
  • Moq for mocking dependencies
  • Located in src/*.Tests/

Test Attributes

Custom xUnit attributes are sometimes used for conditional test execution:

  • [SecretsFact("XAI_API_KEY")] - Skips test if required secrets are missing from user secrets or environment variables
  • [LocalFact("SECRET")] - Runs only locally (skips in CI), requires specified secrets
  • [CIFact] - Runs only in CI environment

Dependency Management

Adding Dependencies

  • Add to appropriate .csproj file
  • Run dotnet restore to update dependencies
  • Ensure version consistency across projects where applicable

CI/CD Pipeline

  • Build workflow: .github/workflows/build.yml - runs on PR and push to main/rel/feature branches
  • Publish workflow: Publishes to Sleet feed when SLEET_CONNECTION secret is available
  • OS matrix: Configured in .github/workflows/os-matrix.json (defaults to ubuntu-latest)

Special Files and Tools

dnx Command

  • Purpose: built-in tool for running arbitrary dotnet tools that are published on nuget.org. --yes auto-confirms install before run.
  • Example: dnx --yes retest - runs tests with automatic retry on transient failures (retest being a tool package published at https://www.nuget.org/packages/retest)
  • In CI: dnx --yes retest -- --no-build (skips build, runs tests only)

Directory.Build.rsp

  • MSBuild response file with default build arguments
  • -nr:false - disables node reuse
  • -m:1 - single-threaded build (for stability)
  • -v:m - minimal verbosity

Code Quality

  • All PRs must pass format validation
  • Tests must pass on all target frameworks
  • Follow existing patterns and conventions in the codebase

Documenting Work

Project implemention details, design and key decisions should be documented in a top-level AGENTS.md file at the repo root. Keep this file updated whenever you make change significant changes for future reference.

User-facing features and APIs should be documented to highlight (not extensively, as an overview) key project features and capabilities, in the readme.md file at the repo root.

Download now (ZIP)

Trending

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about devlooped/moq

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

See all 51

Talked about on GitHub and Stack Overflow (51 times).

On GitHub · 50

45 more on GitHub
  • Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.

    Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

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.