skills/mav-bp-infrastructure-as-code/SKILL.md
Infrastructure as Code conventions for all deployed projects. Covers IaC principles, environment parity, secrets management in IaC, version control, and runbook fallback for unsupported platforms. Applied when reviewing or configuring infrastructure.
npx skillsauth add thermiteau/maverick mav-bp-infrastructure-as-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ensure all infrastructure is defined, versioned, and reproducible from code. Manual provisioning is a last resort, and when unavoidable it must be documented in a runbook.
Before applying these standards, load the project-specific infrastructure-as-code implementation:
digraph lookup {
"docs/maverick/skills/infrastructure-as-code/SKILL.md exists?" [shape=diamond];
"Read and use alongside these standards" [shape=box];
"Invoke upskill" [shape=box];
"Read generated skill" [shape=box];
"docs/maverick/skills/infrastructure-as-code/SKILL.md exists?" -> "Read and use alongside these standards" [label="yes"];
"docs/maverick/skills/infrastructure-as-code/SKILL.md exists?" -> "Invoke upskill" [label="no"];
"Invoke upskill" -> "Read generated skill";
"Read generated skill" -> "Read and use alongside these standards";
}
docs/maverick/skills/infrastructure-as-code/SKILL.mddo-upskill skill with:
resource\s|module\s|provider\s|stack|template|playbook|Chart\.yaml**/*.tf, **/*.tfvars, **/cdk.json, **/template.yaml, **/cloudformation*.*, **/ansible*.*, **/helm/**, **/pulumi*.*Infrastructure as Code tools fall into three broad categories. The choice depends on what layer of the stack you are managing:
| Category | Purpose | Examples | | ------------------------- | ---------------------------------------------- | ------------------------------------------------ | | Provisioning | Create and manage cloud resources | Terraform, Pulumi, AWS CDK, CloudFormation, Bicep | | Configuration management | Configure software on existing machines | Ansible, Chef, Puppet, Salt | | Container orchestration | Define and deploy containerised workloads | Kubernetes manifests, Helm charts, Kustomize, Docker Compose |
All environments must be generated from the same templates. Differences between environments are expressed as parameters, not as separate template copies.
| Principle | Correct approach | Anti-pattern |
| ---------------------------- | ------------------------------------------------- | ----------------------------------------- |
| Same templates | One set of definitions, parameterised per env | Separate prod.tf and staging.tf files |
| Environment-specific values | Variable files, parameter stores, or env configs | Hard-coded values in resource definitions |
| Drift detection | Regular plan/diff runs to detect manual changes | Assuming deployed state matches code |
| Promotion flow | Deploy to dev first, then staging, then prod | Deploying directly to production |
IaC tools that maintain state (e.g., Terraform state files, Pulumi state) require careful handling:
Credentials, API keys, certificates, and other secrets must never appear in IaC definitions or variable files:
| Do | Do not |
| -------------------------------------------------- | --------------------------------------------------- |
| Reference secrets from a secret manager or vault | Hard-code secrets in .tf, .yaml, or .json files |
| Use dynamic secret injection at deploy time | Commit .tfvars or parameter files containing secrets |
| Mark secret outputs as sensitive in the IaC tool | Print secrets in plan/apply output |
| Rotate secrets independently of infrastructure | Tie secret rotation to infrastructure redeployment |
Infrastructure changes must follow a plan-review-apply workflow:
digraph pipeline {
rankdir=LR;
"Validate" [shape=box];
"Plan" [shape=box];
"Review" [shape=box style=filled fillcolor="#fff3cc"];
"Apply" [shape=box style=filled fillcolor="#ffcccc"];
"Validate" -> "Plan" -> "Review" -> "Apply";
}
| Stage | Purpose | Automation level | | ------------ | ---------------------------------------------------------- | ----------------------- | | Validate | Syntax checking, linting, security scanning of IaC files | Fully automated | | Plan | Generate an execution plan showing what will change | Fully automated | | Review | Human reviews the plan output, especially for destructive changes | Human required | | Apply | Execute the plan to create/modify/destroy resources | Automated after approval |
When IaC is not possible -- because the platform does not support it, the tool lacks a provider, or the operation is a one-time manual step -- document all manual steps in a runbook.
| Section | Contents | | ---------------- | ------------------------------------------------------------------------ | | Title | Clear name for the procedure | | Prerequisites | Required access, tools, permissions, and environment context | | Steps | Numbered, explicit instructions. Include screenshots or URLs where helpful. Each step must be independently verifiable. | | Verification | How to confirm each step succeeded and the overall procedure is complete | | Rollback | How to undo the changes if something goes wrong | | Owner | Who maintains this runbook and when it was last reviewed | | Automation goal | Whether and when this procedure should be replaced by IaC |
docs/runbooks/ or infra/runbooks/)| Pattern | Issue | Fix | | ---------------------------------------------- | ------------------------------ | ---------------------------------------------------- | | Hard-coded secret in IaC file | Secret exposure | Move to secret manager, reference dynamically | | Copy-pasted templates per environment | Environment drift risk | Parameterise a single template | | State file committed to repository | State corruption risk | Move to remote backend with locking | | No plan step in CI pipeline | Blind apply | Add plan stage, require review before apply | | Manual infrastructure change with no runbook | Undocumented, unreproducible | Write a runbook or convert to IaC | | Resources with no tags or labels | Untrackable resources | Add standard tags (service, environment, owner, SHA) | | Destructive changes auto-applied | Accidental data loss | Require human approval for destroy/replace actions | | Mixed IaC tools for the same resource layer | Conflicting state management | Standardise on one tool per layer |
<!-- maverick-plugin-version: 3.3.5 -->development
--- name: do-test description: Write or update tests for a code change. Operates in two modes: `unit` (module-scoped, fast, deterministic) and `integration` (crosses module / service / database boundaries). Intended to be invoked once per testable change from inside a do-issue-* or do-epic phase. Mode is required. argument-hint: mode: unit or integration user-invocable: true disable-model-invocation: false --- **Depends on:** mav-bp-unit-testing, mav-bp-integration-testing, mav-local-verificati
development
Implement a focused code change. Use this skill as the wrapper for any implementation work so the Maverick workflow report captures what was done and so the agent applies the project's coding standards before editing. Intended to be invoked once per task from inside a do-issue-* or do-epic phase, not standalone.
testing
How to stack a PR on top of an unmerged sibling branch, and how to retarget it to the repo's default branch once the sibling merges. Prevents orphan-merge incidents when a dependent story is ready before its parent.
development
Claim, lease, heartbeat, and release protocols for when multiple Claude Code instances may act on the same issue or epic concurrently. GitHub labels and marker comments are the coordination surface; local state is a cache.