What if an agent could refactor your agent?
Microsoft Developer shows how to use GitHub Copilot with a Microsoft Foundry skill to review and refactor an existing “Sparkle Cupcakes” agent, aligning it with current Foundry patterns and SDK guidance while improving production readiness.
Overview
The video demonstrates an agent-to-agent workflow: using GitHub Copilot (equipped with a microsoft-foundry skill) to perform a bounded review of an existing agent and propose a refactor grounded in the skill’s current references.
Is your agent production-ready?
- Frames the problem: an agent may work, but still drift from current Microsoft Foundry patterns as SDKs and recommended approaches evolve.
Review the existing agent
- Uses an existing sample agent (“Sparkle Cupcakes”) as the baseline for review.
Add Microsoft Foundry skills
- Adds a Microsoft Foundry skill (described as
microsoft-foundry) to GitHub Copilot. - Uses the skill’s references as the grounding source for the review.
Identify best-practice gaps
- Copilot performs a bounded review and highlights gaps against current Foundry patterns.
Fix issues with GitHub Copilot
- Copilot proposes a Foundry-aware refactor based on the identified gaps.
Review the generated changes
- Reviews the changes Copilot generated as part of the refactor.
Upgrade toolbox and observability
- Improves the agent’s supporting components, including observability.
Test with Agent Inspector
- Uses Agent Inspector to validate the updated agent.
Production-ready agent recap
- Recaps the steps taken to move from a working agent to a more production-ready, Foundry-aligned implementation.