Skip to content

Fix msbuild skill spec conformance violations - #247

Merged
ViktorHofer merged 1 commit into
dotnet:mainfrom
danmoseley:fix/msbuild-spec-conformance
Mar 6, 2026
Merged

ViktorHofer merged 1 commit into
dotnet:mainfrom
danmoseley:fix/msbuild-spec-conformance

Conversation

@danmoseley

@danmoseley danmoseley commented Mar 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the two spec conformance violations flagged by the new checks in #238:

  1. msbuild-antipatterns: Body was 583 lines (max 500). Moved AP-16 through AP-21 and the quick-reference checklist to references/additional-antipatterns.md. Body is now 384 lines.

  2. directory-build-organization: Had a cross-skill reference ../msbuild-antipatterns/SKILL.md (3 levels deep, max is 1). Replaced with a local references/targetframework-props-pitfall.md containing the same AP-21 content.

After this merges and #238 merges, the body-lines and file-ref-depth checks in SkillProfiler should be upgraded from warnings to blocking errors. Change locations:

  • eng/skill-validator/src/Services/SkillProfiler.cs — look for comments warning only — upgrade to blocking error after existing skills are fixed (around the body-lines and ref-depth checks)

Copilot AI review requested due to automatic review settings March 5, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates dotnet-msbuild skills and the skill-validator tooling to conform to new agentskills.io spec checks (body line count + reference depth), while adding additional enforcement around SKILL.md frontmatter fields.

Changes:

  • Move AP-16–AP-21 + checklist out of msbuild-antipatterns/SKILL.md into a local references file to meet body-length limits.
  • Remove cross-skill reference from directory-build-organization by inlining AP-21 content into a local reference.
  • Extend SkillProfiler/discovery/frontmatter parsing to validate name/description/compatibility and add CI tooling to validate description sizes.

Reviewed changes

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

Show a summary per file
File Description
plugins/dotnet-msbuild/skills/msbuild-antipatterns/references/additional-antipatterns.md New reference doc containing AP-16–AP-21 + checklist to reduce SKILL.md body length.
plugins/dotnet-msbuild/skills/msbuild-antipatterns/SKILL.md Removes large sections and links to the new reference file.
plugins/dotnet-msbuild/skills/directory-build-organization/references/targetframework-props-pitfall.md New local reference to replace a cross-skill link (AP-21 content).
plugins/dotnet-msbuild/skills/directory-build-organization/SKILL.md Updates link to local reference to satisfy reference-depth rules.
eng/validate-descriptions.ps1 Adds repo-wide script to validate per-skill and per-plugin aggregate description sizes.
eng/tests/validate-descriptions.tests.ps1 Adds PowerShell tests for the description-size validation script.
eng/skill-validator/tests/SkillProfileTests.cs Adds unit tests for name/description/compatibility/body-lines/ref-depth checks.
eng/skill-validator/src/Services/SkillProfiler.cs Implements new spec conformance validations and adds DescriptionTooLong to profile.
eng/skill-validator/src/Services/SkillDiscovery.cs Threads compatibility from SKILL.md frontmatter into SkillInfo.
eng/skill-validator/src/Services/EvalSchema.cs Adds Compatibility to frontmatter schema.
eng/skill-validator/src/Models/Models.cs Adds Compatibility field to SkillInfo.
eng/skill-validator/src/Commands/ValidateCommand.cs Makes overlong descriptions a blocking failure (description_too_long).
agentic-workflows/dotnet-msbuild/build.ps1 Calls the central description-size validator during workflow build validation.
.github/workflows/validate-descriptions.yml Adds CI workflow to enforce description-size limits on PRs/pushes.
.github/CODEOWNERS Updates ownership entries (unrelated to msbuild spec conformance).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/CODEOWNERS Resolved
@danmoseley
danmoseley force-pushed the fix/msbuild-spec-conformance branch 2 times, most recently from 7e34628 to bf1dc0b Compare March 5, 2026 22:16
@danmoseley

Copy link
Copy Markdown
Contributor Author

@ViktorHofer I think you authored these skills. Note that in order to enforce the depth requirement for references, this duplicates the "antipatterns" content from the other MSBuild skill, rather than "reaching into" the other skill.

I don't know how to avoid this, but it makes it conformant. Likely in use, the "reaching in" reference would not actually work. thoughts?

- msbuild-antipatterns: Move AP-16 through AP-21 and checklist to
  references/additional-antipatterns.md (body: 384 lines, was 583)
- directory-build-organization: Replace cross-skill reference to
  ../msbuild-antipatterns/SKILL.md with local reference file
  references/targetframework-props-pitfall.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danmoseley
danmoseley force-pushed the fix/msbuild-spec-conformance branch from bf1dc0b to dedf961 Compare March 5, 2026 22:29
@JanKrivanek

Copy link
Copy Markdown
Member

/evaluate

@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Skill Validation Results

Skill Scenario Baseline With Skill Δ Skills Loaded Overfit Verdict
directory-build-organization Organize build infrastructure for a multi-project repo 3.0/5 4.7/5 +1.7 ✅ directory-build-organization; msbuild-antipatterns; tools: skill ✅ 0.14 ✅
msbuild-antipatterns Review MSBuild files for anti-patterns and style issues 5.0/5 5.0/5 0.0 ✅ msbuild-antipatterns; tools: skill, glob, edit ✅ 0.05 ❌

Model: claude-opus-4.6 | Judge: claude-opus-4.6

Full results

@ViktorHofer
ViktorHofer merged commit d5bd687 into dotnet:main Mar 6, 2026
6 checks passed
danmoseley pushed a commit to danmoseley/skills that referenced this pull request Mar 6, 2026
Now that dotnet#247 has merged and fixed the two existing violations
(msbuild-antipatterns 582 lines, directory-build-organization cross-ref),
these spec conformance checks can be blocking.

Also replaces the DescriptionTooLong bool with a general Errors list on
SkillProfile, so all spec conformance violations (description length,
body lines, file ref depth) flow through the same mechanism.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danmoseley
danmoseley deleted the fix/msbuild-spec-conformance branch March 6, 2026 22:32
danmoseley pushed a commit that referenced this pull request Mar 7, 2026
* Enforce description size limits (per-skill 1024, per-plugin 15K)

Add infrastructure to reject skills with oversized descriptions, per issue #222:

- SkillProfiler: check description length, flag DescriptionTooLong
- ValidateCommand: block oversized descriptions (survives --verdict-warn-only)
- New eng/validate-descriptions.ps1: validates per-skill and per-plugin aggregate limits
- New CI workflow: runs validation on PRs touching plugins/
- build.ps1: adds size checks to local build validation
- Unit tests for all new SkillProfiler behavior

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update --verdict-warn-only help text to mention description_too_long

Address review feedback: the option description now lists description_too_long
alongside execution errors and --require-evals as conditions that remain
fatal even when --verdict-warn-only is enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add agentskills.io spec conformance checks to SkillProfiler

Validate name rules (max 64 chars, lowercase+hyphens, no edge/consecutive
hyphens, must match directory), compatibility field max 500 chars, body
max 500 lines, and file reference depth.

Scan of existing skills found 2 violations:
- dotnet-msbuild/msbuild-antipatterns: 582 lines (max 500)
- dotnet-msbuild/directory-build-organization: cross-skill ref 3 levels deep

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback on spec conformance checks

- Fix MakeSkill SkillMdPath to derive from resolved path (SkillProfileTests.cs)
- Fix RepoRoot in build.ps1 to be actual repo root (was agentic-workflows/)
- Fix body line count off-by-one: trim trailing newlines before splitting
- Fix file ref depth: normalize paths, handle .. traversals, strip #anchor,
  compute depth from directory segments only
- Add tests for parent traversal, anchor fragments, ./ normalization,
  and trailing newline body count

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Consolidate description validation into skill-validator C#

Move the per-plugin aggregate description limit (15K chars) from the
standalone PowerShell script into ValidateCommand, where it runs after
skill discovery. This eliminates the separate validate-descriptions.ps1,
its CI workflow, its PowerShell tests, and the delegation from build.ps1.

Also rename FailureKind from "description_too_long" to the generic
"spec_conformance_failure" so future spec checks reuse the same kind.

Deleted:
  - eng/validate-descriptions.ps1
  - eng/tests/validate-descriptions.tests.ps1
  - .github/workflows/validate-descriptions.yml

Added:
  - ValidateCommand.CheckAggregateDescriptionLimits()
  - ValidateCommand.DerivePluginName()
  - 6 C# tests for aggregate limit + DerivePluginName

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Upgrade body-lines and file-ref-depth from warnings to blocking errors

Now that #247 has merged and fixed the two existing violations
(msbuild-antipatterns 582 lines, directory-build-organization cross-ref),
these spec conformance checks can be blocking.

Also replaces the DescriptionTooLong bool with a general Errors list on
SkillProfile, so all spec conformance violations (description length,
body lines, file ref depth) flow through the same mechanism.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Revert unrelated lock file changes

The lock file diffs were side effects of running build.ps1 to verify
the validation changes — they picked up upstream content changes
unrelated to this PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

4 participants