agentleFS
jonathan-vellajonathan-vella/bmit-2026/.github/skills/iac-common/SKILL.md

iac-common

Skill3 starsChanged 8 months agoMITArchived repositoryView on GitHub

Shared IaC deploy patterns for Bicep and Terraform deploy agents: deployment strategies, circuit breaker, known deploy issues. For preflight validation (auth, governance, stop rules), see azure-validate. USE FOR: Phased deployment, circuit breaker, deploy-specific known issues. DO NOT USE FOR: Preflight validation (use azure-validate), code generation (use azure-bicep-patterns or terraform-patterns).

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use azd when the project has an azure.yaml manifest.

    line 20
  2. Very specific:

    Before azd provision --no-prompt, verify these environment values are set:

    line 56
  3. Very specific:

    Run azd env get-values and check for missing values.

    line 63
  4. Distinctive:

    Escalation protocol: write to session state, notify user, wait for guidance

    line 122

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

IaC Common Skill

Shared deployment patterns used by both Bicep and Terraform deploy agents (07b, 07t) and review subagents.

Preflight validation (CLI auth, governance mapping, stop rules, known issues) has moved to the azure-validate skill. See azure-validate/references/infraops-preflight.md.


Deployment Strategies

azd Deployment (recommended for projects with azure.yaml)

Use azd when the project has an azure.yaml manifest. Each project is a self-contained azd project with azure.yaml and .azure/ inside infra/{iac}/{project}/.

# Navigate to the project directory (azure.yaml must be here)
cd infra/{iac}/{project}

# Or use -C flag from repo root
azd -C infra/{iac}/{project} env list

# Create/select environment (use {project}-{env} naming to avoid collisions)
azd env new {project}-{env}
azd env set AZURE_LOCATION swedencentral

# Preview changes (replaces what-if)
azd provision --preview

# Deploy infrastructure
azd provision

# Full provision + deploy in one step
azd up

azd hooks replace custom deploy.ps1 pre/post steps:

  • preprovision — auth validation, banner, prerequisite checks
  • postprovision — resource verification, diagnostic setup

Environment management replaces manual parameterization:

  • azd env new prod / azd env new dev
  • azd env set AZURE_LOCATION swedencentral

azd Environment Preflight (MANDATORY for --no-prompt Deploys)

Before azd provision --no-prompt, verify these environment values are set:

  • AZURE_SUBSCRIPTION_ID — from az account show --query id -o tsv
  • AZURE_RESOURCE_GROUP — target resource group name
  • AZURE_ENV_NAME — environment name
  • AZURE_LOCATION — target region

Run azd env get-values and check for missing values. If any are empty, set them via azd env set {KEY} {VALUE} before attempting --no-prompt.

Phased Deployment via deploy.ps1 (legacy, backward-compatible)

PhaseResourcesGate
FoundationResource group, networking, Key VaultUser approval
SecurityIdentity, RBAC, certificatesUser approval
DataStorage, databases, messagingUser approval
ComputeApp Service, Functions, containersUser approval
EdgeCDN, Front Door, DNSUser approval
  • Bicep: Pass -Phase {name} to deploy.ps1
  • Terraform: Pass -var deployment_phase={name} to plan/apply

Single Deployment (only for <5 resources, dev/test)

Deploy everything in one operation. Still requires user approval.

Decision: azd vs deploy.ps1

Full guide: azd-vs-deploy-guide.md — comparison, per-project conventions, workflow, hooks, troubleshooting.

Factorazddeploy.ps1
Cross-platformYesPowerShell only
Environment managementBuilt-in (azd env)Manual parameters
Hooks (pre/post)azure.yaml hooksCustom script logic
Phased deploymentSingle provisionFine-grained phases
New projectsUse azdNot generated
Existing projectsUse azd if azure.yaml existsFallback if no azure.yaml
Project isolationPer-project: infra/{iac}/{project}/azure.yaml + .azure/Per-project: infra/{iac}/{project}/deploy.ps1
Env naming{project}-{env} (e.g., hub-spoke-dev)Manual parameter per invocation

Reference Index

ReferenceLocation
azd vs deploy.ps1 guidereferences/azd-vs-deploy-guide.md
Preflight validationazure-validate/references/infraops-preflight.md
CLI auth validation procedureazure-defaults/references/azure-cli-auth-validation.md
Policy effect decision treeazure-defaults/references/policy-effect-decision-tree.md
IaC policy compliance.github/instructions/iac-bicep-best-practices.instructions.md / .github/instructions/iac-terraform-best-practices.instructions.md
Bootstrap backend templatesterraform-patterns/references/bootstrap-backend-template.md
Deploy script templatesterraform-patterns/references/deploy-script-template.md
Circuit breakerreferences/circuit-breaker.md

Circuit Breaker

Deploy agents MUST read references/circuit-breaker.md before starting any deployment. It defines:

  • Failure taxonomy: 6 categories (build, validation, deployment, empty, timeout, auth)
  • Anomaly patterns: detection thresholds for repetitive failures
  • Stopping rule: 3 consecutive same-type failures → halt + escalate
  • Escalation protocol: write to session state, notify user, wait for guidance

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.