Skip to content

fix(agents): resolve only explicit prompt skills and remove skills/ auto-scan - #10999

Open
Zhijie Huang (hund030) wants to merge 3 commits into
mainfrom
fix/prompt-explicit-skills
Open

Zhijie Huang (hund030) wants to merge 3 commits into
mainfrom
fix/prompt-explicit-skills

Conversation

@hund030

@hund030 Zhijie Huang (hund030) commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Prompt and Copilot-harnessed agents unconditionally scanned <agentDir>/skills/<dir>/SKILL.md during azd ai agent init, predeploy validation, and azd deploy, causing unrelated local skills/ folders (such as coding-agent skills) to be emitted as azure.ai.skill services or fail deployment with invalid_agent_manifest / foundry_dependency_not_ready. Conversely, versionless skills: references backed by inline host: azure.ai.skill services (created via azd ai skill add) failed azd deploy when no <agentDir>/skills/ directory existed on disk.

Changes

  • cli/azd/extensions/azure.ai.agents/internal/project/prompt_skills.go, prompt_graph.go, config.go: remove skills/ directory scanning, SKILL.md parsing (ScanSkillBundles, scanSkillsDir, parseSkillMD), and SkillService from azure.ai.agents, and resolve only versionless entries declared in managed.Skills (declaredVersionlessPromptSkills) against sibling host: azure.ai.skill services and SKILL_<NAME>_VERSION markers.
  • cli/azd/extensions/azure.ai.agents/internal/cmd/resource_services.go, init_managed.go: remove ScanSkillBundles and host: azure.ai.skill service emission from promptResourceServices and emitResourceServices, and align promptResourceServices's conditional promptAgent.Skills uses: wiring with promptAgent.Connections and promptAgent.Toolboxes.
  • cli/azd/extensions/azure.ai.agents/internal/pkg/agents/agent_yaml/map.go & README.md: link versionless Skills entries to ResolvedSkills via servicekey.SanitizeServiceName while preserving distinct authored version pins, and remove the stale skills/ convention-folder note from README.md.

Manual Validation

  • Initialized and deployed a Copilot harness prompt agent (verify-pr10808-northcentralus) on foundry-devx-test-1 in a directory containing both a malformed skills/broken-skill/SKILL.md (missing description) and skills/extra-skill/SKILL.md, and verified azd ai agent init did not emit host: azure.ai.skill services and azd deploy --no-prompt succeeded without scanning skills/.
  • Added skills: [extra-skill] to the prompt agent in azure.yaml before adding the skill service and verified azd deploy --no-prompt failed fast with skill "extra-skill" has no enabled azure.ai.skill sibling service.
  • Ran azd ai skill add extra-skill --file ./skills/extra-skill, wired extra-skill into the agent's uses: list, and verified azd deploy --all --no-prompt published SKILL_EXTRA_SKILL_VERSION=1 and deployed the prompt agent with the resolved skill while still ignoring skills/broken-skill/SKILL.md.

…uto-scan

- Remove implicit skills/ directory scanning, SKILL.md parsing, and azure.ai.skill service emission from azure.ai.agents so azure.ai.skills strictly owns skill authoring and packaging.

- Resolve versionless prompt agent skills: entries directly against sibling azure.ai.skill services and SKILL_<NAME>_VERSION markers.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
25 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

🟡 Changes recommended

Legacy projects can silently lose previously attached skills on deployment when explicit skills: references are absent, with no migration warning to alert users.

4 open issues
What changed in this PR

This PR changes azure.ai.agents to resolve explicitly declared prompt-agent skills instead of discovering local skills/ folders.

Changes:

  • Remove folder scanning and automatic skill-service generation.
  • Resolve versionless references through sibling services and published version markers while preserving authored pins.
  • Update dependency-wiring helpers, regression tests, and documentation.

Extension user-contract review: blocked (13 files inspected; 0 new contract comments; existing threads unverified because review history was not supplied).

Paths are relative to cli/azd/extensions/azure.ai.agents/.

File Description
README.md Removes the obsolete skills-folder convention note.
internal/​project/​service_target_agent_test.go Updates endpoint tests for explicit skills and ignored local folders.
internal/​project/​prompt_skills.go Replaces bundle scanning with declared-skill resolution.
internal/​project/​prompt_skills_test.go Covers explicit references, pins, dependency failures, and ignored folders.
internal/​project/​prompt_graph.go Registers skill nodes only for declared versionless references.
internal/​project/​config.go Removes the skill-service model formerly used by init.
internal/​project/​agent_validation_test.go Tests authored version conflicts and ignored local skill files.
internal/​pkg/​agents/​agent_yaml/​map.go Links sanitized resolved names while preserving authored pins.
internal/​pkg/​agents/​agent_yaml/​managed_test.go Tests sanitized matching and distinct authored pins.
internal/​cmd/​resource_services.go Replaces skill-service generation with conditional dependency wiring.
internal/​cmd/​resource_services_test.go Tests dependency wiring against existing sibling services.
internal/​cmd/​listen_test.go Replaces malformed-file validation with conflicting authored versions.
internal/​cmd/​init_managed.go Calls the simplified resource-service helper.

Review effort: Max

Copilot AI max review requested due to automatic review settings November 18, 2026 07:45

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.

🔵 Needs a closer look

Removing the skill-folder convention can silently detach skills from existing agents during successful deployments, without a migration warning.

3 open issues
2 previously missed issues

In code that hasn't changed since last review

Medium severity Document required uses wiring and pinned Foundry skill alternative

cli/​azd/​extensions/​azure.ai.agents/​internal/​project/​prompt_skills.go:112

For a versionless reference without a sibling service, this suggestion omits the required uses: entry, so following it still fails dependency validation. It also hides the option to pin an already-published Foundry skill instead of publishing a new version. Include both the uses: wiring and the explicit {name, version} alternative.

Low severity Document skill attachment, pinning, and ignored local folders

cli/​azd/​extensions/​azure.ai.agents/​README.md:1261

Removing the folder convention leaves the README without instructions for attaching prompt-agent skills. Document that versionless skills: entries need an azure.ai.skill service in uses:, while {name, version} pins an existing Foundry skill. Also state that local skills/ folders are ignored.

1 resolved since last review

Review effort: Max

- Warn via `warnf` when enabled `azure.ai.skill` siblings in `uses:` are absent from the prompt agent `skills:` list.
- Distinguish missing vs. host-conflicting skill services in `validateSkillDependencies` and document `uses:` and `{name, version}` pinning.
Copilot AI max review requested due to automatic review settings November 23, 2026 04:56

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.

🟡 Changes recommended

Prompt deployment can incorrectly reject environment-conditioned skills and silently remove legacy skills because migration warnings are not preserved in terminal or JSON output.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Set dependencyEnv before resolving skill conditions

cli/​azd/​extensions/​azure.ai.agents/​internal/​project/​prompt_graph.go:348

When a skill's condition: depends on a value saved only in the selected azd environment, prompt deployment leaves p.dependencyEnv unset and can reject the skill as disabled even after core deploys it. Set p.dependencyEnv = env before resolving the prompt graph so dependency conditions use the same environment snapshot.

3 resolved since last review

Review effort: Max

verb, pronoun = "are", "them"
}

g.warnf(
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

azure.ai.agents PR build

Note

This is an unsigned development build. Install it only if you trust this PR.

Install the extension:

azd ext install "https://azuresdkartifacts.z5.web.core.windows.net/azd/extensions/pr/10999/azure-ai-agents.zip"
  • Version: 1.2.0-pr.10999.7102927
  • Merge commit: 41d988d

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants