MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Typespec-Create-Agent

Typespec-Create-Agent是一款code方向的AI技能,核心价值是Generate a complete TypeSpec declarative agent with instructions, capabilities, and conversation starters for Microsoft 365 Copilot,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

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

Last verified on: 2026-05-30
mkdir -p ./skills/typespec-create-agent && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/typespec-create-agent/SKILL.md -o ./skills/typespec-create-agent/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# 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


typescript
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.

🎯 Best For

  • Developers scaffolding new projects
  • Prototype builders
  • Claude users
  • GitHub Copilot users
  • Software engineers

💡 Use Cases

  • Bootstrapping React components
  • Creating API route handlers
  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Typespec-Create-Agent to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Can I customize the generated output?

Yes — modify the skill's prompt instructions to match your project conventions and coding style.

Is Typespec-Create-Agent compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Typespec-Create-Agent?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Typespec-Create-Agent?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/typespec-create-agent/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Using generated code without understanding

Understand what generated code does before shipping it to production.

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills