Skip to main content

I love it when a plan comes together

I love it when a plan comes together

A quote by Colonel John “Hannibal” Smith, the cigar-chomping leader of The A-Team, a hit 1980s TV series and one of my childhood memories.

The lesson to be learned from Hannibal, is that planning is important to succeed.  With the newly introduced ‘Planning mode’, planning also finds its place in our AI assisted development workflows inside Visual Studio.

What is Planning Mode?

Planning mode extends GitHub Copilot's Agent Mode capabilities to handle larger, multi-step coding tasks with a structured approach. Instead of jumping straight into code generation, Planning mode creates a detailed execution plan that includes:

  • A clear breakdown of tasks to be completed
  • Files that need to be edited
  • Context about the approach Copilot will take
  • Checkpoints for transparency and control

These plans are stored as Markdown files with task lists, giving you complete visibility into what Copilot intends to do before it starts making changes to your codebase.

How to Enable Planning Mode

Getting started with Planning mode is straightforward:

  • Ensure you have Visual Studio 2022 version 17.14 or later
    • Check your version at Help > About Visual Studio
    • Update through the Visual Studio Installer if needed
  • Enable Planning in settings
    • Navigate to Tools > Options > GitHub > Copilot
    • Check the box for "Enable Planning"
  • Access Planning tools in Agent mode
    • Open the Copilot Chat window
    • Select "Agent" from the mode dropdown
    • Planning tools will now appear in the Tools list

Once enabled, Planning tools are available immediately in your current chat session.

How Planning Mode Works

Here's the typical workflow when using Planning mode:

Enter a natural language prompt describing your complex task. For example:

  • "Refactor the authentication system to use JWT tokens"
  • "Add a caching layer to the data access layer"
  • "Implement dark mode support across the application"

Copilot analyzes your codebase and generates a detailed plan as a Markdown file. This plan includes things like:

  • Numbered task items with checkboxes
  • Files to be edited or created
  • Rationale for the approach
  • Dependencies between tasks

Remark: If you want to change the plan, stop the execution, update the file and restart it. Otherwise Copilot will immediately move on to execution.

As Copilot executes the plan, it:

  • Updates task checkboxes as work completes
  • Maintains execution state across steps
  • Monitors outcomes like build results and test failures
  • Iterates as needed based on feedback from builds and tests

Copilot still lists all edited files in the "Total changes" section. You can:

  • Review changes to individual files
  • Keep or undo edits for each code chunk
  • Accept or reject all changes since the last checkpoint

Best Practices for Using Planning Mode

To get the most out of Planning mode, consider these tips:

  • Be Specific About Intent (doh!): While Planning mode handles high-level tasks, providing clear requirements helps generate better plans. Include details about constraints, preferences, or specific technologies to use.
  • Use with Project Context: Planning mode works best when your project has clear documentation. Consider adding .instructions.md files in .github/instructions to define project standards that Copilot can reference.
  • Leverage Memories: The October update also introduced Copilot Memories, which capture coding standards and best practices. These preferences (stored in .editorconfig, CONTRIBUTING.md, or README.md) make Planning mode more project-aware.

Current Limitations

As a public preview feature, Planning mode has a few limitations to be aware of:

  • Temporary Storage: Plans are stored temporarily and deleted when the session ends unless you manually save them
  • Agent Compatibility: Some specialized agents might not yet fully support planning
  • No Stepwise Undo: Currently, Visual Studio doesn't support granular undo/redo for planning operations—use checkpoints and the Restore feature instead

More information

Visual Studio 2022 17.14 October Update

Introducing Planning in Visual Studio (Public Preview) - Visual Studio Blog

Popular posts from this blog

Azure DevOps/ GitHub emoji

I’m really bad at remembering emoji’s. So here is cheat sheet with all emoji’s that can be used in tools that support the github emoji markdown markup: All credits go to rcaviers who created this list.

.NET 8–Keyed/Named Services

A feature that a lot of IoC container libraries support but that was missing in the default DI container provided by Microsoft is the support for Keyed or Named Services. This feature allows you to register the same type multiple times using different names, allowing you to resolve a specific instance based on the circumstances. Although there is some controversy if supporting this feature is a good idea or not, it certainly can be handy. To support this feature a new interface IKeyedServiceProvider got introduced in .NET 8 providing 2 new methods on our ServiceProvider instance: object? GetKeyedService(Type serviceType, object? serviceKey); object GetRequiredKeyedService(Type serviceType, object? serviceKey); To use it, we need to register our service using one of the new extension methods: Resolving the service can be done either through the FromKeyedServices attribute: or by injecting the IKeyedServiceProvider interface and calling the GetRequiredKeyedServic...

Kubernetes–Limit your environmental impact

Reducing the carbon footprint and CO2 emission of our (cloud) workloads, is a responsibility of all of us. If you are running a Kubernetes cluster, have a look at Kube-Green . kube-green is a simple Kubernetes operator that automatically shuts down (some of) your pods when you don't need them. A single pod produces about 11 Kg CO2eq per year( here the calculation). Reason enough to give it a try! Installing kube-green in your cluster The easiest way to install the operator in your cluster is through kubectl. We first need to install a cert-manager: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml Remark: Wait a minute before you continue as it can take some time before the cert-manager is up & running inside your cluster. Now we can install the kube-green operator: kubectl apply -f https://github.com/kube-green/kube-green/releases/latest/download/kube-green.yaml Now in the namespace where we want t...