Refactor an AI agent using GitHub Copilot and Foundry skills
Use GitHub Copilot with Microsoft Foundry skills to review and refactor an existing AI agent.
- Provide GitHub Copilot with the Microsoft Foundry skill.
- Hand Copilot a bounded review of your agent (e.g., Sparkle Cupcakes agent).
- Copilot proposes a Foundry-aware refactor grounded in the skill's current references.
- Review the generated changes.
- Upgrade the agent's toolbox and observability.
- Test the refactored agent with Agent Inspector.
Existing AI agent code, Microsoft Foundry skill, GitHub Copilot.
Refactored AI agent meeting current Microsoft Foundry patterns.
This workflow uses GitHub Copilot and Microsoft Foundry skills to refactor an existing AI agent. It involves providing Copilot with the skill and agent review, then implementing and testing the proposed Foundry-aware changes.
This process leverages Copilot's ability to understand code and apply specific patterns (Microsoft Foundry) to improve agent quality and production readiness.
When the agent does not need to adhere to specific foundry patterns or when using a different AI agent framework.
- What if an agent could refactor your agent? ↗Microsoft Developer · Microsoft Developer on YouTube · Sep 15, 2026 · paraphrased
First seen on Subvolts Sep 15, 2026. Updated Sep 15, 2026. Spotted a problem? Tell us.
- What if an agent could refactor your agent?Microsoft · Microsoft Developer on YouTube · Sep 15, 2026
The Playbook: reusable how-tos, prompts, configs and tips pulled out of the news.
- ChecklistChecklist for production-ready AI agent refactoringSteps to ensure an AI agent is production-ready after refactoring. · 20 min
- ChecklistSteps to build and deploy an AI agent from terminalChecklist for planning, building, testing, and deploying an AI agent using GitHub Copilot CLI and Microsoft Foundry. · 30 min
- WorkflowShip an AI agent from terminal using Copilot CLI and FoundryPlan, build, test, and deploy a hosted AI agent from your terminal using GitHub Copilot CLI and Microsoft Foundry. · 120 min
- ChecklistAX Practitioner Playbook Evaluation Quality ChecklistReview your AI agent evaluation process before running it to ensure its quality and trustworthiness. · 30 min
- WorkflowBuild and test an AI agent using Microsoft Foundry ToolkitCreate, configure, test, and evaluate an AI agent within VS Code. · 60 min
- Anti-patternLetting Models Write Evaluation CriteriaAvoid having AI models generate your evaluation criteria for AI agent performance. · 10 min
Questions people ask
- Which AI tools does this work with?
- The sources used it with Copilot.
- Where did this come from?
- Microsoft Developer (Microsoft Developer on YouTube). Subvolts collected, normalized and credited it; the link above opens the original.

