Prompt
I'm building a platform team and need standardized CI templates across multiple repos; what pattern makes sense?
Latest observation
A good default pattern is a “shared CI template + repo-level override” model.
Recommended pattern
1) Keep one central CI template repo
Store standardized pipeline logic in a dedicated repo, for example:
- build/test/deploy stages
- linting and security scans
- artifact publishing
- common variables and conventions
Each application repo then references that template rather than reimplementing CI logic.
2) Let each repo stay thin
In each service repo, keep only:
- repo-specific variables
- service-specific jobs or exceptions
- environment-specific deploy config if needed
This keeps repos consistent while allowing local flexibility.
3) Version the templates
Use version tags/releases for the shared templates:
v1.0.0v1.1.0
That gives teams stability and avoids breaking everyone when templates change.
4) Support overrides, not forks
Design the template so teams can:
- override specific jobs
- add extra steps
- disable a stage if needed
Avoid copying the template into every repo, since that creates drift.
Common implementation styles
Depending on your CI system, this is usually done with one of these patterns:
- GitHub Actions: reusable workflows + composite actions
- GitLab CI: remote
includetemplates - Azure DevOps: YAML templates
- Jenkins: shared library
- CircleCI: orb / reusable commands
- Argo / Tekton: reusable pipeline templates
What usually works best organizationally
Platform team owns:
- the template repo
- standard jobs and policy
- release/versioning of templates
- documentation and examples
- deprecation process
App teams own:
- their repo config
- environment-specific settings
- product-specific build/test/deploy logic where necessary
Key design principles
- Convention over customization
- Small surface area for overrides
- Backward compatibility
- Version pinning
- Clear upgrade path
- Central observability if you want consistent reporting
Practical example structure
ci-templates/
build.yml
test.yml
security.yml
deploy.yml
README.md
Each repo:
include:
- project: platform/ci-templates
ref: v1.2.0
file: /build.yml
- project: platform/ci-templates
ref: v1.2.0
file: /test.yml
Then the repo adds only what’s unique.
Bottom line
The pattern that usually makes the most sense is:
Centralized, versioned CI templates with minimal per-repo overrides.
It gives you:
- consistency
- easier maintenance
- faster onboarding
- safer changes
- less duplicated CI code
If you want, I can also suggest the best pattern for your specific CI system (GitHub Actions, GitLab, Jenkins, Azure DevOps, etc.).