A Practical Guide to
Agentic Coding

Marlene Mhangami

Senior Developer Advocate · Python & AI · Microsoft

aka.ms/pyai-london

✦ · ✦ · ✦ · ✦ · ✦

Agenda

  • The Evolution of AI & Coding
  • Coding Agents & the Agentic Loop
  • Demo: Gather Context, Take Action & Verification
  • Best Practices
    • Context — skills & agents.md
    • Version Control — commits, branches & PRs
✦ · ✦ · ✦

What is Agentic Coding?

✦ · ✦ · ✦ · ✦ · ✦
The Evolution of AI & Coding

Code Completion

1
Code Completion
2
Code Generation
3
Agentic Coding

Autocomplete

Code completion autocomplete example
The Evolution of AI & Coding

Code Generation

Code Completion
2
Code Generation
3
Agentic Coding

LLM-Powered Code Generation

Code generation with LLM example
The Evolution of AI & Coding

Agentic Coding

Code Completion
Code Generation
3
Agentic Coding

Autonomous AI in Your Workspace

Agentic coding autonomous AI example

Coding Agents

IDE

  • Copilot in VS Code
  • Cursor
  • Windsurf

CLI

  • Copilot CLI
  • Claude Code
  • Pi

Web

  • Copilot in GitHub.com
  • Codex
  • Jules

Custom

  • Copilot SDK
  • PyDantic AI
  • LangChain
Core Concept

What is an AI Agent?

A widely accepted definition today:

An AI Agent is an LLM that calls tools in a loop to achieve a goal.

✦ · ✦ · ✦ · ✦ · ✦

The Agentic Loop

How coding agents think, act, and iterate

Your prompt agentic loop Gather context Take action (tools) Verify results Done You: interrupt, steer, or add context

Source: code.claude.com/docs/en/how-claude-code-works

Your prompt Gather context Take action Verify results Done
Gather Context
Demo — Gather Context

Providing Context to an Agent

Attaching Files & Resources

  • Attach files, screenshots, GitHub Issues & PRs to the chat
  • Use example files with best-practice code as a starting point

Instruction Files

  • copilot-instructions.md — GitHub Copilot
  • cursor rules — Cursor
  • claude.md — Claude Code
  • agents.md — OpenAI (becoming a standard)

Context Engineering

Increasing Input Tokens Impacts LLM Performance

Context Rot

trychroma.com/research/context-rot

Your prompt Gather context Take action (tools) Verify results Done
Take Action
Demo — Take Action

Giving Agents Tools

MCP — Model Context Protocol

  • Open protocol for giving agents access to tools
  • In VS Code: search @mcp in extensions for vetted servers
  • You can also create your own MCP servers

Agent Skills

  • A reusable workflow defined in a SKILL.MD file an agent invokes to complete a task
  • Skills can include tools, MCP servers, scripts and more!
Your prompt Gather context Take action Verify results Done
Verification
Demo — Verification

Verification

Require Tests

  • Instruct the agent to write tests and verify they pass
  • Agent-generated unit tests can be self-affirming

Beyond Unit Tests: Playwright

  • End-to-end functionality testing
  • Goes beyond code coverage to verify real behavior
Your prompt Gather context Take action (tools) Verify results Done
Best Practices
Best Practice #1

Context

Curated Skills

Curated Skills improve performance by +16.2pp on average; self-generated Skills provide negligible or negative benefit.

Skills performance chart

arxiv.org/html/2602.12670v1

agents.md

Developer-provided files only marginally improve performance (+4%), while LLM-generated context files have a small negative effect. Context files increase costs by over 20%.

Context files performance chart

arxiv.org/html/2602.11988v1

Best Practice #2

Version Control — Commits & Branches

Commit Often

Create checkpoints as the agent works. Frequent commits make it easy to roll back and give you a clear history of how the code evolved.

Use Branches for Prototypes

Use different branches for different prototypes of the same feature. Compare approaches before committing to one direction.

Best Practice #2

Version Control — Pull Requests

Human & Agent Review

  • Be mindful with PRs — maintainers are getting more PRs than ever from agents. If it's not your repo, think before submitting
  • For critical code, have a human review — agent code can look correct but miss edge cases
  • Attach visual proof — Playwright screenshots provide evidence that features work
Playwright functionality test screenshot

Thank You!

What We Covered

  • Evolution of AI & Coding — from autocomplete to agentic coding
  • Coding Agents — AI agent definition, the agentic loop
  • Demo — gather context, take action with tools, verification
  • Context — curated skills & agents.md
  • Version Control — commit often, branch for prototypes, review PRs carefully

aka.ms/pyai-london

✦ · ✦ · ✦ · ✦ · ✦
1 / 20
aka.ms/pyai-london
← → or click to navigate