close
Skip to content

feat: add DA skill support#15712

Open
qfai wants to merge 39 commits into
devfrom
feature/agent-skills-support
Open

feat: add DA skill support#15712
qfai wants to merge 39 commits into
devfrom
feature/agent-skills-support

Conversation

@qfai
Copy link
Copy Markdown
Contributor

@qfai qfai commented Apr 15, 2026

Add skill support for declarative agents.

Original PR from sebastienlevert/microsoft-365-agents-toolkit:feature/agent-skills-support, cleaned up unrelated changes:

  • Reverted accidental removal of Files\ field in package.json
  • Reverted \checkCopilotAccess.title\ key rename in package.nls.json
  • Reset all localized NLS files to dev baseline (had bulk translation changes and merge conflict)

work item

sebastienlevert and others added 26 commits March 26, 2026 12:29
Add end-to-end support for agent skills in M365 Agents Toolkit:

- Manifest wrapper: AgentSkillElement, CRUD operations (add/remove/has/get),
  max 10 skills, x-agent_skills extension property with agent_skills fallback
- Packaging: bundle skill directories in createAppPackage, validate path
  boundary and SKILL.md existence
- Validation: skill folder/SKILL.md/frontmatter validation, error aggregation,
  telemetry, log formatting for CLI and VS Code
- FxCore.addSkill(): new/existing skill flows, SKILL.md template generation,
  path normalization, confirmation dialog
- Question flow: skill name, description, expose-to-copilot questions
- CLI: atk add skill command with options and telemetry
- VS Code: handler, command registration, telemetry events
- Localization: all English strings for prompts and messages
- Tests: 51 new unit tests across wrapper, packaging, validation, and command

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ore conflict

- Rename checkCopilotAccess.title to checkCopilotAccess in all 16 nls files
  to match the %teamstoolkit.commands.checkCopilotAccess% reference in package.json
- Remove redundant 'files' property from package.json since .vscodeignore
  is used for vsce packaging (newer vsce rejects having both)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add TreeViewCommand for addSkill below Add Action in the Development pane
- Add fx-extension.addSkill command entry in package.json with enablement
- Add localization keys (title, description, running, blockTooltip) across all 16 locales
- Remove diagnostic logging from localizeUtils.ts and treeViewCommand.ts
- Skill item shows only for declarative agent projects (isDeclarativeCopilotApp)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace ConfirmQuestion with SingleSelectQuestion (yes/no options)
- Update FxCore.addSkill to compare string 'yes' instead of boolean
- Add localization keys for yes/no options
- Update CLI option type from boolean to string
- Update tests accordingly - all 11 passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The addSkill flow had a showMessage() confirm dialog before proceeding,
which interrupted the quickpick-only UX. Remove it so the flow stays
entirely within the VS Code quickpick area.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds back the warn-level showMessage confirmation (matching addPlugin
pattern) that asks users to confirm before modifying files. This was
accidentally removed when the pre-action confirmation was stripped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Allow uppercase letters in skill names (not just lowercase)
- Validate for duplicate skill names (check if folder already exists)
- Rename CLI flags: --name, --description, --expose-to-copilot, --from
- Update validation error messages and placeholder text

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When adding an existing skill via --from, the name and description are
already in the SKILL.md file, so they shouldn't be required. Skip the
name/description prompts in the question flow when --from is provided.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When importing an existing skill via --from:
- Validate folder name uses only letters, numbers, and hyphens
- Read SKILL.md frontmatter and verify the name matches the folder name
- Error out with clear messages if either check fails

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add AgentSkillsEnabled feature flag (default: false) following the
established pattern (like EmbeddedKnowledge before cleanup). Gates:
- VS Code tree view item (treeViewManager.ts)
- VS Code command enablement (package.json)
- VS Code context (extension.ts setContext)
- CLI 'atk add skill' command (add.ts)

Set TEAMSFX_AGENT_SKILLS=true to enable the feature.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add re-export of AgentSkillElement interface so it can be imported by
consumers and test files. Previously the type was imported from
generated-types and used internally but not re-exported, causing
TS2459 errors in the manifest test suite.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use path.resolve(projectPath, teamsManifestPath) for manifest file
  resolution to handle both absolute and relative paths correctly
- Revert localized package.nls.*.json files (pipeline handles translations)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Update treeViewManager test to expect 9 items (Add Skill added)
- Apply prettier formatting to CopilotGptManifestUtils and test files

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Merge upstream/dev to stay current
- Fix CopilotGptManifestUtils.ts formatting (CI lint-pr.sh)
- Add 5 new unit tests for addSkill coverage gaps:
  - copilotExtensions manifest format path
  - Skill outside appPackage validation
  - SKILL.md without name frontmatter
  - showMessage error handling
  - DA manifest with empty file property

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 7 tests for addSkillQuestionNode (pattern validation, duplicates, conditions)
- Add 4 tests for logValidationErrors with skill errors (VSC + CLI)
- Add 1 test for validate driver with non-empty skillValidationResult
- Remove 3 unused NLS keys (expose.description, from.title, from.placeholder)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Test VSCode View Agent Manifest button triggers openFile
- Test CLI platform success message path
- Test logValidationErrors with undefined skillValidationResult (covers ?? [] partials)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Skill folder paths were resolved relative to the DA manifest file
location, which points to .generated/ during packaging. Since skill
folders don't support env var substitution, they only exist in the
original appPackage/ directory.

Resolve skill folders relative to appDirectory instead, matching the
pattern used by embedded knowledge files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add ability to import skills from .zip files via UI (source type picker +
file dialog) and CLI (--from flag with .zip path). Includes:

- New SkillSourceType and SkillFromZipFile questions
- importSkillFromZip method with security validation (path traversal,
  zip bomb protection), layout detection, and atomic extraction
- NLS strings for UI labels and error messages
- 8 new tests covering zip import happy path and error cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Restore 'files' field in package.json (was accidentally removed)
- Restore 'checkCopilotAccess.title' key name in package.nls.json

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These files had unrelated bulk translation changes and a merge conflict.
Skill-related translations should be added separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
qfai and others added 2 commits April 16, 2026 16:08
AdmZip.writeZip() normalizes ../../../etc/passwd to etc/passwd on disk.
Use fs.writeFile with toBuffer() to preserve raw traversal entry names.
Also remove duplicate validateInputs stub (already in beforeEach).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…S import

AdmZip.addFile() normalizes '../../../etc/passwd' to 'etc/passwd' at creation
time, so both writeZip() and toBuffer() produce a normalized entry. A real
malicious zip crafted externally preserves the raw traversal path. Construct
the ZIP binary manually to verify our entryName.includes('..') check works.

Also remove unused TOOLS import from test file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 93.85027% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.34%. Comparing base (136ca8a) to head (ac4a0c4).
⚠️ Report is 23 commits behind head on dev.

Files with missing lines Patch % Lines
packages/fx-core/src/core/FxCore.ts 94.77% 7 Missing and 1 partial ⚠️
packages/cli/src/commands/models/addSkill.ts 54.54% 5 Missing ⚠️
...vscode-extension/src/handlers/lifecycleHandlers.ts 33.33% 4 Missing ⚠️
...ckages/vscode-extension/src/handlers/sharedOpts.ts 0.00% 2 Missing ⚠️
packages/cli/src/commands/models/add.ts 75.00% 0 Missing and 1 partial ⚠️
...t/driver/teamsApp/utils/CopilotGptManifestUtils.ts 98.57% 0 Missing and 1 partial ⚠️
.../fx-core/src/component/driver/teamsApp/validate.ts 88.88% 0 Missing and 1 partial ⚠️
...ges/vscode-extension/src/telemetry/extTelemetry.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##              dev   #15712    +/-   ##
========================================
  Coverage   93.34%   93.34%            
========================================
  Files         590      592     +2     
  Lines       37194    37564   +370     
  Branches     6794     6931   +137     
========================================
+ Hits        34717    35064   +347     
- Misses       1831     1850    +19     
- Partials      646      650     +4     
Files with missing lines Coverage Δ
packages/cli/src/telemetry/cliTelemetryEvents.ts 100.00% <100.00%> (ø)
packages/fx-core/src/common/featureFlags.ts 100.00% <100.00%> (ø)
.../src/component/driver/teamsApp/createAppPackage.ts 97.83% <100.00%> (+0.12%) ⬆️
...e/src/component/driver/teamsApp/utils/telemetry.ts 100.00% <100.00%> (ø)
...kages/fx-core/src/component/m365/packageService.ts 98.46% <100.00%> (+0.03%) ⬆️
...kages/fx-core/src/component/utils/fileOperation.ts 96.42% <100.00%> (+0.13%) ⬆️
packages/fx-core/src/error/teamsApp.ts 100.00% <100.00%> (ø)
packages/fx-core/src/question/index.ts 97.22% <100.00%> (+0.07%) ⬆️
packages/fx-core/src/question/inputs/index.ts 100.00% <100.00%> (ø)
...es/fx-core/src/question/options/AddSkillOptions.ts 100.00% <100.00%> (ø)
... and 16 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…test.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
VS Code only populates quickPick.selectedItems on explicit mouse clicks.
Pressing Enter fires onDidAccept with selectedItems=[] while activeItems
holds the keyboard-focused item. Add an activeItems fallback so Enter key
navigation works correctly when selecting a manifest/file in the singleFile
QuickPick (e.g. the Teams App manifest step in 'Add Skill').

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebastienlevert
Copy link
Copy Markdown
Contributor

@qfai My branch was updated with new requirements. Please refresh this one with the latest.

qfai and others added 7 commits May 11, 2026 16:50
Add maxPackageSizeInBytes option to CreateAppPackageArgs to enforce
a configurable size limit on the generated zip package. This prevents
oversized packages from being sent to the Builder API (MOS/Titles APIs)
which have a 10MB maximum upload limit.

The check runs after the zip is written and returns an
AppPackageSizeExceededError with human-readable MB sizes when the
limit is exceeded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a validatePackageSize check in PackageService.sideLoading and
sideLoadXmlManifest that throws AppPackageSizeExceeded when the zip
exceeds the 10 MB MOS API limit. This prevents uploads that would
be rejected server-side with an unhelpful error.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Move validatePackageSize() before getManifestFromZip() in sideLoading
  to reject oversized files before attempting to parse them
- Add fs.statSync stub to beforeEach so existing tests are not broken
  by the new validation call
- Restore and re-stub in size-exceeded tests to override the default

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove configurable maxPackageSizeInBytes option and always enforce
the 10 MB limit at build time, matching the install-time enforcement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…gation

- Add focus-visible outline to sample cards for sufficient contrast ratio (3:1+)
- Make filter tag remove button keyboard accessible with role, tabIndex, aria-label, and onKeyDown handler
- Add focus-visible styles for filter remove button

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

✅ VscUse Test Plan — All tests passed

Why these tests: PR adds DA skill support touching DA manifest wrappers, treeview manager, vscode-extension handlers, and copilot manifest utilities — DA add-action/capability, treeview, and manifest validation plans are most relevant.

Branch diff: feature/agent-skills-supportdev

Plans run:

  • DA_No_Action_Add_Action
  • Feature_DA_Add_Action_And_Capability_Remote_Debug
  • Feature_DA_Advanced_Personal_Scope_Provision_with_Copilot_License
  • Feature_UI_TreeView
  • Feature_Validate_copilot_manifest

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ✅ All tests passed

🔗 Full pipeline results

ℹ️ How were these tests selected?

GitHub Copilot (GPT-4.1) analysed the PR title, description, and the diff between
feature/agent-skills-support and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

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.

3 participants