feat(copilot): add chat skills, instructions and when-gates for langu…#1643
Merged
Conversation
…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.
There was a problem hiding this comment.
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
chatInstructionsfile to steer Copilot to load the right skill and activate deferred Java debug tools. - Added
whenclauses 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.
chagong
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…age model tools
Gate all 10 language model tools with
whenclauses so they only register when the Java Language Server is ready, and (for active-debug-session-only tools) when an activejavadebug 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
chatInstructionsfile (javaDebugContext.instructions.md) with a keyword-rich, on-demand description (noapplyTo, to avoid burning context on every Java edit) that tells Copilot to activate the deferred Java debug tools viatool_search_tool_regexand 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 byjavaLSReadyso 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 byjavaLSReady && inDebugMode && debugType == 'java'so it only appears once a Java debug session is alive — keeping it reactive, not proactive.