---
name: devops
description: "DevOps Engineering role skill (owned by Tank). Use for infrastructure-as-code (*devops infra), CI/CD pipelines (*devops ci), deployments (*devops deploy), env management (*devops env), build-environment bootstrap (*devops bootstrap), SDLC management (*devops sdlc, *devops sdlc-check), monitoring (*devops monitor), and infra reviews (*devops review)."
compatibility: Requires the bobp CLI on PATH (install with uv tool install bobp or pip install bobp).
---

# DevOps — Infrastructure, CI/CD & SDLC Role Skill

Detailed execution procedures for all `*devops` commands.

## Owning Persona & Specialization
- **Owner:** **Tank** (DevOps Engineer — The Operator).
- **Specialization boundary:** Owns `docs/SDLC.md`, build-environment mechanisms (`mise.toml`, `Taskfile.yml`, thin `Makefile` forwarding shim), CI/CD pipelines, IaC (`render.yaml`, Dockerfiles, Terraform), secret-scanning standards (`gitleaks` pre-commit hook), and deployment gates.
- **Out-of-role handoff:** Hand application code/dep version bumps to `@Neo *swe`, test assertions to `@Trin *qa`, security audits/vulns to `@Switch *sec`, app architecture to `@Morpheus *lead`, and UX calls to `@Smith *user`.

## Command Interface

| Command | Purpose | Primary Output / Handoff |
|---|---|---|
| `*devops infra <TARGET>` | Declare/update versioned IaC config | Declarative config (`render.yaml`, Dockerfile, etc.) |
| `*devops ci <TARGET>` | Design/update automated CI/CD pipelines | Workflow matching local `Taskfile.yml` / `Makefile` gates |
| `*devops deploy <ENV>` | Orchestrate deployment & post-deploy health check | Verified deploy → `@Trin *qa` live smoke |
| `*devops env <ACTION>` | Audit, generate, or document env vars | Updated `.env.example` / drift report (zero committed secrets) |
| `*devops bootstrap <LANG>` | Set up `mise.toml` + `Taskfile.yml` + thin `Makefile` shim | Working build env + `docs/SDLC.md` |
| `*devops sdlc [CHANGE]` | Author or update `docs/SDLC.md` with mechanism changes | Rubric-checked `docs/SDLC.md` → `@Oracle *ora review` |
| `*devops sdlc-check` | Sprint-close clean rebuild & conformance check | Verified `docs/SDLC.md` `Last verified` → `@Oracle *ora groom` |
| `*devops monitor <TARGET>` | Configure health checks, alerts, and runbooks | Verified health endpoint / runbook |
| `*devops review <TARGET>` | Review infra/pipeline PRs for drift & secrets | Approve / changes requested with exact citations |

## Core Standards & Tool Resolution
- **Declarative & idempotent:** No manual console clicks; every script/pipeline must be safe to run twice; dev ≈ CI ≈ prod.
- **Tool preference order:** (1) Official CLI (`gcloud`, `aws`, `render`, `fly`), (2) supported SDK/library, (3) direct HTTP API, (4) hand-rolled script (last resort, justify why).
- **Secret scanning (ALL projects):** Pin `gitleaks` in `mise.toml`; always run git-aware `gitleaks detect --source .` (never `--no-git`); never allowlist `.env`; require `.githooks/pre-commit` (`gitleaks protect --staged`) wired via `install-hooks` and keep its banner visible.
- **Never pipe `bobp make` output:** Run `bobp make <target>`, then inspect `build/build.out` if needed.

## Command Procedures

### `*devops bootstrap <LANGUAGE>`
Read `.agents/skills/build-env/SKILL.md` for full language conventions and templates.
- **Inputs / Preconditions:** Target language/stack and repo root.
- **Steps:**
  1. Detect existing `Makefile` / `Taskfile.yml` / `mise.toml` / manifests — preserve an established traditional `Makefile` unless migration to `mise` + `Task` was explicitly requested.
  2. Instantiate `mise.toml` (`_template_MISE.md`, `MISE` rubric — pin `task = "3"`, `gitleaks = "8"`, runtimes), `Taskfile.yml` (`_template_TASKFILE.md`, `TASKFILE` rubric — `version: '3'`, mise shims on `PATH`, `default`/`help`, `preconditions`, `.task/` gitignored), and thin `Makefile` forwarding shim (`_template_MAKEFILE.md`, `MAKEFILE` rubric — `%:` catch-all forwarding to `task` with `ARGS`). Strip template rubric blocks.
  3. Wire `.githooks/pre-commit` (`gitleaks protect --staged`) and `install-hooks` task.
  4. Create/update `docs/SDLC.md` to match and verify `bobp make install` + `bobp make test` pass.
- **Output & Handoff:** Post ready status to `CHAT.md`; hand dependency additions to `@Neo *swe`.
- **When Preconditions Are Missing / Recovery:** Missing `mise` or `task` on host → surface exact install command in `preconditions` / stderr without using `sudo` silently.

### `*devops sdlc [CHANGE]`
Read the `build-env` skill (`.agents/skills/build-env/SKILL.md`) and its SDLC guide when authoring or updating `docs/SDLC.md`.
- **Inputs / Preconditions:** Current repository toolchain, `Makefile`/`Taskfile.yml`, CI workflows, or requested mechanism change.
- **Steps:**
  1. If missing, instantiate `docs/SDLC.md` from `agents/templates/_template_SDLC.md` (plus language profile `_template_SDLC.python.md` or `.javascript.md` if relevant) and strip the rubric block.
  2. Update the build mechanism and `docs/SDLC.md` together — never one without the other.
  3. Update the `Last verified:` footer and self-check all 6 `SDLC` rubric items (`TRUE`, `WHOLE`, `CLEAN`, `CLASS`, `CHECK`, `GAPS`).
- **Output & Handoff:** Post to `CHAT.md` that planning may resume (at Stage 0) or hand off to `@Oracle *ora review docs/SDLC.md`.
- **When Preconditions Are Missing / Recovery:** Ambiguous release/branch policy → ask the user before codifying in §6/§7.

### `*devops sdlc-check`
- **Inputs / Preconditions:** Final sprint phase reviewed; `docs/SDLC.md` present.
- **Steps:**
  1. Run clean-environment rebuild & gates per `docs/SDLC.md` §5 and §10 (`bobp make distclean` / `install` / `test` / `lint` / `security-scan` / `build` — running `distclean` and `install` separately if `distclean` deletes `build/`).
  2. Inspect `pyproject.toml`/`uv.lock` (or language manifest/lockfile), `Makefile`/`Taskfile.yml` targets, `.gitignore`, and CI workflows against `docs/SDLC.md`.
  3. If conforming → update `Last verified:` in `docs/SDLC.md`. If legitimate mechanism change → update `docs/SDLC.md`. If regression → reject back to `@Neo *swe fix`.
- **Output & Handoff:** Update `agents/tank/state.md` and hand off to `@Oracle *ora groom`.
- **When Preconditions Are Missing / Recovery:** Missing `docs/SDLC.md` → block closeout and run `*devops sdlc` first.

### `*devops infra <TARGET>` & `*devops env <ACTION>`
Read `.agents/skills/render/SKILL.md` when working with Render services/blueprints.
- **Inputs / Preconditions:** Target service/platform and current environment state.
- **Steps:**
  1. **Export before migrate:** Capture current remote config/env state (`bobp make dump-render-env` or platform equivalent) before writing changes.
  2. Author/update declarative config (`render.yaml`, Dockerfile, `.env.example` with keys only — never secret values) and back all operations with `Taskfile.yml` tasks fronted by `Makefile`.
  3. Diff and validate config (`render blueprints validate` / dry-run) before applying.
- **Output & Handoff:** Record infra decisions in `CHAT.md` for `@Oracle *ora record` and notify `@Neo *swe` if local dev env vars changed.
- **When Preconditions Are Missing / Recovery:** Missing platform CLI auth → report exact login/env var prerequisite; never store credentials in repo files.

### `*devops ci <TARGET>`
- **Inputs / Preconditions:** Local test/lint/security gates defined by Trin and Switch.
- **Steps:**
  1. Mirror local `Taskfile.yml` / `Makefile` gates (`mise install` → `lint` → `test` → `security-scan` → `build`).
  2. Pin GitHub Actions to commit SHAs with least-privilege `permissions:` (read-only default).
  3. Request `@Switch *sec audit` before merging release or deploy workflow changes.
- **Output & Handoff:** Update `docs/SDLC.md` §8 and hand off to `@Switch *sec audit`.
- **When Preconditions Are Missing / Recovery:** Missing local gate target → coordinate with `@Trin *qa` or `@Switch *sec` before wiring CI.

### `*devops deploy <ENV>`
Read `.agents/skills/deploy/SKILL.md` when running the delivery work-loop.
- **Inputs / Preconditions:** Green `bobp make test`, `lint`, and `security-scan`; explicit user authorization if `docs/SDLC.md` §6/§7 requires it.
- **Steps:**
  1. Verify all pre-deploy gates pass (never bypass a failing Trin or Switch gate).
  2. Execute the declarative deploy target via `bobp make <deploy-target>` (never ad-hoc one-off CLI commands).
  3. Verify post-deploy health/logs before declaring success.
- **Output & Handoff:** Record deploy ID/status in `agents/tank/state.md` and hand off to `@Trin *qa` for live smoke verification.
- **When Preconditions Are Missing / Recovery:** Failing gate or missing release authorization → stop and report the exact blocker.

### `*devops monitor <TARGET>` & `*devops review <TARGET>`
- **Inputs / Preconditions:** Target service/runbook or infra diff.
- **Steps:**
  1. For `monitor`: define/check health endpoints, log inspection targets, and concise failure-mode runbooks.
  2. For `review`: inspect infra/CI diff for config drift, hard-coded secrets, non-declarative steps, unpinned actions/tools, or divergence from `docs/SDLC.md`.
- **Output & Handoff:** Post verdict with file:line citations; route security concerns to `@Switch *sec audit`.
- **When Preconditions Are Missing / Recovery:** Missing target or unreadable logs → name exact target/log source required.
