Catalog
github/typespec-create-agent

github

typespec-create-agent

Generate a complete TypeSpec declarative agent with instructions, capabilities, and conversation starters for Microsoft 365 Copilot

v1.0Latest
New~724Updated Jun 26, 2026

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.

Files1
1 files · 1.0 KB

Select a file to preview

Overall Score

76/100

Grade

B

Good

Safety

80

Quality

72

Clarity

78

Completeness

70

Summary

This skill teaches an agent how to generate a complete TypeSpec declarative agent configuration for Microsoft 365 Copilot. The agent gathers requirements from the user, then writes a `main.tsp` file with agent metadata (name, description, instructions), conversation starters, and capability declarations for accessing Microsoft 365 services like Teams, email, OneDrive, and code execution.

Detected Capabilities

file writecode generationTypeScript/TypeSpec syntax generationconfiguration file creationuser input collection

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

create typespec agentmicrosoft 365 copilot agentgenerate agent configtypespec declarative agentcopilot agent setup

Risk Signals

INFO

No file deletion, privilege escalation, or credential access patterns detected

skill content
INFO

File writes scoped to single main.tsp output file in project context

template structure
WARNING

User input directly incorporated into generated code (agent name, description, instructions)

example section and template

Use Cases

  • Create a Teams integration agent that searches channels and provides summaries
  • Build a customer support chatbot with email and Teams capabilities
  • Generate a research assistant agent with web search and document access
  • Set up a data analysis agent with Dataverse and code interpreter access
  • Create a meeting insights agent that accesses calendar and Teams meeting content

Quality Notes

  • Well-structured with clear requirements section listing all supported capabilities
  • Good template example shows exact TypeSpec syntax and decorator usage
  • Best practices section covers agent naming, instruction style, and capability scoping
  • Limitations clear: agent names ≤100 chars, descriptions ≤1,000 chars, instructions ≤8,000 chars
  • Example prompts (the 4 questions) help guide user input collection
  • No error handling documented for invalid capability combinations or syntax errors
  • No examples of generated output shown—user does not see what success looks like
  • Could benefit from validation rules (e.g., which capabilities are mutually exclusive)
  • Conversation starters guidance is minimal—only 2–4 required but no diversity guidance beyond 'diverse'
Model: claude-haiku-4-5-20251001Analyzed: Jun 26, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use github/typespec-create-agent in your dev environment

Command Palette

Search for a command to run...