acquire-codebase-knowl…
Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like…
Build and evolve agentic web apps that pair a CopilotKit React frontend with a Microsoft Agent Framework agent running as a Microsoft Foundry hosted agent, connected over the AG-UI protocol. Covers choosing the wiring, using Foundry-native primitives instead of hand-rolled
Claude Code
$ npx -y skills add github/awesome-copilot --skill foundry-hosted-agent-copilotkit --agent claude-code
Codex
$ npx skills add github/awesome-copilot --skill foundry-hosted-agent-copilotkit -a codex -y
Cursor
$ npx skills add github/awesome-copilot --skill foundry-hosted-agent-copilotkit -a cursor -y
Gemini CLI
$ npx skills add github/awesome-copilot --skill foundry-hosted-agent-copilotkit -a gemini-cli -y
GitHub Copilot
$ npx skills add github/awesome-copilot --skill foundry-hosted-agent-copilotkit -a github-copilot -y
OpenCode
$ npx skills add github/awesome-copilot --skill foundry-hosted-agent-copilotkit -a opencode -y
Windsurf
$ npx skills add github/awesome-copilot --skill foundry-hosted-agent-copilotkit -a windsurf -y
name: foundry-hosted-agent-copilotkit description: 'Build and evolve agentic web apps that pair a CopilotKit React frontend with a Microsoft Agent Framework agent running as a Microsoft Foundry hosted agent, connected over the AG-UI protocol. Covers choosing the wiring, using Foundry-native primitives instead of hand-rolled plumbing, agent tools, human-in-the-loop approvals, generative UI and shared state, local run and azd deploy, debugging the event stream, and safe upgrades.'
Use this skill when a React/Next.js app uses CopilotKit and talks over AG-UI to a Microsoft Agent Framework (MAF) agent hosted in Microsoft Foundry. This covers new builds and changes to existing apps. Foundry hosted agents are a paid Azure service.
Scaffold the agent with `azd ai agent init` and the frontend with your usual React/Next.js tooling. Then follow this skill for everything that connects them.
React (CopilotKit v2) CopilotKitProvider / CopilotChat threadId=<conv_ id> / useInterrupt
│ HTTP
CopilotKit runtime CopilotRuntime({ agents: { default: new HttpAgent({ url }) } })
│ AG-UI (SSE)
AG-UI gateway (FastAPI) add_agent_framework_fastapi_endpoint(app, AgentFrameworkAgent(FoundryAgent(...),
use_service_session=True, service_session_id_from_thread_id=True)) ← keeps no thread state
│ OpenAI Responses + Entra token (https://ai.azure.com/.default)
Foundry hosted agent ResponsesHostServer(Agent(tools=[...])) ← deployed with azd**A deployed hosted agent does not speak AG-UI.** It exposes `.../agents/<name>/endpoint/protocols/openai/responses` (Responses protocol) or `.../protocols/invocations`. Translate with MAF's own adapter (`FoundryAgent` + `agent-framework-ag-ui`) instead of writing an SSE translator by hand. Browsers cannot hold the Entra token, so the gateway is always server-side.
Before you write any plumbing, check this table. Each row is something older codebases built by hand.
| Need | Native primitive (don't hand-roll) | | --- | --- | | Conversation history across turns and restarts | Foundry **conversations**: create one per chat, use its `conv_…` ID as the AG-UI thread ID, and the gateway passes it through (no snapshot store) | | Durable tool approvals | `ResponsesHostServer` persists approval requests by default (`FoundryFunctionApprovalStore`). The AG-UI adapter turns them into AG-UI interrupts and forwards decisions back to the hosted agent | | Runs that survive browser disconnects | Responses `background: true` + `store: true`, then poll or reconnect (see [wiring](references/wiring.md#background-runs-gateway)) | | Durable multi-step workflows with gates | Invocations hosted agent + `@multi_turn_task` + `FoundryStateStore` | | Per-user files for the agent | Session Files API; the agent reads `$HOME` with its own tools. Never inline large documents into the prompt | | Long-term user memory | Foundry Memory Store (user scope) or `FoundryMemoryProvider` | | Tool catalogs, web search, code interpreter | Foundry **Toolbox** (`FoundryToolbox`) with Tool Search, instead of listing every tool up front | | Live docs while coding | The Microsoft Learn and Foundry MCP servers (bundled with this skill's plugin) |
| If the app needs… | Use | Gateway size | | --- | --- | --- | | Hosted agent + chat + tools + approvals (**default**) | **A. AG-UI gateway over a Responses hosted agent** | ~50 lines of Python | | Every state pattern, local prototype, no Foundry compute | **B. In-process AG-UI** (agent runs inside the FastAPI app) | ~15 lines | | Background runs that keep going after disconnect, reconnect, per-user conversation lists | **C. Background-runs gateway** (custom AG-UI agent over Foundry conversations) | ~150 lines of TypeScript | | Multi-step plan → approve → execute, irreversible steps that must not run twice | **D. Invocations hosted agent** alongside A or C | REST proxy |
Code for each is in [references/wiring.md](references/wiring.md). In an existing codebase, identify the wiring before you change anything:
1. **Pick or identify the wiring** (table above). 2. **Use the latest release of every package** (`@copilotkit/*`, `@ag-ui/*`, `agent-framework-*`, `azd` and its `azure.ai.agents` extension). Then ground on live sources:
APIs move between minor versions, so don't trust memorized names. 3. **Build or change it** with a playbook below. 4. **Verify adversarially** against the completion criteria. A compiling build, a started server, or one good chat reply is not proof.
1. In a **fresh directory**, run `azd ai agent init --no-prompt ...` against the project. Confirm `azd env get-values` shows `FOUNDRY_PROJECT_ENDPOINT`, then write tools in `main.py` ([wiring §1](references/wiring.md#1-hosted-agent)). 2. Run it locally with `azd ai agent run` (port 8088) and smoke-test it with `azd ai agent invoke --local "hi"`. 3. `azd deploy` (each deploy creates a new agent version), then `azd ai agent invoke "hi"`. 4. Add the AG-UI gateway exactly as in [wiring §2](references/wiring.md#2-ag-ui-gateway-wiring-a), including the thread-ID-is-conversation-ID flags and the interop shim. Create a conversation, then test chat **and** an approve resume with `curl -N` using its `conv_…` ID as `threadId` before touching the UI. 5. Add the conversation rou
A community-created collection of custom agents, instructions, skills, hooks, workflows, and plugins to supercharge your GitHub Copilot experience.
Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like…
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps…
Generate tailored AI agent instruction files via AgentRC instructions command. Produces .github/copilot-instructions.md (default,…
Help the user pick, write, or apply an AgentRC policy. Policies customise readiness scoring by disabling irrelevant checks,…
Use this skill when the user shares ad campaign performance data and asks what to cut, scale, or test. Trigger for prompts like…
Add educational comments to the file specified, or prompt asking for file to comment if one is not provided.
Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid…
Design and build AI agents for any domain. Use when users: (1) ask to "create an agent", "build an assistant", or "design an AI…