Robertjam954/multimodal_rag_application / .claude/skills/azure-hosted-copilot-sdk
azure-hosted-copilot-sdk
VerifiedBuild, deploy, and modify GitHub Copilot SDK apps on Azure. MANDATORY when codebase contains @github/copilot-sdk or CopilotClient in package.json. PREFER OVER azure-prepare when copilot-sdk markers detected. WHEN: copilot SDK, @github/copilot-sdk, copilot-powered app, build copilot app, prepare copilot app, add feature to copilot app, modify copilot app, BYOM, bring your own model, CopilotClient, createSession, sendAndWait, azd init copilot. DO NOT USE FOR: deploying already-prepared copilot-sdk apps (use azure-deploy), general web apps without copilot SDK (use azure-prepare), Copilot Extensions, Foundry agents (use microsoft-foundry).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.2 KB |
| references/auth-best-practices.md | markdown | 6.1 KB |
| references/azure-model-config.md | markdown | 4.5 KB |
| references/copilot-sdk.md | markdown | 3.7 KB |
| references/deploy-existing.md | markdown | 3.0 KB |
| references/existing-project-integration.md | markdown | 2.6 KB |
references/existing-project-integration.md
View on GitHub# Integrating Copilot SDK into Existing Projects
Add Copilot SDK AI features to an existing application.
## Project Analysis
Detect the project type by scanning for indicator files:
| Indicator | Language | Framework hints |
|-----------|----------|-----------------|
| `package.json` | Node.js | Express, Fastify, Next.js |
| `requirements.txt` / `pyproject.toml` | Python | Flask, FastAPI, Django |
| `go.mod` | Go | Gin, Echo, net/http |
| `*.csproj` / `*.sln` | .NET | ASP.NET, Minimal API |
## Study Template Patterns
Read the template via MCP for reference implementation:
`github-mcp-server-get_file_contents` with `owner: "azure-samples"`, `repo: "copilot-sdk-service"`. Read `AGENTS.md` first.
Use `github-mcp-server-get_file_contents` with `owner: "github"`, `repo: "copilot-sdk"` for current SDK API examples. If context7 is available, you can also use it (`context7-resolve-library-id` then `context7-query-docs`). If context7 is not available, instruct the user to install it: `npx -y @upstash/context7-mcp@latest`.
## Integration Steps
### 1. Add SDK dependency
| Language | Package |
|----------|---------|
| Node.js | `@github/copilot-sdk` |
| Python | `github-copilot-sdk` |
| Go / .NET | See SDK repo |
### 2. Create Copilot endpoint
Add a route (e.g., `/api/chat`) that creates a `CopilotClient`, starts a session, and returns the response. Use `sendAndWait` for one-shot or SSE streaming for chat.
Adapt to the app's existing routing pattern (Express router, FastAPI route, etc.).
### 3. Configure authentication
Use `gh auth token` for local dev; for production, use Key Vault.
### 4. Wire into existing app
Register the new route with the existing server/app instance. Do NOT create a separate server.
> ⚠️ **Warning:** Do not duplicate server startup logic.
## BYOM Support
If the user wants Azure BYOM, add on top of standard integration:
1. Add `@azure/identity` dependency
2. Get fresh token per request: `credential.getToken("https://cognitiveservices.azure.com/.default")`
3. Pass `provider` config with `bearerToken` to `createSession`
4. Set `model` to Azure deployment name (required)
5. Set env vars: `AZURE_OPENAI_ENDPOINT`, `MODEL_NAME`
See [Azure Model Configuration](azure-model-config.md).
## Testing
```bash
curl -s -X POST http://localhost:<port>/api/chat \
-H "Content-Type: application/json" \
-d '{"message":"test"}'
```
## Errors
| Error | Fix |
|-------|-----|
| SDK not found | Verify dependency installed and import path |
| Auth fails locally | Run `gh auth login` then `gh auth refresh --scopes copilot` |
| Route conflicts | Ensure endpoint path doesn't collide |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |