Skip to content

feat(copilot): add chat skills, instructions and when-gates for langu…#1643

Merged
wenytang-ms merged 1 commit into
mainfrom
feat/copilot-chat-activation
May 20, 2026
Merged

feat(copilot): add chat skills, instructions and when-gates for langu…#1643
wenytang-ms merged 1 commit into
mainfrom
feat/copilot-chat-activation

Conversation

@wenytang-ms
Copy link
Copy Markdown
Contributor

…age model tools

  • Gate all 10 language model tools with when clauses so they only register when the Java Language Server is ready, and (for active-debug-session-only tools) when an active java debug session is in progress. This avoids loading failures and reduces the noise Copilot sees from this extension's tool catalog when the tools cannot actually run.

  • Contribute a chatInstructions file (javaDebugContext.instructions.md) with a keyword-rich, on-demand description (no applyTo, to avoid burning context on every Java edit) that tells Copilot to activate the deferred Java debug tools via tool_search_tool_regex and routes the user request to one of the two skills below.

  • Contribute two chatSkills, split by user-habit telemetry (launch/stop is ~52% of tool usage; inspection/step is ~28%):

    • java-launch-troubleshooting — start/stop a Java program and diagnose launch failures (mainClass missing, classpath, build errors, project not detected). Gated by javaLSReady so it is discoverable any time in a Java workspace.
    • java-debug-inspection — inspect variables, walk the stack, list threads, evaluate expressions, step in/over/out, continue, and manage breakpoints in an active Java debug session. Gated by javaLSReady && inDebugMode && debugType == 'java' so it only appears once a Java debug session is alive — keeping it reactive, not proactive.

…age model tools

- Gate all 10 language model tools with `when` clauses so they only register
  when the Java Language Server is ready, and (for active-debug-session-only
  tools) when an active `java` debug session is in progress. This avoids
  loading failures and reduces the noise Copilot sees from this extension's
  tool catalog when the tools cannot actually run.

- Contribute a `chatInstructions` file (`javaDebugContext.instructions.md`)
  with a keyword-rich, on-demand description (no `applyTo`, to avoid burning
  context on every Java edit) that tells Copilot to activate the deferred
  Java debug tools via `tool_search_tool_regex` and routes the user request
  to one of the two skills below.

- Contribute two `chatSkills`, split by user-habit telemetry (launch/stop is
  ~52% of tool usage; inspection/step is ~28%):
  - `java-launch-troubleshooting` — start/stop a Java program and diagnose
    launch failures (mainClass missing, classpath, build errors, project
    not detected). Gated by `javaLSReady` so it is discoverable any time
    in a Java workspace.
  - `java-debug-inspection` — inspect variables, walk the stack, list
    threads, evaluate expressions, step in/over/out, continue, and manage
    breakpoints in an active Java debug session. Gated by
    `javaLSReady && inDebugMode && debugType == 'java'` so it only appears
    once a Java debug session is alive — keeping it reactive, not proactive.
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

This PR adds Copilot Chat “skills” and an on-demand instructions file for Java debugging, and gates the extension’s Java debug language model tools so they’re only contributed when the Java Language Server (and, for inspection tools, an active Java debug session) is available—reducing tool-catalog noise and avoiding tool availability mismatches.

Changes:

  • Added two chatSkills (java-launch-troubleshooting, java-debug-inspection) with targeted workflows and tool routing.
  • Added a chatInstructions file to steer Copilot to load the right skill and activate deferred Java debug tools.
  • Added when clauses to all Java debug language model tool contributions (and to the skills/instructions contributions).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
resources/skills/java-launch-troubleshooting/SKILL.md New skill guidance for launch/start/stop + diagnosing launch failures using Java debug LM tools.
resources/skills/java-debug-inspection/SKILL.md New skill guidance for in-session inspection/stepping/breakpoints using Java debug LM tools.
resources/instruments/javaDebugContext.instructions.md New on-demand instructions to select the correct skill and prefer Java debug LM tools over generic shell commands.
package.json Adds when gating to LM tools and contributes the new chat skills/instructions with matching gates.

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

Comment thread package.json
@wenytang-ms wenytang-ms merged commit 1bf69fe into main May 20, 2026
10 of 12 checks passed
@wenytang-ms wenytang-ms deleted the feat/copilot-chat-activation branch May 20, 2026 08:02
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