Skip to main content
New: Deck Doctor. Upload your deck, get CPO-level feedback. 7-day free trial.
TemplateFREE⏱️ 45-60 minutes

CI/CD Pipeline Specification Template

A structured template for defining CI/CD pipeline stages, build configurations, deployment strategies, and quality gates.

Last updated 2026-03-04
CI/CD Pipeline Specification Template preview

CI/CD Pipeline Specification Template

Free CI/CD Pipeline Specification Template — open and start using immediately

or use email

Instant access. No spam.

Get Template Pro — all templates, no gates, premium files

888+ templates without email gates, plus 30 premium Excel spreadsheets with formulas and professional slide decks. One payment, lifetime access.

Need a custom version?

Forge AI generates PM documents customized to your product, team, and goals. Get a draft in seconds, then refine with AI chat.

Generate with Forge AI

What This Template Is For

A CI/CD pipeline is the assembly line between a code commit and a production deployment. When it works well, engineers merge code and it reaches users within minutes, with automated tests catching problems before they ship. When it is poorly defined, deployments are manual, test coverage is inconsistent, and "it works on my machine" is a weekly conversation.

This template documents the full pipeline specification: what happens at each stage, what quality gates must pass, how artifacts are managed, and how code progresses from development to production. It is not a tutorial on setting up Jenkins or GitHub Actions. It is the specification that tells your team exactly what the pipeline should do, regardless of which tool runs it.

Use this template when setting up a pipeline for a new service, migrating from a manual deployment process, or standardizing pipelines across multiple teams. For the broader context of how deployment processes fit into technical product management, see the Technical PM Handbook. If your team is evaluating build-vs-buy for CI/CD tooling, the PM Tool Picker can help compare options.


How to Use This Template

  1. Map your current deployment process from commit to production. Document every manual step, even if it seems obvious.
  2. Define the pipeline stages in order: source, build, test, artifact, deploy. Each stage should have clear inputs, outputs, and pass/fail criteria.
  3. Set quality gates between stages. A quality gate is a set of conditions that must be met before code advances to the next stage.
  4. Document environment promotion rules: how code moves from dev to staging to production, and who approves each transition.
  5. Define rollback procedures for each environment.
  6. Review with the engineering team to identify gaps, then implement stage by stage.

The Template

Pipeline Overview

FieldDetails
Service/Application[Name]
Repository[URL]
CI/CD Tool[GitHub Actions / GitLab CI / Jenkins / CircleCI / etc.]
Owner[Team or individual]
Date[Date]
Pipeline Trigger[Push to main / PR merge / Tag / Manual]

Source Control Configuration

SettingValue
Default Branch[main / master]
Branch Protection[Required approvals, status checks]
Merge Strategy[Squash / Merge commit / Rebase]
Branch Naming[Convention: feature/, bugfix/, hotfix/]

Branch rules.

  • All changes go through pull requests (no direct pushes to default branch)
  • Minimum [N] approving reviews required
  • All CI checks must pass before merge
  • Branch must be up to date with default branch before merge
  • Force pushes disabled on protected branches

Pipeline Stages

Stage 1: Build

SettingValue
Trigger[On PR open / On push to default branch]
Runtime[Node 20 / Python 3.12 / Go 1.22 / etc.]
StepsInstall dependencies, compile, lint
Timeout[e.g., 10 minutes]
Caching[node_modules, .next/cache, pip cache]

Stage 2: Test

SettingValue
Trigger[After build succeeds]
Test Types[Unit, Integration, E2E]
Coverage Threshold[e.g., 80% lines, 70% branches]
Timeout[e.g., 15 minutes]
Parallelization[Yes/No, number of shards]

Stage 3: Security Scan

SettingValue
Trigger[After tests pass]
Scans[Dependency audit, SAST, secret detection]
Blocking Severity[Critical and High block merge / Medium as warning]
Tool[Snyk / Dependabot / Trivy / etc.]

Stage 4: Build Artifact

SettingValue
Trigger[After all checks pass on default branch]
Artifact Type[Docker image / Static bundle / Serverless package]
Registry[ECR / GCR / Docker Hub / S3]
Tagging[Git SHA, semver, latest]
Retention[e.g., 30 days for non-production, indefinite for production]

Stage 5: Deploy

SettingValue
Strategy[Rolling / Blue-green / Canary / Recreate]
Environments[Dev → Staging → Production]
Approval Required[None for dev, manual for production / auto for all]
Health Check[Endpoint, expected response, timeout]
Rollback Trigger[Health check failure / error rate spike / manual]

Quality Gates

GateStageCriteriaBlocking?
LintBuildZero errors (warnings allowed)Yes
Type checkBuildZero type errorsYes
Unit testsTest100% pass rateYes
CoverageTest> [threshold]% line coverageYes
Integration testsTest100% pass rateYes
Security scanSecurityNo critical/high vulnerabilitiesYes
Build sizeArtifactBundle < [size] MBNo (warning)
Smoke testsDeployCritical paths pass in target environmentYes

Environment Configuration

EnvironmentURLDeployment TriggerApprovalData
Development[URL]Push to feature branchNoneSynthetic / seeded
Staging[URL]Merge to default branchNoneProduction mirror (anonymized)
Production[URL][Manual approval / Auto after staging][Approver]Live

Rollback Procedures

  • Automated rollback on health check failure (deploy stage)
  • Manual rollback via [tool/command: e.g., kubectl rollout undo]
  • Database migration rollback strategy documented
  • Feature flag kill switch for new functionality
  • Previous artifact retained for instant rollback ([retention period])

Secrets and Configuration

Secret/ConfigStorageAccessRotation
API keys[Vault / AWS Secrets Manager / GitHub Secrets][Pipeline only / Runtime][Quarterly / Annual]
Database credentials[Vault / SSM Parameter Store][Runtime only][Quarterly]
Signing keys[KMS / Vault][Pipeline only][Annual]
Feature flags[LaunchDarkly / environment variables][Runtime]N/A

Filled Example: Next.js SaaS Application

Pipeline Overview

FieldDetails
ServiceAcme Dashboard (Next.js 14)
Repositorygithub.com/acme/dashboard
CI/CD ToolGitHub Actions
OwnerPlatform Team
Pipeline TriggerPush to main (deploy), PR open (checks)

Pipeline Stages

StageStepsDurationQuality Gate
Buildnpm ci, npm run lint, npm run type-check, npm run build~3 minZero lint errors, zero type errors
Testnpm run test (Vitest), npm run test:e2e (Playwright)~5 min100% pass, >85% coverage
Securitynpm audit --audit-level=high, Snyk container scan~2 minNo critical/high CVEs
ArtifactBuild Docker image, push to ECR with git SHA tag~2 minImage builds, health check passes
Deploy (staging)Deploy to ECS staging, run smoke tests~4 minAll smoke tests pass
Deploy (production)Deploy to ECS production (rolling, 25% at a time)~8 minError rate < 0.5%, P99 < 2s

Total pipeline duration: ~24 minutes (commit to production)

Environment Configuration

EnvironmentURLTriggerApproval
Previewpr-{number}.preview.acme.comPR openNone
Stagingstaging.acme.comMerge to mainNone
Productionapp.acme.comStaging smoke tests passAuto (manual override available)

Rollback

TriggerActionDuration
Health check fails (3 consecutive)Automatic ECS rollback to previous task definition~2 min
Error rate > 2% for 5 min post-deployAutomated rollback via CloudWatch alarm + Lambda~3 min
Manual (engineer decision)aws ecs update-service --force-new-deployment with previous image tag~5 min

Key Takeaways

  • Define quality gates between every pipeline stage with specific pass/fail criteria
  • Target under 15 minutes from push to production deployment readiness
  • Automate rollback with health checks and error rate monitoring
  • Cache dependencies and parallelize tests to keep pipeline duration low
  • Separate database migrations from application deployments for safer rollbacks

About This Template

Created by: Tim Adair

Last Updated: 3/4/2026

Version: 1.0.0

License: Free for personal and commercial use

Frequently Asked Questions

How long should a CI/CD pipeline take?+
Target under 15 minutes for the full cycle from push to production deployment readiness. Under 10 minutes is excellent. Over 30 minutes and developers will start batching changes, which defeats the purpose of continuous integration. Optimize by parallelizing test suites, caching dependencies, and using incremental builds. Track pipeline duration as a [team metric](/glossary/prioritization) and set alerts when it exceeds your target.
Should we auto-deploy to production or require manual approval?+
Auto-deploy if your test coverage is high, your monitoring catches issues quickly, and you have automated rollback. Manual approval if you are in a regulated industry, your test suite has known gaps, or deployments require coordination across teams. Many teams use a hybrid: auto-deploy for low-risk changes (behind feature flags) and manual approval for database migrations or breaking API changes.
How do we handle database migrations in the pipeline?+
Run migrations as a separate, ordered step before the application deployment. Migrations should be backward-compatible (the old code should work with the new schema) so you can roll back the application without rolling back the migration. Use the [database migration template](/templates/database-migration-template) for planning schema changes.
What is the right test coverage threshold?+
80% line coverage is a reasonable starting point for most teams. Below 70% and you are likely shipping untested code paths. Above 95% and you are probably writing tests that do not add value (testing getters and setters). Focus coverage requirements on critical paths (authentication, payments, data mutations) rather than hitting a blanket number.
How do we manage secrets in the pipeline?+
Never store secrets in code, environment files, or pipeline configuration files. Use a dedicated secrets manager (AWS Secrets Manager, HashiCorp Vault, GitHub Secrets for CI). Rotate secrets quarterly. Audit secret access logs monthly. The [Technical PM Handbook](/technical-pm-guide) covers security practices for technical PMs. ---

Explore More Templates

Browse our full library of PM templates, or generate a custom version with AI.

Free PDF

Like This Template?

Subscribe to get new templates, frameworks, and PM strategies delivered to your inbox.

or use email

Join 10,000+ product leaders. Instant PDF download.

Want full SaaS idea playbooks with market research?

Explore Ideas Pro →