Skip to content

chore: reuse hooks by building for all plugins - #2991

Merged
JasonYeMSFT (JasonYeMSFT) merged 1 commit into
microsoft:mainfrom
JasonYeMSFT:chuye/reuse-hooks
Aug 3, 2026
Merged

chore: reuse hooks by building for all plugins#2991
JasonYeMSFT (JasonYeMSFT) merged 1 commit into
microsoft:mainfrom
JasonYeMSFT:chuye/reuse-hooks

Conversation

@JasonYeMSFT

Copy link
Copy Markdown
Member

Description

Make hooks a plugin build artifact so they can be shared by all plugins without duplicating code.

Checklist

  • Tests pass locally (cd tests && npm test)
  • Title has one of the prefixes: fix:, feat:, feature:, chore:, misc:, test:, eval:
  • If modifying skill descriptions: verified routing correctness with integration tests (In tests/, npm run test:integration -- <skill> or npm run test:vally -- --skill <skill>)

Related Issues

Copilot AI review requested due to automatic review settings July 29, 2026 21:01
@JasonYeMSFT
JasonYeMSFT (JasonYeMSFT) requested a review from a team as a code owner July 29, 2026 21:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a shared hooks build artifact so telemetry hook logic/config can be reused across plugin builds without duplicating hook files inside each plugin directory.

Changes:

  • Add cross-client telemetry hook implementations (Bash + PowerShell) that parse PostToolUse payloads and emit telemetry via @azure/mcp.
  • Add hook configuration files for Copilot/Claude/Cursor hook formats under a shared hooks/ directory.
  • Update the gulp build to copy the shared hooks/ directory into each plugin’s output/<plugin>/hooks folder during build.
Show a summary per file
File Description
hooks/scripts/track-telemetry.sh Adds Bash telemetry hook implementation (parses tool events, emits MCP telemetry).
hooks/scripts/track-telemetry.ps1 Adds PowerShell telemetry hook implementation with equivalent behavior to the Bash script.
hooks/hooks.json Adds a hooks config file for PostToolUse with OS/shell-specific command entries.
hooks/cursor-hooks.json Adds Cursor hook config to run the telemetry script after tool use.
hooks/claude-hooks.json Adds Claude Code hook config to run the telemetry script after tool use.
gulpfile.ts Copies the shared hooks/ directory into each built plugin output so hooks ship with all plugins.

Review details

  • Files reviewed: 1/6 changed files
  • Comments generated: 0
  • Review effort level: Low

@JasonYeMSFT
JasonYeMSFT (JasonYeMSFT) merged commit 7cb4c6a into microsoft:main Aug 3, 2026
10 checks passed
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