Skip to content

docs: expand shared Copilot hook migration guidance - #10503

Merged
Harald Kirschner (digitarald) merged 3 commits into
vnextfrom
digitarald/agents/expand-copilot-hooks-migration-guide
Oct 19, 2026
Merged

Harald Kirschner (digitarald) merged 3 commits into
vnextfrom
digitarald/agents/expand-copilot-hooks-migration-guide

Conversation

@digitarald

Copy link
Copy Markdown
Contributor

Summary

  • Expand hook migration guidance with a sourced compatibility matrix, safe before/after examples, disabled-state preservation, inactive staging, and concrete verification steps.
  • Cover personal folders, inline settings, repositories, custom agents, plugins, and managed hooks. Frame these as the shared Copilot harness used by VS Code, the GitHub Copilot app, and Copilot CLI, without requiring CLI installation.
  • Make the main hooks guide Copilot-first and align custom-agent, plugin, settings, permissions, security, and enterprise guidance. Retain Local details as migration reference and avoid treating hooks or instructions as security boundaries.

Additional changes

Migrate this repository's existing documentation hook to the shared format and consolidate its shell scripts into a Node handler. The hook is enabled; no new test files are included. Generated enterprise policies are untouched.

Validation

  • Documentation JSON and runnable script examples, including matching/nonmatching inputs and error exit codes.
  • Internal links and anchors, external source links, metadata, and product variables.
  • Existing data-variable tests (9 passed), targeted ESLint, and git diff --check.
  • Live hook smoke check: normal edits succeeded, the post-edit reminder appeared, and a prohibited punctuation edit was denied without changing the file. Temporary probes removed.
  • Two adversarial documentation reviews; addressed migration-safety and usability findings.

Sources

  • Copilot hooks reference
  • Public VS Code Local hook and plugin parser implementations linked from the migration guide.

Document migration across personal, repository, settings, agent, and plugin hook sources. Add compatibility tables, safe conversion examples, and verification steps, and align related guidance with the shared Copilot harness. Include the migrated repository hook without added test files.

Co-authored-by: Copilot <[email protected]>

@ntrogh Nick Trogh (ntrogh) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Distinguish shared-runtime support for scoped hooks from VS Code's converter omission. Keep affected plugin-agent hook migrations incomplete and avoid suggesting broader hook scope as a workaround.

Co-authored-by: Copilot <[email protected]>
@digitarald

Copy link
Copy Markdown
Contributor Author

Nick Trogh (@ntrogh) Investigated the agent-scoped hook conversion question and corrected the docs in 09efc63.

This is an integration gap in the VS Code plugin-agent conversion path, not a separate hooks format or a missing capability in the shared Copilot harness:

  • The SDK added CustomAgentConfig.hooks in the October 12 snapshot. I also checked the exact @github/[email protected] package currently pinned by VS Code: its type declares the field and toWireCustomAgents preserves it when supplied.
  • toSdkCustomAgents constructs a field-by-field config but does not read or forward hooks from frontmatter. I found no explicit policy gate or rationale for excluding it.
  • agentHost: keep plugin subagents in Copilot catalog vscode#342092 now projects every enabled plugin agent into that explicit catalog. The launcher documents that explicit customAgents are not merged with agents discovered from pluginDirectories, so relying on plugin-file discovery does not restore the dropped field on that path.

The four affected docs now say to retain the original scoped definition but leave affected plugin-agent hook migrations incomplete. They no longer imply that keeping the frontmatter is sufficient, and they still warn against moving the command to plugin-wide or repository-wide scope as a workaround. This does not claim that every native agent-discovery path lacks scoped-hook support.

Upstream product fix needed: parse and forward the declarative hook map into CustomAgentConfig.hooks, preserving plugin-root/path handling and source/trust restrictions. Cover both selecting the plugin agent and invoking it as a subagent, and verify hook execution plus disabled/managed-source behavior. No product-code change or upstream issue is included in this docs PR.

Validation: docs-only scope, metadata and variables, internal links, the pinned source link, and git diff --check passed.

@digitarald

Copy link
Copy Markdown
Contributor Author

The upstream converter gap is tracked by microsoft/vscode#341681. Added the current pinned-SDK and converter evidence there; no duplicate issue was created.

Preserve upstream guide/reference separation, deprecation migrations, and current customization UI guidance. Carry hook migration examples and the tracked scoped-hook converter limitation into the new reference pages.

Co-authored-by: Copilot <[email protected]>
@digitarald
Harald Kirschner (digitarald) merged commit df225ab into vnext Oct 19, 2026
1 check passed
@digitarald
Harald Kirschner (digitarald) deleted the digitarald/agents/expand-copilot-hooks-migration-guide branch October 19, 2026 03:54
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