typespec-create-agent
它能做什么
这个工具可以为 Microsoft 365 Copilot 创建一个 AI 助手(称为“智能体”,即 agent)。它会定义这个智能体能做什么、应该如何表现,以及用户该如何开始与它对话。
适用场景
- ✓当你想为特定任务创建一个自定义 AI 助手时。
- ✓当你需要设定智能体的能力,比如搜索网页或文档时。
- ✓当你需要设置智能体与用户的互动方式时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/typespec-create-agent/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“创建一个帮助回答公司产品相关问题的智能体,并让它可以访问网页和 SharePoint 文档。”
每周 5 个新技能,1 分钟读完。
工作原理
你需要提供智能体的用途、它的能力(比如搜索网页、阅读邮件等),以及它应该如何表现。工具随后会生成该智能体的配置代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Create TypeSpec Declarative Agent
Create a complete TypeSpec declarative agent for Microsoft 365 Copilot with the following structure:
Requirements
Generate a main.tsp file with:
Agent Declaration
- Use
@agentdecorator with a descriptive name and description - Name should be 100 characters or less
- Description should be 1,000 characters or less
- Use
Instructions
- Use
@instructionsdecorator with clear behavioral guidelines - Define the agent's role, expertise, and personality
- Specify what the agent should and shouldn't do
- Keep under 8,000 characters
- Use
Conversation Starters
- Include 2-4
@conversationStarterdecorators - Each with a title and example query
- Make them diverse and showcase different capabilities
- Include 2-4
Capabilities (based on user needs)
WebSearch- for web content with optional site scopingOneDriveAndSharePoint- for document access with URL filteringTeamsMessages- for Teams channel/chat accessEmail- for email access with folder filteringPeople- for organization people searchCodeInterpreter- for Python code executionGraphicArt- for image generationGraphConnectors- for Copilot connector contentDataverse- for Dataverse data accessMeetings- for meeting content access
Template Structure
import "@typespec/http";
import "@typespec/openapi3";
import "@microsoft/typespec-m365-copilot";
using TypeSpec.Http;
using TypeSpec.M365.Copilot.Agents;
@agent({
name: "[Agent Name]",
description: "[Agent Description]"
})
@instructions("""
[Detailed instructions about agent behavior, role, and guidelines]
""")
@conversationStarter(#{
title: "[Starter Title 1]",
text: "[Example query 1]"
})
@conversationStarter(#{
title: "[Starter Title 2]",
text: "[Example query 2]"
})
namespace [AgentName] {
// Add capabilities as operations here
op capabilityName is AgentCapabilities.[CapabilityType]<[Parameters]>;
}
Best Practices
- Use descriptive, role-based agent names (e.g., "Customer Support Assistant", "Research Helper")
- Write instructions in second person ("You are...")
- Be specific about the agent's expertise and limitations
- Include diverse conversation starters that showcase different features
- Only include capabilities the agent actually needs
- Scope capabilities (URLs, folders, etc.) when possible for better performance
- Use triple-quoted strings for multi-line instructions
Examples
Ask the user:
- What is the agent's purpose and role?
- What capabilities does it need?
- What knowledge sources should it access?
- What are typical user interactions?
Then generate the complete TypeSpec agent definition.
常见问题
Microsoft 365 Copilot 里的“智能体”是什么?
智能体是一个可以配置的 AI 助手,用来在 Microsoft 365 中完成特定任务,比如回答问题或管理信息。
“能力”是什么意思?
能力指智能体可以使用的工具,比如搜索互联网(WebSearch)、访问 OneDrive 或 SharePoint 中的文件、阅读邮件等。
什么是 TypeSpec?
TypeSpec 是一种用来描述 AI 智能体应如何运作以及具备哪些能力的语言。
详情
作者的原始描述
Generate a complete TypeSpec declarative agent with instructions, capabilities, and conversation starters for Microsoft 365 Copilot
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7458
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。