Platform and delivery engineering — CI/CD pipelines, infrastructure as code, containers, environment parity, deployment strategies (blue/green, canary, rolling), rollback, secrets management, disaster recovery, autoscaling and cloud cost control. Use when working on pipelines, Dockerfiles, Terraform, Kubernetes, GitHub Actions, deployment or hosting; when the user says "CI", "CD", "pipeline", "deploy", "Docker", "Kubernetes", "Terraform", "infrastructure", "staging", "rollback", "downtime", "environment variables", "secrets", "autoscaling", "cloud costs" or "how do I ship this"; and as a pass in any project audit. By Devleck.
Container base images pinned by digest, not by a moving tag.
Infrastructure in code, in the repository, applied by the pipeline.
No snowflake servers. Anything configured by hand once is a single
point of failure with no recovery procedure. The test: could you delete
the production environment and rebuild it from the repo?
Local development one command away — Docker Compose, devcontainer, or a
documented single script.
build once, tag by commit SHA → deploy to staging → smoke tests → ready for production
Rules that matter more than the tool:
Build the artefact once. Promote the same artefact through environments.
Rebuilding per environment means you deployed something you never tested.
CI must block merge. Establish this before there is pressure to bypass it;
it is never established afterwards.
Keep it under ~10 minutes. Beyond that, people stop waiting and start
merging around it. Cache dependencies, parallelise, split slow suites.
A flaky pipeline is a broken pipeline. A suite people re-run until green
provides no information.
Pin actions to a commit SHA, not a tag. Tags are mutable.
Fork PRs must not access secrets.
Branch protection: no direct pushes, review required, checks required.
Environments
Local, staging and production should be structurally identical, differing in
scale. Staging with a different database engine, no data and half the services
stubbed does not tell you anything about production.
Local
Staging
Production
Same engines and versions
yes
yes
yes
Same deploy mechanism
—
yes
yes
Realistic data volume
no
approximate
—
Real personal data
never
never
yes
Same secret management
file
manager
manager
Staging must never hold production personal data or production credentials.
If staging can read the production database, staging is production for breach
purposes, with weaker controls and broader access. See
database-engineering/references/data-lifecycle.md.
Ephemeral preview environments per pull request are the highest-value platform
investment most teams have not made: they turn "looks right in the diff" into
"I clicked it".
Deployment and rollback
Rollback is the feature. A deploy you cannot reverse in minutes is a deploy
you are afraid to make, which is how teams end up shipping monthly.
Strategy
Reversal
Cost
Use
Rolling
Redeploy previous
Low
Default for stateless services
Blue/green
Switch traffic back — seconds
Double infra briefly
When instant reversal matters
Canary
Shift the small percentage back
Needs traffic splitting + metrics
High-risk changes at real volume
Feature flag
Toggle — no deploy at all
Flag debt
Risky behaviour changes
Non-negotiables
The rollback procedure is documented and has been executed at least once for
practice. An untested rollback has unknown duration.
Migrations are ordered relative to the deploy by direction: additive changes
migrate first, destructive changes deploy first. During a rolling deploy both
code versions run simultaneously, so the schema must satisfy both.
Health and readiness endpoints are distinct: liveness means "restart me",
readiness means "do not send traffic yet".
Graceful shutdown on SIGTERM, draining in-flight requests. Without it, every
deploy drops requests.
Deploys are logged and annotated on dashboards — the first question in any
incident is "what changed?"
Containers
# Multi-stage: build tooling never reaches the runtime image
FROM node:22.11.0-slim@sha256:<digest> AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci --ignore-scripts
COPY . .
RUN npm run build && npm prune --omit=dev
FROM node:22.11.0-slim@sha256:<digest>
ENV NODE_ENV=production
WORKDIR /app
RUN groupadd -r app && useradd -r -g app app
COPY --from=build --chown=app:app /app/node_modules ./node_modules
COPY --from=build --chown=app:app /app/dist ./dist
USER app # never root
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s CMD node dist/healthcheck.js
CMD ["node", "dist/server.js"]
Pin the base image by digest. Multi-stage so compilers and dev dependencies do
not ship.
Run as non-root. Read-only root filesystem where possible.
No secrets in layers, ever — including in intermediate layers a later
RM "removed". Layers are permanently inspectable. Use build secrets or
runtime injection.
Set memory and CPU limits, and make sure the runtime respects them (older
runtimes ignore cgroup limits and get OOM-killed).
Secrets
In the platform's secret manager (cloud KMS/Secrets Manager, Vault, or the
hosting platform's own). Never in the repository, never in the image, never in
CI logs.
Injected at runtime, distinct per environment.
Rotatable, with a documented and practised procedure. A secret nobody knows
how to rotate is a secret you cannot revoke after a leak.
Access audited. Least privilege per service.
Prefer short-lived federated credentials (OIDC from CI to cloud) over
long-lived static keys.
Secret scanning in CI and as a pre-commit hook.
Disaster recovery
Backups and restore drills live in
database-engineering/references/resilience.md — that is the core of DR and it
is the part most often unverified.
Beyond the database:
Object storage versioned and backed up; deletion protection on.
Infrastructure rebuildable from code — tested by actually creating a fresh
environment from scratch.
Secrets recoverable (who else can access the manager if one person is
unavailable?).
DNS and domain ownership documented, with registrar access not held by one
person.
TLS certificates auto-renewing, with expiry alerting as a backstop.
A written incident runbook, and a named escalation path.
Dependencies on third parties assessed: what breaks if the identity
provider, payment processor or CDN is down?
Cost
Cost is an engineering property, not a finance problem discovered at month end.
Tag every resource by service and environment; report spend per tag.
Alert on anomalies, not just on budget — a 3x jump on Tuesday matters more
than a monthly total.
The usual leaks, in order: unbounded log retention; over-provisioned instances
running at 5%; forgotten non-production environments; cross-AZ and egress
traffic; unattached volumes and old snapshots; oversized managed databases.
Autoscaling with a maximum — unbounded scaling turns a traffic spike or a
retry storm into a five-figure bill.
Set a budget alert on day one, before anything is deployed.
Review checklist
Environment rebuildable from the repository alone
Lockfile committed; CI installs frozen; images pinned by digest
1---2name: devops-platform3description: Platform and delivery engineering — CI/CD pipelines, infrastructure as code, containers, environment parity, deployment strategies (blue/green, canary, rolling), rollback, secrets management, disaster recovery, autoscaling and cloud cost control. Use when working on pipelines, Dockerfiles, Terraform, Kubernetes, GitHub Actions, deployment or hosting; when the user says "CI", "CD", "pipeline", "deploy", "Docker", "Kubernetes", "Terraform", "infrastructure", "staging", "rollback", "downtime", "environment variables", "secrets", "autoscaling", "cloud costs" or "how do I ship this"; and as a pass in any project audit. By Devleck.4license: MIT5---67# DevOps and Platform Engineering89Two questions decide whether a platform is professional:1011> **How long from commit to production?**12> **How long from "this is broken" to it not being broken?**1314Everything below serves those two numbers. A pipeline that produces neither15speed nor reversibility is ceremony.1617---1819## Reproducibility — the precondition2021If the environment cannot be rebuilt from the repository, everything else is22built on sand.2324- [ ] Runtime version pinned in a file the toolchain reads, and in the manifest.25- [ ] Lockfile committed; CI installs **frozen** (`npm ci`, `--frozen-lockfile`,26 `poetry install --sync`, `bundle --deployment`).27- [ ] Container base images pinned **by digest**, not by a moving tag.28- [ ] Infrastructure in code, in the repository, applied by the pipeline.29- [ ] **No snowflake servers.** Anything configured by hand once is a single30 point of failure with no recovery procedure. The test: could you delete31 the production environment and rebuild it from the repo?32- [ ] Local development one command away — Docker Compose, devcontainer, or a33 documented single script.3435---3637## The pipeline3839**On every pull request**, blocking merge:40```41install (frozen) → lint → typecheck → unit → integration → build → dependency audit → secret scan42```4344**On merge to the default branch:**45```46build once, tag by commit SHA → deploy to staging → smoke tests → ready for production47```4849Rules that matter more than the tool:5051- **Build the artefact once.** Promote the *same* artefact through environments.52 Rebuilding per environment means you deployed something you never tested.53- **CI must block merge.** Establish this before there is pressure to bypass it;54 it is never established afterwards.55- **Keep it under ~10 minutes.** Beyond that, people stop waiting and start56 merging around it. Cache dependencies, parallelise, split slow suites.57- **A flaky pipeline is a broken pipeline.** A suite people re-run until green58 provides no information.59- **Pin actions to a commit SHA**, not a tag. Tags are mutable.60- **Fork PRs must not access secrets.**61- Branch protection: no direct pushes, review required, checks required.6263---6465## Environments6667Local, staging and production should be **structurally identical, differing in68scale**. Staging with a different database engine, no data and half the services69stubbed does not tell you anything about production.7071| | Local | Staging | Production |72|---|---|---|---|73| Same engines and versions | yes | yes | yes |74| Same deploy mechanism | — | yes | yes |75| Realistic data volume | no | approximate | — |76| Real personal data | **never** | **never** | yes |77| Same secret management | file | manager | manager |7879**Staging must never hold production personal data or production credentials.**80If staging can read the production database, staging *is* production for breach81purposes, with weaker controls and broader access. See82`database-engineering/references/data-lifecycle.md`.8384Ephemeral preview environments per pull request are the highest-value platform85investment most teams have not made: they turn "looks right in the diff" into86"I clicked it".8788---8990## Deployment and rollback9192**Rollback is the feature.** A deploy you cannot reverse in minutes is a deploy93you are afraid to make, which is how teams end up shipping monthly.9495| Strategy | Reversal | Cost | Use |96|---|---|---|---|97| Rolling | Redeploy previous | Low | Default for stateless services |98| Blue/green | Switch traffic back — seconds | Double infra briefly | When instant reversal matters |99| Canary | Shift the small percentage back | Needs traffic splitting + metrics | High-risk changes at real volume |100| Feature flag | Toggle — no deploy at all | Flag debt | Risky behaviour changes |101102**Non-negotiables**103- The rollback procedure is documented **and has been executed at least once for104 practice**. An untested rollback has unknown duration.105- Migrations are ordered relative to the deploy by direction: additive changes106 migrate first, destructive changes deploy first. During a rolling deploy both107 code versions run simultaneously, so the schema must satisfy both.108- Health and readiness endpoints are distinct: liveness means "restart me",109 readiness means "do not send traffic yet".110- Graceful shutdown on `SIGTERM`, draining in-flight requests. Without it, every111 deploy drops requests.112- Deploys are logged and annotated on dashboards — the first question in any113 incident is "what changed?"114115---116117## Containers118119```dockerfile120# Multi-stage: build tooling never reaches the runtime image121FROM node:22.11.0-slim@sha256:<digest> AS build122WORKDIR /app123COPY package*.json ./124RUN npm ci --ignore-scripts125COPY . .126RUN npm run build && npm prune --omit=dev127128FROM node:22.11.0-slim@sha256:<digest>129ENV NODE_ENV=production130WORKDIR /app131RUN groupadd -r app && useradd -r -g app app132COPY --from=build --chown=app:app /app/node_modules ./node_modules133COPY --from=build --chown=app:app /app/dist ./dist134USER app # never root135EXPOSE 3000136HEALTHCHECK --interval=30s --timeout=3s CMD node dist/healthcheck.js137CMD ["node", "dist/server.js"]138```139140- Pin the base image by digest. Multi-stage so compilers and dev dependencies do141 not ship.142- **Run as non-root.** Read-only root filesystem where possible.143- **No secrets in layers, ever** — including in intermediate layers a later144 `RM` "removed". Layers are permanently inspectable. Use build secrets or145 runtime injection.146- `.dockerignore` covering `.git`, `.env`, `node_modules`, tests.147- Scan images for vulnerabilities in CI.148- Set memory and CPU limits, and make sure the runtime respects them (older149 runtimes ignore cgroup limits and get OOM-killed).150151---152153## Secrets154155- In the platform's secret manager (cloud KMS/Secrets Manager, Vault, or the156 hosting platform's own). Never in the repository, never in the image, never in157 CI logs.158- Injected at runtime, distinct per environment.159- **Rotatable, with a documented and practised procedure.** A secret nobody knows160 how to rotate is a secret you cannot revoke after a leak.161- Access audited. Least privilege per service.162- Prefer short-lived federated credentials (OIDC from CI to cloud) over163 long-lived static keys.164- Secret scanning in CI and as a pre-commit hook.165166---167168## Disaster recovery169170Backups and restore drills live in171`database-engineering/references/resilience.md` — that is the core of DR and it172is the part most often unverified.173174Beyond the database:175- [ ] Object storage versioned and backed up; deletion protection on.176- [ ] Infrastructure rebuildable from code — tested by actually creating a fresh177 environment from scratch.178- [ ] Secrets recoverable (who else can access the manager if one person is179 unavailable?).180- [ ] DNS and domain ownership documented, with registrar access not held by one181 person.182- [ ] TLS certificates auto-renewing, with expiry alerting as a backstop.183- [ ] A written incident runbook, and a named escalation path.184- [ ] Dependencies on third parties assessed: what breaks if the identity185 provider, payment processor or CDN is down?186187---188189## Cost190191Cost is an engineering property, not a finance problem discovered at month end.192193- Tag every resource by service and environment; report spend per tag.194- **Alert on anomalies**, not just on budget — a 3x jump on Tuesday matters more195 than a monthly total.196- The usual leaks, in order: unbounded log retention; over-provisioned instances197 running at 5%; forgotten non-production environments; cross-AZ and egress198 traffic; unattached volumes and old snapshots; oversized managed databases.199- Autoscaling with a **maximum** — unbounded scaling turns a traffic spike or a200 retry storm into a five-figure bill.201- Set a budget alert on day one, before anything is deployed.202203---204205## Review checklist206207- [ ] Environment rebuildable from the repository alone208- [ ] Lockfile committed; CI installs frozen; images pinned by digest209- [ ] CI runs lint, types, tests, build, dependency audit, secret scan — blocking210- [ ] CI under ~10 minutes and not flaky211- [ ] One artefact built once and promoted212- [ ] Staging structurally matches production and holds no production data213- [ ] Deploys automated; **rollback documented and rehearsed**214- [ ] Migration ordering relative to deploys is correct for both directions215- [ ] Health and readiness distinct; graceful shutdown implemented216- [ ] Containers non-root, multi-stage, no secrets in layers, scanned217- [ ] Secrets in a manager, per-environment, rotatable, audited218- [ ] Backups tested by restore; infrastructure rebuild tested219- [ ] Cost tagged, monitored, anomaly-alerted; autoscaling capped220221## References222223- `references/pipeline-design.md` — CI/CD in depth, per platform224- `references/infrastructure.md` — IaC, environments, networking, scaling, cost
Run npx skillmds@latest add kin9zeus/devops-platform in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Platform and delivery engineering — CI/CD pipelines, infrastructure as code, containers, environment parity, deployment strategies (blue/green, canary, rolling), rollback, secrets management, disaster recovery, autoscaling and cloud cost control. Use when working on pipelines, Dockerfiles, Terraform, Kubernetes, GitHub Actions, deployment or hosting; when the user says "CI", "CD", "pipeline", "deploy", "Docker", "Kubernetes", "Terraform", "infrastructure", "staging", "rollback", "downtime", "environment variables", "secrets", "autoscaling", "cloud costs" or "how do I ship this"; and as a pass in any project audit. By Devleck. It is listed under DevOps & Infra on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free. This skill is licensed under MIT.
Kin9Zeus (@kin9zeus) published this skill. Their other Agent Skills are listed on their SkillMD profile.