New to Claude Skills? Learn how to install them →

github on GitHub

TypeSpec Declarative Agent

OfficialFree

Easily generate TypeSpec agents for Microsoft 365 Copilot.

Get this skill

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 source

1. Install with the skills CLI

npx skills add github/awesome-copilot/typespec-create-agent --agent claude-code

2. 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 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:

  1. Agent Declaration

    • Use @agent decorator with a descriptive name and description
    • Name should be 100 characters or less
    • Description should be 1,000 characters or less
  2. Instructions

    • Use @instructions decorator 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
  3. Conversation Starters

    • Include 2-4 @conversationStarter decorators
    • Each with a title and example query
    • Make them diverse and showcase different capabilities
  4. Capabilities (based on user needs)

    • WebSearch - for web content with optional site scoping
    • OneDriveAndSharePoint - for document access with URL filtering
    • TeamsMessages - for Teams channel/chat access
    • Email - for email access with folder filtering
    • People - for organization people search
    • CodeInterpreter - for Python code execution
    • GraphicArt - for image generation
    • GraphConnectors - for Copilot connector content
    • Dataverse - for Dataverse data access
    • Meetings - 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:

  1. What is the agent's purpose and role?
  2. What capabilities does it need?
  3. What knowledge sources should it access?
  4. What are typical user interactions?

Then generate the complete TypeSpec agent definition.

Frequently asked questions about TypeSpec Declarative Agent

Similar skills