Skip to content

docs: add an agent guide - #895

Merged
vbreuss merged 1 commit into
mainfrom
docs/agents-md
Oct 18, 2026
Merged

vbreuss merged 1 commit into
mainfrom
docs/agents-md

Conversation

@vbreuss

@vbreuss vbreuss commented Oct 18, 2026

Copy link
Copy Markdown
Member

CLAUDE.md and the Copilot instructions had drifted from the code (old API names, a removed attribute, a missing solution file) and each served only one tool. A single AGENTS.md with the hard constraints, plus deeper reference docs read on demand, gives every agent and contributor one verified source to keep current.

Docs/agents/design-goals.md gives every change the same priorities. Correctness is a must; the other goals are strong defaults and win in this order when they conflict:

  • Stable and compatible
  • AOT and trimming friendly
  • A consistent, discoverable and pleasant API
  • Fast, especially on the happy path
  • Extensible
  • Errors at compile time rather than at run time
  • Documented and pleasant to read, using Docusaurus features where they help

It also sets the code rules (modern C# within the target frameworks, async rules including ConfigureAwait(false), patterns to avoid), the checks before a commit (including no new Sonar findings and asking before suppressing one), and how to handle review findings.

Goals of this repository:

  • Every mockable shape compiles and behaves
  • One entry point and one verb surface
  • Consistent vocabulary
  • Allocation-free hot path
  • Invisible generated code
  • AOT by construction, within the Roslyn floor
  • Correct incremental caching

CLAUDE.md and the Copilot instructions had drifted from the code (old API names, a removed attribute, a missing solution file) and each served only one tool. A single AGENTS.md with the hard constraints, plus deeper reference docs read on demand, gives every agent and contributor one verified source to keep current.

Docs/agents/design-goals.md gives every change the same priorities. Correctness is a must; the other goals are strong defaults and win in this order when they conflict:
- Stable and compatible
- AOT and trimming friendly
- A consistent, discoverable and pleasant API
- Fast, especially on the happy path
- Extensible
- Errors at compile time rather than at run time
- Documented and pleasant to read, using Docusaurus features where they help

It also sets the code rules (modern C# within the target frameworks, async rules including ConfigureAwait(false), patterns to avoid), the checks before a commit (including no new Sonar findings and asking before suppressing one), and how to handle review findings.

Goals of this repository:
- Every mockable shape compiles and behaves
- One entry point and one verb surface
- Consistent vocabulary
- Allocation-free hot path
- Invisible generated code
- AOT by construction, within the Roslyn floor
- Correct incremental caching
@vbreuss vbreuss self-assigned this Oct 18, 2026
Copilot AI balanced review requested due to automatic review settings October 18, 2026 11:05
@vbreuss vbreuss added the documentation Improvements or additions to documentation label Oct 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@vbreuss
vbreuss merged commit 7a2727f into main Oct 18, 2026
14 checks passed
@vbreuss
vbreuss deleted the docs/agents-md branch October 18, 2026 11:05
@sonarqubecloud

Copy link
Copy Markdown

github-actions Bot added a commit that referenced this pull request Oct 18, 2026
github-actions Bot added a commit that referenced this pull request Oct 18, 2026
@github-actions

Copy link
Copy Markdown

🚀 Benchmark Results

Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.402
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Method N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 291.2 ns 8.78 ns 8.21 ns 0.81 1.93 KB 1.00
Mockolate 1 360.7 ns 5.35 ns 4.74 ns 1.00 1.93 KB 1.00
Imposter 1 527.1 ns 7.69 ns 6.82 ns 1.46 3.96 KB 2.05
TUnitMocks 1 471.6 ns 5.82 ns 5.44 ns 1.31 2.02 KB 1.05
Moq 1 183,004.0 ns 414.07 ns 367.06 ns 507.50 14.58 KB 7.55
NSubstitute 1 6,375.5 ns 55.92 ns 49.57 ns 17.68 9.12 KB 4.72
FakeItEasy 1 6,216.3 ns 44.88 ns 39.78 ns 17.24 8.05 KB 4.17
baseline* 10 535.8 ns 5.49 ns 5.14 ns 0.77 2.14 KB 1.00
Mockolate 10 691.6 ns 6.27 ns 5.56 ns 1.00 2.14 KB 1.00
Imposter 10 882.7 ns 16.18 ns 14.34 ns 1.28 4.8 KB 2.24
TUnitMocks 10 1,370.4 ns 28.06 ns 26.25 ns 1.98 3.73 KB 1.74
Moq 10 190,853.0 ns 1,131.85 ns 945.14 ns 275.98 18.48 KB 8.63
NSubstitute 10 9,298.0 ns 96.32 ns 90.10 ns 13.45 12.07 KB 5.64
FakeItEasy 10 9,569.7 ns 150.16 ns 140.46 ns 13.84 15.42 KB 7.20
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 9V74 3.37GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.402
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v4

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Event Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 236.4 ns 2.00 ns 1.87 ns 0.92 1.7 KB 1.00
Mockolate 258.1 ns 9.48 ns 8.87 ns 1.00 1.7 KB 1.00
Imposter 756.5 ns 19.76 ns 17.52 ns 2.93 7.18 KB 4.22
TUnitMocks 154.1 ns 4.32 ns 4.04 ns 0.60 1.34 KB 0.79
Moq 12,476.4 ns 176.35 ns 156.33 ns 48.38 12.51 KB 7.34
NSubstitute 4,652.5 ns 99.49 ns 88.20 ns 18.04 9.05 KB 5.31
FakeItEasy 197,502.4 ns 2,773.22 ns 2,594.07 ns 765.92 15.26 KB 8.96
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.60GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.402
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Callback Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 362.1 ns 8.31 ns 7.77 ns 1.13 1.57 KB 1.00
Mockolate 320.8 ns 6.79 ns 6.35 ns 1.00 1.57 KB 1.00
Imposter 430.7 ns 5.98 ns 5.30 ns 1.34 2.37 KB 1.51
TUnitMocks 486.3 ns 2.48 ns 2.07 ns 1.52 2 KB 1.27
Moq 99,359.5 ns 379.99 ns 296.67 ns 309.86 8.99 KB 5.73
NSubstitute 4,810.4 ns 19.68 ns 15.36 ns 15.00 7.71 KB 4.91
FakeItEasy 4,806.8 ns 21.85 ns 20.44 ns 14.99 6.81 KB 4.33
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.91GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.402
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Indexer N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 1,058.5 ns 26.48 ns 23.47 ns 1.01 3.77 KB 1.00
Mockolate 1 1,047.4 ns 37.02 ns 34.63 ns 1.00 3.77 KB 1.00
Imposter 1 963.8 ns 33.45 ns 31.29 ns 0.92 4.99 KB 1.33
Moq 1 220,765.0 ns 1,378.03 ns 1,289.01 ns 211.00 20.37 KB 5.41
NSubstitute 1 10,812.8 ns 90.91 ns 80.59 ns 10.33 12.78 KB 3.39
FakeItEasy 1 12,411.2 ns 208.56 ns 184.88 ns 11.86 13.63 KB 3.62
baseline* 10 2,596.8 ns 17.14 ns 16.03 ns 0.95 4.82 KB 1.00
Mockolate 10 2,728.9 ns 30.23 ns 26.80 ns 1.00 4.82 KB 1.00
Imposter 10 1,793.4 ns 84.05 ns 78.62 ns 0.66 6.47 KB 1.34
Moq 10 235,908.8 ns 1,919.27 ns 1,795.29 ns 86.46 29.89 KB 6.20
NSubstitute 10 25,365.1 ns 209.95 ns 196.39 ns 9.30 25.58 KB 5.31
FakeItEasy 10 25,949.0 ns 334.13 ns 296.20 ns 9.51 32.97 KB 6.84
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.45GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.402
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

CreateMock Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 9.887 ns 0.1868 ns 0.1656 ns 0.57 160 B 1.00
Mockolate 17.42 ns 0.566 ns 0.501 ns 1.00 160 B 1.00
Imposter 279.05 ns 5.048 ns 4.475 ns 16.03 2240 B 14.00
TUnitMocks 35.69 ns 0.574 ns 0.537 ns 2.05 200 B 1.25
Moq 1,433.39 ns 14.429 ns 13.497 ns 82.36 2096 B 13.10
NSubstitute 1,998.65 ns 7.036 ns 6.238 ns 114.83 5048 B 31.55
FakeItEasy 1,772.09 ns 16.732 ns 13.972 ns 101.82 2763 B 17.27
Details

BenchmarkDotNet v0.15.8, Linux Ubuntu 24.04.5 LTS (Noble Numbat)
AMD EPYC 7763 2.82GHz, 1 CPU, 4 logical and 2 physical cores
.NET SDK 10.0.402
[Host] : .NET 10.0.13 (10.0.13, 10.0.1326.50504), X64 RyuJIT x86-64-v3

Job=InProcess Toolchain=InProcessEmitToolchain IterationCount=15
LaunchCount=1 WarmupCount=10

Property N Mean Error StdDev Ratio Allocated Alloc Ratio
baseline* 1 531.7 ns 21.36 ns 19.98 ns 0.95 2.41 KB 1.00
Mockolate 1 561.9 ns 15.85 ns 14.83 ns 1.00 2.41 KB 1.00
Imposter 1 453.2 ns 6.70 ns 6.27 ns 0.81 2.98 KB 1.23
TUnitMocks 1 485.0 ns 4.65 ns 4.35 ns 0.86 1.64 KB 0.68
Moq 1 11,890.0 ns 58.64 ns 51.99 ns 21.17 10.27 KB 4.25
NSubstitute 1 7,952.5 ns 40.53 ns 33.85 ns 14.16 11.45 KB 4.74
FakeItEasy 1 8,737.6 ns 54.42 ns 50.91 ns 15.56 11.24 KB 4.66
baseline* 10 1,008.5 ns 5.49 ns 4.86 ns 0.94 2.91 KB 1.00
Mockolate 10 1,075.2 ns 8.13 ns 7.21 ns 1.00 2.91 KB 1.00
Imposter 10 698.7 ns 8.33 ns 6.95 ns 0.65 3.26 KB 1.12
TUnitMocks 10 1,650.7 ns 7.83 ns 6.94 ns 1.54 3.94 KB 1.35
Moq 10 18,996.3 ns 59.62 ns 49.79 ns 17.67 17.03 KB 5.86
NSubstitute 10 17,575.4 ns 116.55 ns 97.32 ns 16.35 21.08 KB 7.25
FakeItEasy 10 20,174.3 ns 147.06 ns 130.36 ns 18.76 30.81 KB 10.60

baseline* rows show the corresponding Mockolate benchmark from the most recent successful main branch build with results, for regression comparison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants