
CodeCollection DevTools
codecollection-devtools is the standard development environment for authoring and testing RunWhen codebundles. One image, any codecollection — pull the pre-built container, set an env var, and start developing.
GitHub · GHCR · Author Docs
Key features
- One image for all codecollections — set
CODECOLLECTION_REPO to bootstrap any codecollection repo automatically.
- PR review ready — set
PR_NUMBER and the environment checks out the PR branch for you.
- Multi-arch — pre-built for both
linux/amd64 (Codespaces, CI) and linux/arm64 (Apple Silicon).
- Batteries included — Robot Framework,
ro test runner, kubectl, Helm, AWS CLI, Azure CLI, gcloud, Terraform, gh CLI, and more.
- Agent-ready — Skills ship as agent rules in
.agents/, symlinked for Cursor and any AI coding tool.
- Works everywhere — GitHub Codespaces, VS Code devcontainers (local), Zed, or plain
docker run.
Requirements
- Docker or a compatible runtime (Podman, OrbStack, etc.) — for local devcontainer use
- GitHub Codespaces — no local runtime needed; runs in the cloud
- A codecollection repo to work on (defaults to
rw-cli-codecollection)
Getting started
Option 1: GitHub Codespaces (recommended for PR review)
- Go to github.com/runwhen-contrib/codecollection-devtools → Code → Codespaces → New with options
- Pick your branch, region, and machine type → Create codespace
- Once the terminal is ready, bootstrap your codecollection:
# defaults to rw-cli-codecollection on main
task setup
# specific repo + PR
task setup REPO=runwhen-contrib/rw-cli-codecollection PR=42
# different codecollection and branch
task setup REPO=runwhen-contrib/azure-c7n-codecollection BRANCH=feat/foo
That clones the repo, installs Python deps, installs authoring skills as Cursor rules, and checks out the PR branch if specified.
Option 2: VS Code devcontainer (local)
Clone this repo and open it in VS Code with the Dev Containers extension:
git clone https://github.com/runwhen-contrib/codecollection-devtools.git
cd codecollection-devtools
Then open in VS Code → Reopen in Container (or Cmd+Shift+P → "Dev Containers: Reopen in Container").
The devcontainer pulls the pre-built image from GHCR — no local Docker build required.
Once inside the container, bootstrap your codecollection:
task setup REPO=runwhen-contrib/rw-cli-codecollection
Cursor with GitHub Codespaces
Use Cursor with a Codespace via gh codespace ssh and Remote - SSH. See Cursor + Codespaces + devcontainer.
Option 3: Docker run (headless)
docker run --rm -it \
-v "$HOME/.kube:/home/runwhen/auth/.kube:ro" \
ghcr.io/runwhen-contrib/codecollection-devtools:latest \
bash -c 'task setup REPO=runwhen-contrib/rw-cli-codecollection && exec bash'
Task parameters
task setup accepts these variables:
| Variable |
Default |
Description |
REPO |
runwhen-contrib/rw-cli-codecollection |
GitHub org/repo shorthand or full git URL of the codecollection. |
BRANCH |
main |
Branch to check out after cloning. |
PR |
(none) |
If set, checks out the PR branch via gh pr checkout. |
Other tasks: task verify (check tools), task install-skills (re-install skills), task clean (remove cloned codecollection).
Environment variables
These are set in the container automatically:
| Variable |
Default |
Description |
GITHUB_TOKEN |
(injected by Codespaces) |
GitHub token for gh CLI auth. Codespaces provides this automatically. |
RW_MODE |
dev |
Set to dev for local development behavior (handled by rw-core-keywords). |
RW_IDE_TOOLS |
claude,opencode,zed |
Comma-separated tool names. Creates ~/.{tool}/ config directories at container start. Add any IDE or AI agent — no rebuild needed. |
Running codebundles
Once the environment is bootstrapped, navigate to any codebundle and use the ro wrapper:
cd codecollection/codebundles/k8s-namespace-healthcheck
ro runbook.robot
ro wraps the robot command with:
- Isolated working directories — each run gets its own temp dir with copied cloud CLI configs (
.azure, .gcloud, .kube)
- Log output — HTML reports written to
/robot_logs, served at localhost:3000
- Selective test execution —
ro --test "Check Health" runbook.robot
ro # run all .robot files in current dir
ro runbook.robot # run a specific file
ro --test "Check Health" # run a specific test case
ro ../other-codebundle/ # run tests in a different directory
Credentials
Mount or copy credentials into the auth/ directory:
/home/runwhen/
├── auth/
│ ├── .kube/config # kubectl
│ ├── .azure/ # Azure CLI
│ └── .gcloud/ # Google Cloud SDK
├── codecollection/
│ ├── codebundles/ # your codebundles
│ └── libraries/ # shared keyword libraries
└── ro # test runner
ro copies these configs into an isolated temp directory per run, so parallel executions don't interfere with each other.
IDE & AI Agent Support
The devcontainer auto-initializes config directories for your IDE or AI coding
agent. Define the tools you use via RW_IDE_TOOLS — no image rebuild needed.
# Built-in defaults (always available)
RW_IDE_TOOLS=claude,opencode,zed
# Add Cursor, Windsurf, or any other tool
RW_IDE_TOOLS=claude,opencode,zed,cursor,windsurf
At container start, init-ide-tools creates ~/.{tool}/ for each entry with
correct permissions. Existing directories are left untouched.
Supported IDEs & agents (built-in):
| IDE / Agent |
Config directory |
API key env var |
| Claude Code |
~/.claude/ |
ANTHROPIC_API_KEY |
| OpenCode |
~/.opencode/ |
OPENAI_API_KEY |
| Zed |
~/.zed/ |
— |
Adding your own: Set RW_IDE_TOOLS to include any tool name. The
container creates an empty ~/.{tool}/ directory for you.
Mounting your host IDE configs
The container creates empty directories — to bring in your existing configs
(API keys, settings, history), mount them from your host machine.
Option A: devcontainer.json (works in Codespaces too)
Add a mounts array to .devcontainer/devcontainer.json. You'll also need
initializeCommand to make sure the source directories exist on the host
before the container starts:
// .devcontainer/devcontainer.json
"initializeCommand": "mkdir -p ${localEnv:HOME}/.opencode ${localEnv:HOME}/.claude",
"mounts": [
"source=${localEnv:HOME}/.opencode,target=/home/runwhen/.opencode,type=bind,consistency=cached",
"source=${localEnv:HOME}/.claude,target=/home/runwhen/.claude,type=bind,consistency=cached"
]
Option B: docker-compose.override.yaml (local devcontainer only)
Create docker-compose.override.yaml alongside the existing
docker-compose.yaml. Docker Compose merges it automatically:
# docker-compose.override.yaml
services:
devtools:
volumes:
- ~/.opencode:/home/runwhen/.opencode
- ~/.claude:/home/runwhen/.claude
Tip for Codespaces users: Set RW_IDE_TOOLS as a Codespaces secret
to apply across all your codespaces automatically. Use Option A above
to mount your configs — Codespaces supports mounts in devcontainer.json.
CodeBundle authoring skills
The skills/ directory contains platform-specific authoring guidance, installed
as agent rules into .agents/ during task setup. A symlink at .cursor/rules
points to .agents/ for Cursor IDE compatibility. To add rules for other agents,
symlink their rules directory to .agents/ — see AGENTS.md for details.
| Skill |
Covers |
generation-rules-kubernetes.md |
K8s resource types, match rules, qualifiers, templates |
generation-rules-aws.md |
AWS resource types, CloudQuery tables, account qualifiers |
generation-rules-azure.md |
Azure + Azure DevOps platforms, resource groups, subscriptions |
generation-rules-gcp.md |
GCP resource types, project qualifiers |
sli-authoring.md |
In-repo SLIs, cron-scheduler SLIs, scoring patterns |
test-infra-kubernetes.md |
Static manifests, Terraform patterns, Taskfile contract |
test-infra-azure.md |
Azure Terraform test infra, tf.secret, workspaceInfo |
test-infra-azure-devops.md |
DevOps projects, pipelines, agent pools via Terraform |
test-infra-cloud.md |
Shared conventions across all cloud platforms |
Skills are installed into .agents/ (the workspace root) at setup time. A
.gitignore in that directory prevents accidental commits. Cursor, Windsurf, and
other agents can find rules by symlinking their rules directory to .agents/.
To re-install after an update, run:
These same skills are used by the CodeBundle Farm
Creator agent. Changes should be synced between both repos.
What's in the image
| Category |
Tools |
| Core |
Python 3.x, Robot Framework, ro, rw-core-keywords, rw-cli-keywords |
| Kubernetes |
kubectl, Helm, istioctl, kubelogin |
| Cloud CLIs |
AWS CLI v2, Azure CLI, Google Cloud SDK (gcloud, gsutil, bq) |
| Infrastructure |
Terraform, go-task |
| Dev tools |
git, gh (GitHub CLI), sudo, jq |
Python packages
Base packages installed in the image (from requirements.txt):
rw-cli-keywords (includes rw-core-keywords — handles RW_MODE=dev for local development)
jmespath, python-dateutil, thefuzz, jinja2
Each codecollection's requirements.txt is installed at bootstrap time by task setup.
File structure