/typespec-m365-copilot:typespec-create-agentfrom typespec-m365-copilot
Generates a complete main.tsp file for a Microsoft 365 Copilot declarative agent, including agent metadata, instructions, capabilities, and conversation starters.
Ships in typespec-m365-copilot. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
GitHub Copilot uses this skill to generate a main.tsp file for a Microsoft 365 Copilot declarative agent by translating the user's purpose, knowledge sources, and interaction examples into TypeSpec decorators and scoped AgentCapabilities operations.
Ask or infer these facts before writing main.tsp:
| Input | Required | Rule |
|---|---|---|
| Agent purpose and role | Yes | Convert to a descriptive role-based name and behavior. |
| Capabilities needed | Yes | Include only capabilities the agent actually needs. |
| Knowledge sources | Conditional | Capture sites, folders, Teams areas, connectors, Dataverse tables, or meeting scope when relevant. |
| Typical user interactions | Yes | Use them to write 2-4 diverse conversation starters. |
| Limits and safety behavior | Yes | Put refusals, escalation, and boundaries in @instructions. |
Generate one main.tsp file with these pieces:
| Part | TypeSpec construct | Constraint |
|---|---|---|
| Imports | import "@typespec/http";, import "@typespec/openapi3";, import "@microsoft/typespec-m365-copilot"; | Keep imports at the top. |
| Usings | using TypeSpec.Http;, using TypeSpec.M365.Copilot.Agents; | Required for agent decorators and capabilities. |
| Agent declaration | @agent({ name, description }) | Name is 100 characters or less; description is 1,000 characters or less. |
| Instructions | @instructions("""...""") | Under 8,000 characters; define role, expertise, personality, do and do not rules. |
| Conversation starters | @conversationStarter(#{ title, text }) | Include 2-4 starters with diverse user intents. |
| Namespace | namespace [AgentName] { ... } | Use a valid TypeSpec identifier, usually PascalCase without spaces. |
| Capabilities | op capabilityName is AgentCapabilities.[CapabilityType]<[Parameters]>; | Scope URLs, folders, and content where possible. |
| Capability | Use when | Scoping guidance |
|---|---|---|
WebSearch | The agent needs public web content. | Add site scoping when the domain is known. |
OneDriveAndSharePoint | The agent answers from user or organization documents. | Filter by URL, folder, or site when possible. |
TeamsMessages | The agent needs Teams channels or chats. | Limit to relevant channel/chat contexts. |
Email | Mailbox content is part of the task. | Prefer folder or sender filters over broad mailbox access. |
People | The agent searches organization people or roles. | Use for expertise and directory lookup, not document search. |
CodeInterpreter | The agent needs Python analysis, calculation, or file processing. | Describe data boundaries in instructions. |
GraphicArt | The agent generates images. | Include style and brand limitations. |
GraphConnectors | The agent uses Microsoft 365 Copilot connector content. | Name the connector content domain. |
Dataverse | The agent reads Dataverse data. | Scope to relevant tables or business objects. |
Meetings | The agent uses meeting content. | State whether summaries, transcripts, or action items are expected. |
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] {
op capabilityName is AgentCapabilities.[CapabilityType]<[Parameters]>;
}
Customer Support Assistant or Research Helper.WebSearch, OneDriveAndSharePoint, TeamsMessages, and Email capabilities are usually better than unbounded access.## TypeSpec declarative agent
**Status:** generated | needs input | blocked
**File:** `main.tsp`
**Agent name:** <display name>
**Namespace:** <TypeSpec namespace>
### Capabilities
| Operation | AgentCapabilities type | Scope |
| --- | --- | --- |
| `<operation>` | `<CapabilityType>` | `<parameters or none>` |
### Conversation starters
- `<title>` — `<text>`
### Validation
- Name length: <pass/fail>
- Description length: <pass/fail>
- Instructions length: <pass/fail>
main.tsp includes the three required imports and two required using statements.@agent has a descriptive name no longer than 100 characters and description no longer than 1,000 characters.@instructions defines role, expertise, personality, allowed behavior, and limits in fewer than 8,000 characters.@conversationStarter decorators.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
3 skills in this plugin
/typespec-api-operationsAdd RESTful GET, POST, PATCH, and DELETE operations to a TypeSpec API plugin for Microsoft 365 plugin for GitHub Copilot with routing, parameters, models, confirmations, adaptive cards, and testing prompts. Use when asked to add TypeSpec API operations, CRUD endpoints, @route/@get/@post/@patch/@delete handlers, or GitHub Copilot plugin actions./typespec-create-api-pluginGenerate TypeSpec API plugins for Microsoft 365 Copilot with REST operations, authentication, confirmations, Adaptive Cards, and response instructions. Use when asked to create a TypeSpec API plugin, define main.tsp and actions.tsp, model API operations, add @useAuth, or build Adaptive Card responses for Microsoft 365 Copilot agents.npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin typespec-m365-copilotOther plugins' skills for the same job