Skip to content

feat: Support agent skills in agent mode and add preferences settings#133

Open
ethanyhou wants to merge 21 commits intomainfrom
ethan/support-skill
Open

feat: Support agent skills in agent mode and add preferences settings#133
ethanyhou wants to merge 21 commits intomainfrom
ethan/support-skill

Conversation

@ethanyhou
Copy link
Copy Markdown
Contributor

  1. Create SKILL.md files across directories:
    '.github/skills/**/SKILL.md',
    '.claude/skills/**/SKILL.md',
    '.agents/skills/**/SKILL.md',
    '~/.copilot/skills/**/SKILL.md',
    '~/.claude/skills/**/SKILL.md',
    '~/.agents/skills/**/SKILL.md'
  1. Go to preference page to enable the skill:
    image
  2. Switch to agent mode and type /, the skills should be rendered / hide corresponding to the preference settings.
    image
  3. Skills is only enabled in agent mode, this is a CLS side behavior.

Copilot AI review requested due to automatic review settings April 29, 2026 08:57
@ethanyhou ethanyhou changed the title Ethan/support skill feat: Support agent skills in agent mode and add preferences settings Apr 29, 2026
Copy link
Copy Markdown

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 Skills support to Copilot Chat’s Agent experience by wiring a new “Enable Skills” preference through to CLS settings, extending the conversation templates LSP request to include workspace folders (so CLS can discover SKILL.md / .prompt.md), and updating UI/test infrastructure to validate skills rendering via SWTBot probes.

Changes:

  • Add “Enable Skills” preference (UI strings, preference page UI, defaults) and propagate it to language server settings.
  • Extend conversation/templates request to include workspace folders; enrich template model with source (BUILTIN/PROMPT/SKILL) and update completion filtering/sorting.
  • Add SWTBot probe actions + a new probe script to validate skills appear/disappear based on the preference.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/messages.properties Adds UI strings for Skills toggle; adjusts sub-agent label.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/Messages.java Adds NLS keys for Skills toggle.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/LanguageServerSettingManager.java Syncs enableSkills to CLS settings, including live updates.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/CopilotPreferenceInitializer.java Sets default values for sub-agent + skills toggles.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/preferences/ChatPreferencesPage.java Adds “Enable Skills” field editor; refactors layout helpers.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionService.java Refreshes templates using workspace folders; listens for skill/prompt file changes + pref changes.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatAssistProcessor.java Filters templates by mode scope and improves matching/sorting; displays skills using short description.
com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/preferences/LanguageServerSettingManagerTests.java Updates mocks for the new preference key.
com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/chat/services/McpExtensionPointManagerTest.java Fixes test setup to avoid NPE; improves null-map assertion.
com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionServiceTest.java Updates tests for new templates API + job family; adds static mocking of CopilotUi.
com.microsoft.copilot.eclipse.swtbot.test/src/com/microsoft/copilot/eclipse/swtbot/test/probe/StepExecutor.java Adds new probe actions (preferences, workspace file ops, job waiting, content-assist assertions, key typing).
com.microsoft.copilot.eclipse.swtbot.test/src/com/microsoft/copilot/eclipse/swtbot/test/probe/ProbeStep.java Adds fields needed for the new probe actions.
com.microsoft.copilot.eclipse.swtbot.test/src/com/microsoft/copilot/eclipse/swtbot/test/probe/Locator.java Documents new checkBox locator type.
com.microsoft.copilot.eclipse.swtbot.test/probe-scripts/skills-file-with-pref-001.json New probe validating Skills enabled/disabled behavior.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/TemplateSource.java New enum identifying template source type.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotAgentSettings.java Adds enableSkills setting.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ConversationTemplatesParams.java New params record for conversation/templates request.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ConversationTemplate.java Converts template model to a record; adds source.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServerConnection.java Updates listConversationTemplates to pass workspace folders.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServer.java Updates LSP request signature for templates to accept params.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/Constants.java Adds ENABLE_SKILLS preference key.
.github/skills/ui-action/SKILL.md Documents new probe actions used by the skills probe script.
Comments suppressed due to low confidence (2)

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionService.java:120

  • InterruptedException is caught and only logged here. The thread interrupt flag should be restored (Thread.currentThread().interrupt()) so callers/framework code can react appropriately (e.g., job cancellation).
    } catch (InterruptedException | ExecutionException e) {
      CopilotCore.LOGGER.error(e);
    }

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ChatCompletionService.java:234

  • syncCommands() mutates the current HashSet/ArrayList instances via clear(). Since fetchAsync() updates these fields from a background Job, readers (e.g., isCommand() from the UI thread) can race with clear(), and HashSet/ArrayList are not thread-safe for concurrent reads+writes. Prefer swapping in new immutable/empty instances (e.g., Collections.emptySet()/emptyList()) to keep the snapshot swap pattern consistent and avoid concurrent mutation.
  private void syncCommands(String status) {
    switch (status) {
      case CopilotStatusResult.OK:
        fetchAsync();
        break;
      default:
        allCommands.clear();
        templates.clear();
        agents.clear();
        break;

ethanyhou and others added 2 commits April 29, 2026 17:20
Co-authored-by: Copilot <copilot@github.com>
@kwin
Copy link
Copy Markdown

kwin commented Apr 30, 2026

Looking forward to it, however README should probably updated as well for this feature.

ethanyhou and others added 7 commits May 6, 2026 13:42
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…rity

Co-authored-by: Copilot <copilot@github.com>
@ethanyhou ethanyhou requested a review from jdneo May 6, 2026 06:49
@ethanyhou
Copy link
Copy Markdown
Contributor Author

Looking forward to it, however README should probably updated as well for this feature.

@kwin added.

Co-authored-by: Copilot <copilot@github.com>
@ethanyhou ethanyhou requested a review from jdneo May 7, 2026 02:45
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