BlueGreenPilot
/install bluegreenpilot
BlueGreenPilot
Use this skill when the user wants to configure, plan, verify, deploy, promote, switch traffic, or roll back a blue-green deployment flow.
BlueGreenPilot is a deployment safety protocol. It must help the user operate their real environment without relying on chat memory or guessing.
Hard Rules
- Never switch production traffic without explicit final confirmation.
- Never deploy to the active production slot unless the user explicitly says they are not using blue-green for that environment.
- Never store secrets in
.bluegreenpilot/config.yaml. - Never assume the active slot. Read state, query the environment, or ask.
- Never assume a project is greenfield. If
.bluegreenpilotis missing and the user mentions production, first ask whether production already exists. - Never treat an environment as a blue-green slot.
dev,homolog,staging, andprodare environments;blueandgreenare slots inside one environment. - Never say
homologisgreenorprodisblueunless config explicitly models that nonstandard topology and the user confirms the risk. - If a project has
homologandprod, treat it as a candidate for mapping, not as proof that blue-green is already implemented. - Stop if the state backend is unknown or unreadable.
- Stop if brownfield adoption says the inactive production slot is not provisioned.
- Stop if rollback is unknown for production.
- Stop if database changes are involved and snapshot/migration policy is unknown.
- Prefer read-only discovery before any write/deploy action.
- Treat
homologas production-like for safety checks and data policy, but not as a production traffic slot unless config explicitly says so. - Always produce a plan before running deployment commands.
- Record what changed after every switch or rollback.
Environment vs Slot Model
Keep environments and slots separate.
- Environments are deployment stages such as
dev,homolog,staging, andprod. - Slots are parallel runtime targets inside one environment, such as
blueandgreen.
Correct model:
homolog
single-slot, or homolog-blue/homolog-green if explicitly configured
prod
blue: active production slot
green: inactive production candidate slot
Incorrect model:
homolog = green
prod = blue
If the user says an app has homolog and prod, say it is a good candidate for BlueGreenPilot mapping. Do not claim blue-green exists yet. First discover whether production can run two equivalent slots and switch traffic between them.
Files
Use these files in the target application repository:
.bluegreenpilot/config.yaml
.bluegreenpilot/state.dev.yaml
.bluegreenpilot/state.homolog.yaml
.bluegreenpilot/state.prod.yaml
.bluegreenpilot/history/
config.yaml is versioned and contains topology/workflow only. Environment
state may be versioned for simple projects, but production state is usually
stored in CI artifacts, the server, object storage, or another trusted backend.
Secrets belong in .env, CI secrets, server env vars, Vault, Doppler, 1Password,
or equivalent secret storage.
The state.backend config field tells the agent where state persists across
developer machines, homolog, CI, and production. If the backend is not readable,
stop and ask how to retrieve state before planning a deploy.
Standard Workflow
- Identify the requested operation: init, status, plan, deploy, verify, switch, promote, rollback, or audit.
- Read
.bluegreenpilot/config.yaml. If missing, run init workflow. - Determine target environment: dev, homolog, prod, or custom.
- Read state for that environment. If missing or stale, ask how to retrieve or initialize it.
- Confirm active and inactive slots for blue-green environments.
- Check deploy mode: no-docker, docker, mixed, CI, script, manual.
- Check database policy: snapshot, mock, empty, manual, or none.
- Generate a concise plan with commands, checks, switch method, rollback path, and unknowns.
- Ask before executing state-changing actions.
- After execution, record result, commit/release id, active slot, checks, and rollback metadata.
Init Workflow
Ask only for missing facts:
- App name.
- Whether production already exists today.
- Branch model: single branch, dev/homolog/prod, or custom.
- Environments: dev, homolog, prod, custom.
- For each environment: deploy mode, blue-green or single-slot, URLs.
- Docker usage: none, all environments, homolog only, prod only, or mixed.
- Switch method: manual, script, nginx, Cloudflare, load balancer, CI, other.
- Rollback method.
- Healthcheck path and smoke commands.
- Database type and whether deploys include migrations.
- Homolog data mode: production snapshot, mock data, empty database, manual.
- Where state should be stored.
Create .bluegreenpilot/config.yaml and example state files. Do not ask for
secrets. If a command needs a secret, reference an env var name instead.
Existing Production / Brownfield Adoption
If the app is already live, do not start by proposing a blue-green switch. Adopt current production first:
- Ask for the current production URL, deploy mode, current release/source, and
whether the current live service should be labeled
blueorgreen. - Treat the current live service as the stable active slot.
- Mark the opposite production slot as
not-provisioneduntil the user creates an equivalent secondary production slot. A homolog/staging environment does not count as the inactive production slot unless the user deliberately defines that topology and accepts the risk. - Record
adoption.mode: brownfieldandinactive_slot_status: not-provisioned. - Block deploy/switch plans until the inactive slot is provisioned and verified.
If the CLI is available, use:
bluegreenpilot --project /path/to/app adopt-prod \
--app \x3Cname> \
--public-url \x3Ccurrent-prod-url> \
--deploy-mode \x3Cdocker|script|manual|ci|mixed|no-docker> \
--active-slot \x3Cblue|green> \
--source \x3Ccurrent-release-or-commit> \
--state-backend \x3Crepo|server-file|ci-artifact|object-storage|manual>
Deploy Plan Shape
Always show:
Target: \x3Cenvironment>
Current active slot: \x3Cslot or unknown>
Deploy target: \x3Cinactive slot>
Source: \x3Cbranch/tag/commit>
Database policy: \x3Csnapshot/mock/empty/manual/none>
Pre-flight checks:
- ...
Deploy steps:
- ...
Verification:
- ...
Switch:
- method
- requires final confirmation: yes/no
Rollback:
- ...
Unknowns / blockers:
- ...
Production Switch Gate
Before switching production, ask a direct confirmation that includes:
- target environment;
- current active slot;
- proposed new active slot;
- release/commit;
- healthcheck result;
- rollback command or procedure.
Do not proceed from vague approval. The user must clearly approve the switch.
Rollback Workflow
For rollback:
- Read current state.
- Identify last known stable slot/release.
- Check whether rollback affects database state.
- Generate rollback plan.
- Ask for confirmation.
- Switch back or run rollback command.
- Verify public URL.
- Record rollback reason and result.
Variant References
Read only the relevant reference:
- Docker and mixed Docker deployments:
references/docker.md - No-Docker/manual/script deployments:
references/no-docker.md - Database snapshot/mock/empty policy:
references/database.md - Config/state model and examples:
references/configuration.md
Helper Script
If available, use:
bluegreenpilot init
bluegreenpilot --project /path/to/app validate --env prod
bluegreenpilot --project /path/to/app status prod
bluegreenpilot --project /path/to/app plan prod --source \x3Cbranch-or-commit>
If only the skill bundle is installed, use the bundled helper:
python {baseDir}/scripts/bluegreenpilot.py init
python {baseDir}/scripts/bluegreenpilot.py adopt-prod --app \x3Cname> --public-url \x3Ccurrent-prod-url>
python {baseDir}/scripts/bluegreenpilot.py status --env prod
python {baseDir}/scripts/bluegreenpilot.py plan --env prod
The helper is conservative. It creates templates and reports missing facts; it does not switch traffic or run destructive deployment commands.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install bluegreenpilot - After installation, invoke the skill by name or use
/bluegreenpilot - Provide required inputs per the skill's parameter spec and get structured output
What is BlueGreenPilot?
Guide safe blue-green deployments with persistent repo config, environment state, health checks, explicit switch confirmation, and rollback discipline. It is an AI Agent Skill for Claude Code / OpenClaw, with 62 downloads so far.
How do I install BlueGreenPilot?
Run "/install bluegreenpilot" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is BlueGreenPilot free?
Yes, BlueGreenPilot is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does BlueGreenPilot support?
BlueGreenPilot is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created BlueGreenPilot?
It is built and maintained by BlueGreenPilot (@bluegreenpilot); the current version is v2026.6.4.