| name | devcontainer-setup |
| description | Templates and process for creating devcontainer configurations. Use this when setting up a new project, adding devcontainer support, or creating devcontainers for worktrees. |
Every project must have a devcontainer. Agents execute all commands inside devcontainers — never on the host.
Devcontainer Tiers
Yolo (Developer Agent) — Safelisted Network
For sandboxed development. The agent limits network access to safelisted registries (Terraform, PyPI, Azure/Jira/GitLab docs) per its agent instructions. No ad-hoc package installation at runtime.
{
"name": "${project-name}-yolo",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
},
"postCreateCommand": "echo 'Yolo devcontainer ready'",
"customizations": {
"vscode": {
"extensions": ["GitHub.copilot"]
}
}
}
Interactive — With Network
For agents that need human-approved network access (Architect, Product, Designer, Orchestrator).
{
"name": "${project-name}",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
},
"postCreateCommand": "echo 'Interactive devcontainer ready'",
"customizations": {
"vscode": {
"extensions": ["GitHub.copilot"]
}
}
}
Language Features
Add only what the project requires:
"ghcr.io/devcontainers/features/node:1": {}
"ghcr.io/devcontainers/features/python:1": {}
"ghcr.io/devcontainers/features/rust:1": {}
"ghcr.io/devcontainers/features/common-utils:1": {}
"ghcr.io/devcontainers/features/go:1": {}
ARM64 (Apple Silicon) Notes
mcr.microsoft.com/devcontainers/universal:2 does NOT support ARM64.
- Use
mcr.microsoft.com/devcontainers/base:ubuntu instead.
- All
ghcr.io/devcontainers/features/* features support ARM64.
Pre-flight Check
See .github/instructions/devcontainer.instructions.md for context detection and command rules before running any dev command.
Setup Process
New Project
- Create
.devcontainer/devcontainer.json with the appropriate tier template.
- Add language features needed for the project.
- Test:
devcontainer up --workspace-folder .
- Verify:
devcontainer exec --workspace-folder . <build-command>
Worktree Task
- Create worktree:
git worktree add ../worktrees/<branch> -b <branch>
- Start container:
devcontainer up --workspace-folder ../worktrees/<branch>
- Run commands:
devcontainer exec --workspace-folder ../worktrees/<branch> <command>
Developer Experience Checklist
The devcontainer must support:
Dependency Installation Policy
All dependencies must be reproducible. Agents must never install packages ad-hoc at runtime.
| ✅ Allowed | ❌ Prohibited |
|---|
Add to pyproject.toml / package.json then run uv sync / npm ci | pip install, npm install <pkg>, apt install at runtime |
Add devcontainer features in devcontainer.json | Manual tool installation in a running container |
Add system packages to postCreateCommand | One-off curl | bash installs |
terraform init (downloads providers per lockfile) | |
uv sync / npm ci (installs from lockfile) | |
When a task requires a new dependency: update the declarative config (pyproject.toml, devcontainer.json, Dockerfile), rebuild the container if needed, then use the dependency. The container must be reproducible from its config files alone.
postCreateCommand Examples
"postCreateCommand": "npm ci"
"postCreateCommand": "uv sync"
"postCreateCommand": "cargo fetch"
"postCreateCommand": "apt-get update && apt-get install -y build-essential cmake"