Skip to content

1901 aligning coding standards skill discovery - #2358

Open
vdstrizhkova wants to merge 9 commits into
microsoft:mainfrom
vdstrizhkova:feat/1901-align-coding-standards-skill-discovery
Open

1901 aligning coding standards skill discovery#2358
vdstrizhkova wants to merge 9 commits into
microsoft:mainfrom
vdstrizhkova:feat/1901-align-coding-standards-skill-discovery

Conversation

@vdstrizhkova

Copy link
Copy Markdown
Contributor

Pull Request

Description

Aligns the Code Review Standards perspective with platform-supported coding-standards skill discovery roots for issue #1901.

This PR updates the coding-standards standards subagent and docs to clarify that skill discovery starts from supported roots, then semantic matching selects relevant discovered candidates. It also documents same-name de-duplication, repository precedence over the built-in baseline, additive stacking for distinct skill names, and visible handling for contradictory distinct skills.

The change adds advisory Vally coverage for the requested merge-policy scenarios: no conflict, same-name collision, and contradictory distinct skills.

Related Issue(s)

Fixes #1901

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder agent and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)
  • Copilot hook (.github/hooks/*/*.json)
  • Eval spec added/updated for changed AI artifacts (evals/)

Note for AI Artifact Contributors:

  • Agents: Research, indexing/referencing other project (using standard VS Code GitHub Copilot/MCP tools), planning, and general implementation agents likely already exist. Review .github/agents/ before creating new ones.
  • Skills: Must include both bash and PowerShell scripts. See Skills.
  • Model Versions: Only contributions targeting the latest Anthropic and OpenAI models will be accepted. Older model versions (e.g., GPT-3.5, Claude 3) will be rejected.
  • See Agents Not Accepted and Model Version Requirements.

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Sample Prompts (for AI Artifact Contributions)

User Request:

Run the Code Review Standards perspective on a Python diff when both built-in and repository-authored coding-standards skills are available.

Execution Flow:

  1. The Code Review orchestrator prepares the review context and invokes the standards perspective.
  2. The standards subagent discovers coding-standards skill candidates from the built-in hve-core baseline and supported repository or configured roots.
  3. Same-named skills are de-duplicated before semantic selection, with repository-authored candidates taking precedence over the built-in baseline.
  4. Distinct-named matching skills stack additively up to the configured limit.
  5. Contradictory distinct skills surface findings from each skill instead of silently merging or suppressing either policy.

Output Artifacts:

  • Standards findings from the Code Review Standards perspective.
  • Updated documentation for language skill discovery and merge behavior.
  • Updated advisory Vally stimuli and generated eval spec for the merge-policy scenarios.

Success Indicators:

  • Same-named built-in and repository skills do not both load.
  • Repository-authored same-name skills take precedence over the built-in baseline.
  • Distinct-named skills apply together when both match the changed files.
  • Contradictory distinct skills are both surfaced for reviewer judgment.
  • Focused merge-policy Vally scenarios pass.

For detailed contribution requirements, see:

Testing

Automated validation performed:

  • pwsh scripts/evals/Build-AgentBehaviorSpec.ps1 -Force - passed

  • npm run eval:lint:schema - passed

    • 10 specs validated successfully
    • Agent behavior coverage: 48 covered, 0 missing
  • Focused advisory Vally eval - passed

    Command: npx vally eval --eval-spec evals/agent-behavior/eval.yaml --tag scenario=merge-no-conflict,merge-name-collision,merge-content-contradiction --runs 1 --output-dir /tmp/vally-merge-results

    Result: agent-behavior: passed (score: 100.0%, threshold: 70.0%)

  • npm run lint:md -- docs/agents/code-review/language-skills.md docs/agents/code-review/README.md .github/agents/coding-standards/subagents/code-review-standards.agent.md - passed

  • npm run lint:frontmatter - passed

    • 801 files validated
    • 0 errors, 0 warnings
  • npm run lint:md-links - passed

  • npm run spell-check - passed

    • 657 files checked
    • 0 issues
  • git diff --check -- .github/agents/coding-standards/subagents/code-review-standards.agent.md docs/agents/code-review/README.md docs/agents/code-review/language-skills.md evals/agent-behavior/stimuli/code-review-standards.yml evals/agent-behavior/eval.yaml - passed

  • VS Code diagnostics on touched files - passed

    • No errors found

Manual testing was not performed.

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable)

AI Artifact Contributions

  • Used /prompt-analyze to review contribution
  • Addressed all feedback from prompt-builder review
  • Verified contribution follows common standards and type-specific requirements

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md
  • Spell checking: npm run spell-check
  • Frontmatter validation: npm run lint:frontmatter
  • Skill structure validation: npm run validate:skills (N/A - no skill files changed)
  • Link validation: npm run lint:md-links
  • PowerShell analysis: npm run lint:ps (N/A - no PowerShell files changed)
  • Eval spec schema and coverage (if AI artifacts changed): npm run eval:lint:schema
  • Plugin freshness: npm run plugin:generate
  • Docusaurus tests: npm run docs:test

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues (N/A - no dependency changes)
  • Security-related scripts follow the principle of least privilege (N/A - no security scripts changed)

GHCP Artifact Maturity

Warning

This PR includes experimental GHCP artifacts that may have breaking changes.

  • .github/agents/coding-standards/subagents/code-review-standards.agent.md
File Type Maturity Notes
.github/agents/coding-standards/subagents/code-review-standards.agent.md Agent experimental Standards perspective subagent

GHCP Maturity Acknowledgment

  • I acknowledge this PR includes non-stable GHCP artifacts
  • Non-stable artifacts are intentional for this change

Additional Notes

This PR is intentionally scoped to coding-standards discovery and merge behavior only. It does not broaden security or accessibility skill discovery.

@codecov-commenter

codecov-commenter commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.74%. Comparing base (8ae6195) to head (81bad11).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2358      +/-   ##
==========================================
- Coverage   82.76%   82.74%   -0.03%     
==========================================
  Files         154      154              
  Lines       20853    20831      -22     
  Branches       13       13              
==========================================
- Hits        17259    17236      -23     
- Misses       3592     3593       +1     
  Partials        2        2              
Flag Coverage Δ
docusaurus 94.44% <ø> (ø)
pester 86.26% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdstrizhkova
vdstrizhkova force-pushed the feat/1901-align-coding-standards-skill-discovery branch from d6d15dc to b538028 Compare July 2, 2026 13:28
@vdstrizhkova
vdstrizhkova marked this pull request as ready for review July 2, 2026 13:57
@vdstrizhkova
vdstrizhkova requested a review from a team as a code owner July 2, 2026 13:57

@WilliamBerryiii WilliamBerryiii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like either the eval matrix job is broken, or the discovery system has a bug as the evals weren't run over the new tests. Might want to do a root cause analysis on that and file a bug.

Comment thread .github/agents/coding-standards/subagents/code-review-standards.agent.md Outdated
Comment thread .github/agents/coding-standards/subagents/code-review-standards.agent.md Outdated
Comment thread .github/agents/coding-standards/subagents/code-review-standards.agent.md Outdated
Comment thread .github/agents/coding-standards/subagents/code-review-standards.agent.md Outdated
Comment thread docs/agents/code-review/language-skills.md Outdated
Comment thread evals/agent-behavior/stimuli/code-review-standards.yml Outdated
Comment thread evals/agent-behavior/stimuli/code-review-standards.yml Outdated
Comment thread evals/agent-behavior/eval.yaml
@vdstrizhkova
vdstrizhkova force-pushed the feat/1901-align-coding-standards-skill-discovery branch from f164d99 to ff26b45 Compare July 3, 2026 09:24
@vdstrizhkova
vdstrizhkova marked this pull request as draft July 3, 2026 09:25
@vdstrizhkova

Copy link
Copy Markdown
Contributor Author

@WilliamBerryiii thanks for the review!
The issue with running the tests is that by default sub-agents are not run.
There are two ways to fix it: move the tests to the parent code-standards agent (with the loss of granularity) or enable the run of sub-agents. I opted right now for the first option as the second will bring a lot of changes to the PR. Please let me know if you want me to open a ticket and look into the sub-agents tests run separately or in this PR

Varvara Strizhkova and others added 5 commits July 6, 2026 13:12
add behavior tests

- Reframe standards discovery via Workspace/User/Bundled origin precedence and coverage-based stacking
- Add code-review stimuli: user-tier precedence, unknown-origin dedup, stacked coverage
- Regenerate agent-behavior eval.yaml from partials
replaced with named origin references
fixed spellcheck
@vdstrizhkova
vdstrizhkova marked this pull request as ready for review July 7, 2026 06:56
* **Define file groups.** For coverage decisions, treat each distinct literal extension in `extensions` as a changed file group. Also treat obvious framework or tool signals from `files` as groups when they appear in filenames or path segments. If a language or framework is uncertain, use the literal extension group rather than inferring a broader group.
* **Preserve origin evidence.** Keep each candidate skill's exact `name`, `description`, and any source label or path together throughout selection. Treat workspace paths as Workspace, user-profile paths or labels as User, and extension, plugin, or bundled labels as Bundled. If no source label or path is available, mark the origin as Unknown rather than inferring it from content.
* **Resolve duplicates.** If same-named skills are available and their origin is identifiable, prefer Workspace over User over Bundled. If origin is Unknown, load one same-named skill only, do not merge bodies, and mention the ambiguous duplicate in the one-line return summary.
* **Load stacked skills.** Load distinct-named matches needed to cover every changed language, framework, or literal extension so their checklists stack. Do not drop a skill if it is the only match for any changed file group. When many skills match, include additional skills only when they cover otherwise-uncovered file groups; drop description-only matches first.

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.

The previous step 2 had an explicit ceiling of "up to 8 matching skills." That cap appears to have been removed in this revision. Was that intentional?

The new stacking heuristic (cover every changed file group, drop description-only matches first) is a quality improvement, but on a diff that genuinely touches many distinct languages or frameworks, there is no longer a hard upper bound on how many skills the agent loads. On smaller models, an unbounded load could exhaust the context window.

If the removal was unintentional, consider appending "Load at most 8 skills total." to this sub-bullet to restore the guard.

## Extending with Custom Skills

The Standards and Accessibility perspectives discover skills dynamically at review time. You extend coverage by adding `SKILL.md` files to your repository without modifying the agent itself. See [Language Skills](language-skills.md) for the full guide on built-in skills, skill stacking, and authoring enterprise-specific standards.
The Standards perspective discovers coding-standards skills dynamically at review time. You extend coverage by adding `SKILL.md` files under a supported repository skill root without modifying the agent itself. See [Language Skills](language-skills.md) for the full guide on built-in skills, skill stacking, same-name precedence, and authoring enterprise-specific standards.

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.

The previous sentence also covered the Accessibility perspective: "The Standards and Accessibility perspectives discover skills dynamically at review time." That reference has been removed here.

Was this intentional scoping for this PR? If the Accessibility perspective still supports custom skill authoring, consider keeping a mention rather than dropping it entirely. For example:

The Standards perspective discovers coding-standards skills dynamically at review time; the Accessibility perspective uses the same extension mechanism for accessibility skills. You extend either by adding SKILL.md files under a supported repository skill root without modifying the agent itself.

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.

feat(agents): align coding-standards skill discovery with VS Code and Copilot CLI skill locations

4 participants