@codingame/monaco-vscode-chat-service-override 37.3.7 → 37.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-chat-service-override",
3
- "version": "37.3.7",
3
+ "version": "37.3.9",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - chat service-override",
6
6
  "keywords": [],
@@ -15,9 +15,10 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-api": "37.3.7",
19
- "@codingame/monaco-vscode-katex-common": "37.3.7",
20
- "@codingame/monaco-vscode-xterm-common": "37.3.7"
18
+ "@codingame/monaco-vscode-api": "37.3.9",
19
+ "@codingame/monaco-vscode-files-service-override": "37.3.9",
20
+ "@codingame/monaco-vscode-katex-common": "37.3.9",
21
+ "@codingame/monaco-vscode-xterm-common": "37.3.9"
21
22
  },
22
23
  "main": "index.js",
23
24
  "module": "index.js",
package/session.js CHANGED
@@ -40,7 +40,17 @@ import './vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webSo
40
40
  import '@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/providers/remoteAgentHost/browser/webTunnelAgentHostService.contribution';
41
41
  import './vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.js';
42
42
  import './vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.js';
43
+ import skillAssets from './vscode/src/vs/sessions/skills/all_/SKILL.md.js';
44
+ import { FileAccess } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
45
+ import { RegisteredFileSystemProvider, RegisteredUriFile, registerCustomProvider } from '@codingame/monaco-vscode-files-service-override';
46
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
43
47
 
48
+ FileAccess.registerAppResourcePathUrl('vs/sessions/skills', 'skills:/vs/sessions/skills');
49
+ const skillFileSystemProvider = new RegisteredFileSystemProvider(true);
50
+ for (const [assetPath, assetUrl] of Object.entries(skillAssets)) {
51
+ skillFileSystemProvider.registerFile(new RegisteredUriFile(URI.from({ scheme: 'skills', path: assetPath }), assetUrl));
52
+ }
53
+ registerCustomProvider('skills', skillFileSystemProvider);
44
54
  function getServiceOverride({ defaultAccount } = {}) {
45
55
  return {
46
56
  ...getServiceOverride$1({ defaultAccount }),
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: act-on-feedback
3
+ description: Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit Feedback button.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Act on Feedback
8
+
9
+ The user has provided feedback on the current session's changes.
10
+
11
+ 1. Use the `listComments` tool to retrieve the user's feedback comments for this session
12
+ 2. If specific feedback comments were attached to this message, act on **only** those attached comments (match them by their comment id); otherwise act on all of the listed comments, or whatever subset the user specified in their message
13
+ 3. Understand the intent behind each piece of feedback you are acting on
14
+ 4. Make the requested changes to address the feedback
15
+ 5. When feedback has been tackled, use the `resolveComments` tool to mark those comments as resolved, or the `deleteComments` tool to delete them
16
+ 6. Verify your changes are consistent with the rest of the codebase
@@ -0,0 +1,17 @@
1
+ var skillAssets = {
2
+ 'vs/sessions/skills/act-on-feedback/SKILL.md': new URL('../act-on-feedback/SKILL.md', import.meta.url).href,
3
+ 'vs/sessions/skills/code-review/SKILL.md': new URL('../code-review/SKILL.md', import.meta.url).href,
4
+ 'vs/sessions/skills/commit/SKILL.md': new URL('../commit/SKILL.md', import.meta.url).href,
5
+ 'vs/sessions/skills/create-draft-pr/SKILL.md': new URL('../create-draft-pr/SKILL.md', import.meta.url).href,
6
+ 'vs/sessions/skills/create-pr/SKILL.md': new URL('../create-pr/SKILL.md', import.meta.url).href,
7
+ 'vs/sessions/skills/fix-ci/SKILL.md': new URL('../fix-ci/SKILL.md', import.meta.url).href,
8
+ 'vs/sessions/skills/generate-run-commands/SKILL.md': new URL('../generate-run-commands/SKILL.md', import.meta.url).href,
9
+ 'vs/sessions/skills/merge/SKILL.md': new URL('../merge/SKILL.md', import.meta.url).href,
10
+ 'vs/sessions/skills/sync-upstream/SKILL.md': new URL('../sync-upstream/SKILL.md', import.meta.url).href,
11
+ 'vs/sessions/skills/troubleshoot/SKILL.md': new URL('../troubleshoot/SKILL.md', import.meta.url).href,
12
+ 'vs/sessions/skills/sync/SKILL.md': new URL('../sync/SKILL.md', import.meta.url).href,
13
+ 'vs/sessions/skills/update-pr/SKILL.md': new URL('../update-pr/SKILL.md', import.meta.url).href,
14
+ 'vs/sessions/skills/update-skills/SKILL.md': new URL('../update-skills/SKILL.md', import.meta.url).href
15
+ };
16
+
17
+ export { skillAssets as default };
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: code-review
3
+ description: Perform a code review of the current session's changes. Use when the user requests a code review via the Run Code Review button in the Changes toolbar.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Code Review
8
+
9
+ You are a coding agent acting as a code reviewer. Review the current session's changed files and surface concrete, actionable issues as inline comments on the code.
10
+
11
+ ## Workflow
12
+
13
+ 1. Determine the set of changed files in the current session (e.g. `git status`, `git diff`).
14
+ 2. For each changed file, read the relevant ranges and review them against the rest of the codebase:
15
+ - Correctness and edge cases
16
+ - Bugs, regressions, and missing error handling
17
+ - Security and data-handling issues
18
+ - Code clarity, naming, and consistency with surrounding code
19
+ - Tests and documentation gaps that the change introduces
20
+ 3. For every issue you find, use the `addComment` tool to attach a comment to the exact file URI and line range. Each comment should:
21
+ - Explain *what* is wrong and *why* it matters
22
+ - Be specific to that range - do not leave a single summary comment per file
23
+ 4. Prefer fewer, higher-signal comments over many minor stylistic nits. Do not comment on things that are already correct.
24
+ 5. Do not modify files. Do not run commits, pushes, or other write operations. Your only output is review comments.
25
+ 6. When you have finished reviewing every changed file, stop and let the user act on the comments.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: commit
3
+ description: Commit staged or unstaged changes with an AI-generated commit message that matches the repository's existing commit style. Use when the user asks to 'commit', 'commit changes', 'create a commit', 'save my work', or 'check in code'.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Commit Changes
8
+
9
+ Help the user commit code changes with a well-crafted commit message derived from the diff, following the conventions already established in the repository.
10
+
11
+ ## Guidelines
12
+
13
+ - **Never amend existing commits** without asking.
14
+ - **Never force-push or push** without explicit user approval.
15
+ - **Never skip pre-commit hooks** (do not use `--no-verify`).
16
+ - **Never skip signing commits** (do not use `--no-gpg-sign`).
17
+ - **Never revert, reset, or discard user changes** unless the user explicitly asked for that.
18
+ - Check for obvious secrets or generated artifacts that should not be committed. If something looks risky - ask the user.
19
+ - When in doubt about staging, convention, or message content — ask the user.
20
+
21
+ ## Workflow
22
+
23
+ ### 1. Discover the repository's commit convention
24
+
25
+ Run the following to sample recent commits and the user's own commits:
26
+
27
+ ```
28
+ # Recent repo commits (for overall style)
29
+ git log --oneline -20
30
+
31
+ # User's recent commits (for personal style)
32
+ git log --oneline --author="$(git config user.name)" -10
33
+ ```
34
+
35
+ Analyse the output to determine the commit message convention used in the repository (e.g. Conventional Commits, Gitmoji, ticket-prefixed, free-form). All generated messages **must** follow the detected convention.
36
+
37
+ ### 2. Check repository status
38
+
39
+ ```
40
+ git status --short
41
+ ```
42
+
43
+ - If there are **no changes** (working tree clean, nothing staged), inform the user and stop.
44
+ - If there are **staged changes**, proceed with those and do not stage any unstaged changes.
45
+ - If there are **only unstaged changes**, stage everything (`git add -A`), and proceed with those.
46
+
47
+ ### 3. Generate the commit message
48
+
49
+ Obtain the full diff of what will be committed:
50
+
51
+ ```bash
52
+ git diff --cached --stat
53
+ git diff --cached
54
+ ```
55
+
56
+ Using the diff and the commit convention detected in step 1, draft a commit message with:
57
+
58
+ - A **subject line** (≤ 72 characters) that summarises the change, following the repository's convention.
59
+ - An optional **body** that explains *why* the change was made, only when the diff is non-trivial.
60
+ - Reference issue/ticket numbers when they appear in branch names or related context.
61
+ - Focus on the intent of the change, not a file-by-file inventory.
62
+
63
+ ### 4. Commit
64
+
65
+ Construct the `git commit` command with the generated message.
66
+
67
+ Execute the commit:
68
+
69
+ ```
70
+ git commit -m "<subject>" -m "<body>"
71
+ ```
72
+
73
+ ### 5. Confirm
74
+
75
+ After the commit:
76
+
77
+ - Run `git status --short` to confirm the commit completed.
78
+ - Run `git log --oneline -1` to show the new commit.
79
+ - If pre-commit hooks changed files or blocked the commit, summarize exactly what happened.
80
+ - If hooks rewrote files after the commit attempt, do not amend automatically. Tell the user what changed and ask whether they want you to stage and commit those follow-up edits.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: create-draft-pr
3
+ description: Create a draft pull request for the current session. Use when the user wants to open a draft PR with the session's changes.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Create Draft Pull Request
8
+
9
+ Use the GitHub MCP server to create a draft pull request if available, otherwise use `gh` CLI.
10
+
11
+ 1. Run the compile and hygiene tasks (fixing any errors)
12
+ 2. If there are any uncommitted changes, use the `/commit` skill to commit them
13
+ 3. Review all changes in the current session
14
+ 4. Write a clear, concise PR title with a short area prefix (e.g. "sessions: …", "editor: …")
15
+ 5. Write a description covering what changed, why, and anything reviewers should know
16
+ 6. Create the draft pull request
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: create-pr
3
+ description: Create a pull request for the current session. Use when the user wants to open a PR with the session's changes.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Create Pull Request
8
+
9
+ Use the GitHub MCP server to create a pull request if available, otherwise use `gh` CLI.
10
+
11
+ 1. Run the compile and hygiene tasks (fixing any errors)
12
+ 2. If there are any uncommitted changes, use the `/commit` skill to commit them
13
+ 3. Review all changes in the current session
14
+ 4. Write a clear, concise PR title with a short area prefix (e.g. "sessions: …", "editor: …")
15
+ 5. Write a description covering what changed, why, and anything reviewers should know
16
+ 6. Create the pull request, passing `show_ui=false` so the PR is created without opening a confirmation UI
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: fix-ci
3
+ description: Fix the failed CI checks for the current session. Use when the user requests a CI fix via the Fix Checks button in the Changes toolbar.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Fix CI
8
+
9
+ Please fix the failed CI checks for this session immediately.
10
+
11
+ Use the failed check information provided with this message, including annotations and check output, to identify the root causes and make the necessary code changes.
12
+
13
+ ## Workflow
14
+
15
+ 1. Read the failed check information attached to this message. It includes a link to the pull request, and for each failed check the check name, status, conclusion, a details URL, and any annotations or output.
16
+ 2. Use the annotations and output to identify the root cause of each failure (e.g. compile errors, lint/hygiene violations, failing tests).
17
+ 3. Make the necessary code changes to resolve the failures. Focus on resolving these CI failures and avoid unrelated changes unless they are required to fix the checks.
18
+ 4. Validate your changes locally where possible (e.g. compile, lint, run the relevant tests) to confirm the failures are addressed.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: generate-run-commands
3
+ description: Generate or modify run commands for the current session. Use when the user wants to set up or update run commands that appear in the session's Run button.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Generate Run Commands
8
+
9
+ Help the user set up run commands for the current Agent Session workspace. Run commands appear in the session's Run button in the title bar.
10
+
11
+ ## Understanding the task schema
12
+
13
+ A run command is a `tasks.json` task with:
14
+ - `"inAgents": true` — required: makes the task appear in the Agents run button
15
+ - `"runOptions": { "runOn": "worktreeCreated" }` — optional: auto-runs the task whenever a new worktree is created (use for setup/install commands)
16
+
17
+ ```json
18
+ {
19
+ "tasks": [
20
+ {
21
+ "label": "Install dependencies",
22
+ "type": "shell",
23
+ "command": "npm install",
24
+ "inAgents": true,
25
+ "runOptions": { "runOn": "worktreeCreated" }
26
+ },
27
+ {
28
+ "label": "Start dev server",
29
+ "type": "shell",
30
+ "command": "npm run dev",
31
+ "inAgents": true
32
+ }
33
+ ]
34
+ }
35
+ ```
36
+
37
+ ## Decision logic
38
+
39
+ **First, read the existing `.vscode/tasks.json`** to check for existing run commands (`inAgents: true` tasks).
40
+
41
+ **If run commands already exist:** treat this as a modify request — ask the user what they'd like to change (add, remove, or update a command).
42
+
43
+ **If no run commands exist:** try to infer the right commands from the workspace:
44
+ - Check `package.json`, `Makefile`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `.nvmrc`, or other project files to understand the stack and common commands.
45
+ - If it's clear what the setup command is (e.g., `npm install`, `pip install -r requirements.txt`), add it with `"runOptions": { "runOn": "worktreeCreated" }` — no need to ask.
46
+ - If it's clear what the primary run/dev command is (e.g., `npm run dev`, `cargo run`), add it with just `"inAgents": true`.
47
+ - **Only ask the user** if the commands are ambiguous (e.g., multiple equally valid options, no recognizable project structure, or the project uses a non-standard setup).
48
+
49
+ ## Writing the file
50
+
51
+ Always write to `.vscode/tasks.json` in the workspace root. If the file already exists, merge — do not overwrite unrelated tasks.
52
+
53
+ After writing, briefly confirm what was added and how to trigger it from the Run button.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: merge
3
+ description: Merge changes from the topic branch to the merge base branch. Use when the user wants to merge their session's work back to the base branch.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Merge Changes
8
+
9
+ Merge the topic branch (checked out in the current worktree) into the merge base branch (checked out in the main worktree). The context block appended to the prompt contains the source branch, target branch, and main worktree path.
10
+
11
+ ## Guidelines
12
+
13
+ - **Never force-push** (`--force`, `--force-with-lease`) without explicit user approval.
14
+ - **Never skip pre-push hooks** (do not use `--no-verify`).
15
+ - **Never rewrite or drop commits** without asking the user.
16
+ - When in doubt about conflict resolution — ask the user.
17
+
18
+ ## Workflow
19
+
20
+ ### 1. Commit uncommitted changes in the current worktree
21
+
22
+ Check for uncommitted changes in the current worktree:
23
+ ```
24
+ git status --porcelain
25
+ ```
26
+ If there are uncommitted changes, use the `/commit` skill to commit them before continuing.
27
+
28
+ ### 2. Merge the topic branch into the base branch
29
+
30
+ Use `git -C <main-worktree-path>` to run commands against the main worktree without leaving the current worktree.
31
+
32
+ ```
33
+ git -C <main-worktree-path> merge <topic-branch>
34
+ ```
35
+
36
+ ### 3. Handle merge conflicts
37
+
38
+ If the merge reports conflicts:
39
+
40
+ 3.1. List conflicted files:
41
+ ```
42
+ git -C <main-worktree-path> diff --name-only --diff-filter=U
43
+ ```
44
+
45
+ 3.2. For each conflicted file, read the file content, resolve the conflict by preserving the intent of both sides, and stage the resolved file:
46
+ ```
47
+ git -C <main-worktree-path> add <resolved-file>
48
+ ```
49
+
50
+ 3.3. When in doubt on how to resolve a merge conflict, ask the user for guidance. If the user wants to abort, run:
51
+ ```
52
+ git -C <main-worktree-path> merge --abort
53
+ ```
54
+
55
+ 3.4. Once all conflicts are resolved and staged, commit the merge:
56
+ ```
57
+ git -C <main-worktree-path> commit --no-edit
58
+ ```
59
+
60
+ ## Validation
61
+
62
+ After the merge completes, verify the result:
63
+
64
+ 1. Confirm the main worktree is clean:
65
+ ```
66
+ git -C <main-worktree-path> status --porcelain
67
+ ```
68
+
69
+ 2. Confirm the topic branch is an ancestor of the base branch (i.e. all commits are merged):
70
+ ```
71
+ git -C <main-worktree-path> merge-base --is-ancestor <topic-branch> HEAD
72
+ ```
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: sync
3
+ description: Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Sync Changes
8
+
9
+ Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.
10
+
11
+ ## Guidelines
12
+
13
+ - **Never force-push** (`--force`, `--force-with-lease`) without explicit user approval.
14
+ - **Never skip pre-push hooks** (do not use `--no-verify`).
15
+ - **Never rewrite or drop commits** during rebase without asking the user.
16
+ - When in doubt about conflict resolution — ask the user.
17
+
18
+ ## Workflow
19
+
20
+ 1. Check for uncommitted changes first. If there are uncommitted changes, use the `/commit` skill to commit them before continuing.
21
+ 2. Check whether the current session branch has an upstream branch.
22
+ 3. If the current session branch has an upstream branch:
23
+ 3.1. Fetch the upstream remote first so tracking refs are up to date.
24
+ ```
25
+ git fetch <upstream-remote>
26
+ ```
27
+ 3.2. Check ahead/behind counts. If the branch is already in sync (0 ahead, 0 behind), stop and report that no sync is needed.
28
+ ```
29
+ git rev-list --left-right --count HEAD...@{u}
30
+ ```
31
+ 3.3. If behind, rebase onto the upstream tracking branch.
32
+ ```
33
+ git rebase @{u}
34
+ ```
35
+ 3.4. If there are merge conflicts, resolve them by preserving the intent of both sides. Stage the resolved files and continue the rebase.
36
+ ```
37
+ git add <resolved-files>
38
+ git rebase --continue
39
+ ```
40
+ If conflict resolution is unclear, ask the user how to proceed. If the user wants to stop the rebase, abort it:
41
+ ```
42
+ git rebase --abort
43
+ ```
44
+ 3.5. If the branch has local commits (ahead > 0), push them to the remote after a successful rebase.
45
+ ```
46
+ git push
47
+ ```
48
+ If the push is rejected because the rebase rewrote history, explain the situation to the user and ask for approval before force-pushing.
49
+ 4. If the current session branch does not have an upstream branch:
50
+ 4.1. Determine the remote to publish to.
51
+ - If there is only one remote, use it.
52
+ - If there are multiple remotes, use the #tool:vscode/askQuestions tool to ask which remote to use.
53
+ 4.2. Publish the current branch and set upstream in one step.
54
+ ```
55
+ git push -u <remote> HEAD
56
+ ```
57
+
58
+ ## Validation
59
+
60
+ After the workflow completes, validate the result with explicit checks:
61
+
62
+ 1. Verify the working tree is clean:
63
+ ```
64
+ git status --porcelain
65
+ ```
66
+ 2. Verify sync state (ahead/behind counts are both 0):
67
+ ```
68
+ git rev-list --left-right --count HEAD...@{u}
69
+ ```
70
+ 3. If the branch was newly published, verify the upstream branch is configured:
71
+ ```
72
+ git rev-parse --abbrev-ref --symbolic-full-name @{u}
73
+ ```
@@ -0,0 +1,31 @@
1
+ ---
2
+ name: sync-upstream
3
+ description: Update a stale session branch by rebasing onto the latest origin. Use when the upstream has moved significantly and the session needs to catch up, resolving conflicts by preserving upstream changes and adapting session work to fit.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Update Branch
8
+
9
+ Rebase the current session branch onto the latest upstream so the work stays grounded in origin.
10
+
11
+ ## Workflow
12
+
13
+ 1. If there are uncommitted changes, use the `/commit` skill to commit them first.
14
+ 2. Fetch the latest upstream and rebase onto it:
15
+ ```
16
+ git fetch origin
17
+ git rebase origin/main
18
+ ```
19
+ Use the appropriate base branch if it is not `main`.
20
+
21
+ ## Conflict Resolution
22
+
23
+ When conflicts arise, **upstream always wins**:
24
+
25
+ - **Never alter upstream logic, APIs, or patterns** to accommodate session changes.
26
+ - **Adapt session work** to fit the new upstream — rename, restructure, or rewrite as needed while preserving the session's goals.
27
+ - After resolving each conflict, `git add` the files and `git rebase --continue`.
28
+
29
+ ## Validation
30
+
31
+ After the rebase completes, verify the result still compiles and meets the session's objectives. If session changes no longer make sense against the updated upstream, explain what changed and propose a revised approach.
@@ -0,0 +1,178 @@
1
+ ---
2
+ name: troubleshoot
3
+ description: Investigate unexpected behavior in the current Copilot agent session by analyzing its event log. Use when the user asks why something happened, why a request was slow, why a tool was or was not used, or why instructions/skills/agents did not load.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Troubleshoot
8
+
9
+ ## Purpose
10
+
11
+ This skill investigates and explains unexpected agent behavior in the **current Copilot agent session** using its on-disk event log.
12
+
13
+ Use this skill for questions like:
14
+ - Why did this request take so long?
15
+ - Why was a tool called (or not called)?
16
+ - Why did an instruction/skill/agent file not load?
17
+ - Why did a tool call fail?
18
+ - Why did the model not follow expectations?
19
+
20
+ Base every conclusion on evidence from the event log. Do not guess.
21
+
22
+ ## Locating the Session Log
23
+
24
+ The skill runs **inside** the session's agent, so the log is on the same machine. It lives outside the workspace — read it via the terminal (`run_in_terminal`), never `grep_search`.
25
+
26
+ 1. **If a `Session log:` path is provided with this message, use it.** It may point to a session **other than** the current one (via `#session`) and may be **comma-separated paths** — investigate all of them and compare.
27
+ 2. **Sticky reference:** if no path is on the *current* message but an earlier turn in **this conversation** already established a target (a `Session log:` path, or a `#session:` reference), keep analyzing **that same session** for the follow-up. Do **not** fall back to self-discovery here — the newest log is the *current* session, which is the wrong one. Switch only if the user references a new session.
28
+ 3. **Otherwise, self-discover it:** pick the **most recently modified** `events.jsonl` under `${XDG_STATE_HOME:-$HOME}/.copilot/session-state/<sessionId>/` — this skill is appending to the current session's log, so it's reliably newest. Honor `XDG_STATE_HOME`, else `$HOME`.
29
+ 4. **If none exists** there, this isn't a Copilot session — tell the user the skill supports Copilot sessions only, and stop.
30
+
31
+ ## Data Source — `events.jsonl`
32
+
33
+ Each line is a JSON object sharing one envelope:
34
+
35
+ ```json
36
+ { "type": "...", "id": "...", "parentId": "...", "agentId": "...", "timestamp": "ISO-8601", "data": { } }
37
+ ```
38
+
39
+ - `type` — the event kind (see below).
40
+ - `id` — unique event id.
41
+ - `parentId` — the **chronologically preceding** event, not a logical parent. It is a flat back-pointer over every event, *not* the user → turn → tool-call hierarchy. Do not treat it as a logical parent.
42
+ - `agentId` — present for sub-agent events; absent for the main agent and session-level events.
43
+ - `timestamp` — ISO-8601 time. Compute durations by differencing timestamps (e.g. a tool's start vs. its completion, a turn's `assistant.turn_start` vs. the `assistant.message`).
44
+ - `data` — type-specific payload.
45
+
46
+ ### Event types (`data.*` fields)
47
+
48
+ - **`session.start`** (once) — `selectedModel`, `reasoningEffort`.
49
+ - **`user.message`** — `content`; `transformedContent` (expanded prompt, when it differs).
50
+ - **`assistant.turn_start` / `assistant.turn_end`** — `turnId`; measure a turn's duration vs the following `assistant.message`.
51
+ - **`assistant.message`** — `model`, `outputTokens`, `content`, `reasoningText` (thinking, when present), `turnId`, `parentToolCallId` (set ⇒ sub-agent turn spawned by that tool call).
52
+ - **`tool.execution_start`** — `toolName`, `toolCallId`, `arguments`, `parentToolCallId` (set ⇒ nested/sub-agent).
53
+ - **`tool.execution_complete`** — `toolCallId` (matches start), `success`, `result`. Pair with its start by `toolCallId` for the full call + duration.
54
+ - **`session.shutdown`** (once, at end) — `modelMetrics[*].usage`, `totalNanoAiu`. Absent mid-session.
55
+ - Other (`hook.*`, `permission.*`, `system.message`) — inspect `data` as needed.
56
+
57
+ ### Reconstructing the flow
58
+
59
+ Iterate records in order and rebuild the logical tree from context:
60
+ - `session.start` is the root.
61
+ - a `user.message` begins a turn.
62
+ - an `assistant.message` answers the current `user.message` — unless it has `data.parentToolCallId`, in which case it belongs to the sub-agent spawned by that tool call.
63
+ - a `tool.execution_start` belongs to the current `assistant.message` — unless it has `data.parentToolCallId`, in which case it is nested under that parent tool call.
64
+ - pair each `tool.execution_start` with its `tool.execution_complete` by `toolCallId`.
65
+
66
+ ## Secondary Source — Agent Host Wire Log (protocol communication)
67
+
68
+ `events.jsonl` is the **primary** source and answers almost every question on its own. A *separate* log captures the **transport/protocol** between VS Code and the agent host process — the JSON-RPC-style frames that drive sessions.
69
+
70
+ **Use the wire log only when the symptom points at the agent host / transport itself, not the model or a tool.** Reach for it when:
71
+ - the agent host won't start, or the session never begins;
72
+ - requests **hang or time out**, or the agent appears stuck "connecting" / unresponsive;
73
+ - `createSession` / `subscribe` fails, or expected updates/notifications never arrive;
74
+ - you see RPC / protocol / connection errors.
75
+
76
+ **Do not** open it for ordinary "why did the model/tool do X" questions — `events.jsonl` already answers those. If `events.jsonl` fully explains the behavior, stop there and don't read the wire log.
77
+
78
+ **It is written by VS Code on the _client_ machine, so it is only reachable for a _local_ agent host** (VS Code and the agent on the same machine). For a remote agent host it lives on the client, not the host this skill runs on — skip it there.
79
+
80
+ ### Location
81
+
82
+ ```
83
+ <VS Code user-data dir>/logs/<session-timestamp>/ahp/ahp-<timestamp>-<connectionId>.jsonl
84
+ ```
85
+
86
+ The VS Code user-data dir depends on the build:
87
+ - Windows: `%APPDATA%\Code` (Insiders: `Code - Insiders`; OSS/dev may use `Code - OSS` or a custom `--user-data-dir`)
88
+ - macOS: `~/Library/Application Support/Code`
89
+ - Linux: `~/.config/Code`
90
+
91
+ A new `logs/<timestamp>/` folder is created per VS Code session — pick the **most recently modified** `ahp/ahp-*.jsonl`.
92
+
93
+ **Named by _connection_ id, not session id** — one log **multiplexes all sessions on that connection** (no per-session file). Long connections rotate into `ahp-….1.jsonl`, `.2.jsonl`, … (max 5); the active one is the **most recently modified** (the locate commands pick it). Read the newest log for connection-level health; to isolate one session, filter by its id (the `session-state/<sessionId>/` folder name, which appears in frames' `params`/`result`).
94
+
95
+ **If no `ahp/` folder exists, the wire log is disabled** (it is off by default). Tell the user to set `"chat.agentHost.ahpJsonlLoggingEnabled": true`, restart VS Code, reproduce the issue, then re-run.
96
+
97
+ ### Format
98
+
99
+ Each line is a JSON-RPC frame plus an `_ahpLog` envelope:
100
+
101
+ ```json
102
+ { "jsonrpc": "2.0", "id": 12, "method": "createSession", "params": {}, "_ahpLog": { "ts": "ISO-8601", "dir": "c2s", "connectionId": "…", "transport": "local" } }
103
+ ```
104
+
105
+ - `_ahpLog.dir` — direction: `c2s` = VS Code → host (requests/notifications), `s2c` = host → VS Code (results/errors/actions/notifications).
106
+ - `_ahpLog.transport` — `local` / `websocket` / `ssh` / `wsl`.
107
+ - Requests/notifications carry `method` + `params`; responses carry `result` or `error` — pair a response to its request by `id`.
108
+ - `_ahpLog.truncated: true` marks frames whose large payloads were elided.
109
+
110
+ Triage: look for `error` frames, requests (`c2s` with an `id`) that have **no matching `s2c` response** (hangs/timeouts), or a missing `s2c` after `createSession` / `subscribe`. Apply the same streaming / `jq` / `node` rules as for `events.jsonl`.
111
+
112
+ ### Locating it (terminal)
113
+ - macOS/Linux: `ls -t ~/Library/Application\ Support/Code*/logs/*/ahp/ahp-*.jsonl ~/.config/Code*/logs/*/ahp/ahp-*.jsonl 2>/dev/null | head -n 1`
114
+ - Windows (PowerShell): `Get-ChildItem "$env:APPDATA\Code*\logs\*\ahp\ahp-*.jsonl" -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1`
115
+
116
+ ## Tooling Strategy (important)
117
+
118
+ The event log is outside the workspace, so `grep_search` cannot read it. **Use `run_in_terminal`.**
119
+
120
+ ### Do a single triage pass first (important for efficiency)
121
+
122
+ Each terminal command is a separate round-trip, so **don't run one command per question.** Do **one streaming pass** (constant memory — `events.jsonl` can be hundreds of MB, so never load it whole) that prints, in a single read:
123
+ - the event counts by type,
124
+ - every tool call with success/failure and duration (pair each `tool.execution_start` with its `tool.execution_complete` by `toolCallId`),
125
+ - the user messages.
126
+
127
+ Use a streaming `jq` program (macOS/Linux) or a streaming Node `readline` pass (Windows) — the per-query examples below are the building blocks. Then run targeted follow-ups only to drill in.
128
+
129
+ ### macOS / Linux / WSL / Git Bash (`grep` / `jq`)
130
+ - Locate the newest log: `ls -t "${XDG_STATE_HOME:-$HOME}"/.copilot/session-state/*/events.jsonl | head -n 1`
131
+ - Check size first: `ls -lh <logPath>`
132
+ - Errors: `grep '"success":false' <logPath>` (tool failures) and `grep '"type":"tool.execution_complete"' <logPath>`
133
+ - Count events by type (streaming): `jq -nr 'reduce inputs as $i ({}; .[$i.type] += 1) | to_entries | sort_by(-.value)[] | "\(.value) \(.key)"' <logPath>`
134
+ - Tool calls: `jq -c 'select(.type=="tool.execution_start") | {tool:.data.toolName, id:.data.toolCallId}' <logPath>`
135
+ - User messages: `jq -c 'select(.type=="user.message") | .data.content' <logPath>`
136
+ - Assistant turns: `jq -c 'select(.type=="assistant.message") | {model:.data.model, out:.data.outputTokens}' <logPath>`
137
+
138
+ ### Windows (PowerShell + Node.js)
139
+ **Do not parse the log with PowerShell JSON.** `Get-Content … | ForEach-Object { ConvertFrom-Json }` (or any per-line `ConvertFrom-Json`) deserializes one object at a time and is slow even on small logs. Use `Select-String` for plain-text matches and a **streaming** `node` pass for anything that needs JSON. Use `jq` instead if it is available.
140
+
141
+ - Locate the newest log:
142
+ ```powershell
143
+ $stateHome = if ($env:XDG_STATE_HOME) { $env:XDG_STATE_HOME } else { $HOME }
144
+ Get-ChildItem (Join-Path $stateHome '.copilot\session-state\*\events.jsonl') | Sort-Object LastWriteTime -Descending | Select-Object -First 1
145
+ ```
146
+ - Check size first: `(Get-Item <logPath>).Length`
147
+ - Plain-text matches (fast, streaming, no parsing): `Select-String '"success":false' <logPath>`
148
+ - JSON queries — a **streaming** `node` pass (constant memory, safe for hundreds-of-MB logs; pass the log path as an argument so it stays quote-safe). Use this shape and change only the per-line `if (…)` to select what you need (tool failures, tool calls, assistant turns, …):
149
+ `node -e "const rl=require('readline').createInterface({input:require('fs').createReadStream(process.argv[1])});rl.on('line',l=>{if(!l)return;let x;try{x=JSON.parse(l)}catch{return}if(x.type==='tool.execution_complete'&&x.data.success===false)console.log(x.data.toolCallId,JSON.stringify(x.data.result))})" "<logPath>"`
150
+ For aggregates (e.g. counts by type), accumulate into an object as you go and print it on `rl.on('close', …)`.
151
+ - For a very large log, narrow with `Select-String` first to find the line, then read that small slice with `read_file`.
152
+
153
+ ### General rules
154
+ - **One streaming pass, not many.** Each command is a round-trip; prefer the single triage pass, then targeted follow-ups. Never load a whole (hundreds-of-MB) log into memory (`readFileSync` / `Get-Content`) — stream (`jq` / the readline pass) or narrow with `grep` / `Select-String` first. Check size first if unsure (`ls -lh` / `(Get-Item).Length`).
155
+ - **Never deserialize JSON line-by-line in the shell** (PowerShell `ConvertFrom-Json` in a loop) — slow. Use one `jq` filter or one `node` pass.
156
+ - Use `read_file` only for small targeted ranges, never an entire log.
157
+
158
+ ## Investigation Workflow
159
+
160
+ 1. Locate `events.jsonl` and run the single triage pass.
161
+ 2. Match the symptom: **errors** → `success:false`; **latency** → gaps between `assistant.turn_start` and its `assistant.message`, or a tool's start↔complete; **tool / model / input** → the relevant event type; **agent-host / transport** failure (local) → also the Wire Log.
162
+ 3. Read only the relevant slices, then determine the most likely root cause (order contributing factors by impact) and give concrete next steps.
163
+
164
+ ## Response Guidelines
165
+
166
+ Cover **what happened and why** (root cause), **key evidence** (paraphrased — quote only a telling detail like an error message, never raw dumps), and **how to fix it**. A short combined explanation is fine; add structure (headers, bullets, tables) only for complex, multi-factor issues. Keep paragraphs short.
167
+
168
+ **Abstraction:** don't narrate your investigation or use internal terms (`events.jsonl`, `tool.execution_start`, `parentId`, "envelope"). Refer to "the session log" abstractly. Focus on what happened and why, not how you found it.
169
+
170
+ **Example** — instead of "I read events.jsonl and saw a `tool.execution_complete` with `success:false`…", say:
171
+
172
+ > The "testing" skill was found but not loaded because the folder name and the name in the skill file differ (`testing` vs `testing2`). **Fix:** make them match (rename the folder or change the name), then start a new session.
173
+
174
+ ## Important Rules
175
+
176
+ - Base every claim on log evidence — never assume causality.
177
+ - Search via `run_in_terminal`; never `grep_search`, and never `read_file` a whole (possibly huge) log — narrow first, then read small ranges.
178
+ - If no Copilot session log exists, say so and stop.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: update-pr
3
+ description: Update the pull request for the current session. Use when the user wants to push new changes to an existing PR.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Update Pull Request
8
+
9
+ Update the existing pull request for the current session.
10
+ The context block appended to the prompt contains the pull request information.
11
+
12
+ 1. Check whether the pull request has any commits that are not yet present on the current branch (incoming changes). If there are any incoming changes, pull them into the current branch and resolve any merge conflicts
13
+ 2. Run the compile and hygiene tasks (fixing any errors)
14
+ 3. If there are any uncommitted changes, use the `/commit` skill to commit them
15
+ 4. If the outgoing changes introduce significant changes to the pull request, update the pull request title and description to reflect those changes
16
+ 5. Update the pull request with the new commits and information
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: update-skills
3
+ description: Create or update repository skills and instructions when major learnings are discovered during a session. Use when the user says "learn!", when a significant pattern or pitfall is identified, or when reusable domain knowledge should be captured for future sessions.
4
+ ---
5
+ <!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6
+
7
+ # Update Skills & Instructions
8
+
9
+ When a major repository learning is discovered — a recurring pattern, a non-obvious pitfall, a crucial architectural constraint, or domain knowledge that would save future sessions significant time — capture it as a skill or instruction so it persists across sessions.
10
+
11
+ ## When to Use
12
+
13
+ - The user explicitly says **"learn!"** or asks to capture a learning
14
+ - You discover a significant pattern or constraint that cost meaningful debugging time
15
+ - You identify reusable domain knowledge that isn't documented anywhere in the repo
16
+ - A correction from the user reveals a general principle worth preserving
17
+
18
+ ## Decision: Skill vs Instruction vs Learning
19
+
20
+ **Add a learning to an existing instruction** when:
21
+ - The insight is small (1-4 sentences) and fits naturally into an existing instruction file
22
+ - It refines or extends an existing guideline
23
+ - Follow the pattern in `.github/instructions/learnings.instructions.md`
24
+
25
+ **Create or update a skill** (`.github/skills/{name}/SKILL.md` or `.agents/skills/{name}/SKILL.md`) when:
26
+ - The knowledge is substantial (multi-step procedure, detailed guidelines, or rich examples)
27
+ - It covers a distinct domain area (e.g., "how to debug X", "patterns for Y")
28
+ - Future sessions should be able to invoke it by name
29
+
30
+ **Create or update an instruction** (`.github/instructions/{name}.instructions.md`) when:
31
+ - The rule should apply automatically based on file patterns (`applyTo`) or globally
32
+ - It's a coding convention, architectural constraint, or process rule
33
+ - It doesn't need to be invoked on demand
34
+
35
+ ## Procedure
36
+
37
+ ### 1. Identify the Learning
38
+
39
+ Reflect on what went wrong or what was discovered:
40
+ - What was the problem or unexpected behavior?
41
+ - Why was it a problem? (root cause, not symptoms)
42
+ - How was it fixed or what's the correct approach?
43
+ - Can it be generalized beyond this specific instance?
44
+
45
+ ### 2. Check for Existing Files
46
+
47
+ Before creating new files, search for existing skills and instructions that might be the right home:
48
+
49
+ ```
50
+ # Check existing skills
51
+ ls .github/skills/ .agents/skills/ 2>/dev/null
52
+
53
+ # Check existing instructions
54
+ ls .github/instructions/ 2>/dev/null
55
+
56
+ # Search for related content
57
+ grep -r "related-keyword" .github/skills/ .github/instructions/ .agents/skills/
58
+ ```
59
+
60
+ ### 3a. Add to Existing File
61
+
62
+ If an appropriate file exists, add the learning to its `## Learnings` section (create the section if it doesn't exist). Each learning should be 1-4 sentences.
63
+
64
+ ### 3b. Create a New Skill
65
+
66
+ If the knowledge warrants a standalone skill:
67
+
68
+ 1. Choose the location:
69
+ - `.github/skills/{name}/SKILL.md` for project-level skills (committed to repo)
70
+ - `.agents/skills/{name}/SKILL.md` for agent-specific skills
71
+ 2. Create the directory and SKILL.md with frontmatter:
72
+
73
+ ```markdown
74
+ ---
75
+ name: {skill-name}
76
+ description: {One-line description of when and why to use this skill.}
77
+ ---
78
+
79
+ # {Skill Title}
80
+
81
+ {Body with guidelines, procedures, examples, and learnings.}
82
+ ```
83
+
84
+ 3. The `name` field **must match** the parent folder name exactly.
85
+ 4. Include concrete examples — skills with examples are far more useful than abstract rules.
86
+
87
+ ### 3c. Create a New Instruction
88
+
89
+ If the knowledge should apply automatically:
90
+
91
+ ```markdown
92
+ ---
93
+ description: {When these instructions should be loaded}
94
+ applyTo: '{glob pattern}' # optional — auto-load when matching files are attached
95
+ ---
96
+
97
+ {Content of the instruction.}
98
+ ```
99
+
100
+ ### 4. Quality Checks
101
+
102
+ Before saving:
103
+ - Is the learning **general enough** to help future sessions, not just this one?
104
+ - Is it **specific enough** to be actionable, not just a vague principle?
105
+ - Does it include a **concrete example** of right vs wrong?
106
+ - Does it avoid duplicating knowledge already captured elsewhere?
107
+ - Is the description clear enough that the agent will know **when** to invoke/apply it?
108
+
109
+ ### 5. Inform the User
110
+
111
+ After creating or updating the file:
112
+ - Summarize what was captured and where
113
+ - Explain why this location was chosen
114
+ - Note if any existing content was updated vs new content created