CI/CD adoption guide — phases 0, 1 and 2
Audience: developers and project managers. Purpose: pick the right level of CI/CD for your project before running
/hv:cicd-init. Origin: Ovillo's double-barrier model, local + remote pipeline.
Is your repository on GitHub? The phases are the same; what you need and what gets generated change. Read
GUIA_GITHUB_ACTIONS.md(§ 2 and § 3) and use this guide for the phase model.
TL;DR — which one to choose
| Phase | State of the project | Initial effort | What you gain | What you do NOT get |
|---|---|---|---|---|
| Phase 0 | No Azure DevOps infrastructure at all, manual deployment | 0 hours (just Ovillo locally) | /hv:verify 7 phases before pushing, discipline reminders | Remote build, green/red CI, automatic deployment |
| Phase 1 | You have access to Azure DevOps + a build agent online | ~2 hours | Build validation branch policy, dotnet build + dotnet test on every PR | Automatic deployment, rollback, manual gates |
| Phase 2 | You have the configured pool + <ENV>_DEPLOY agents + an approvers group | ~6 hours | Full pipeline Build → DEV (auto) → DEMO (manual gate) → PROD (environment gate, 2 servers rolling, triple rollback) | — (this is the ceiling) |
Quick rule: start at the lowest phase you can sustain. Moving up is easy; moving down hurts.
Phase 0 — Ovillo locally only
When it applies
- A new project, or one with no previous pipeline.
- The organization's infrastructure team has not authorized the configured pool for the project yet.
- A small team (one developer) with no need for remote validation.
- Occasional deployments (every few weeks), not daily.
What /hv:cicd-init generates in phase 0
RUNBOOK_DEPLOY_MANUAL.mdadapted to the project: RDP into the server, copy the DLLs, recycle the app pool, manual smoke test.- Pre-push reminders in the project's
CLAUDE.md("Pre-commit" section): they require running/hv:verifybefore eachgit push. - An entry in
_hilo/ESTADO_PROYECTO.json.infraestructura.cicd[]with{ fase: 0, ... }.
What it does NOT generate
- ❌
azure-pipelines.yml(there is no pipeline) - ❌ A call to the Hub MCP (
register_pipelineis skipped) - ❌ Azure DevOps agents or groups
How to move up to phase 1
Once the infrastructure team authorizes the configured pool for the project and a build agent (cicd.buildAgent) is available:
claude /hv:cicd-init # detects phase 0 and rewrites to phase 1 (idempotent edit mode, PHASE 0.5)
Phase 1 — Build validation branch policy
When it applies
- You have access to Azure DevOps and the configured pool is authorized.
- The build agent (
cicd.buildAgent) is online (the infrastructure team confirms it). - You want to block merges with a red build or red tests, while deployment stays manual.
- A team of two or more developers (PRs need protection).
What /hv:cicd-init generates in phase 1
- A minimal
azure-pipelines.yml: a singleBuildstage withdotnet restore/build/testanddotnet publish→ thedropartifact. No CD, no deployment groups. - Registering the pipeline in Azure DevOps through
_apis/build/definitions(PHASE 2.5 of the command). - A suggested build validation branch policy (by hand in the Azure DevOps UI, or through
_apis/policy/configurations). - Registration in the Hub MCP: the
register_pipelinetool withfase=1. - An entry in
_hilo/ESTADO_PROYECTO.json.infraestructura.cicd[]with{ fase: 1, pipelineId, url, stages: ['Build'] }.
What it does NOT generate
- ❌ DeployDev/Demo/Prod stages
- ❌ Variable groups for secrets
- ❌ Automatic backup and rollback
- ❌ A runbook (deployment is manual from the artifact)
How to move up to phase 2
Once the infrastructure team installs <SERVER>_DEPLOY agents with the capability DeployTarget=<env>-<app|svc> (R1/R25: one agent per environment × type — applications and services; see PERMISOS_CICD.md §3) on every target server:
claude /hv:cicd-init # detects phase 1 and rewrites to phase 2, adding the CD stages (edit mode, PHASE 0.5)
Phase 2 — Full CD pipeline
When it applies
- You have had phase 1 running stably for four weeks or more.
- The infrastructure team confirms agents online in DEV, DEMO and PROD (each server with its own
<SERVER>_DEPLOYagent). - The Azure DevOps approvers group is created and populated (two or more members for PROD).
- A supported stack: .NET ASP.NET Core (in-process) or Vue 3 + Vite + TS (a static SPA).
What /hv:cicd-init generates in phase 2
- A full
azure-pipelines.yml: stages Build → DeployDev (auto) → DeployDemo (ManualValidation@0gate) → DeployProd (environment + group approval + two servers rolling). - Triple PROD rollback: a pre-deploy backup +
MSDeploy enableRule:DoNotDeleteRule+ acondition: failed()restore step. - A variable group
<PIPELINE_NAME>-secretscreated through_apis/distributedtask/variablegroups, with a pre-build fail-fast (it checks that the secrets actually have values). - Retention rules: main branch 30 days/5 builds, others 7 days/1 build.
- A coverage gate: it warns (WARN-first) or blocks if line/branch coverage drops below the threshold (
coverage-gate.ps1, our own script;-Mode blockto block; it does not compute CRAP). - The project's
RUNBOOK.md: six sections (build fails / DEMO deployment fails / PROD deployment fails / app down after a green deployment / contacts / backups), one page each at most. - Registration in the Hub MCP: the
register_pipelinetool withfase=2.
Limits to respect
Before editing the YAML by hand, check your platform's constraints (cicd.platform + cicd.variant). On the server-2020 variant these apply:
- ❌ NEVER
Cache@2(the Pipeline Caching service does not exist in Azure DevOps Server 2020) - ❌ NEVER
IISWebAppDeployment@1(a deprecated preview) → useIISWebAppDeploymentOnMachineGroup@0 - ❌ NEVER the
deploymentGroup:keyword (the schema rejects it) - ❌ NEVER
DownloadBuildArtifacts@0/DownloadPipelineArtifact@2(a Node.js SSL bug against the on-premise host) → use the REST API + PowerShell - ❌ NEVER TLS 1.0/1.1 in PowerShell scripts (PS 5.1 defaults to 1.0; force 1.2+)
Summary table — what you need for each phase
| Requirement | Phase 0 | Phase 1 | Phase 2 |
|---|---|---|---|
_hilo/ESTADO_PROYECTO.json configured | ✅ | ✅ | ✅ |
/hv:verify run before pushing | ✅ recommended | ✅ mandatory | ✅ mandatory |
| Azure DevOps access (project + repo) | ❌ not needed | ✅ mandatory | ✅ mandatory |
Configured pool (cicd.buildPool) authorized for the project | ❌ | ✅ | ✅ |
| Build agent online | ❌ | ✅ | ✅ |
A <SERVER>_DEPLOY agent per environment | ❌ | ❌ | ✅ (one per DEV/DEMO/PROD) |
| Approvers group in Azure DevOps (≥2) | ❌ | ❌ | ✅ |
| Variable group for secrets | ❌ | ❌ | ✅ (if there are secrets) |
Health endpoints (/health/live, /ready) | optional | optional | recommended (strict .NET smoke) |
And on GitHub Actions
| What you need on Azure DevOps | The GitHub equivalent |
|---|---|
Pool {{BUILD_POOL}} authorized + a build agent (cicd.buildAgent) | A hosted runner (ubuntu-latest) or self-hosted; nothing to authorize |
<ENV>_DEPLOY agents with DeployTarget | OIDC to the cloud (id-token: write) or a self-hosted runner with access to the target |
| Approvers group (≥2) | Required reviewers on the pro environment (public repositories or a Team/Enterprise plan) |
| Variable group for secrets | Environment/repository secrets (gh secret set --env) |
| Build validation branch policy | A ruleset with the Build/Security checks + a merge queue (git-best-practices) |
| Registering the definition (PHASE 2.5) | Does not exist: a workflow counts simply by being in .github/workflows/ |
Detail, commands and opt-in security: GUIA_GITHUB_ACTIONS.md.
Anti-patterns (what NOT to do)
- ❌ Jumping straight from phase 0 to phase 2: the command's PHASE 0.5 edit mode allows it, but skipping the middle phase means the first PROD failure will be catastrophic (no practice with phase 1).
- ❌ Asking for phase 2 without
<ENV>_DEPLOYagents: the wizard detects it in the PHASE 0.4 pre-flight and aborts with a clear message. - ❌ Treating phase 0 as "we do not do CI/CD": phase 0 IS CI/CD — the first barrier (Ovillo locally with
/hv:verify's 7 phases) is what keeps real bugs out of manual deployments. - ❌ Editing
azure-pipelines.ymlignoring G1-G19: thecicd-pipeline-revieweragent will tell you, but human discipline is cheaper.
When in doubt
Follow this tree:
Do you have Azure DevOps access and the configured pool authorized?
├── NO → Phase 0
└── YES → Do you have <ENV>_DEPLOY agents online on every target server?
├── NO → Phase 1
└── YES → Is there an Azure DevOps approvers group with 2 or more members?
├── NO → Phase 1 (and create the group in parallel)
└── YES → Phase 2
If you are not sure, start at phase 0 and move up when the next step is clear. /hv:cicd-init is idempotent — running it again in edit mode breaks nothing.
Updating the pipeline after new versions of Ovillo
There are two layers, and updating one does NOT update the other:
| Layer | What it is | How it is updated | |
|---|---|---|---|
The Ovillo template (.claude/) | The tooling: workflows, rules, the cicd-architect skill, the cicd-pipeline-reviewer agent, hooks, templates | `irm <distribution.baseUrl>/install.ps1 \ | iex` |
Your azure-pipelines.yml | The generated artifact: it lives in your repository and runs on Azure DevOps | /hv:cicd-init (run again) or by hand |
The key point:
irmupdates the tooling, but it never touches your YAML. The pipeline is yours; improvements to the rules are not imposed on it unless you decide so.
Workflow vs skill vs agent — how to invoke each
- Workflows (
/hv:cicd-init,/hv:cicd-status,/hv:cicd-deploy,/hv:cicd-release): you type them with/. - The
cicd-architectskill: auto-invoked (it activates by itself when you editazure-pipelines.yml). - The
cicd-pipeline-revieweragent: it is NOT a/workflow (which is why you do not see it in the slash menu). You ask Claude for it — for example "audit my azure-pipelines.yml with the cicd-pipeline-reviewer agent" or "review my pipeline and give me a severity report" — and it runs as a subagent.
Recommended flow when updating
- Update the template:
irm … | iex(it brings new rules and templates). - Audit your YAML against the current rules: ask Claude to run the
cicd-pipeline-revieweragent. It gives you the "conformance diff" (which new rules your pipeline does not meet). If it comes out clean, there is nothing to do. - If there are findings you want to apply: run
/hv:cicd-initagain. Its PHASE 0.5 (edit mode, rule R14, idempotence): - takes an automatic backup (
.azure-pipelines.bak.<date>.yml), - shows the diff before touching anything,
- offers five options: add a stage / modify a stage / regenerate the docs / update the whole YAML / exit,
- preserves your
# CUSTOM: ... # /CUSTOMblocks and your own variables. - Commit and push the YAML in your repository → the push triggers the build and confirms it is still green. The definition in Azure DevOps is not registered again (it already exists).
- Changing phase (0→1→2): the same
/hv:cicd-initadds the new stages (on-demand deploy withDeployEnvR20, the R22 security gate, rollback, and so on).
What forces you to touch the YAML (and what does not)
| Kind of improvement in Ovillo | Touch the YAML? |
|---|---|
| Audit only (the reviewer detects more things) | No, unless you want to fix a finding |
| A change in the template (a new canonical step) | /hv:cicd-init, option "update the YAML", brings it in (preserving your customs) |
| A new phase / CD | /hv:cicd-init adds the stages |
| Changes only in hooks / workflows / skills | Does not affect the YAML |
Guarantee: running
/hv:cicd-initagain never overwrites your work (backup + diff + confirmation + it preserves# CUSTOM). It is safe to do on every update, to re-sync the pipeline with the current rules.
Example (a phase-1 project that only refreshes the tooling): if the version's news are about phase 2 (deployment) or another stack, your phase-1 YAML needs no changes — irm … | iex is enough. You only run /hv:cicd-init again when you want to move up a phase or apply a template change.
Document generated by Ovillo — CI/CD integration. The "Updating the pipeline" section was added 2026-06-02.
Fuente: ovillo/_patron/08_CICD/GUIA_FASES_ADOPCION_EN.md