Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Infrastructure-as-Code from the first commit — every new project must be rebuildable from git clone + one command, with declarative state in code and idempotent execution. Use when scaffolding new projects, bootstrapping infrastructure, choosing IaC tools (Ansible/Terraform/SST/Fastlane), or setting up infra/, scripts/, or deployment automation.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 42% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 241% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 175% | 0% |
Core principle: Every new project, from its first commit, must be fully rebuildable from zero using only git clone + a single, documented bootstrap command. All infrastructure state is declarative, version-controlled, and reproducible without tribal knowledge or manual steps.
"If another person or an AI agent needed to rebuild this project from zero right now, would git clone <repo> && ./bootstrap.sh be sufficient? Or are there undocumented, manual steps?"
If the answer is "there are manual steps," the project lacks proper IaC coverage.
Use the IaC tool native to your infrastructure platform. There is no one-size-fits-all tool — the platform dictates the choice:
| Context | Native IaC Tool | Example | |---|---|---| | VPS / Linux server | Ansible (configuration) + Terraform (if cloud provisioning) | ansible-playbook site.yml | | Frontend SaaS (Next.js, Vite, etc.) | Platform config-as-code + GitHub Actions | Vercel/Netlify/Cloudflare Pages deployment config | | Serverless APIs (AWS Lambda, Cloudflare Workers) | SST / SAM / CDK / Wrangler | sst deploy or wrangler deploy | | Mobile (iOS, Android, Expo) | Fastlane + EAS/Code Push config | fastlane build + eas build | | Kubernetes | ArgoCD / Flux + Helm charts | GitOps with declarative manifests in git | | ML / data pipelines | DVC + MLflow + Airflow DAGs | Reproducible training/inference pipelines | | Browser extension / desktop app | Build manifest + bundler config + CI/CD | GitHub Actions release workflow | | Static docs / sites | GitHub Actions + hosting provider config | Build → upload → serve, automated |
Key principle: Choose based on the infrastructure platform, not on what the team prefers. The tool should map 1:1 to the target platform's native declarative model.
Adapt this template to your context, but all elements should exist by first commit:
project-root/
├── infra/ # Declarative infrastructure code
│ ├── main.tf # (Terraform) or
│ ├── site.yml # (Ansible) or
│ ├── sst.config.ts # (SST) or equivalent
│ └── secrets.sops.yaml # encrypted secrets (NEVER plaintext)
├── .github/workflows/ # CI/CD pipelines
│ ├── deploy.yml
│ └── test.yml
├── scripts/
│ └── bootstrap.sh # Single command to rebuild from zero
├── docs/
│ ├── architecture.md # System design, deployment diagram, key decisions
│ ├── decisions.md # Architecture Decision Records (ADRs)
│ └── runbooks/ # Operations: "how to X" (restart service, add user, etc.)
│ ├── deploy.md
│ ├── troubleshoot.md
│ └── backup-restore.md
├── README.md # Top section: "How to bootstrap from zero"
├── CHANGELOG.md # Version history and deployed changes
└── [project files]Your scripts/bootstrap.sh (or equivalent for your language/OS) should be the only documentation users need to get from zero to running.
Requirements:
mkdir -p not mkdir)set -e in bash)Example structure:
bash#!/bin/bash set -e echo "Bootstrap: project-name" # 1. Check prerequisites if ! command -v docker &> /dev/null; then echo "ERROR: docker not found. Install Docker and try again." exit 1 fi # 2. Fetch dependencies go mod download npm ci # 3. Set up infrastructure terraform -chdir=infra/ init terraform -chdir=infra/ apply -auto-approve # 4. Configure database ./scripts/migrate-db.sh # 5. Load secrets from vault (not committed) source <(sops -d secrets.sops.yaml | envsubst) # 6. Start services docker-compose up -d echo "✓ Bootstrap complete. Services running at http://localhost:8080"
.env.example.source <(vault kv get --json secret/data | envsubst).npm install or pip install without pinning versions in lockfiles..env files committed to git.Web application (Next.js → Vercel):
infra/: Vercel project config (environment variables, domains, build settings) as infrastructure-as-code.scripts/bootstrap.sh: Clone repo, npm ci, deploy via Vercel CLI or GitHub Actions.docs/deployment.md: How to promote from staging to production.Backend service (Go API → Kubernetes):
infra/: Helm chart, kustomize overlays, or plain YAML manifests; stored in git.scripts/bootstrap.sh: Install kubectl/Helm, apply manifests, wait for rollout, run migrations.docs/runbooks/scale.md: How to add replicas, upgrade image, perform canary deployments.Microservices (Docker Compose):
docker-compose.yml: All services, networks, volumes defined..env.example: Template for environment variables (never include secrets).scripts/bootstrap.sh: Build images, run migrations, start containers.docs/local-development.md: How to develop and test locally.Terraform-managed cloud infrastructure:
infra/terraform/: Organized by environment (dev/, staging/, prod/).scripts/bootstrap.sh: terraform init → terraform plan → terraform apply.docs/decisions.md: Why this VPC design, why this RDS tier, etc..tfstate in a remote backend (S3, Terraform Cloud), never commit locally.This principle applies to all new projects, regardless of team size, project scope, or platform. An AI agent scaffolding a project should include this structure from the first commit, not retrofit it later.
When to invoke this skill:
Other measured skills in the registry, with their headline benchmark lift.