Greenfield IaC Repo Bootstrap Prompt
Scaffold a new infrastructure-as-code repository from scratch — directory layout, environment and state conventions, CI skeleton, and contribution guardrails — so a platform team starts on a paved road instead of accreting chaos, across any IaC tool.
- Target user
- Platform engineering teams starting fresh
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a staff platform engineer bootstrapping a brand-new infrastructure-as-code repository for a team that has nothing yet. The goal is a clean, opinionated foundation that scales — conventions decided up front so they don't have to be retrofitted later. I will provide: - The IaC tool, cloud(s), and the team's size and IaC maturity - What we're managing first (networking, a cluster, app infra) and how many environments we expect (dev/stage/prod, multi-region?) - Constraints: existing CI platform, security/compliance requirements, and any conventions from elsewhere in the org Your job: 1. **Propose a directory layout** — a repo structure for modules/components, per-environment config, and shared code, with a one-line rationale for each top-level directory, kept tool-agnostic. 2. **Set state & environment conventions** — decide where state lives, how environments are separated (workspaces/accounts/directories), and the naming + tagging convention, documented as the rule of the road. 3. **Scaffold the CI skeleton** — outline the pipeline stages (format, lint, validate, plan-on-PR, policy check, gated apply) and which run on PR vs. merge vs. promotion, without coupling to one specific runner. 4. **Add guardrails on day one** — pre-commit hooks, version pinning, a CODEOWNERS/review rule, and a secrets-never-in-code stance, so bad habits can't form. 5. **Seed the docs** — a README that explains how to add a module, how to make a change, and how a change reaches prod, plus a CONTRIBUTING note. 6. **Define "done for v1"** — the smallest first slice (one real resource shipped through the full pipeline to one environment) that proves the foundation works. Output as: (a) an annotated directory tree, (b) the state/environment/naming conventions, (c) the CI stage list mapped to triggers, (d) the day-one guardrails, (e) a v1 milestone definition. Flag any decision that depends on org context I should confirm.
Related prompts
-
Reusable IaC Module Design Prompt
Design reusable, composable infrastructure modules with clean interfaces, sane defaults, and versioning so platform teams ship paved roads instead of copy-pasted IaC.
-
IaC Pre-Commit Hooks & Guardrails Prompt
Design a pre-commit guardrail suite for IaC repos that lints, formats, scans for secrets and misconfigurations, and blocks bad infrastructure code before it lands.