Restructure agent skills to use multi-source architecture - #104
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Restructures the skills subsystem to support a multi-source architecture (in-memory + external sources) and introduces first-class script discovery/execution wiring, aligning with the referenced upstream port.
Changes:
- Replaces the legacy filesystem-only skills provider with a new
NewContextProviderbuilt around composableSourceimplementations. - Adds
fsskills.Sourcefor file-based discovery of skills, resources, and scripts (with configurable directories/extensions and optional script runners). - Updates/expands tests and refreshes skills examples to demonstrate file-based, code-defined, and mixed skills composition.
Show a summary per file
| File | Description |
|---|---|
| memory/skills/skills_test.go | Updates tests to use the new provider + file source options; adjusts expectations around tool exposure and exact-name behaviors. |
| memory/skills/skills.go | Refactors core type definitions (Frontmatter/Skill/Resource/Script) and validation utilities to support the new provider model. |
| memory/skills/provider_test.go | Adds coverage for new provider behaviors: caching, deduplication, template validation, scripts, approval, and multi-source aggregation. |
| memory/skills/provider.go | Introduces the new multi-source NewContextProvider implementation, prompt templating, tool wiring, caching, and deduplication logic. |
| memory/skills/loader.go | Removes the old filesystem loader/provider implementation in favor of the new source/provider architecture. |
| memory/skills/fsskills/source.go | Adds file-based Source for discovering skills/resources/scripts from one or more fs.FS roots with normalization and filtering. |
| memory/skills/fsskills/source_test.go | Adds tests for file-based skill discovery, frontmatter parsing (incl. metadata), and resource directory normalization. |
| memory/skills/fsskills/source_script_test.go | Adds tests for script discovery, allowed extensions, runner behavior, directories, and error cases. |
| memory/skills/frontmatter_source_test.go | Adds validation tests for Frontmatter and in-memory source behavior. |
| examples/skills/01_basic_skills/main.go | Removes the old basic skills example entrypoint (superseded by new examples structure). |
| examples/skills/01_basic_skills/skills/expense-report/SKILL.md | Removes legacy example skill content (part of examples restructure). |
| examples/skills/01_basic_skills/skills/expense-report/references/POLICY_FAQ.md | Removes legacy example resource file (part of examples restructure). |
| examples/skills/01_basic_skills/skills/expense-report/assets/expense-report-template.md | Removes legacy example asset file (part of examples restructure). |
| examples/02-agents/skills/step01_file_based_skills/main.go | Adds a new example showing file-based skills with explicit source composition and script runner integration. |
| examples/02-agents/skills/step01_file_based_skills/skills/unit-converter/SKILL.md | Adds a file-based unit converter skill for the new examples. |
| examples/02-agents/skills/step01_file_based_skills/skills/unit-converter/references/conversion-table.md | Adds a resource file used by the file-based unit converter skill. |
| examples/02-agents/skills/step01_file_based_skills/skills/unit-converter/scripts/convert.py | Adds a script used by the file-based unit converter skill. |
| examples/02-agents/skills/step02_code_defined_skills/main.go | Adds a code-defined skills example demonstrating programmatic skills/resources/scripts. |
| examples/02-agents/skills/step03_mixed_skills/main.go | Adds a mixed-skills example combining in-memory skills with a file-based source. |
| examples/02-agents/skills/step03_mixed_skills/skills/unit-converter/SKILL.md | Adds an additional file-based skill used by the mixed-skills example. |
| examples/02-agents/skills/step03_mixed_skills/skills/unit-converter/references/conversion-table.md | Adds resource content for the mixed-skills file-based unit converter skill. |
| examples/02-agents/skills/step03_mixed_skills/skills/unit-converter/scripts/convert.py | Adds script content for the mixed-skills file-based unit converter skill. |
| examples/02-agents/skills/internal/skillhelpers/subprocess_script_runner.go | Adds a sample script runner that materializes a file-backed skill and executes scripts via subprocess. |
| examples/02-agents/skills/internal/skillhelpers/inline.go | Adds helper utilities for parsing arguments and shaping conversion results in examples. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 24/24 changed files
- Comments generated: 5
…into dev/qmuntal/skillsrebump
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by Go API Consistency Review Agent for issue #104 · ● 1.8M
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Cross-repo parity review — PR #104: Restructure agent skills to use multi-source architectureThis PR is a port of Two minor parity observations1. Go's Upstream surface to watch: 2. Code-defined skill In .NET, In the Go example ( This is not necessarily wrong (the Go design is simpler and the system-prompt approach is valid), but it represents a behavioral difference in what the model sees after calling Sample coverage
Everything else reviewed —
|
Port of microsoft/agent-framework#4871
Fixes https://github.com/microsoft/go-lab/issues/269