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.

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...

Podman– Command execution failed with exit code 125

After updating WSL on one of the developer machines, Podman failed to work. When we took a look through Podman Desktop, we noticed that Podman had stopped running and returned the following error message: Error: Command execution failed with exit code 125 Here are the steps we tried to fix the issue: We started by running podman info to get some extra details on what could be wrong: >podman info OS: windows/amd64 provider: wsl version: 5.3.1 Cannot connect to Podman. Please verify your connection to the Linux system using `podman system connection list`, or try `podman machine init` and `podman machine start` to manage a new Linux VM Error: unable to connect to Podman socket: failed to connect: dial tcp 127.0.0.1:2655: connectex: No connection could be made because the target machine actively refused it. That makes sense as the podman VM was not running. Let’s check the VM: >podman machine list NAME         ...