Ops Skill - CI/CD, Deployment & Automation
Version: 9.0 | Updated: 01-July-2026 | Architect: Karim Bhalwani | Tiered: core (~140 lines) + on-demand references
Unified reference for operational automation. For copy-ready templates (GitHub Actions, Docker, Terraform, release checklists), load the deep-dive reference.
Core Principles
- Immutable artifacts: every build produces a versioned, unchangeable artifact
- Environment parity: dev/staging/prod from same templates
- Secrets in vaults: never in code, config, or CI logs
- Rollback before deploy: document rollback plan BEFORE deployment
Mechanical Enforcement
When a behavioral rule fails twice in retrospectives, promote it to a mechanical check. Linters and CI are more reliable than prompt instructions.
Promote-to-Code Decision Rule
- Trigger: behavioral rule caused rework 2+ times
- Action: write a mechanical check (pre-commit hook, lint rule, or CI job)
- Record: log in
.copilot/context/DECISIONS.md as an ADR
- Remove redundancy: move the original prompt instruction verbatim into
.copilot/context/DECISIONS.md under the relevant ADR entry, then delete it from the prompt.
Enforcement Layers
| Layer |
Catches |
Speed |
Scope |
| Pre-commit hooks |
Style, structure, obvious violations |
Seconds |
Per-commit |
| CI workflow |
Cross-file issues, Bible freshness, doc staleness |
Minutes |
Per-PR |
| Guardian review |
Design quality, logic correctness, architectural fit |
Minutes |
Per-PR |
Load mechanical-enforcement.md for copy-ready pre-commit, ruff, and CI config templates.
Quick Reference: Key Patterns
GitHub Actions
- Standard CI: lint > test > security scan (parallel where possible)
- Reusable workflows via
workflow_call for DRY deployment
- Matrix strategy for cross-version/cross-OS testing
- Cache pip/npm dependencies with
actions/cache@v4
Docker
- Multi-stage builds, pin base image versions, non-root user
.dockerignore for build context optimization
- Health checks for orchestrated deployments
Deployment
- Azure: OIDC via
azure/login@v2, deployment slots for zero-downtime
- Databricks: Asset Bundles for pipeline deployment
- Blue-green or canary for stateless services
- Database migrations: forward-only with backward compatibility
Release Management
- Semantic versioning:
MAJOR.MINOR.PATCH
- Changelog in Keep a Changelog format
- Release checklist: CI green, changelog updated, version bumped, security scan clean, staging tested, rollback documented, tag pushed
Infrastructure as Code
- Terraform: modules for reuse, remote state backend, environment variables
- Idempotent: running twice produces same result
For full templates and examples of all patterns above, load cicd-patterns-deep-dive.md.
Definition of Done
Constraints
- Does NOT write application business logic (pipelines and automation only)
- Does NOT manage secrets directly (provides vault integration patterns)
- Does NOT perform security audits (consult guardian)
- Does NOT design system architecture (consult architect)
Common Pitfalls
- Over-complex pipelines: start simple, add stages only when justified
- Missing rollback plan: every deployment needs one
- Secret leakage: never echo secrets in logs
- Flaky tests in CI: quarantine, don't ignore
- Manual steps in "automated" pipelines: if it requires human intervention, it's not automated
Integration Points
- guardian: Reviews CI/CD configurations for security and quality
- release-manager: Consumes pipeline outputs for release decisions
- architect: Provides infrastructure architecture and deployment topology
- data-engineering: Deploys data pipelines via Airflow/Databricks workflows
References
Load on demand for specific sub-tasks. If a referenced file is not available, generate a minimal inline template based on the Quick Reference patterns above and note that the full template should be added to the references directory.
- cicd-patterns-deep-dive.md - Full GitHub Actions templates (CI, reusable workflows, matrix, caching, PR automation), Docker patterns, deployment configs (Databricks, Azure), release management (semver, changelog, checklist), IaC (Terraform). Load when building or modifying pipelines.
- mechanical-enforcement.md - Pre-commit hooks, ruff rules, GitHub Actions enforcement workflows.
Scripts
1---2name: ops3description: CI/CD pipelines, GitHub Actions workflows, Docker configurations, deployment automation, and release management patterns. Use when building CI/CD, writing GitHub Actions, creating Docker configs, automating deployments, managing releases, or setting up infrastructure-as-code. DO NOT USE FOR: writing application-specific business logic (use implementer), designing high-level system architecture or topology (use architect), performing security audits (use guardian), or orchestrating data pipelines like Airflow DAGs (use data-engineering).4license: MIT5---67# Ops Skill - CI/CD, Deployment & Automation89> Version: 9.0 | Updated: 01-July-2026 | Architect: Karim Bhalwani | Tiered: core (~140 lines) + on-demand references1011Unified reference for operational automation. For copy-ready templates (GitHub Actions, Docker, Terraform, release checklists), load the deep-dive reference.1213## Core Principles1415- **Immutable artifacts**: every build produces a versioned, unchangeable artifact16- **Environment parity**: dev/staging/prod from same templates17- **Secrets in vaults**: never in code, config, or CI logs18- **Rollback before deploy**: document rollback plan BEFORE deployment1920## Mechanical Enforcement2122> When a behavioral rule fails twice in retrospectives, promote it to a mechanical check. Linters and CI are more reliable than prompt instructions.2324### Promote-to-Code Decision Rule25261. **Trigger**: behavioral rule caused rework 2+ times272. **Action**: write a mechanical check (pre-commit hook, lint rule, or CI job)283. **Record**: log in `.copilot/context/DECISIONS.md` as an ADR294. **Remove redundancy**: move the original prompt instruction verbatim into `.copilot/context/DECISIONS.md` under the relevant ADR entry, then delete it from the prompt.3031### Enforcement Layers3233| Layer | Catches | Speed | Scope |34| -------------------- | ---------------------------------------------------- | ------- | ---------- |35| **Pre-commit hooks** | Style, structure, obvious violations | Seconds | Per-commit |36| **CI workflow** | Cross-file issues, Bible freshness, doc staleness | Minutes | Per-PR |37| **Guardian review** | Design quality, logic correctness, architectural fit | Minutes | Per-PR |3839Load [mechanical-enforcement.md](./references/mechanical-enforcement.md) for copy-ready pre-commit, ruff, and CI config templates.4041## Quick Reference: Key Patterns4243### GitHub Actions4445- Standard CI: lint > test > security scan (parallel where possible)46- Reusable workflows via `workflow_call` for DRY deployment47- Matrix strategy for cross-version/cross-OS testing48- Cache pip/npm dependencies with `actions/cache@v4`4950### Docker5152- Multi-stage builds, pin base image versions, non-root user53- `.dockerignore` for build context optimization54- Health checks for orchestrated deployments5556### Deployment5758- Azure: OIDC via `azure/login@v2`, deployment slots for zero-downtime59- Databricks: Asset Bundles for pipeline deployment60- Blue-green or canary for stateless services61- Database migrations: forward-only with backward compatibility6263### Release Management6465- Semantic versioning: `MAJOR.MINOR.PATCH`66- Changelog in Keep a Changelog format67- Release checklist: CI green, changelog updated, version bumped, security scan clean, staging tested, rollback documented, tag pushed6869### Infrastructure as Code7071- Terraform: modules for reuse, remote state backend, environment variables72- Idempotent: running twice produces same result7374For full templates and examples of all patterns above, load [cicd-patterns-deep-dive.md](./references/cicd-patterns-deep-dive.md).7576## Definition of Done7778- [ ] CI pipeline runs green (lint, test, security scan)79- [ ] Docker image builds and runs with health check passing80- [ ] Rollback plan documented before deployment81- [ ] Secrets managed via vault/env vars (none in code)82- [ ] Release checklist completed83- [ ] Mechanical enforcement in place for P1 invariants8485## Constraints8687- Does NOT write application business logic (pipelines and automation only)88- Does NOT manage secrets directly (provides vault integration patterns)89- Does NOT perform security audits (consult guardian)90- Does NOT design system architecture (consult architect)9192## Common Pitfalls9394- Over-complex pipelines: start simple, add stages only when justified95- Missing rollback plan: every deployment needs one96- Secret leakage: never echo secrets in logs97- Flaky tests in CI: quarantine, don't ignore98- Manual steps in "automated" pipelines: if it requires human intervention, it's not automated99100## Integration Points101102- **guardian**: Reviews CI/CD configurations for security and quality103- **release-manager**: Consumes pipeline outputs for release decisions104- **architect**: Provides infrastructure architecture and deployment topology105- **data-engineering**: Deploys data pipelines via Airflow/Databricks workflows106107## References108109Load on demand for specific sub-tasks. If a referenced file is not available, generate a minimal inline template based on the Quick Reference patterns above and note that the full template should be added to the references directory.110111- [cicd-patterns-deep-dive.md](./references/cicd-patterns-deep-dive.md) - Full GitHub Actions templates (CI, reusable workflows, matrix, caching, PR automation), Docker patterns, deployment configs (Databricks, Azure), release management (semver, changelog, checklist), IaC (Terraform). **Load when building or modifying pipelines.**112- [mechanical-enforcement.md](./references/mechanical-enforcement.md) - Pre-commit hooks, ruff rules, GitHub Actions enforcement workflows.113114### Scripts115116- [check_pipeline_health.py](./scripts/check_pipeline_health.py) - CI/CD config validator (hard-coded secrets, unpinned images, deprecated runners, missing timeouts).117- [lint_agent_legible_errors.py](./scripts/lint_agent_legible_errors.py) - Linter enforcing agent-legible error messages with remediation hints.