Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,14 @@
# - toolArgs.path / toolArgs.filePath (Copilot CLI)
# - tool_input.filePath / tool_input.file_path / tool_input.path (Claude Code / VS Code)
#
# Recognized install paths (one set per plugin, see $pathPatterns below):
# azure-skills:
# Recognized azure-skills install paths:
# - .copilot/installed-plugins/<catalog-name>/azure/skills/...
# (<catalog-name> is the marketplace/catalog folder the plugin was
# installed under, e.g. "awesome-copilot" — it does not necessarily
# match the plugin's own name, "azure")
# - .claude/plugins/cache/azure-skills/azure/<version>/skills/...
# - .claude/plugins/cache/claude-plugins-official/azure/<version>/skills/...
# - .vscode/agent-plugins/github.com/microsoft/azure-skills/.github/plugins/azure-skills/skills/...
# azure-kusto-graph-skills:
# - .copilot/installed-plugins/<catalog-name>/azure-kusto-graph-skills/skills/...
# - .claude/plugins/cache/azure-skills/azure-kusto-graph-skills/<version>/skills/...
# - .vscode/agent-plugins/github.com/microsoft/azure-skills/.github/plugins/azure-kusto-graph-skills/skills/...
# shared:
# - .agents/skills/...
#
# If the path matches AND is not a SKILL.md file, the relative path after
Expand Down Expand Up @@ -182,6 +176,20 @@ function Get-SkillVersion {
return $null
}

# Extract the plugin version from the top-level .plugin/plugin.json manifest.
# Returns $null if the file or expected JSON value cannot be read.
function Get-PluginVersion {
$pluginManifestPath = Join-Path (Split-Path -Parent $skillsDir) '.plugin/plugin.json'
if (-not (Test-Path -LiteralPath $pluginManifestPath)) { return $null }
try {
$manifest = Get-Content -LiteralPath $pluginManifestPath -Raw -ErrorAction Stop | ConvertFrom-Json -ErrorAction Stop
if ($manifest.version -is [string] -and -not [string]::IsNullOrWhiteSpace($manifest.version)) {
return $manifest.version
}
} catch { }
return $null
}

# === Main Processing ===

# Read entire stdin at once - hooks send one complete JSON per invocation
Expand Down Expand Up @@ -281,32 +289,14 @@ function Get-ToolInputPath {

# === STEP 2: Determine what to track for azmcp ===

# Path patterns per client, one block per plugin (used for SKILL.md and
# file-reference matching). Add a new block (with the "azure-skills"
# segments swapped for the new plugin's name) when onboarding another plugin.

# --- azure-skills plugin ---
# The Copilot CLI pattern wildcards the catalog/marketplace folder name
# (e.g. "awesome-copilot") since it does not necessarily match the plugin's
# own name ("azure").
# Azure-skills path patterns per client (used for SKILL.md and file-reference matching)
$pathPatternCopilot = '\.copilot/installed-plugins/[^/]+/azure/skills/'
$pathPatternClaude = '\.claude/plugins/cache/(azure-skills|claude-plugins-official)/azure/[0-9.]+/skills/'
$pathPatternVscodeAgentPlugins = 'agent-plugins/github\.com/microsoft/azure-skills/\.github/plugins/azure-skills/skills/'
Comment on lines +292 to 295

# --- azure-kusto-graph-skills plugin ---
$pathPatternCopilotKustoGraph = '\.copilot/installed-plugins/[^/]+/azure-kusto-graph-skills/skills/'
$pathPatternClaudeKustoGraph = '\.claude/plugins/cache/azure-skills/azure-kusto-graph-skills/[0-9.]+/skills/'
$pathPatternVscodeAgentPluginsKustoGraph = 'agent-plugins/github\.com/microsoft/azure-skills/\.github/plugins/azure-kusto-graph-skills/skills/'

# --- shared across all plugins ---
$pathPatternAgentsSkills = '\.agents/skills/'

# Put the path patterns into an array for easier iteration
$pathPatterns = @(
$pathPatternCopilot, $pathPatternClaude, $pathPatternVscodeAgentPlugins,
$pathPatternCopilotKustoGraph, $pathPatternClaudeKustoGraph, $pathPatternVscodeAgentPluginsKustoGraph,
$pathPatternAgentsSkills
)
$pathPatterns = @($pathPatternCopilot, $pathPatternClaude, $pathPatternVscodeAgentPlugins, $pathPatternAgentsSkills)

# If $env:AZURE_SKILLS_PLUGIN_ROOT is set, add it to the path patterns for local skill development
if ($env:AZURE_SKILLS_PLUGIN_ROOT) {
Expand Down Expand Up @@ -417,6 +407,8 @@ if (-not $filePath -and -not $skillName) {
# === STEP 3: Publish event ===

if ($shouldTrack) {
$pluginVersion = Get-PluginVersion

# Build MCP command arguments
$mcpArgs = @(
"server", "plugin-telemetry",
Expand All @@ -428,6 +420,7 @@ if ($shouldTrack) {
if ($sessionId) { $mcpArgs += "--session-id"; $mcpArgs += $sessionId }
if ($skillName) { $mcpArgs += "--skill-name"; $mcpArgs += $skillName }
if ($skillVersion) { $mcpArgs += "--skill-version"; $mcpArgs += $skillVersion }
if ($pluginVersion) { $mcpArgs += "--plugin-version"; $mcpArgs += $pluginVersion }
if ($azureToolName) { $mcpArgs += "--tool-name"; $mcpArgs += $azureToolName }
# Convert forward slashes to backslashes for azmcp allowlist compatibility
if ($filePath) { $mcpArgs += "--file-reference"; $mcpArgs += ($filePath -replace '/', '\') }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,14 @@
# - toolArgs.path / toolArgs.filePath (Copilot CLI)
# - tool_input.filePath / tool_input.file_path / tool_input.path (Claude Code / VS Code)
#
# Recognized install paths (one set per plugin, see is_azure_skills_path):
# azure-skills:
# Recognized azure-skills install paths:
# - .copilot/installed-plugins/<catalog-name>/azure/skills/...
# (<catalog-name> is the marketplace/catalog folder the plugin was
# installed under, e.g. "awesome-copilot" — it does not necessarily
# match the plugin's own name, "azure")
# - .claude/plugins/cache/azure-skills/azure/<version>/skills/...
# - .claude/plugins/cache/claude-plugins-official/azure/<version>/skills/...
# - .vscode/agent-plugins/github.com/microsoft/azure-skills/.github/plugins/azure-skills/skills/...
# azure-kusto-graph-skills:
# - .copilot/installed-plugins/<catalog-name>/azure-kusto-graph-skills/skills/...
# - .claude/plugins/cache/azure-skills/azure-kusto-graph-skills/<version>/skills/...
# - .vscode/agent-plugins/github.com/microsoft/azure-skills/.github/plugins/azure-kusto-graph-skills/skills/...
# shared:
# - .agents/skills/...
#
# If the path matches AND is not a SKILL.md file, the relative path after
Expand Down Expand Up @@ -164,6 +158,20 @@ get_skill_version() {
| sed -E 's/^[[:space:]]*version:[[:space:]]*//; s/^["'"'"']//; s/["'"'"'][[:space:]]*$//; s/[[:space:]]*$//'
}

# Extract the plugin version from the top-level .plugin/plugin.json manifest.
# Prints nothing if the file or expected JSON value cannot be read.
get_plugin_version() {
local pluginManifestPath
pluginManifestPath="$(dirname "$SKILLS_DIR")/.plugin/plugin.json"
[ -f "$pluginManifestPath" ] || return 0
node -e '
try {
const manifest = JSON.parse(require("fs").readFileSync(process.argv[1], "utf8"));
if (typeof manifest.version === "string" && manifest.version) process.stdout.write(manifest.version);
} catch { }
' "$pluginManifestPath" 2>/dev/null
}

# === JSON Parsing Functions (using sed - portable across platforms) ===

# Extract simple string field from JSON
Expand Down Expand Up @@ -288,30 +296,15 @@ fi

# === STEP 2: Determine what to track for azmcp ===

# Check if a path matches any known plugin skills folder structure.
# Each plugin has its own block below — add a new block (with the
# "azure-skills" segments swapped for the new plugin's name) when onboarding
# another plugin. Returns 0 (true) if matched, 1 (false) otherwise.
# Check if a path matches any known azure-skills folder structure
# Returns 0 (true) if matched, 1 (false) otherwise
Comment on lines +299 to +300
is_azure_skills_path() {
local p="$1"

# --- azure-skills plugin ---
# The Copilot CLI pattern wildcards the catalog/marketplace folder name
# (e.g. "awesome-copilot") since it does not necessarily match the
# plugin's own name ("azure").
[[ "$p" == *".copilot/installed-plugins/"*"/azure/skills/"* ]] && return 0
[[ "$p" == *".claude/plugins/cache/azure-skills/azure/"*"/skills/"* ]] && return 0
[[ "$p" == *".claude/plugins/cache/claude-plugins-official/azure/"*"/skills/"* ]] && return 0
[[ "$p" == *"agent-plugins/github.com/microsoft/azure-skills/.github/plugins/azure-skills/skills/"* ]] && return 0

# --- azure-kusto-graph-skills plugin ---
[[ "$p" == *".copilot/installed-plugins/"*"/azure-kusto-graph-skills/skills/"* ]] && return 0
[[ "$p" == *".claude/plugins/cache/azure-skills/azure-kusto-graph-skills/"*"/skills/"* ]] && return 0
[[ "$p" == *"agent-plugins/github.com/microsoft/azure-skills/.github/plugins/azure-kusto-graph-skills/skills/"* ]] && return 0

# --- shared across all plugins ---
[[ "$p" == *".agents/skills/"* ]] && return 0

# Local plugin development: match paths under AZURE_SKILLS_PLUGIN_ROOT/skills/
# (e.g. when loading a local plugin via `--plugin-dir`)
if [ -n "$AZURE_SKILLS_PLUGIN_ROOT" ]; then
Expand Down Expand Up @@ -410,6 +403,8 @@ fi
# === STEP 3: Publish event via azmcp ===

if [ "$shouldTrack" = true ]; then
pluginVersion=$(get_plugin_version)

# Build MCP command arguments (using array for proper quoting)
mcpArgs=(
"server" "plugin-telemetry"
Expand All @@ -421,6 +416,7 @@ if [ "$shouldTrack" = true ]; then
[ -n "$sessionId" ] && mcpArgs+=("--session-id" "$sessionId")
[ -n "$skillName" ] && mcpArgs+=("--skill-name" "$skillName")
[ -n "$skillVersion" ] && mcpArgs+=("--skill-version" "$skillVersion")
[ -n "$pluginVersion" ] && mcpArgs+=("--plugin-version" "$pluginVersion")
[ -n "$azureToolName" ] && mcpArgs+=("--tool-name" "$azureToolName")
# Convert forward slashes to backslashes for azmcp allowlist compatibility
[ -n "$filePath" ] && mcpArgs+=("--file-reference" "$(echo "$filePath" | tr '/' '\\')")
Expand All @@ -435,4 +431,3 @@ fi

# Output success to stdout (required by hooks)
return_success

2 changes: 1 addition & 1 deletion .github/plugins/azure-skills/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure",
"description": "Microsoft Azure MCP and Skills integration for cloud resource management, deployments, and Azure services. Manage your Azure infrastructure, monitor applications, and deploy resources directly from Claude Code.",
"version": "1.2.33",
"version": "1.2.34",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
2 changes: 1 addition & 1 deletion .github/plugins/azure-skills/.cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure",
"description": "Microsoft Azure MCP and Skills integration for cloud resource management, deployments, and Azure services. Manage your Azure infrastructure, monitor applications, and deploy resources directly from Cursor.",
"version": "1.2.33",
"version": "1.2.34",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
2 changes: 1 addition & 1 deletion .github/plugins/azure-skills/.plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "azure",
"description": "Microsoft Azure MCP and Skills integration for cloud resource management, deployments, and Azure services. Manage your Azure infrastructure, monitor applications, and deploy resources directly from your development environment.",
"version": "1.2.33",
"version": "1.2.34",
"author": {
"name": "Microsoft",
"url": "https://www.microsoft.com"
Expand Down
4 changes: 4 additions & 0 deletions .github/plugins/azure-skills/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.2.34

- feat: Added Referenced Workloads Updates to Azure Enterprise Infra Planner Skills (feature: Referenced Workloads) ([#3094](https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/3094))

## 1.2.33

- refactor: remove duplicate content from Foundry skill description ([#3104](https://github.com/microsoft/GitHub-Copilot-for-Azure/pull/3104))
Expand Down
47 changes: 20 additions & 27 deletions .github/plugins/azure-skills/hooks/scripts/track-telemetry.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,14 @@
# - toolArgs.path / toolArgs.filePath (Copilot CLI)
# - tool_input.filePath / tool_input.file_path / tool_input.path (Claude Code / VS Code)
#
# Recognized install paths (one set per plugin, see $pathPatterns below):
# azure-skills:
# Recognized azure-skills install paths:
# - .copilot/installed-plugins/<catalog-name>/azure/skills/...
# (<catalog-name> is the marketplace/catalog folder the plugin was
# installed under, e.g. "awesome-copilot" — it does not necessarily
# match the plugin's own name, "azure")
# - .claude/plugins/cache/azure-skills/azure/<version>/skills/...
# - .claude/plugins/cache/claude-plugins-official/azure/<version>/skills/...
# - .vscode/agent-plugins/github.com/microsoft/azure-skills/.github/plugins/azure-skills/skills/...
# azure-kusto-graph-skills:
# - .copilot/installed-plugins/<catalog-name>/azure-kusto-graph-skills/skills/...
# - .claude/plugins/cache/azure-skills/azure-kusto-graph-skills/<version>/skills/...
# - .vscode/agent-plugins/github.com/microsoft/azure-skills/.github/plugins/azure-kusto-graph-skills/skills/...
# shared:
# - .agents/skills/...
#
# If the path matches AND is not a SKILL.md file, the relative path after
Expand Down Expand Up @@ -182,6 +176,20 @@ function Get-SkillVersion {
return $null
}

# Extract the plugin version from the top-level .plugin/plugin.json manifest.
# Returns $null if the file or expected JSON value cannot be read.
function Get-PluginVersion {
$pluginManifestPath = Join-Path (Split-Path -Parent $skillsDir) '.plugin/plugin.json'
if (-not (Test-Path -LiteralPath $pluginManifestPath)) { return $null }
try {
$manifest = Get-Content -LiteralPath $pluginManifestPath -Raw -ErrorAction Stop | ConvertFrom-Json -ErrorAction Stop
if ($manifest.version -is [string] -and -not [string]::IsNullOrWhiteSpace($manifest.version)) {
return $manifest.version
}
} catch { }
return $null
}

# === Main Processing ===

# Read entire stdin at once - hooks send one complete JSON per invocation
Expand Down Expand Up @@ -281,32 +289,14 @@ function Get-ToolInputPath {

# === STEP 2: Determine what to track for azmcp ===

# Path patterns per client, one block per plugin (used for SKILL.md and
# file-reference matching). Add a new block (with the "azure-skills"
# segments swapped for the new plugin's name) when onboarding another plugin.

# --- azure-skills plugin ---
# The Copilot CLI pattern wildcards the catalog/marketplace folder name
# (e.g. "awesome-copilot") since it does not necessarily match the plugin's
# own name ("azure").
# Azure-skills path patterns per client (used for SKILL.md and file-reference matching)
$pathPatternCopilot = '\.copilot/installed-plugins/[^/]+/azure/skills/'
$pathPatternClaude = '\.claude/plugins/cache/(azure-skills|claude-plugins-official)/azure/[0-9.]+/skills/'
$pathPatternVscodeAgentPlugins = 'agent-plugins/github\.com/microsoft/azure-skills/\.github/plugins/azure-skills/skills/'

# --- azure-kusto-graph-skills plugin ---
$pathPatternCopilotKustoGraph = '\.copilot/installed-plugins/[^/]+/azure-kusto-graph-skills/skills/'
$pathPatternClaudeKustoGraph = '\.claude/plugins/cache/azure-skills/azure-kusto-graph-skills/[0-9.]+/skills/'
$pathPatternVscodeAgentPluginsKustoGraph = 'agent-plugins/github\.com/microsoft/azure-skills/\.github/plugins/azure-kusto-graph-skills/skills/'

# --- shared across all plugins ---
$pathPatternAgentsSkills = '\.agents/skills/'

# Put the path patterns into an array for easier iteration
$pathPatterns = @(
$pathPatternCopilot, $pathPatternClaude, $pathPatternVscodeAgentPlugins,
$pathPatternCopilotKustoGraph, $pathPatternClaudeKustoGraph, $pathPatternVscodeAgentPluginsKustoGraph,
$pathPatternAgentsSkills
)
$pathPatterns = @($pathPatternCopilot, $pathPatternClaude, $pathPatternVscodeAgentPlugins, $pathPatternAgentsSkills)

# If $env:AZURE_SKILLS_PLUGIN_ROOT is set, add it to the path patterns for local skill development
if ($env:AZURE_SKILLS_PLUGIN_ROOT) {
Expand Down Expand Up @@ -417,6 +407,8 @@ if (-not $filePath -and -not $skillName) {
# === STEP 3: Publish event ===

if ($shouldTrack) {
$pluginVersion = Get-PluginVersion

# Build MCP command arguments
$mcpArgs = @(
"server", "plugin-telemetry",
Expand All @@ -428,6 +420,7 @@ if ($shouldTrack) {
if ($sessionId) { $mcpArgs += "--session-id"; $mcpArgs += $sessionId }
if ($skillName) { $mcpArgs += "--skill-name"; $mcpArgs += $skillName }
if ($skillVersion) { $mcpArgs += "--skill-version"; $mcpArgs += $skillVersion }
if ($pluginVersion) { $mcpArgs += "--plugin-version"; $mcpArgs += $pluginVersion }
if ($azureToolName) { $mcpArgs += "--tool-name"; $mcpArgs += $azureToolName }
# Convert forward slashes to backslashes for azmcp allowlist compatibility
if ($filePath) { $mcpArgs += "--file-reference"; $mcpArgs += ($filePath -replace '/', '\') }
Expand Down
Loading
Loading