Agent skill

Apex Terraform Test

by jonathan-vella in jonathan-vella/apex

WORKFLOW SKILL — Write and run Terraform tests (.tftest.hcl).

MITAuto-check passedDevOps & Cloud

Install Apex Terraform Test

skills CLI
$ npx skills add jonathan-vella/apex --skill apex-terraform-test -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jonathan-vella/apex apex-terraform-test --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jonathan-vella/apex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/apex-terraform-test .claude/skills/apex-terraform-test && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
apex-terraform-test
GitHub stars
217
Token cost
~1.6k tokens
SKILL.md length
484 words
Files
5 (incl. references)
Skills in repo
39
Repo updated
First seen
Licence
MIT

At a glance

WORKFLOW SKILL — Write and run Terraform tests (.tftest.hcl).

  • Works in 8 steps: Naming: *_unit_test.tftest.hcl /… → Plan mode first: Use command = plan for… → Clear error messages: Describe what went… → …
  • Plan-mode unit tests
  • SKILL.md covers Quick Reference, File Structure, Test File Components and Canonical Example, plus 7 more sections
  • Calls terraform

What it does

Apex Terraform Test is an agent skill from jonathan-vella/apex. WORKFLOW SKILL — Write and run Terraform tests (.tftest.hcl). WHEN: "create terraform test", "write tftest", ".tftest.hcl", "mock provider", "test module", "test assertion". USE FOR: test files, run blocks, assertions, mock providers, plan-mode unit tests, apply-mode integration tests, test troubleshooting. DO NOT USE FOR: Bicep code, architecture decisions, deployment (use apex-azure-deploy).

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/mock-providers.md`, `references/test-examples.md` and `references/test-execution.md`). Compatibility notes: Requires Terraform = 1.6 (test blocks), = 1.7 (mock providers), = 1.9 (parallel execution)

It sits in DevOps & Cloud, covering Infrastructure as code. It works with Terraform, Microsoft Azure and Bicep. The repository describes itself as: APEX turns Azure platform engineering requirements into verified, deploy-ready IaC — powered by GitHub Copilot agents, real-time pricing, and built-in compliance. The licence is MIT.

When your agent uses it

  • Plan-mode unit tests
  • Apply-mode integration tests
  • Test troubleshooting
  • Architecture decisions

Example prompts

  • “create terraform test”
  • “write tftest”
  • “.tftest.hcl”
  • “/apex-terraform-test”

Requirements

  • Compatibility (from SKILL.md): Requires Terraform >= 1.6 (test blocks), >= 1.7 (mock providers), >= 1.9 (parallel execution)

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Naming: *_unit_test.tftest.hcl / *_integration_test.tftest.hcl
  2. Plan mode first: Use command = plan for fast, cost-free validation
  3. Clear error messages: Describe what went wrong and expected state
  4. Test isolation: Independent run blocks where possible
  5. Variable coverage: Test multiple combinations for all code paths
  6. Mock for speed: Use mock providers in CI without Azure access
  7. Negative testing: Use expect_failures for validation rule coverage
  8. Sequential only when needed: Only chain run blocks via run. when required

What it can do on your machine

Read from SKILL.md and the folder at commit b8e5908. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • terraform

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developer.hashicorp.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Terraform >= 1.6 (test blocks), >= 1.7 (mock providers), >= 1.9 (parallel execution)

    From compatibility in the SKILL.md frontmatter.

Context cost

Apex Terraform Test loads about 1.6k tokens when it runs, and up to ~6.1k if it reads all its reference files. Until then it costs about 105 tokens; SKILL.md has 484 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~105
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jonathan-vella/apex at commit b8e5908, republished under its MIT licence (© jonathan-vella). 484 words, ~1,637 tokens.

Download SKILL.mdSave it as .claude/skills/apex-terraform-test/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
apex-terraform-test
description
**WORKFLOW SKILL** — Write and run Terraform tests (.tftest.hcl). WHEN: "create terraform test", "write tftest", ".tftest.hcl", "mock provider", "test module", "test assertion". USE FOR: test files, run blocks, assertions, mock providers, plan-mode unit tests, apply-mode integration tests, test troubleshooting. DO NOT USE FOR: Bicep code, architecture decisions, deployment (use apex-azure-deploy).
compatibility
Requires Terraform >= 1.6 (test blocks), >= 1.7 (mock providers), >= 1.9 (parallel execution)
user-invocable
true
disable-model-invocation
false
argument-hint
test path and plan or mock mode

Terraform Test Skill

Write, organize, and run Terraform's built-in test framework for Azure infrastructure modules.

Reference: Terraform Testing Documentation


Quick Reference

ConceptDescriptionMin Version
Test file.tftest.hcl in tests/ directory1.6
Run blockSingle test scenario with assertions1.6
Assert blockCondition that must be true for test to pass1.6
Plan modecommand = plan — validates logic, no resources created1.6
Apply modecommand = apply (default) — creates real infrastructure1.6
Mock providerSimulates provider without real API calls1.7
Parallel executionparallel = true on independent run blocks1.9
Expect failuresVerify validation rules reject invalid input1.6

File Structure

text
my-module/
├── main.tf
├── variables.tf
├── outputs.tf
└── tests/
    ├── defaults_unit_test.tftest.hcl        # Plan mode (fast)
    ├── validation_unit_test.tftest.hcl      # Plan mode (fast)
    └── full_stack_integration_test.tftest.hcl  # Apply mode (creates resources)

Naming convention: *_unit_test.tftest.hcl (plan mode), *_integration_test.tftest.hcl (apply mode).

Test File Components

  • 0–1 test block (test-wide settings)
  • 1+ run blocks (test scenarios, sequential by default)
  • 0–1 variables block (file-level inputs, highest precedence)
  • 0+ provider blocks (provider configuration)
  • 0+ mock_provider blocks (simulated providers, TF 1.7+)

Canonical Example

See references/test-examples.md for a complete Azure Resource Group test (unit tests, tag validation, expect_failures).

Key Syntax Rules

Run Block Attributes
AttributeTypeDefaultDescription
commandplan/applyapplyTest mode
variablesblock—Override file-level variables
moduleblock—Test alternate module (local/registry only)
assertblock (1+)—Validation conditions
expect_failureslist—Expected validation failures
Assert Syntax
hcl
assert {
  condition     = <boolean expression>
  error_message = "Human-readable failure description"
}

Assertions can reference: resource attributes, outputs, run.<name>.<output>, var.*, data sources. Variables precedence: run-block > file-level > all other sources. See references/test-examples.md for module blocks, plan options, and prior run references.

Mock Providers (TF 1.7+)

Simulate Azure provider without API calls — ideal for unit tests. Use mock_provider "azurerm" with mock_resource and mock_data blocks. When to use: Unit tests, CI without Azure credentials, fast local development. When NOT to use: Integration tests, validating actual Azure API behavior. See references/mock-providers.md for full mock patterns and examples.

Common Test Patterns

See references/test-examples.md for: conditional resources, tag validation, resource count with for_each, variables precedence, and prior run references.

Show full SKILL.md (185 more words)Show less

Steps

bash
terraform test                              # All tests
terraform test -filter=tests/defaults_unit_test.tftest.hcl # Specific file
terraform test -verbose                     # Detailed output
terraform test -test-directory=integration-tests # Custom test directory

-filter selects test files, not run-block names. Apply-mode tests create real resources and attempt cleanup automatically; obtain deployment authorization before running them. Use mocks for offline checks, and investigate any resources reported after failed cleanup.

Rules

  1. Naming: *_unit_test.tftest.hcl / *_integration_test.tftest.hcl
  2. Plan mode first: Use command = plan for fast, cost-free validation
  3. Clear error messages: Describe what went wrong and expected state
  4. Test isolation: Independent run blocks where possible
  5. Variable coverage: Test multiple combinations for all code paths
  6. Mock for speed: Use mock providers in CI without Azure access
  7. Negative testing: Use expect_failures for validation rule coverage
  8. Sequential only when needed: Only chain run blocks via run.<name> when required

Provider Schema Validation

Run terraform init, then use terraform providers schema -json to validate that resource types referenced by assertions exist in the selected provider. See apex-azure-defaults/references/terraform-conventions.md for the canonical metadata source policy.


Reference Index

FileContents
references/test-examples.mdCanonical example, common patterns, variables, module blocks
references/test-patterns.mdUnit vs integration patterns, CI/CD examples, complex assertions
references/mock-providers.mdMock provider setup, mock resources/data sources, override files
references/test-execution.mdCLI commands, parallel execution, verbose/debug, diagnostics

© jonathan-vella, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in .github/skills/apex-terraform-test of jonathan-vella/apex.

  • SKILL.md
  • references/mock-providers.md
  • references/test-examples.md
  • references/test-execution.md
  • references/test-patterns.md

Open the folder on GitHubat commit b8e5908

Compare with similar skills

Apex Terraform Test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Apex Terraform Test compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Apex Terraform Test this skilljonathan-vella/apex217—~1.6kAutomated safety check: PassMIT
Iac Securityhardw00t/ai-security-arsenal105—~2.4kAutomated safety check: PassNone
Azure Deploymicrosoft/GitHub-Copilot-for-Azure2551 repos~1.6kAutomated safety check: PassMIT
Azure Preparemicrosoft/GitHub-Copilot-for-Azure2551 repos~3.2kAutomated safety check: PassMIT
Azure Validatemicrosoft/GitHub-Copilot-for-Azure2551 repos~880Automated safety check: PassMIT
Azure To AWSaws/agent-toolkit-for-aws2.8k—~5.5kAutomated safety check: PassApache-2.0

Similar skills

  • Iac Security

    hardw00t/ai-security-arsenal

    Infrastructure-as-Code security scanning router for Terraform, CloudFormation, Kubernetes manifests, Helm, ARM/Bicep.

    105 GitHub stars~2.4k tokensUpdated 5 mo ago
    DevOps & CloudAuto-check passed
  • Azure Deploy

    microsoft/GitHub-Copilot-for-Azure

    Official

    Execute Azure deployments for ALREADY-PREPARED applications that have existing .azure/deployment-plan.md and infrastructure files.

    255 GitHub starsUsed in 1 repo~1.6k tokens
    DevOps & CloudAuto-check passed
  • Azure Prepare

    microsoft/GitHub-Copilot-for-Azure

    Official

    Prepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Terraform), and Dockerfiles for the Azure Developer CLI (azd) workflow.

    255 GitHub starsUsed in 1 repo~3.2k tokens
    DevOps & CloudAuto-check passed
  • Azure Validate

    microsoft/GitHub-Copilot-for-Azure

    Official

    Pre-deployment validation for Azure readiness. An agent skill from microsoft/GitHub-Copilot-for-Azure.

    255 GitHub starsUsed in 1 repo~880 tokens
    DevOps & CloudAuto-check passed
  • Azure To AWS

    aws/agent-toolkit-for-aws

    Official

    Migrate workloads from Microsoft Azure to AWS. An agent skill from aws/agent-toolkit-for-aws.

    2.8k GitHub stars~5.5k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Azure Copilot

    MicrosoftDocs/Agent-Skills

    Official

    Expert knowledge for Azure Copilot development including troubleshooting, decision making, architecture & design patterns, security, configuration, and integrations & coding patterns.

    776 GitHub stars~1.4k tokensUpdated 5 days ago
    DevOps & CloudAuto-check passed

More from jonathan-vella/apex

All 39 skills in this repo
  • Apex Azure Diagnostics

    jonathan-vella/apex

    WORKFLOW SKILL — Debug Azure production issues: Container Apps, Functions, App Service, AKS, VMs and messaging, with KQL log analysis.

    217 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • ANALYSIS SKILL — Azure Policy discovery: effective assignments (incl.

    217 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Apex Context Management

    jonathan-vella/apex

    UTILITY SKILL — Two-mode context-window management. An agent skill from jonathan-vella/apex.

    217 GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Apex Python Diagrams

    jonathan-vella/apex

    UTILITY SKILL — Python diagram generation for Azure architectures, WAF/cost/compliance charts, ERDs, swimlanes, timelines, and wireframes.

    217 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Apex Terraform Search Import

    jonathan-vella/apex

    WORKFLOW SKILL — Manual-only discovery and import of existing Azure resources into Terraform management.

    217 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Apex Vendor Prompting

    jonathan-vella/apex

    ANALYSIS SKILL — Manual-only audit of Anthropic Claude Opus 5.5 / Sonnet 5.5 and OpenAI GPT-6 / GPT-5.6 prompting guidance and APEX conventions.

    217 GitHub stars~2.7k tokensUpdated today
    Auto-check passed

Categories

Questions about Apex Terraform Test

What does Apex Terraform Test do?

WORKFLOW SKILL — Write and run Terraform tests (.tftest.hcl). Apex Terraform Test is an agent skill from jonathan-vella/apex.hcl).

When should I use Apex Terraform Test?

Apex Terraform Test fits situations like: plan-mode unit tests; apply-mode integration tests; test troubleshooting; architecture decisions.

How do I install Apex Terraform Test in Claude Code?

Run `npx skills add jonathan-vella/apex --skill apex-terraform-test -a claude-code`. Or copy the skill folder (.github/skills/apex-terraform-test in jonathan-vella/apex) into .claude/skills/apex-terraform-test in your project. Claude Code loads it when a task matches its description.

How do I install Apex Terraform Test in Codex?

Run `npx skills add jonathan-vella/apex --skill apex-terraform-test -a codex`. Or copy the skill folder (.github/skills/apex-terraform-test in jonathan-vella/apex) into .agents/skills/apex-terraform-test in your project. Codex loads it when a task matches its description.

Can I use Apex Terraform Test in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jonathan-vella/apex --skill apex-terraform-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/apex-terraform-test, .gemini/skills/apex-terraform-test, .github/skills/apex-terraform-test and .opencode/skills/apex-terraform-test in your project.

What does Apex Terraform Test need to run?

Going by SKILL.md and its folder, Apex Terraform Test needs the command-line tools its instructions call (terraform). Compatibility (from SKILL.md): Requires Terraform >= 1.6 (test blocks), >= 1.7 (mock providers), >= 1.9 (parallel execution).

Does Apex Terraform Test access the network?

SKILL.md names 1 domain. As links in the text: developer.hashicorp.com. This is read from the text; nothing was executed.

Is Apex Terraform Test safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Apex Terraform Test use?

Apex Terraform Test is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Apex Terraform Test use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.5k tokens, read only when the agent opens those files.

What are the alternatives to Apex Terraform Test?

Skills that share tags, products or a category with Apex Terraform Test: Iac Security (hardw00t/ai-security-arsenal, 105 stars), Azure Deploy (microsoft/GitHub-Copilot-for-Azure, 255 stars), Azure Prepare (microsoft/GitHub-Copilot-for-Azure, 255 stars) and Azure Validate (microsoft/GitHub-Copilot-for-Azure, 255 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Apex Terraform Test?

jonathan-vella (a GitHub user) maintains it in jonathan-vella/apex, which has 217 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on October 10, 2026.

Source: jonathan-vella/apex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.