mcpField
I
int-project-context

int-project-context

github.com/microsoftAgent 工作流483106 次安装1 天前更新
代码仓库

关于 int-project-context

为 Copilot Studio Agent 项目提供共享开发上下文的技能,说明项目目录、架构和连接器查询脚本,以及创建 YAML 时的工作约定。适用于需要修改或检查项目文件的开发流程。

主要功能

  1. 01概述项目目录与 YAML 文件结构
  2. 02提供架构查询脚本的用法
  3. 03提供连接器查询脚本的用法
  4. 04要求优先使用专用技能
  5. 05列出 ID、Power Fx 等约定

适用场景

  1. 01了解 Copilot Studio 项目布局
  2. 02查询 YAML 架构后创建文件
  3. 03查找连接器操作的输入与输出

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/microsoft/skills-for-copilot-studio --skill int-project-context

安装后在 Claude Code 中输入/int-project-context确认已加载。

详细介绍

Copilot Studio — 共享项目上下文

你正在 Copilot Studio Agent 项目中工作。所有 YAML 文件的扩展名都是 .mcs.yml。

项目结构

<agent-dir>/           # Auto-discover via Glob: **/agent.mcs.yml
├── agent.mcs.yml      # Agent metadata (display name, schema version)
├── settings.mcs.yml   # Agent settings (schemaName, GenerativeActionsEnabled, instructions)
├── topics/            # Conversation topics (AdaptiveDialog YAML files)
├── actions/           # Connector-based actions (TaskDialog YAML files)
├── knowledge/         # Knowledge sources (KnowledgeSourceConfiguration YAML files)
├── variables/         # Global variables (GlobalVariableComponent YAML files)
└── agents/            # Child agents (AgentDialog YAML files, each in its own subfolder)

架构查询脚本

编写新的 YAML 文件时,务必使用架构查询脚本了解架构,包括必填字段、定义和引用。脚本位于 ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js,可在终端中按如下方式使用:

node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js search trigger             # Search by keyword
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js lookup SendActivity        # Look up a definition
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js resolve AdaptiveDialog     # Resolve with $refs
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js kinds                      # List all valid kind values
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js summary Question           # Compact overview
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js validate <file.yml>        # Validate a YAML file

如果你已经知道要查询的具体定义,请使用 lookup。如果你想了解某个主题相关的架构,可以使用 search 或 summary。 编写 YAML 之前,务必先检查架构,以确保包含所有必填字段并使用有效值。

切勿加载完整的架构文件(reference/bot.schema.yaml-authoring.json)——该文件过长。请始终使用上述脚本。

连接器查询脚本

连接器查询脚本位于 ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js。如有任何关于连接器、操作及其输入和输出的问题,请使用此脚本:

node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js list                                 # List all connectors with operation counts
node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js operations <connector>               # List operations for a connector
node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js operation <connector> <operationId>  # Full details of one operation (inputs/outputs)
node ${CLAUDE_SKILL_DIR}/../../scripts/connector-lookup.bundle.js search <keyword>                     # Search operations across all connectors

<connector> 可匹配 API 名称(shared_office365)或部分显示名称(outlook)。

使用场景:当你需要了解可用的连接器、某个操作有哪些输入/输出,或有哪些可用操作时。Agent 中的操作 YAML 文件仅显示已配置的输入;connector-lookup 会显示包含所有可用输入和输出的完整连接器定义。

技能优先规则(非常重要)

你可以使用专门负责创建、编辑、验证和测试 YAML 的技能。务必调用对应的技能,而不要手动操作。 技能包含正确的模板、架构验证和常用模式。手动操作可能会导致臆造 kind: 值、遗漏必填字段或生成有问题的 YAML。 技能示例包括用于创建新主题的 /copilot-studio:new-topic、用于添加连接器操作和工具的 /copilot-studio:add-action,以及用于验证 YAML 文件的 /copilot-studio:validate。

如果没有匹配的技能,才手动操作——但之后务必使用 /copilot-studio:validate 进行验证。

关键约定

  • Agent 发现:切勿对 Agent 名称进行硬编码。始终使用 Glob: **/agent.mcs.yml。
  • ID 生成:使用随机字母数字字符,在前缀后添加 6–8 个字符(例如,sendMessage_g5Ls09)。
  • 模板 _REPLACE:始终将 _REPLACE 占位 ID 替换为唯一的随机 ID。
  • Power Fx:表达式以 = 开头。字符串插值使用 {}。只能使用受支持的函数(请查看 int-reference 技能)。
  • 生成式编排:当 GenerativeActionsEnabled: true 时,使用主题输入/输出,而不是硬编码的问题/消息。

评论

支持 Markdown