Golden paths are how a platform team scales opinion: a new service should arrive with CI, observability, security scanning, and deploy config already correct.
Tier: Core · Hands-on time: ~60 minutes
Writing those templates is high-leverage and mind-numbing — templating syntax inside YAML inside cookiecutter variables — which makes it ideal AI work with one non-negotiable gate: a template is only done when a freshly scaffolded service builds, deploys, and emits telemetry without human touch-ups. Bonus: well-built golden paths are also what keep AI coding assistants inside your standards, because generated services start compliant instead of improvised.
Skip AI for a template you will instantiate twice — copy a good service and move on.
Extract the opinions before templating. Have the assistant read the reference service and produce the "standards inventory": every convention it embodies (port conventions, health endpoints, label schema, pipeline stages, scan gates, dashboard links). Review and prune — this list, not the code, is what the template must guarantee. Disagreements surface now, cheaply.
Generate the template from reference + inventory.
Convert the attached reference service into a [cookiecutter/Backstage]
template. Parameterize ONLY: service name, team, port, repo URL, and
[your short list]. Everything in the standards inventory stays fixed —
do not make standards configurable. Preserve working CI and deploy
config with variables substituted. Generate the template metadata
(template.yaml / cookiecutter.json) and a post-scaffold checklist of
anything that cannot be templated (secrets, DNS, ownership registration).
The "parameterize ONLY" rule is the heart of it: every unnecessary knob is a future support ticket and a standards escape hatch.
Run the scaffold-and-deploy smoke test. Instantiate the template with test values; the scaffolded service must: build in CI, pass its own scan gates, deploy to the sandbox, answer its health endpoint, and show traces/metrics in the sandbox stack. Fix the template — never the scaffolded output — until this passes clean. Automate this as the template's own CI so every template change re-proves it.
Red-team the parameters. Feed hostile values (service name with hyphens/uppercase/50 chars, port collisions) and confirm sane validation or sane failure. AI drafts the validation rules (regex in template metadata) from the failures you find.
Write the docs the moment it works. Assistant drafts the template README (what you get, what the parameters mean, the post-scaffold checklist, who owns the template) plus the Backstage TechDocs page. Docs generated while the smoke test is green describe reality.
Version and measure. Templates are products: semver them, changelog them, and track instantiations and post-scaffold modification rate (how much do teams change immediately after scaffolding — the best signal a standard is wrong or a knob is missing). AI summarizes the diff patterns across scaffolded repos quarterly to propose template updates.
The template is correct when the smoke test says so — "the YAML looks right" is not a completion state for golden paths, and AI makes producing plausible-looking-but-broken templates effortless.
template.yaml steps and skeleton content; test via a local Backstage instance or the scaffolder dry-run before publishing to the catalog.init/validate/plan plus a Checkov pass on the scaffolded module.up/deploy into the sandbox account.Add your AI-usage guardrails to the template itself — assistant-instructions file, pre-commit secret scan, PR-review config — so every new service is born with the team's AI working agreements installed.