Design a new CI/CD pipeline from scratch. Use when the user wants to create a CI/CD pipeline, set up continuous integration, build a deployment workflow, or configure CI for a new project. Covers platform selection, pipeline architecture (DAG design, merge gates, artifact strategy), security hardening, deployment path, self-hosted runner topology, and observability. Triggers on "design a pipeline", "set up CI", "create CI/CD", "build a workflow", "configure GitHub Actions", "set up GitLab CI", "create Jenkinsfile", "new pipeline for", "CI for my project". Produces complete, runnable configuration files with architecture rationale.
Dispatches the cicd-expert agent with a design-workflow briefing.
Before dispatching, resolve:
If the user provided these, proceed. If not, ask the 1-2 most critical missing questions.
Read existing project files (package.json, Dockerfile, tsconfig.json, language markers) to infer what you can.
Agent({
description: "Design CI/CD pipeline",
subagent_type: "cicd-expert:cicd-expert",
model: "opus",
prompt: "<see briefing below>"
})
ORIGINAL USER REQUEST: <verbatim>
WORKFLOW: design
CONTEXT:
- Platform: <resolved>
- Repo topology: <resolved>
- Team shape: <small-product / monorepo / high-compliance>
- Runner preference: <hosted / self-hosted / hybrid>
- Deployment target: <resolved>
- Compliance needs: <resolved>
- Working directory: <absolute path>
DELIVERABLES:
1. Architecture summary:
- Pipeline DAG diagram (text)
- Control plane, execution plane, deployment plane
- Merge gate strategy
- Artifact promotion path
2. Complete configuration files:
- All workflow/pipeline YAML files
- Branch protection / ruleset recommendations
- Environment definitions with approval rules
- Secret scoping recommendations
3. Security baseline:
- Permissions blocks (least privilege)
- Action pinning strategy
- OIDC configuration (if applicable)
- Supply chain controls (Dependabot, Scorecard)
4. Optimization built-in:
- Path filtering for affected-only execution
- Concurrency controls for duplicate cancellation
- Cache strategy (keys, paths, expected hit rate)
- Job parallelism vs serialization rationale
5. Observability hooks:
- What to measure (queue time, execution time, flaky rate)
- Where to start with DORA metrics
6. Maturity roadmap:
- What to add later vs what to ship now
- Progressive delivery readiness
TEMPLATE SELECTION:
Use the reference templates from review-checklist.md as the starting baseline:
- Small product team: blocking PR checks + stable merge gate + environment approvals
- Monorepo team: graph-aware affected-only + stable gatekeeper + remote caching
- High-compliance team: strict permissions + pinning + immutable artifacts + provenance + rollout analysis
Proceed with your standard workflow (reference files first, then codebase inspection, then produce the design).
Present the architecture summary + key files. Offer to write the configuration files to the project directory.