
TypeSpec Declarative Agent
OfficialFreeEasily generate TypeSpec agents for Microsoft 365 Copilot.
Free · Opens the source repo
What TypeSpec Declarative Agent does
The TypeSpec Declarative Agent skill enables developers to create a fully functional TypeSpec agent tailored for Microsoft 365 Copilot. This skill streamlines the process of defining an agent's behavior, capabilities, and interaction patterns, allowing for a more efficient development experience. By generating a main.tsp file, users can specify critical attributes such as the agent's name, description, and detailed instructions using decorators that are easy to implement and understand.
With this skill, you can define the agent's role and personality through the @instructions decorator, ensuring that the agent behaves in a manner consistent with its intended purpose. The skill also prompts users to include conversation starters, which are essential for engaging interactions with end-users. This feature helps showcase the agent's capabilities and provides a better user experience by allowing for diverse queries.
The skill supports a variety of capabilities, including web searching, document access, email management, and more, making it versatile for different use cases. Developers can include only the necessary capabilities, optimizing the agent's performance and relevance. The provided best practices guide users on naming conventions, writing effective instructions, and scoping capabilities, ensuring that the generated agents are both functional and user-friendly.
This skill is ideal for developers looking to enhance their Microsoft 365 Copilot implementations with customized agents that meet specific organizational needs. By automating the agent creation process, it reduces manual coding efforts and accelerates deployment, allowing teams to focus on higher-level design and functionality.
When to use it
Use this skill when you need to create a TypeSpec agent for Microsoft 365 Copilot with specific capabilities and instructions.
When not to use it
Avoid this skill if you do not require a TypeSpec agent or if you need a more complex agent structure that exceeds the provided templates.
What you can build with it
Customer Support Agent
Generate a TypeSpec agent tailored for customer support, including capabilities for handling inquiries and accessing relevant documents.
Document Access Agent
Create an agent that can access OneDrive and SharePoint documents, providing users with quick retrieval options.
Meeting Assistant
Develop a TypeSpec agent that can access meeting content and provide summaries or action items based on user queries.
How to install TypeSpec Declarative Agent
View source1. Install with the skills CLI
npx skills add github/awesome-copilot/typespec-create-agent --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by githubCreate 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.
Frequently asked questions about TypeSpec Declarative Agent
Similar skills
Skill Creator
Efficiently create and manage skills for Gemini CLI.
Agent Development
Create and manage autonomous agents for Claude Code.
Math Olympiad Solver
Solve and verify competition math problems effectively.
Microsoft Skill Creator
Create specialized skills for Microsoft technologies.
Doublecheck
A verification pipeline for AI-generated claims.
Skill Development for Claude Code
Create and enhance skills for Claude Code plugins.
