Skip to content

Add validation script and nested AGENTS.md to enforce agent skill quality#53721

Merged
lbussell merged 5 commits intodotnet:release/10.0.3xxfrom
lbussell:skill-quality
Apr 16, 2026
Merged

Add validation script and nested AGENTS.md to enforce agent skill quality#53721
lbussell merged 5 commits intodotnet:release/10.0.3xxfrom
lbussell:skill-quality

Conversation

@lbussell
Copy link
Copy Markdown
Member

@lbussell lbussell commented Apr 6, 2026

#53479 attempted to introduce an agent skill but it was not properly formatted or located in the correct directory. It also did not follow some of the Agent Skills best practices.

This PR adds .github/skills/AGENTS.md which is intended to improve skill quality. It also adds a script that validates basic SKILL.md formatting requirements based on the specification.

Then in a new session, I had Copilot fix the incremental-test skill based on the spec + best practices. /cc @jjonescz

This should also be backported to main.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds repository-local guidance and validation to improve Agent Skill quality/consistency, and migrates the incremental test skill to the spec-compliant .github/skills/ layout.

Changes:

  • Add .github/skills/AGENTS.md with structure + checklist for creating skills.
  • Add a ValidateSkill.cs file-based app to validate basic SKILL.md frontmatter/size requirements.
  • Move/replace the incremental-test skill content into .github/skills/incremental-test/ and add a supporting copy script.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.github/skills/ValidateSkill.cs New validator script for SKILL.md frontmatter and size rules.
.github/skills/incremental-test/SKILL.md New spec-style skill document for incremental dotnet.Tests runs.
.github/skills/incremental-test/scripts/Copy-ToRedist.ps1 New helper script to copy built outputs into the redist SDK layout.
.github/skills/AGENTS.md New contributor guidance/checklist for skills under .github/skills/.
.github/copilot/skills/incremental-test.md Removes old skill doc from the previous location.
.github/copilot-instructions.md Updates docs to reference the incremental-test skill instead of a specific file path.

Comment thread .github/skills/ValidateSkill.cs Outdated
Comment thread .github/skills/ValidateSkill.cs Outdated
Comment on lines +44 to +46
IDeserializer deserializer = new DeserializerBuilder().Build();
Dictionary<string, object> frontmatter = deserializer.Deserialize<Dictionary<string, object>>(yaml);

Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

Deserialize<Dictionary<string, object>> can throw on invalid YAML, which will surface as an unhandled exception/stack trace rather than a clear validation failure. Catch YAML parsing exceptions and return exit code 1 with a concise error message.

Copilot uses AI. Check for mistakes.
Comment thread .github/skills/ValidateSkill.cs Outdated
Comment on lines +92 to +96
int lineCount = text.Split('\n').Length;
if (lineCount > 500)
{
Console.Error.WriteLine($"SKILL.md is {lineCount} lines (max 500). See \"Progressive Disclosure\" at https://agentskills.io/specification.md");
return 1;
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

text.Split('\n').Length can overcount by 1 when the file ends with a trailing newline (common in repo files), potentially rejecting a 500-line file as 501. Use File.ReadLines(...).Count() or a split that removes empty trailing entries / handles CRLF consistently.

Copilot uses AI. Check for mistakes.
@jjonescz
Copy link
Copy Markdown
Member

jjonescz commented Apr 7, 2026

attempted to introduce an agent skill but it was not properly formatted or located in the correct directory.

Where is this specified? Copilot CLI and Copilot in VSCode found and used my skill without a problem.

@lbussell
Copy link
Copy Markdown
Member Author

lbussell commented Apr 7, 2026

Where is this specified? Copilot CLI and Copilot in VSCode found and used my skill without a problem.

Comment thread .github/skills/ValidateSkill.cs
Comment thread .github/skills/incremental-test/scripts/Copy-ToRedist.ps1 Outdated
lbussell and others added 2 commits April 7, 2026 08:35
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lbussell lbussell enabled auto-merge (squash) April 15, 2026 17:51
@lbussell
Copy link
Copy Markdown
Member Author

/ba-g

@jjonescz
Copy link
Copy Markdown
Member

you have to provide a reason, like this:

@jjonescz
Copy link
Copy Markdown
Member

/ba-g docs-only change

@lbussell lbussell merged commit eecf585 into dotnet:release/10.0.3xx Apr 16, 2026
13 of 14 checks passed
@lbussell
Copy link
Copy Markdown
Member Author

Thanks @jjonescz!

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.

3 participants