Writing

Pipeline templates are a product

Shared CI templates succeed or fail on versioning, documentation and migration paths, not on the YAML itself.

CI/CD, Platform engineering

Shared CI templates look like a configuration problem. In practice they behave like a product with internal customers, and they succeed or fail for product reasons.

Version them

If every project includes the template from the main branch, a single change can break every pipeline at once. Versioned templates let teams pin, test a new version on one project, and roll forward deliberately.

Document the inputs

A template is an interface. Its variables, defaults and extension points should be documented as carefully as an API, because teams will depend on them in ways you did not plan for.

Offer a migration path

Nobody migrates a working pipeline for the sake of consistency. Make the first step small (adopt one stage) and make the benefit visible (security scanning you no longer maintain yourself).

Leave room for exceptions, with an owner

Some projects genuinely need something different. A documented exception with a named owner is healthier than a template full of conditionals trying to cover every case.