Infrastructure for running multiple parallel GitHub Copilot CLI sessions using git worktrees and devcontainers.
Inspired by Jesse Vincent's workflow.
This repository provides reusable infrastructure (Windows host + PowerShell) that enables:
- Parallel development: Work on multiple branches simultaneously, each in its own container
- Isolated environments: Each worktree gets its own devcontainer with isolated state
- Easy setup: PowerShell scripts automate worktree creation and container management
- Project-agnostic: Copy these files to any project to enable multi-copilot workflows
Copy the following to your project:
.devcontainer/- Devcontainer configurationscripts/- Worktree management scripts.gitattributes- Ensures shell scripts have correct line endings
Edit .devcontainer/Dockerfile to add your project's dependencies (languages, tools, etc.).
Edit .devcontainer/devcontainer.json to:
- Change the
nameto your project name - Update VS Code extensions for your tech stack
Set these on your Windows host:
# Required: GitHub authentication
$env:GH_TOKEN = (gh auth token)
# Optional: Git identity
$env:GIT_USER_NAME = "Your Name"
$env:GIT_USER_EMAIL = "your.email@example.com"
# Optional: SSH commit signing
$env:GIT_SIGNING_KEY = "id_ed25519" # or your key nameOption A: PowerShell scripts (for parallel Copilot CLI sessions)
.\scripts\worktree-up.ps1 feature-branchOption B: VS Code (for single-session development)
Open the folder in VS Code with the Dev Containers extension installed. VS Code will prompt to reopen in container.
This will:
- Create a git worktree at
.worktrees/feature-branch/ - Start a devcontainer for that worktree
- Configure Copilot CLI
- Launch Copilot in the container
Inside the container, run:
bash scripts/smoke-test.sh.\scripts\worktree-status.ps1# Remove a specific worktree and its container
.\scripts\worktree-down.ps1 feature-branch
# Clean up orphaned containers and project volumes (prompts first)
.\scripts\worktree-cleanup.ps1Git worktrees allow multiple working directories linked to the same repository. Each worktree can be on a different branch, enabling parallel development without stashing or committing.
Worktrees are created in .worktrees/ inside your repo (gitignored).
Each worktree gets its own Docker container with:
- Isolated filesystem
- Pre-configured Copilot CLI (yolo mode by default)
- Git authentication via
GH_TOKEN
The tricky part is that git worktrees on Windows use host paths, but inside containers we need container paths. The scripts handle this by:
- Mounting the main
.gitdirectory at a known location - Rewriting worktree
.gitfiles to use container paths - Restoring host paths when exiting
.devcontainer/
├── devcontainer.json # Container configuration
├── Dockerfile # Build dependencies (customize this)
├── copilot-config.json # Copilot CLI settings (yolo mode)
├── mcp-config.json # MCP server configuration
└── setup-git-auth.sh # Configure git authentication
.github/
├── agents/ # Specialized Copilot agent definitions
│ ├── agent-workflow-engineer.agent.md
│ ├── python-code-expert.agent.md
│ ├── python-workflow-test-expert.agent.md
│ └── secure-code-reviewer.agent.md
├── skills/ # Copilot skill workflows
│ ├── done/ # /done — commit, push, merge
│ ├── parallel/ # /parallel — multi-agent orchestration
│ ├── worktree/ # /worktree — git worktree management
│ ├── coaching/ # /coaching — user writes, Copilot reviews
│ ├── issue/ # /issue — brainstorm and log issues
│ ├── ado-issue-tracker/ # ADO work item management
│ ├── ado-get-current-pr/# Get PR for current branch (with script)
│ └── skill-creator/ # Meta-skill: how to create new skills
├── instructions/ # Scoped instruction files (loaded per applyTo pattern)
│ └── 00-start.instructions.md
├── prompts/ # Reusable prompt templates
│ ├── ado-create-task.prompt.md
│ └── get-pr-changes.prompt.md
├── workflows/ # CI/CD pipelines
│ ├── ci.yml # Lint, format, test
│ └── codeql.yml # Security scanning
├── ISSUE_TEMPLATE/ # Bug report and feature request templates
├── pull_request_template.md
└── copilot-instructions.md
scripts/
├── worktree-up.ps1 # Create worktree + start container
├── worktree-down.ps1 # Remove worktree + stop container
├── worktree-status.ps1 # Show all worktrees and container status
├── worktree-cleanup.ps1 # Clean up orphaned containers
├── smoke-test.sh # Verify devcontainer setup
└── README.md # Script documentation
AGENTS.md # AI agent guidelines for this project
This template includes a batteries-included set of Copilot skills and agents. After copying to your project, update the <PLACEHOLDER> values in each file.
| Skill | Trigger | Description |
|---|---|---|
/done |
"I'm done", "commit" | Stages, tests, commits with conventional message, pushes |
/parallel |
Complex features | Decomposes into file-independent tasks, spawns parallel workers |
/worktree |
Parallel branches | Creates/manages git worktrees for simultaneous development |
/coaching |
"Coach me" | Role-reversal: user codes, Copilot reviews and mentors |
/issue |
"Log this", "I have an idea" | Brainstorms rough ideas into structured ADO + GitHub issues |
ado-issue-tracker |
"Track this", "show issues" | Full ADO work item lifecycle with session SQL caching |
ado-get-current-pr |
PR workflows | Finds the PR for the current branch via ADO API script |
skill-creator |
"Create a skill" | Meta-skill: guides you through creating new Copilot skills |
Reusable prompt templates that can be invoked directly:
| Prompt | Description |
|---|---|
ado-create-task |
Create an ADO work item for a task |
get-pr-changes |
Retrieve code changes for an ADO pull request |
Scoped instruction files loaded automatically by Copilot based on applyTo patterns:
| File | Scope | Description |
|---|---|---|
00-start.instructions.md |
** (all files) |
Project info, build commands, repo structure |
| Agent | Invoke With | Expertise |
|---|---|---|
| Agent Workflow Engineer | @agent-workflow-engineer |
Agent systems, orchestration, state management |
| Python Code Expert | @python-code-expert |
Python implementation, debugging, optimization |
| Python Test Expert | @python-workflow-test-expert |
pytest, mocking, async testing, coverage |
| Secure Code Reviewer | @secure-code-reviewer |
Threat modeling, vulnerability assessment |
Files containing <PLACEHOLDER> values that need updating:
| File | Placeholders |
|---|---|
.github/skills/issue/SKILL.md |
<ADO_ORG>, <ADO_PROJECT>, <GITHUB_OWNER>, <GITHUB_REPO> |
.github/skills/ado-issue-tracker/SKILL.md |
Same as above |
.github/workflows/ci.yml |
Source directory, install/test commands |
.github/workflows/codeql.yml |
Language |
AGENTS.md |
Owner, repo, build commands, project structure |
Edit .devcontainer/mcp-config.json:
{
"mcpServers": {
"your-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "your-mcp-server"],
"env": {
"API_TOKEN": "${YOUR_API_TOKEN}"
}
}
}
}Then add the env var to remoteEnv in devcontainer.json.
Add to remoteEnv in devcontainer.json:
"remoteEnv": {
"MY_TOKEN": "${localEnv:MY_TOKEN}"
}- Windows with PowerShell 5.1+ (scripts are PowerShell/Windows-focused)
- Git with worktree support
- Docker Desktop
- Node.js (for devcontainer CLI)
- GitHub CLI (
gh) for authentication
Copyright 2026 James Casey
SPDX-License-Identifier: Apache-2.0