Skip to content

feat: add azure-advisor skill#2663

Open
sharadhisrikanth28 wants to merge 7 commits into
microsoft:mainfrom
sharadhisrikanth28:feature/azure-advisor-skill
Open

feat: add azure-advisor skill#2663
sharadhisrikanth28 wants to merge 7 commits into
microsoft:mainfrom
sharadhisrikanth28:feature/azure-advisor-skill

Conversation

@sharadhisrikanth28

@sharadhisrikanth28 sharadhisrikanth28 commented Jun 18, 2026

Copy link
Copy Markdown

Summary

Adds the azure-advisor product-area router skill, ported and adapted to repo conventions.

What's included

  • Skill: plugin/skills/azure-advisor/ with a read-only review capability that uses whichever advisor_* MCP tools are available (routes by capability, not hard-coded tool names).
  • Shared references: capability-routing and subscription-discovery.
  • Tests: trigger tests under tests/azure-advisor/ (16 passing).
  • Registration: added to tests/skills.json (skills array + 0 12 * * 2-6 integration batch).
  • Versioning: version.json added; frontmatter uses 0.0.0-placeholder (NBGV stamps at build).

Validation

  • References validator passes
  • Build / version stamping (stamped 1.1.71)
  • Trigger tests 16/16
  • Typecheck + lint clean

Add the azure-advisor product-area router skill with a read-only review capability that uses available advisor_* MCP tools. Includes shared capability-routing and subscription-discovery references, trigger tests, and registers the skill in tests/skills.json.
Copilot AI review requested due to automatic review settings June 18, 2026 07:38

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

Adds a new azure-advisor product-area router skill under plugin/skills/ with a single review capability, plus trigger tests and registration so it’s included in CI/integration scheduling.

Changes:

  • Introduces the azure-advisor skill (router SKILL.md, shared references, and review/ capability workflow) with per-skill version.json for NBGV path filtering.
  • Adds trigger tests + snapshots for the new skill.
  • Registers azure-advisor in tests/skills.json and adds it to the scheduled integration batch list.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tests/skills.json Registers azure-advisor and includes it in the integration test schedule batch.
tests/azure-advisor/triggers.test.ts Adds trigger/negative/edge-case tests for routing activation.
tests/azure-advisor/snapshots/triggers.test.ts.snap Adds snapshots for extracted keywords and description-driven triggers.
plugin/skills/azure-advisor/version.json Adds per-skill NBGV config via pathFilters.
plugin/skills/azure-advisor/SKILL.md Adds the router skill frontmatter + capability routing table and constraints.
plugin/skills/azure-advisor/review/review.md Adds the read-only “review” capability workflow, constraints, and error handling.
plugin/skills/azure-advisor/references/subscription-discovery.md Adds shared subscription discovery guidance for all capabilities.
plugin/skills/azure-advisor/references/capability-routing.md Adds shared guidance for resolving advisor_* MCP tools by capability.
plugin/skills/azure-advisor/README.md Adds contributor-facing folder map and conventions for extending the skill.

Comment on lines +11 to +13
- `*.bicepparam` / `*.parameters.json` → `subscriptionId` / `subscription` parameter
- `.env*` files → `AZURE_SUBSCRIPTION_ID` line
- `infra/**/main.parameters.json`

Reply in chat with this structure (no files written):

```
Comment on lines +107 to +108
- ❌ **Never** write helper scripts, scratch files, or parsing utilities to disk (no `.tmp/*.js`, no `.tmp/*.json`, no temp files of any kind). Reason over MCP tool responses directly in-context. Prefer aggregating via the `advisor_recommendation_summary` tool over computing counts yourself.
- ❌ **Never** shell out to `node`, `python`, `pwsh`, `powershell`, `jq`, or any other interpreter to read, parse, group, or count MCP tool responses. The tool responses are already in your context — reason over them directly. If you need server-side aggregation, use the `advisor_recommendation_summary` tool.
Comment thread plugin/skills/azure-advisor/SKILL.md Outdated
@@ -0,0 +1,62 @@
---
name: azure-advisor
description: "Azure Advisor reviews and recommendation workflows using whichever advisor_* MCP tools are available. WHEN: \"run an advisor review\", \"check my Azure advisor recommendations\", \"summarize advisor findings\", \"what does Advisor say about my subscription\", \"give me an advisor health check\", \"audit my Azure resources with Advisor\". USE FOR: end-to-end Advisor sweeps that combine the recommendation catalog, active recommendations, summaries/aggregates, and IaaC fix suggestions into one chat summary. DO NOT USE FOR: applying changes to Azure resources directly (read-only review), cost analysis beyond Advisor's cost category (use azure-cost), or non-Advisor diagnostics (use azure-diagnostics)."
Comment on lines +18 to +19
> 🛠️ **Contributing a new capability?** See [README.md](README.md) for the folder map
> and a step-by-step recipe.
Comment thread plugin/skills/azure-advisor/SKILL.md Outdated

| Capability | When to Use | Reference |
|-----------|-------------|-----------|
| **review** | Run a holistic, read-only Advisor sweep across a subscription — probe the catalog, pull active recommendations, aggregate by category/impact, spotlight high-impact items, and propose IaaC fix snippets. | [review](review/review.md) |

Drive an end-to-end Azure Advisor sweep using whichever `advisor_*` MCP tools the
connected Azure MCP server exposes. Designed to stay useful as new advisor tools
land — it routes by *capability* (catalog, recommendations, summary, IaaC fix),
| **Metadata / catalog** | "list recommendation types / categories / impact levels / supported values" | tenant context (no subscription needed) |
| **Active recommendations** | "list Advisor recommendations in a subscription" | subscription (resource group optional, filters optional) |
| **Aggregation / summary** | "summarize / group / aggregate Advisor recommendations" | subscription + group-by field |
| **IaaC remediation** | "apply Advisor recommendations to IaaC / ARM / Bicep / Terraform" | a resource type identifier |
Comment thread plugin/skills/azure-advisor/README.md Outdated
Comment on lines +19 to +23
| [references/capability-routing.md](references/capability-routing.md) | **Shared, capability-agnostic docs** reused by every capability. Don't duplicate these inside a capability. |
| [references/capability-routing.md](references/capability-routing.md) | How to resolve an `advisor_*` MCP tool by capability (catalog, recommendations, summary, IaaC fix). |
| [references/subscription-discovery.md](references/subscription-discovery.md) | How to resolve the target subscription from repo config / env without hardcoding. |
| [review/review.md](review/review.md) | **Capability:** holistic read-only Advisor sweep. |
| [review/review.md](review/review.md) | The review workflow (the only file the agent reads for this capability). |
`azure-advisor` is a **product area**, not a single workflow. It groups multiple
Advisor-related capabilities behind one router so the agent can pick the right one by
user intent. Each capability is a self-contained folder; shared concerns live in the
[references](references/capability-routing.md) folder.

@jongio jongio 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.

Testing standards gap per tests/AGENTS.md:

  1. The "Should NOT Trigger" section has only 4 negative prompts (minimum is 5).
  2. None of the negative prompts test adjacent Azure services. The AGENTS.md guide explicitly requires prompts about "different Azure services not covered by this skill." Since the description's DO NOT USE FOR section mentions azure-cost and azure-diagnostics, boundary prompts like "analyze my Azure costs" or "troubleshoot my Azure subscription" are needed to verify the skill doesn't false-positive on adjacent domains. This matters because keyword extraction pulls "cost" and "diagnostics" into the trigger set from the DO NOT USE FOR text.
  3. No unit.test.ts file is present. The testing checklist requires unit tests that verify the skill's content contains expected sections.

The eval CI check is also failing. Worth confirming whether it's related to this PR.

Comment thread tests/azure-advisor/triggers.test.ts
jongio
jongio previously requested changes Jun 25, 2026

@jongio jongio 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.

Two things need fixing before this can merge:

  1. No unit.test.ts. Every other skill in the repo has one (the template includes it). tests/AGENTS.md Step 5 and the checklist require unit tests that verify skill metadata and content sections.

  2. The shouldNotTriggerPrompts array has 4 entries; minimum is 5. None test adjacent Azure services. Since the skill's DO NOT USE FOR calls out azure-cost and azure-diagnostics, add boundary prompts like "analyze my Azure subscription costs" or "troubleshoot my Azure VM" to verify the skill doesn't false-positive on neighboring domains.

The Copilot review also flagged "IaaC" typos (should be "IaC") and .env* scanning in subscription-discovery.md. Worth fixing in the same pass.

Comment thread tests/azure-advisor/triggers.test.ts
…s, IaaC->IaC

- Match MCP tools whose name contains advisor_ (e.g. azure-mcp-advisor_*) instead of requiring an advisor_ prefix, so Copilot CLI server-prefixed tools resolve correctly
- Reword description to stop cost/diagnostics keyword bleed and expand shouldNotTriggerPrompts with adjacent-Azure-service boundaries (4 -> 9)
- Regenerate triggers snapshot for updated description
- Correct IaaC -> IaC across SKILL.md, README, references, and review docs
- Harden .env* handling to read only AZURE_SUBSCRIPTION_ID line

@jongio jongio 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.

Correction on my earlier unit.test.ts feedback: no other skill in this repo actually has one (checked azure-compute, azure-deploy, azure-validate, azure-prepare, microsoft-foundry). The AGENTS.md documents it but nobody follows it. Withdrawing that as a blocker.

One remaining nit: README.md folder map table has duplicate rows for references/capability-routing.md and review/review.md. Each path appears twice with different purpose text. Consider collapsing each pair into a single row.

Comment thread plugin/skills/azure-advisor/README.md

@jongio jongio 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.

My prior changes-request items are all resolved: negative prompts now cover adjacent-service boundaries (9 total), IaaC typos are fixed, and the README folder-map duplicates are collapsed.

One consistency issue remains: review.md references advisor_recommendation_summary by exact name in its constraints, but the rest of the skill routes by capability, not by hard-coded tool name. See inline comment.

The eval CI failure is pre-existing (azure-compute) and isn't related to this PR.

Comment thread plugin/skills/azure-advisor/review/review.md Outdated
…eview

Auto-discover every subscription the repo references (per-environment param/azd configs) and classify each into prod/staging/test/dev/other, running the Advisor review per subscription with results grouped by environment. Tenant-wide subscription-list enumeration becomes a widen-on-request/fallback path. Also route summary via the Aggregation/summary capability instead of a hard-coded tool name, and strengthen the case-insensitive trigger test.
Comment thread plugin/skills/azure-advisor/README.md Outdated
|------|---------|
| [SKILL.md](SKILL.md) | **Router.** Frontmatter (makes the skill discoverable) + a capability table that routes intent to a capability file. Keep it thin. |
| [references/capability-routing.md](references/capability-routing.md) | **Shared, capability-agnostic docs** reused by every capability. Don't duplicate these inside a capability. |
| [references/capability-routing.md](references/capability-routing.md) | How to resolve an `advisor_*` MCP tool by capability (catalog, recommendations, summary, IaC fix). |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Duplicate rows, keep single row for capability and review

Comment thread plugin/skills/azure-advisor/SKILL.md Outdated
@@ -0,0 +1,64 @@
---
name: azure-advisor
description: "Azure Advisor reviews and recommendations using available advisor_* MCP tools. WHEN: \"run an advisor review\", \"check my Azure advisor recommendations\", \"summarize advisor findings\", \"what does Advisor say about my subscription\", \"give me an advisor health check\", \"audit my Azure resources with Advisor\". USE FOR: read-only Advisor sweeps with catalog, recommendations, and IaC fixes. DO NOT USE FOR: changing resources, billing analysis (use azure-cost), or non-Advisor troubleshooting (use azure-diagnostics)."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Update start to -> "Azure Advisor reviews resources and provides recommendations...."

- **greenfield** — Advisor-informed guidance for new/empty subscriptions
- **cost** — Advisor cost-category optimization (coordinates with `azure-cost`)
- **reliability** — Advisor reliability-category reviews
- **governance** — Advisor operational-excellence / governance reviews

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We can also add security and performance reviews to the roadmap here. But consider it as optional

const result2 = triggerMatcher.shouldTrigger(
"run an azure advisor review"
);
expect(result1.triggered).toBe(result2.triggered);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check one of the results to be true as well here.

> **Shared across all `azure-advisor` capabilities.** Any capability that operates on a
> subscription should link here instead of re-defining discovery logic.

Subscription **must never be hardcoded**. Resolve in this order and stop at the first hit:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Better to not stop at the first sub, rather scan all subscriptions and then run the skill for all Subscriptions and provide results accordingly, as this could lead to us missing the important Production subscriptions for a user.

### Step 1 — Resolve subscription

Run [Subscription Discovery](../references/subscription-discovery.md). Save the resolved
value; mention its *source* in the final chat summary ("Subscription pulled from

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

values (in case of multiple subscriptions)

### Step 2 — Probe the catalog (metadata)

Invoke the **metadata / catalog** capability (see
[Capability Routing](../references/capability-routing.md)) with no filter to learn what

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instead of no filter, We should have a step to discover the relevant resource Types part of Infra Files within the repo and add those as filters to one by one invoke metadata tool for each resource type

OR

Get the results without any filters but only show results belonging to specific resource types part of repo files.

## Azure Advisor Review

**Subscription:** <id> (from <source>)
**Tenant catalog:** N categories, M impact levels, K resource types

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Displaying the whole catalog of recommendations does not make sense. Only specific to customer resource types is better.

Also, remove Tenant Keyword from output.

@jongio jongio 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.

Prior changes-request items are all resolved: capability routing now references capability-routing.md instead of hard-coded tool names.

One formatting defect in the new commit: the Error Handling table in review.md has two rows merged onto a single line (the "Catalog call returns empty" and "Recommendation list 401/403" rows are separated by || instead of a newline). This breaks table rendering.

Comment thread plugin/skills/azure-advisor/review/review.md Outdated
- Add resource-discovery reference and mandatory Step 1b to collect every repo resource type/group/id; apply scope in Steps 3-4 (filter or post-filter).
- Reword SKILL.md description opener and add resource-scope + security/performance roadmap rows.
- Add resource-discovery row to README folder map.
- Drop whole-tenant catalog line from the chat summary (scope to customer resources, remove Tenant keyword).
- Split merged error-handling table rows onto separate lines.
- Update trigger snapshots.

@jongio jongio 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.

Incremental review of 106786a (resource-scoping commit). The table formatting defect from my last review is fixed, and the new resource-discovery.md is well-structured with good security awareness around .env file handling.

One minor nit on the new file (non-blocking).

Comment thread plugin/skills/azure-advisor/references/resource-discovery.md
Bicep/ARM provider types are literal extractions; the Terraform azurerm_<kind> -> Microsoft.* mapping must be derived and can be non-obvious. When uncertain, fall back to the resource group filter rather than risk a wrong type filter that hides recommendations.

@jongio jongio 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.

Incremental review of 59e0776 (Terraform type-mapping fallback note).

The distinction between literal extraction (Bicep/ARM) and derived mapping (Terraform) is the right framing. The azurerm_linux_function_app example illustrates why guessing is dangerous, and the fallback-to-resource-group-filter guidance prevents silent data loss from wrong type filters.

No new issues. My prior changes-requested items (negative prompts, IaC typos, README duplicates, hard-coded tool names, table formatting) are all resolved across the earlier commits.

@jongio jongio dismissed their stale review June 26, 2026 23:16

Dismissing: this review was incorrectly posted as changes-requested due to an automation bug. The findings remain valid as comments.

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.

4 participants