typespec-create-api-plugin

Generate a TypeSpec API plugin with REST operations, authentication, and Adaptive Cards for Microsoft 365 Copilot

By github · 8,756 installs

npx skills add github/awesome-copilot --skill typespec-create-api-plugin

Source repository · Upstream listing

Create TypeSpec API Plugin Create a complete TypeSpec API plugin for Microsoft 365 Copilot that integrates with external REST APIs. Requirements Generate TypeSpec files with: main.tsp Agent Definition actions.tsp API Operations Authentication Options Choose based on API requirements: 1. No Authentication (Public APIs) 2. API Key 3. OAuth2 4. Registered Auth Reference Function Capabilities Confirmation Dialog Adaptive Card Response Reasoning & Response Instructions Best Practices 1. Operation Names : Use clear, action oriented names (listProjects, createTicket) 2. Models : Define TypeScript like models for requests and responses 3. HTTP Methods : Use appropriate verbs (@get, @post, @patch, @delete) 4. Paths : Use RESTful path conventions with @route 5. Parameters : Use @path, @query, @header, @body appropriately 6. Descriptions : Provide clear descriptions for model understanding 7. Confirmations : Add for destructive operations (delete, update critical data) 8. Cards : Use for rich visual responses with multiple data items Workflow Ask the user: 1. What is the API base URL and purpose? 2. What operations are needed (CRUD operations)? 3. What authentication method does the API use? 4. Should confirmations be required for any operations? 5. Do responses need Adaptive Cards? Then generate: Complete main.tsp with agent definition Complete actions.tsp with API operations and models Optional cards/card.json if Adaptive Cards are needed