Add Modern Agent support with skill filtering - #165
Open
adilei wants to merge 19 commits into
Open
Conversation
Introduces the foundation for supporting modern Copilot Studio agents alongside classic ones. Modern agents use instructions + skills + tools instead of topics + action nodes. Key changes: - SessionStart hook detects agent type (classic vs modern) from settings.mcs.yml and writes blocked skill list to state file - PreToolUse hook blocks incompatible skills with a helpful message (e.g., "new-skill is for modern agents only") - 3 new modern-only skills: new-skill, list-skills, edit-agent-modern - 9 classic-only skills tagged with agent-types: classic frontmatter - Author agent updated with dual dispatch table (classic vs modern) - InlineAgentSkill template for modern agent skills Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Runs on PRs that touch skills or the detection hook. Parses agent-types frontmatter from SKILL.md files and compares against the hardcoded lists in detect-agent-type.js. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The hook can list future skills (add-tool, edit-tool, etc.) that don't have SKILL.md files yet. CI now only checks that every skill WITH agent-types frontmatter is in the hook — not the reverse. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI now fails if any skill is missing agent-types frontmatter, forcing contributors to think about agent type compatibility. All existing skills tagged: - classic: 12 skills (topics, nodes, actions, cards, triggers, variables) - modern: 3 skills (new-skill, list-skills, edit-agent-modern) - both: 16 skills (manage, clone, validate, chat, eval, etc.) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
add-knowledge, add-other-agents, and edit-agent are classic-only (their modern equivalents are add-knowledge-modern, etc.) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- filter-skills.js now detects agent type AND blocks in one step (reads settings.mcs.yml on each Skill invocation — single file read) - Remove detect-agent-type.js and the state file (~/.copilot-studio-cli/agent-type.json) - Remove SessionStart detection hook from hooks.json - Add build-skill-filter.js: generates filter-skills.js from SKILL.md frontmatter - CI validates: all skills have agent-types tag + committed hook matches build output Contributor workflow: 1. Add agent-types: classic|modern|both to SKILL.md 2. Run: node scripts/build-skill-filter.js 3. Commit both files — CI enforces they match Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- build-skill-filter.js now generates skill-types.json (data only) - filter-skills.js is a static script that reads the JSON - CI validates: all skills have agent-types + JSON matches frontmatter - Cleaner separation: data (JSON) vs logic (JS) Contributor workflow: 1. Add agent-types: classic|modern|both to SKILL.md 2. Run: node scripts/build-skill-filter.js 3. Commit SKILL.md + hooks/skill-types.json Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of a generated JSON file + build script + CI sync check, the hook now reads the invoked skill's own SKILL.md frontmatter directly. Single source of truth, no build step. - filter-skills.js reads SKILL.md agent-types tag on each invocation - CI just validates every skill has the tag (one simple check) - Removed: skill-types.json, build-skill-filter.js Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use only public-facing names: "Generative Orchestration" and "Modern Agents" throughout skill descriptions, author agent, and system prompt. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 evals covering: - 3 modern skills blocked on classic agent (new-skill, list-skills, edit-agent-modern) - 3 classic skills blocked on modern agent (new-topic, add-adaptive-card, add-node) - 1 classic skill allowed on classic agent (new-topic) - 1 modern skill allowed on modern agent (new-skill) Also adds modern-agent fixture with CLICopilotRecognizer and cliagent-1.0.0 template. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 eval scenarios testing skill routing by agent type. Note: hook-based blocking works in real sessions but not in eval sub-agent forks (hooks don't propagate into forked contexts). Evals test Author agent routing behavior instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Keep only positive cases: classic skill on classic agent, modern skill on modern agent. Hook blocking is validated by manual testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The LSP clone hardcoded clusterCategory=5 (prod), causing 403 on test/preprod environments. Now accepts --cluster-category N and writes it to conn.json so push/pull use the correct token. Usage: manage-agent clone --cluster-category 1 ... Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- add-tool: guide pattern (like classic add-action) — walks user through UI for connector/MCP/workflow connection, then edits YAML after pull - add-knowledge-modern: creates WebsiteKnowledgeSource YAML directly, guides to UI for SharePoint/files/Dataverse - edit-skill: edit InlineAgentSkill markdown content and description - Updated author agent dispatch table with all modern skills Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 eval scenarios covering all modern skills: - new-skill: create ReturnPolicy skill - edit-skill: update OrderLookup description - edit-agent-modern: change instructions, add conversation starters - add-knowledge-modern: add website knowledge source - list-skills: list skills and tools - add-tool: guide for adding Outlook connector - Classic topic creation (baseline regression) Modern agent fixture now includes: - Instructions with conversation starters - Existing OrderLookup skill in topics/ - MSN Weather ConnectorTool in translations/ - Website knowledge source in knowledge/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5 evals: create skill, edit skill, edit instructions, add knowledge, add conversation starters. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Skill tracing hooks don't propagate into forked sub-agents in the eval harness. Keep skill_invoked (works for some) and content checks (always work). 22/25 remaining checks pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces dual agent type support (Generative Orchestration vs Modern Agents) with deterministic skill filtering, 6 new modern agent authoring skills, and infrastructure fixes.
How skill filtering works
Single source of truth: the
agent-typestag in each SKILL.md frontmatter. No generated files, no build step, no state files.CI workflow
.github/workflows/validate-skill-types.yml— fails if any skill is missingagent-typesfrontmatter or has an invalid value.New skills (Modern Agents)
new-skillInlineAgentSkillintopics/dirlist-skillsedit-agent-modernadd-tooladd-knowledge-modernedit-skillClone fix
manage-agent clonenow accepts--cluster-category Nfor non-prod environments (was hardcoded to 5/prod, causing 403 on test environments).Evals
5 eval scenarios covering modern agent authoring: create skill, edit skill, edit instructions, add knowledge, add conversation starters.
Known Issues: Push/Pull Tooling
Both the LSP (VS Code extension) and PAC CLI have issues with Modern Agents. These are platform bugs, not plugin bugs.
LSP (manage-agent.bundle.js) — current approach
TranslationsComponent) instead of invocable (DialogComponent).PreconditionFailed/ConcurrencyVersionMismatcherrors on push.403 Forbiddenwhen cloning from non-prod environments.--cluster-category 1for test environments (fixed in this PR).workspace/agent-name/agent-name/.PAC CLI (pac copilot) — future approach
pac copilot pushcrashes on$kindformatArgumentOutOfRangeExceptioninKindFromTypewhen reading Modern Agent YAML. Cannot push Modern Agents at all.pac copilot clone/pull/pushcommands are hidden behindverbCopilotSync: "on"infeatureflags.json.~/.dotnet/tools/.store/microsoft.powerapps.cli.tool/<version>/.../featureflags.json.brew install dotnet@10.Recommendation
Use the LSP for all push/pull/clone/publish operations. Be aware of the DialogComponent demotion bug — avoid pushing if you haven't changed tool files. Switch to PAC CLI once the
$kindcrash is fixed.Test plan
--cluster-category 1enables clone on test environmentstopics/creates DialogComponent (visible in UI)🤖 Generated with Claude Code