Skip to content

Add Copilot agent skills and expand contributor instructions#4863

Merged
hanniavalera merged 3 commits intomainfrom
dev/hanniavalera/copilotImprovements
Apr 20, 2026
Merged

Add Copilot agent skills and expand contributor instructions#4863
hanniavalera merged 3 commits intomainfrom
dev/hanniavalera/copilotImprovements

Conversation

@hanniavalera
Copy link
Copy Markdown
Contributor

@hanniavalera hanniavalera commented Apr 6, 2026

Summary

This PR improves the Copilot agent experience for contributors to CMake Tools by:

  1. Adding auto-discoverable skills — Step-by-step recipes the agent automatically loads based on task context
  2. Expanding contributor instructions — More conventions, patterns, and checklists in .github/copilot-instructions.md
  3. Enabling Copilot CI — A setup workflow that bypasses the private Azure Artifacts registry so the agent can build and test

New Skills

Skill Triggers on Purpose
add-command "add command", "register command", extension.ts changes Adding a new cmake.* command
add-setting "add setting", "new configuration", config.ts changes Adding a new cmake.* setting
add-diagnostic-parser "add parser", "diagnostic parser", src/diagnostics/ changes Adding a compiler output parser
presets-vs-kits "presets vs kits", "useCMakePresets", dual-mode code Writing code that handles both operating modes
backend-tests "backend test", "unit test", test/unit-tests/backend/ changes Writing fast Mocha tests without VS Code

Skills use YAML frontmatter with name and description so the agent can auto-load them when relevant.

Expanded Contributor Instructions

New sections in .github/copilot-instructions.md:

  • Reactive configuration subscriptions — Use ConfigurationReader.onChange(), not vscode.workspace.onDidChangeConfiguration
  • SpecialKits sentinel values — Always check for __unspec__, __scanforkits__ before treating a kit as a real compiler
  • Kit trust model — Don't bypass isTrusted filtering
  • NLS key naming — Conventions for package.nls.json keys
  • Setting scope — When to use "resource" vs "window"
  • Adding diagnostic parsers — Quick checklist (detailed recipe in skill)
  • Copilot CI environment — Warning about .npmrc.bak and patched yarn.lock
  • Backend tests — Import strategy, mirror pattern for vscode-dependent modules

Copilot agent CI environment (agent-only)

This section applies only to the Copilot coding agent, not human contributors.

The Copilot agent runs in a sandbox without Azure Artifacts credentials. The copilot-setup-steps.yml workflow patches the registry configuration to allow yarn install to succeed.

If you are the Copilot agent and git status shows .npmrc.bak or modified yarn.lock:

  • These are environment artifacts — do not commit them
  • Run git checkout -- .npmrc yarn.lock before committing

If you are a human contributor: Ignore this section. Your local environment should use the standard .npmrc and yarn.lock as-is. If you have Azure Artifacts access issues, see the repo's onboarding docs or contact the team.

Why This Matters

  • Faster onboarding — New contributors (human or AI) get actionable guidance without reading the entire codebase
  • Fewer review cycles — Skills encode common patterns and checklists, reducing "you forgot X" comments
  • Auto-discovery — The agent loads relevant skills based on task context, not just when explicitly invoked
  • CI validation — The agent can now run backend tests to catch regressions before opening a PR

Testing

  • Skills render correctly in GitHub UI
  • yarn compile passes
  • yarn backendTests passes
  • Copilot agent can load skills based on description triggers (manual testing)

No user-facing changes — this is contributor/agent tooling only.

@hanniavalera hanniavalera force-pushed the dev/hanniavalera/copilotImprovements branch from e08a62b to fcbbde5 Compare April 8, 2026 16:51
@hanniavalera hanniavalera force-pushed the dev/hanniavalera/copilotImprovements branch from db31e45 to f69660c Compare April 20, 2026 19:52
@hanniavalera hanniavalera requested a review from snehara99 April 20, 2026 20:00
@hanniavalera hanniavalera changed the title improve copilot agent setup: instructions, prompts, and ci environment Add Copilot agent skills and expand contributor instructions Apr 20, 2026
@hanniavalera hanniavalera marked this pull request as ready for review April 20, 2026 20:01
@hanniavalera hanniavalera merged commit e90fa2c into main Apr 20, 2026
4 checks passed
@hanniavalera hanniavalera deleted the dev/hanniavalera/copilotImprovements branch April 20, 2026 20:29
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.

2 participants