complexity-analyzers
Copilot instructions4 starsChanged 3 months agoMITView on GitHub
This repository contains ComplexityAnalysis.Analyzers, a standalone Roslyn analyzer for estimating and diagnosing algorithmic complexity in C# code. Before making changes, read the root AGENTS.md. It is the primary repository-specific instruction source and contains the detailed architecture, Roslyn, NuGet, performance, validation, and Git rules. Use the canonical Definition of Done in docs/en/development/quality-gates.md to classify the change type and choose proportional validation. Do not duplicate or bypass that policy. Use the relevant skills under .agents/skills/ when the task touches their area. Do…
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,349 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.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- coverage-analysisSkill
- directory-build-organizationSkill
- msbuild-antipatternsSkill
- nuget-release-governanceSkill
- roslyn-analyzer-developmentSkill
- scaffold-dotnet-test-projectSkill
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
22 rules. About 0 are common, 16 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
Before making changes, read the root AGENTS.md.
- Very specific: line 9
Use the canonical Definition of Done in docs/en/development/quality-gates.md to classify the change type and choose proportional validation.
- Very specific: line 11
Use the relevant skills under .agents/skills/ when the task touches their area.
- Very specific: line 15
Treat the repository root as the canonical workspace.
- Distinctive: line 17
Use Roslyn syntax, symbols, semantic models, and operation identities instead of text-only matching when semantic identity matters.
- Distinctive: line 18
Keep analyzer execution deterministic, bounded, cancellation-aware, and safe for concurrent compiler/IDE execution.
- Distinctive: line 19
Treat analyzer performance as a functional requirement.
- Very specific: line 21
Do not introduce Microsoft.CodeAnalysis.Workspaces unless a feature clearly requires workspace APIs.
- Distinctive: line 22
Keep Roslyn authoring dependencies private and avoid unnecessary transitive runtime dependencies in the NuGet package.
- Distinctive: line 24
Do not routinely upgrade the pinned Roslyn compiler API baseline without explicit compatibility evaluation across supported SDK/compiler …
- Distinctive: line 28
Add or update tests for behavior changes and bug fixes.
- Very specific: line 30
When a public diagnostic changes, update src/ComplexityAnalysis.Analyzers/AnalyzerReleases.Unshipped.md when required by analyzer release …
- Distinctive: line 31
Keep English and Portuguese public documentation aligned when behavior, configuration, diagnostics, compatibility, or package usage changes.
- Distinctive: line 36
Run validation proportional to the change.
- Distinctive: line 44
When packaging behavior changes, also validate a local package:
- Distinctive: line 54
Use the repository's focused compatibility, package-contract, coverage, and performance tests when relevant to the change.
- Distinctive: line 59
Keep pull requests focused and review the final diff before concluding.
- Very specific: line 60
Do not commit local artifacts/, packages, coverage output, or build output.
- Distinctive: line 61
Never expose machine-specific absolute paths, local usernames, home directories, or resolved tool installation paths in PR descriptions, …
- Distinctive: line 63
Before creating or updating a Pull Request, sanitize the final public text so machine-specific environment details are removed.
- Distinctive: line 64
Do not create tags, GitHub Releases, publish NuGet packages, publish GitHub Packages, or otherwise perform a release unless explicitly …
- Distinctive: line 65
Do not weaken CI, security, compatibility, or quality gates merely to make a change pass.
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 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.
Files
GitHub Copilot Instructions
This repository contains ComplexityAnalysis.Analyzers, a standalone Roslyn analyzer for estimating and diagnosing algorithmic complexity in C# code.
Start here
Before making changes, read the root AGENTS.md. It is the primary repository-specific instruction source and contains the detailed architecture, Roslyn, NuGet, performance, validation, and Git rules.
Use the canonical Definition of Done in docs/en/development/quality-gates.md to classify the change type and choose proportional validation. Do not duplicate or bypass that policy.
Use the relevant skills under .agents/skills/ when the task touches their area. Do not load unrelated repository content unnecessarily.
Core invariants
- Treat the repository root as the canonical workspace. Do not reintroduce an
analyzer/workspace boundary. - Preserve conservative analysis: prefer
Unknownover an unsafe or unproven complexity estimate. - Use Roslyn syntax, symbols, semantic models, and operation identities instead of text-only matching when semantic identity matters.
- Keep analyzer execution deterministic, bounded, cancellation-aware, and safe for concurrent compiler/IDE execution.
- Treat analyzer performance as a functional requirement. Avoid broad scans, I/O, network access, process execution, and heavyweight reflection in analyzer hot paths.
- Preserve analyzer host compatibility. The analyzer project targets
netstandard2.0unless an explicit architecture decision changes that contract. - Do not introduce
Microsoft.CodeAnalysis.Workspacesunless a feature clearly requires workspace APIs. - Keep Roslyn authoring dependencies private and avoid unnecessary transitive runtime dependencies in the NuGet package.
- Preserve the analyzer package layout with the analyzer assembly under
analyzers/dotnet/cs/rather than a normal runtimelib/asset. - Do not routinely upgrade the pinned Roslyn compiler API baseline without explicit compatibility evaluation across supported SDK/compiler hosts.
Tests and public behavior
- Add or update tests for behavior changes and bug fixes. Analyzer diagnostics should normally include triggering and non-triggering coverage.
- Changes to interprocedural analysis, recursion/recurrence solving, caching, budgets, known operations, or package loading must consider compatibility and performance regressions.
- When a public diagnostic changes, update
src/ComplexityAnalysis.Analyzers/AnalyzerReleases.Unshipped.mdwhen required by analyzer release tracking. - Keep English and Portuguese public documentation aligned when behavior, configuration, diagnostics, compatibility, or package usage changes.
- New analyzer configuration options must be documented in both
docs/en/configuration.mdanddocs/pt-BR/configuration.md.
Validation
Run validation proportional to the change. For analyzer, MSBuild, NuGet, packaging, or broad repository changes, use the root solution:
dotnet restore ComplexityAnalysis.Analyzers.slnx
dotnet build ComplexityAnalysis.Analyzers.slnx --configuration Release --no-restore
dotnet test ComplexityAnalysis.Analyzers.slnx --configuration Release --no-buildWhen packaging behavior changes, also validate a local package:
dotnet pack src/ComplexityAnalysis.Analyzers/ComplexityAnalysis.Analyzers.csproj \
--configuration Release \
--no-build \
-p:PackageVersion=0.0.0-local \
--output artifacts/local-packagesUse the repository's focused compatibility, package-contract, coverage, and performance tests when relevant to the change.
Git and release safety
- Use Conventional Commits.
- Keep pull requests focused and review the final diff before concluding.
- Do not commit local
artifacts/, packages, coverage output, or build output. - Never expose machine-specific absolute paths, local usernames, home directories, or resolved tool installation paths in PR descriptions, documentation, issues, or comments.
- Report validation with portable commands such as
dotnetand repository-relative paths, even when execution internally used an absolute executable path. - Before creating or updating a Pull Request, sanitize the final public text so machine-specific environment details are removed.
- Do not create tags, GitHub Releases, publish NuGet packages, publish GitHub Packages, or otherwise perform a release unless explicitly requested by the user/maintainer.
- Do not weaken CI, security, compatibility, or quality gates merely to make a change pass.
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
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.

