Skip to content

Add agent skills and AGENTS.md for AI-assisted contributions - #4209

Merged
AArnott merged 2 commits into
masterfrom
agent-skills
Oct 10, 2026
Merged

AArnott merged 2 commits into
masterfrom
agent-skills

Conversation

@AArnott

@AArnott AArnott commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Adds Agent Skills that describe how work in this repo gets done, so contributors' AI agents follow the same procedures. They're grounded in the C# 10–15 audits (#4042–#4046, #4180–#4186), the Oct 2026 backlog triage, and the PRs that came out of them (#4148/#4149, #4173, #4187–#4193, #4195–#4208).

Skills

Skill What it covers
csharp-language-version-audit Listing a new version's features (what's-new, Roslyn Language Feature Status, csharplang proposals), the c# N label, tracking issue and sub-issues, the Test.CSharpN project checklist, the preview default (#4192), probing every rule category, closing sub-issues with evidence, and handling compiler bugs (#4191).
fixing-a-bug Reproduce first: a test that fails on master exactly as reported (same ID, location and message, crash, or bad fix output), placed in the lowest test project, before any product change. Also code fixes, Fix All, docs, Fixes #N, and Roslyn 1.x/4.0/5.x quirks.
testing-and-coverage Test project layout and inheritance, running one rule's tests, Linux CRLF failures vs Windows CI (compare failure sets), coverage expectations (both outcomes of each new condition, as in the #4197 review), DefaultVerifier, exactly-once tests, and never weakening tests.
analyzer-performance Narrow syntax-kind registrations, shared kind lists, the shared token walk, syntax before semantics, expensive checks in code fixes, no compiler-version checks or dedup filters, and measuring with StyleCopTester.
lightup-and-roslyn-versions Product code stays on Roslyn 1.2.1: SyntaxKindEx, base-type casts, generated wrappers, light-up helpers, LanguageFeatureHelpers, refreshing Syntax.xml, and regenerating and checking Lightup/.generated.
issue-triage Categories (likely fixed, duplicate, quick win, stale), what counts as evidence, confidence levels, report-before-closing, comment templates, and closing as a GitHub duplicate.
pull-request-workflow One PR per independent change, stacking only real dependencies, building on contributors' original commits, drafts until all 25 checks pass on the head SHA (including rerunning cancelled duplicate runs), gh api -X PATCH for body edits, review replies, and test-class merge conflicts.

csharp-language-version-audit/scripts/probe is the probe harness used for the audits and the triage. It's a small console app, not in StyleCopAnalyzers.sln, that runs every built analyzer, plus the first code fix of each diagnostic with --fix, on snippet files. It prints diagnostics, compiler errors, AD0001 crashes and fix diffs. -p:RoslynVersion= swaps the compiler. As a check, I ran the C# 15 union snippet with 5.9.0, which reports SA1600 three times on one union member (dotnet/roslyn#84570), and with 5.10.0-1.26477.9, which reports it once.

AGENTS.md is a short index of the skills plus a few ground rules. CLAUDE.md is one line, @AGENTS.md.

Why .agents/skills

All three common project locations work with GitHub Copilot (cloud agent, CLI, code review), VS Code and Visual Studio. They differ for other agents:

Location Copilot / VS Code / VS Codex Cursor Claude Code
.github/skills ✅ only via VS Code Agent Host ❌ ❌
.agents/skills ✅ ✅ ✅ ❌
.claude/skills ✅ ❌ ✅ (compatibility) ✅

.agents/skills is the cross-client location from the Agent Skills spec, and it reaches the most agents. Claude Code is the gap: it only discovers .claude/skills. Instead of duplicating the files or committing symlinks, which are fragile on Windows, CLAUDE.md imports AGENTS.md, and that links every skill. Claude Code then reads them on demand, though it won't list them as native skills.

Sources: GitHub Copilot docs, VS Code docs, Codex docs, Cursor docs, Claude Code docs.

Checks

  • All 7 skills pass agentskills validate from the reference skills-ref package. Each name matches its folder, descriptions run 348–496 characters, and every SKILL.md is under 210 lines.
  • The repo has no markdown lint.
  • I tested the commands the skills rely on: the stub-generation loop (it reproduces the C# 15 stub layout, 263 files with BOMs), the cross-reference GraphQL query, the statusCheckRollup query, and the probe harness.
  • Nothing here changes product code, tests or the CI workflow.

Worth a look ⚑

  • Several rules describe current maintainer preferences: no perf risk, humans merge, and agents don't close or comment on issues unless asked. Edit them if they don't match how you want outside contributors' agents to behave.
  • The check count (25) and the compiler table in testing-and-coverage are a snapshot. The audit skill says to update them when a test project is added.

…and PRs

Agent Skills (SKILL.md with name/description frontmatter) under .agents/skills, the
cross-client location read by GitHub Copilot (cloud agent, CLI, code review), VS Code,
Visual Studio, Codex and Cursor. Each skill is a procedure grounded in how the C# 10-15
audits, the Oct 2026 issue triage and the follow-up bug fixes were done in this repo.

csharp-language-version-audit also carries the probe harness used for those audits
(scripts/probe), which runs every analyzer and code fix on snippet files.
Claude Code reads CLAUDE.md rather than AGENTS.md and doesn't discover .agents/skills, so CLAUDE.md imports AGENTS.md, which links each skill.
@AArnott
AArnott marked this pull request as ready for review October 10, 2026 03:07
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.58%. Comparing base (61b4c85) to head (1cb6475).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4209   +/-   ##
=======================================
  Coverage   97.57%   97.58%           
=======================================
  Files        1276     1276           
  Lines      135074   135074           
  Branches     4333     4333           
=======================================
+ Hits       131805   131807    +2     
+ Misses       2120     2119    -1     
+ Partials     1149     1148    -1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AArnott
AArnott merged commit 9e2e85c into master Oct 10, 2026
25 checks passed
@AArnott
AArnott deleted the agent-skills branch October 10, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant