add-docs

A command for creating or updating documentation for rad-modules, which are reusable Terraform infrastructure components.

In plain words
What is it for?
Use it to document selected modules or every module when documentation needs to be generated or refreshed.
Why use it?
It keeps module documentation aligned with the module's inputs, outputs, providers, resources, and project conventions.

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/add-docs
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 744 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.00744
Opus 5 $0.00000 $0.00372
Sonnet 5 $0.00000 $0.00149
Haiku 4.5 $0.00000 $0.00074

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

Security

Grade A, and why

add-docs 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/add-docs.md · 59 lines

What it actually says

Generate or refresh documentation for one or more rad-modules modules: $ARGUMENTS

$ARGUMENTS is a comma/space-separated list of module names (e.g. "Istio_GKE", "Bank_GKE EKS_GKE"). If empty, process every module under modules/.

For each module, produce/update three artifacts to match variables.tf/outputs.tf and the shapes defined in .agent/skills/module-conventions/SKILL.md → "Documentation". Read an existing well-formed module (Bank_GKE or Container_Migration) first to match table style.


ARTIFACT 1 — README.md (~90–110 lines)

Sections, in order:

  1. One-paragraph overview, including the mig-{deployment_id}-* (or module-appropriate) resource-naming convention.
  2. A link to the lab guide: [<Module>.md](../../docs/labs/<Module>.md). NEVER link to a LAB_GUIDE.md inside the module directory.
  3. ## Usage — a minimal module "<name>" { source = "..." ... } block with the required inputs.
  4. ## Requirements — provider/version table from versions.tf or provider.tf.
  5. ## Providers — the same providers.
  6. ## Modules — only if the module has nested helpers under modules/.
  7. ## Resourcesname | type table of the resources the module creates.
  8. ## Inputs — a row for EVERY variable in variables.tf: name, description (verbatim minus the {{UIMeta ...}} tag), type, default, required. Required = "yes" when there is no default.
  9. ## Outputs — a row for every output in outputs.tf (and outputs in main.tf, if any).

The Inputs/Outputs tables must be exhaustive and exact — they are the module's contract.


ARTIFACT 2 — docs/modules/<Module>.md (long-form deep dive, published to the docs site)

An educational deep dive into how the module works: the architecture it provisions, the provider-auth pattern it uses and why, the post-provisioning null_resource flow, key design decisions (e.g. Istio's IstioOperator HPA block, MC_Bank's static provider aliases), and gotchas. This is narrative prose with code excerpts, not a table dump.


ARTIFACT 3 — docs/labs/<Module>.md (shared lab guide)

A hands-on lab guide. Structure: Overview & Architecture → Lab Setup (prereqs, project, bucket, varfile) → numbered Exercises (deploy via rad-launcher, explore, modify) → Cleanup (radlab.py -m <Module> -a delete ...) → Reference. If this file already exists, update it rather than overwriting hand-written exercises.


AFTER GENERATING

  • Set/verify module_documentation default in variables.tf points to the GitHub URL of docs/labs/<Module>.md.
  • Add the module to the "Module Families" table in CLAUDE.md if missing. Do NOT add it to README.md — that file is the upstream OpenTofu project README and has no module list.
  • Report what was written/updated per module. Do not commit unless asked.
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 · 59 lines · 0 tokens per session scan A 33e582bf84e9

Subscribe to this mod's changes

add-docs 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 744 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.