audit-module

A checklist command for reviewing a Terraform module, which is a set of files that defines cloud infrastructure. It checks required variables, naming rules, and other project conventions.

In plain words
What is it for?
Use it to audit a named module under the modules/ directory, run mechanical checks, review additional issues, and report the final issue count.
Why use it?
It finds missing or incorrectly defined parts before the module is used or deployed, reducing manual review work and convention-related errors.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/techequitycloud/rad-modules/audit-module
Clone the repo
git clone --depth 1 https://github.com/techequitycloud/rad-modules

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 867 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00867
Opus 5 $0.00000 $0.00434
Sonnet 5 $0.00000 $0.00173
Haiku 4.5 $0.00000 $0.00087

Measured yesterday against content hash d2166e2ae57b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

audit-module scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/audit-module.md · 91 lines

What it actually says

Audit the rad-modules module: $ARGUMENTS

Resolve $ARGUMENTS to a directory under modules/ (e.g. "Istio_GKE", "Bank_GKE", "AKS_GKE"). If it doesn't match a directory, report the available modules and stop.

Run every check below and report findings. For each issue, state what is wrong and the correct fix per .agent/skills/module-conventions/SKILL.md. End with: "Module $ARGUMENTS: N issue(s) found." or "Module $ARGUMENTS passes all checks."

You may run python3 scripts/check_conventions.py --modules-dir modules/ first for the mechanical checks, then add the judgement-based ones below.


CHECK 1 — TEN STANDARD VARIABLES

Read the module's variables.tf. Verify all ten standard variables are declared with the correct names: module_description, module_dependency, module_services, credit_cost, require_credit_purchases, enable_purge, public_access, deployment_id, resource_creator_identity, trusted_users. Also verify enable_services is declared.

Note legitimate exceptions: AKS_GKE, EKS_GKE and Migration_Center omit enable_services (they enable local.default_apis unconditionally); Container_Migration, Migration_Center and VMware_Engine omit trusted_users. Report omissions, but classify these as informational for those module types.


CHECK 2 — UIMETA TAGS

Every variable description must contain a {{UIMeta group=N order=M}} tag inside the description string (not a separate comment). Report any variable missing it. Confirm enable_services, where present, uses group=0 order=109.


CHECK 3 — SENSITIVE CREDENTIALS

Any variable whose name contains client_secret, aws_secret_key, aws_access_key, private_key, or service_account_key must set sensitive = true AND must have no hardcoded default (no default, or default = ""). Report violations.


CHECK 4 — PROVIDER AUTH PATTERN

Determine which pattern the module uses and confirm it is internally consistent:

  • Pattern A (direct): a single provider.tf, no impersonation. Used by AKS_GKE, EKS_GKE.
  • Pattern B (impersonated): versions.tf (requirements) + provider-auth.tf declaring both the google and google-beta providers with impersonate_service_account = length(var.resource_creator_identity) != 0 ? var.resource_creator_identity : null.

Flag: both provider.tf and provider-auth.tf present (should be one or the other); a module using google-beta under Pattern A (must be Pattern B); a hardcoded access_token.


CHECK 5 — API ENABLEMENT INVARIANT

For every google_project_service resource (usually in main.tf), confirm BOTH: disable_dependent_services = false disable_on_destroy = false and that it does NOT use lifecycle { prevent_destroy = true }. These are critical: multiple modules share a project, so disabling APIs on destroy breaks the others.


CHECK 6 — LICENSE HEADERS

Every .tf file should begin with the Apache 2.0 block-comment header (Google LLC). Report any .tf file missing it.


CHECK 7 — OUTPUTS

outputs.tf should export at least deployment_id and project_id. For attached-cluster modules that keep outputs in main.tf, confirm those two outputs exist somewhere. Report if absent.


CHECK 8 — DOCUMENTATION CONSISTENCY

a) README.md exists and its Inputs table lists every variable in variables.tf with matching defaults (minus the {{UIMeta}} tag). b) module_documentation default in variables.tf points to the GitHub URL of docs/labs/<Module>.md — NOT a LAB_GUIDE.md inside the module directory. c) The lab guide docs/labs/<Module>.md exists. d) No LAB_GUIDE.md file exists inside the module directory.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 91 lines · 0 tokens per session scan A d2166e2ae57b

Subscribe to this mod's changes

audit-module is a command published in the GitHub repository techequitycloud/rad-modules (2 stars, last pushed 8d ago), licensed MPL-2.0. It costs nothing until one of its globs matches a file; then it loads 867 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.