feat(skills): author skill services in azure.yaml - #9638
feat(skills): author skill services in azure.yaml#9638Glenn Harper (glharper) wants to merge 3 commits into
Conversation
Add a declarative skill add command that creates or updates azure.ai.skill service blocks without mutating the remote resource. Preserve unowned service fields and write safe portable archive references. Refs #9088 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6d1f6705-1953-4a0a-852c-0dae4541e1d8
|
Azure Pipelines: Successfully started running 1 pipeline(s). 20 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Adds declarative Foundry skill authoring to azure.yaml.
Changes:
- Adds
azd ai skill add. - Supports inline,
SKILL.md, ZIP, and directory sources. - Adds schema, documentation, path-safety, and archive-size updates.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
schemas/v1.0/azure.yaml.json |
Allows skill service paths. |
schemas/alpha/azure.yaml.json |
Mirrors schema support. |
cli/azd/extensions/azure.ai.skills/README.md |
Documents declarative composition. |
internal/exterrors/codes.go |
Adds manifest error codes. |
internal/cmd/skill_update.go |
Reuses skill-file loading. |
internal/cmd/skill_service_config.go |
Implements service upserts. |
internal/cmd/skill_service_config_test.go |
Tests upserts and paths. |
internal/cmd/skill_input.go |
Centralizes SKILL.md parsing. |
internal/cmd/skill_create.go |
Reuses parsing helper. |
internal/cmd/skill_add.go |
Adds the command. |
internal/cmd/skill_add_test.go |
Tests command behavior. |
internal/cmd/service_target.go |
Enforces archive size limits. |
internal/cmd/service_target_test.go |
Tests size boundaries. |
internal/cmd/root.go |
Registers skill add. |
extension.yaml |
Adds command example. |
Suppressed comments (1)
cli/azd/extensions/azure.ai.skills/internal/cmd/skill_add.go:105
- A one-line
SKILL.mdbody ending in.mdor.txtis also stored as instruction text here, but reconciliation trims it and interprets it as a path. A valid body such asFollow README.mdtherefore becomes undeployable afterskill add --file SKILL.md; retain an explicit inline/file distinction and add a regression test for this input shape. (azd-code-reviewer)
declaration.Config = skillServiceConfig{
Description: parsed.Description,
Instructions: parsed.Instructions,
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| declaration.Config = skillServiceConfig{ | ||
| Description: a.flags.description, | ||
| Instructions: a.flags.instructions, |
Co-authored-by: glharper <64209257+glharper@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
cli/azd/extensions/azure.ai.skills/internal/cmd/skill_add.go:112
- This persisted archive reference makes the extension's contributor guidance inaccurate:
cli/azd/extensions/azure.ai.skills/AGENTS.md:66-68says--fileis invocation-only and is never tracked or re-read. Update that section to distinguish declarativeaddarchive/directory inputs, which are re-read during deploy, from remotecreate/updateinputs.
case modeFilePackage, modeFileDirectory:
declaration.ArchiveSource = a.flags.file
cli/azd/extensions/azure.ai.skills/internal/cmd/service_target.go:506
- This whitespace check makes valid references such as
prompts/code review.mdbecome literal instructions instead of loading the file. The skill schema allows.md/.txtpaths without excluding spaces, so distinguish prose from a path without rejecting all whitespace and add coverage for a spaced filename.
if strings.ContainsAny(value, " \t\r\n") {
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.
Suppressed comments (3)
cli/azd/extensions/azure.ai.skills/internal/cmd/skill_service_config.go:282
- [azd-code-reviewer] This line is not
gofmt-formatted;gofmt -dchanges it, so the repository's enforced formatting check (cli/azd/AGENTS.md:127) will fail. Rungofmton this file.
return filepath.ToSlash(resolvedRelative), nil
cli/azd/extensions/azure.ai.skills/internal/cmd/service_target.go:506
- [azd-code-reviewer] Treating any whitespace as proof that
instructionsis inline breaks valid.md/.txtpaths containing spaces, including absolute paths, even though the schema documents this field as a file path. The heuristic also still misclassifies a one-token inline body such asREADME.md. Use an explicit file-versus-inline discriminator or another unambiguous syntax so both forms round-trip.
if strings.ContainsAny(value, " \t\r\n") {
cli/azd/extensions/azure.ai.skills/internal/cmd/skill_service_config.go:238
- [azd-code-reviewer] The new real-path containment check is the protection against an archive symlink escaping the service root, but the tests cover only a lexically outside path. Add cases for an in-root symlink pointing outside (rejected) and an in-root symlink pointing inside (accepted) so this path-safety boundary cannot regress.
sourceReal, err := filepath.EvalSymlinks(sourceAbs)
azure.ai.skills PR buildNote 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/9638/azure-ai-skills.zip"
|
Summary
Completes the authoring stage of #9088 after #9622 moved deploy-time reconciliation into
azure.ai.skills.Adds a dedicated declarative command:
skill addonly writesazure.yaml; it does not create or update the remote Foundry skill. This avoids the remote-success/local-write-failure window discussed on #9116 and keepsazure.yamlas the source of truth.What changed
SKILL.md, ZIP packages, and skill directories.host: azure.ai.skillservices withProject.Get+AddService.GetServiceConfigSection+SetServiceConfigSection.uses:,project:,$ref, and unknown/unowned fields while clearing stale owned fields when switching between inline and archive content.project:forazure.ai.skillin the v1.0 and alpha core schemas so documented service-relative paths are schema-valid.uses:.This supersedes the authoring portion of #9116 without adding the unresolved
--save-to-azure-yamldual-write behavior.Validation
go test ./... -count=1,go build ./..., andgolangci-lint run ./...inazure.ai.skillsmage checkDependencyVersionsmage preflight(all checks passed)