agentleFS
Microsoft AzureKnown publisherAzure/terraform-azurerm-avm-res-logic-workflow/.github/copilot-instructions.md

terraform-azurerm-avm-res-logic-workflow

Copilot instructions3 starsChanged 13 days agoMITView on GitHub

Instructions for developing and maintaining Azure Verified Modules for Terraform.

227 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

15 rules. About 0 are common, 11 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use the AVM Terraform agent for specification-driven module development.

    line 17
  2. Distinctive:

    After reading these instructions and the relevant skills, but before modifying files, output this block visibly to the user:

    line 23
  3. Distinctive:

    Before reviewing or generating Terraform:

    line 36
  4. Distinctive:

    Read the complete skill matching the task.

    line 40
  5. Distinctive:

    Do not cite a specification from memory or treat an older module as authoritative.

    line 43
  6. Very specific:

    Do not hand-edit generated README.md files.

    line 53
  7. Very specific:

    Use PowerShell 7.4 or later with Avm.Authoring from Microsoft Artifact Registry (MAR).

    line 57
  8. Distinctive:

    Use the current AVM indexes to confirm module availability, classification, naming, and ownership:

    line 107
  9. Distinctive:

    Keep reusable modules free of provider configuration blocks.

    line 117
  10. Distinctive:

    Use PowerShell for supported hooks and scripts.

    line 118
  11. Distinctive:

    Add or update the smallest relevant unit, integration, or E2E coverage.

    line 119
  12. Very specific:

    Run avm pre-commit and review generated changes.

    line 120
  13. Very specific:

    Commit the complete worktree before running avm pr-check.

    line 121
  14. Distinctive:

    Treat TFLint and Conftest exceptions as reviewed deviations, not shortcuts around a failing check.

    line 122
  15. Distinctive:

    When a task falls within a skill's domain, read and follow the full skill before proceeding.

    line 126

≈ “Common” is an estimate: at least 1 in 5 of the 3,950 Copilot instructions 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
copilot-instructions.md

Azure Verified Modules (AVM) - Terraform Instructions

Overview

This repository contains an Azure Verified Module for Terraform. AVM modules are reusable, tested Azure infrastructure modules that follow the published AVM specifications.

AVM has three module classifications:

  • Resource modules - one primary Azure resource and its child or extension resources.
  • Pattern modules - opinionated multi-resource solutions composed from resource modules.
  • Utility modules - shared logic or interfaces that do not directly deploy an Azure resource.

Use the AVM Terraform agent for specification-driven module development. AGENTS.md is a compatibility entry point for agents that do not load this Copilot-specific file directly.

Critical Compliance Requirements

Instruction acknowledgement

After reading these instructions and the relevant skills, but before modifying files, output this block visibly to the user:

{
  "avm-terraform-instructions": "loaded",
  "skills": ["<loaded-skill-name>"]
}

List every skill loaded for the task. Use an empty skills array when no specialized skill applies.

Follow current AVM specifications

Before reviewing or generating Terraform:

  1. Fetch https://azure.github.io/Azure-Verified-Modules/llms.txt.
  2. Locate and read the current raw page for every relevant Terraform and shared specification.
  3. Read the complete skill matching the task.
  4. Resolve conflicts in favor of the current published specification.

Do not cite a specification from memory or treat an older module as authoritative.

Use AzAPI for managed authoring

New AVM Terraform modules use Azure/azapi for every control-plane resource and every supported direct Azure operation. Do not use hashicorp/azurerm for convenience, ordinary supporting infrastructure, examples, tests, or fixtures.

AzureRM is permitted only for a specifically documented data-plane or non-ARM operation that AzAPI cannot perform. Each exception must be independently justified and must not authorize other AzureRM usage. Read avm-tf-azapi and avm-tf-tflint before implementing an exception.

Generate documentation

Do not hand-edit generated README.md files. Author module content in _header.md and _footer.md, then run avm docs or avm pre-commit. Read avm-tf-documentation before changing module documentation.

Use the Managed Toolchain

Use PowerShell 7.4 or later with Avm.Authoring from Microsoft Artifact Registry (MAR). MAR is not registered by default. Follow the PSResourceGet 1.2.0 prerequisite, then register MAR once:

Import-Module Microsoft.PowerShell.PSResourceGet -MinimumVersion 1.2.0
Register-PSResourceRepository -Name MAR `
    -Uri 'https://mcr.microsoft.com' `
    -ApiVersion ContainerRegistry `
    -Trusted
Install-PSResource -Name avm.authoring `
    -Repository MAR `
    -Scope CurrentUser
Import-Module Avm.Authoring
avm version
CommandPurpose
avm pre-commitSynchronize managed files, apply fixable conventions and transforms, format Terraform, and generate documentation.
avm pr-checkRun the clean-worktree pull request validation gate.
avm test unitRun provider-mocked Terraform tests.
avm test integrationRun real-Azure integration tests.
avm test e2eDeploy, idempotency-check, and destroy runnable examples.
avm lintRun the managed TFLint configuration.
avm check policyEvaluate example plans against APRL and AVMSEC through Conftest.
avm release-branchHand off a reviewed external fork PR for credentialed E2E testing.

To update from MAR, repeat Install-PSResource with -Reinstall, then start a new PowerShell session and import the module. The built-in avm update still uses PowerShell Gallery. Do not substitute the retired Make, Porch, container, or repository-launcher workflows.

Pull request deployment labels

Open PRs early; add deployment labels when the changes and examples are ready to avoid unnecessary cloud cost and runtime. Static PR checks, unit tests, and integration tests do not require these labels.

For Terraform module examples, the pending public-spec addition TFNFR42 requires executable direct roots under examples/:

Module classRequired examplesOptional examples
Resourceexamples/defaults/ and examples/waf-aligned/Additional examples
Patternexamples/defaults/examples/waf-aligned/ and additional examples
Utilityexamples/defaults/examples/waf-aligned/ and additional examples

Use defaults for new modules. default remains only as a migration compatibility spelling. Required examples must use required and applicable conditional module inputs, rely on module defaults for optional inputs not needed by the scenario, keep test-harness setup, location/telemetry controls, and dependencies separate from module feature overrides, and must not contain .e2eignore. Terraform submodules do not require separate example trees; exercise submodule behavior through parent examples.

PR: Run Required E2E Tests and PR: Run All E2E Tests exist, but class-aware selection and the Terraform missing-canonical-example composition warning are pending changes in Avm.Authoring/Tools and are not yet published behavior. Until those changes are released, do not claim that a required label is class-aware or that a warning is a merge/release gate. The current shared workflow still discovers existing runnable default/defaults and waf-aligned examples. A warning, label, or skipped job is not evidence that E2E tests passed.

Backfill existing repositories by renaming suitable existing examples to defaults or waf-aligned only when the example already represents that scenario. If a canonical gap or WAF intent is ambiguous, raise it to the module owner instead of deploying a rewrite or fabricating another copy. A name such as waf-aligned does not prove semantic WAF compliance; validate the scenario against SFR2.

Fork PR labels do not grant deployment credentials. For credentialed E2E testing, an authorized Microsoft FTE must review the current fork changes and use avm release-branch for the same-repository handoff. Follow the process skill's fork handoff guidance; do not weaken permissions or environment controls.

Module Discovery

Use the current AVM indexes to confirm module availability, classification, naming, and ownership:

New repositories use terraform-azure-avm-<class>-<name> and publish under the Azure Terraform Registry namespace with the /azure system identifier. Existing legacy repository and Registry names do not permit AzureRM use.

Quality Assurance

  • Keep reusable modules free of provider configuration blocks.
  • Use PowerShell for supported hooks and scripts.
  • Add or update the smallest relevant unit, integration, or E2E coverage.
  • Run avm pre-commit and review generated changes.
  • Commit the complete worktree before running avm pr-check.
  • Treat TFLint and Conftest exceptions as reviewed deviations, not shortcuts around a failing check.

Skills

When a task falls within a skill's domain, read and follow the full skill before proceeding.

SkillUse forFile
avm-tf-azapiAzAPI resources, ARM schemas, provider constraints, retries, timeouts, response exports, replacement triggers, and ignore_body_changes..github/skills/avm-tf-azapi/SKILL.md
avm-tf-classificationsResource, pattern, and utility module classification and naming..github/skills/avm-tf-classifications/SKILL.md
avm-tf-codestyleTerraform file layout, HCL style, variables, outputs, validation, and lifecycle syntax..github/skills/avm-tf-codestyle/SKILL.md
avm-tf-conftestConftest policy findings, APRL and AVMSEC rule identifiers, and example-local Rego exceptions..github/skills/avm-tf-conftest/SKILL.md
avm-tf-documentationGenerated README inputs, examples, and documentation validation..github/skills/avm-tf-documentation/SKILL.md
avm-tf-interfacesStandard AVM interfaces and utility-module composition..github/skills/avm-tf-interfaces/SKILL.md
avm-tf-lifecycleModule proposal, ownership, lifecycle, versioning, and deprecation..github/skills/avm-tf-lifecycle/SKILL.md
avm-tf-migrationAzureRM-to-AzAPI migration and state-preserving changes..github/skills/avm-tf-migration/SKILL.md
avm-tf-processContribution flow from repository setup through validation, pull request, and release..github/skills/avm-tf-process/SKILL.md
avm-tf-submodulesChild-resource submodule structure and composition..github/skills/avm-tf-submodules/SKILL.md
avm-tf-telemetryAVM telemetry resources, inputs, and AzAPI headers..github/skills/avm-tf-telemetry/SKILL.md
avm-tf-testingUnit, integration, E2E, hooks, and CI testing..github/skills/avm-tf-testing/SKILL.md
avm-tf-tflintCurrent AVM TFLint rules, canonical rule IDs, severity, overrides, scope, and precedence..github/skills/avm-tf-tflint/SKILL.md

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.