/llmctl-ops:tf-standardsfrom llmctl Ops
Authoring conventions for TF (OpenTofu/Terraform) source files: provider version pinning and auth patterns, variable/tfvars defaults and validation, OpenTofu-native syntax, and file/module organization. ALWAYS invoke when creating, reviewing, or modifying .tf/.tofu/.tfvars content — provider blocks, variables, modules, or resource definitions. Covers how the code is written, not how it is run: state operations, drift, CI/CD pipelines, module testing, and provider-upgrade risk belong to the `terraform-skill` skill. Do not write or review OpenTofu/Terraform source without this skill. Keywords: terraform, opentofu, tofu, provider, variables, tfvars, module, lifecycle, hcl.
Ships in llmctl Ops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Authoring conventions for TF (OpenTofu/Terraform) infrastructure code: provider configuration, variable management, TF-specific syntax, and code organization.
Worked ✅/❌ examples live in references/ and are linked from each rule — load them on demand rather than reading them all up front.
Scope boundary. This skill governs the source text. Execution and operational risk — state operations and recovery, plan/apply and destroy safety, CI drift, module testing frameworks, provider upgrades, compliance scanning — are owned by the terraform-skill skill installed as an APM dependency of this package. Invoke both when a task spans authoring and execution.
Use OpenTofu Registry MCP tools to research provider resource schemas and arguments instead of local schema parsing or web searches.
mcp_opentofu-regi_search-opentofu-registry to find providersmcp_opentofu-regi_get-provider-details to get provider overview and available resources/data sourcesmcp_opentofu-regi_get-resource-docs to get resource argument detailsmcp_opentofu-regi_get-datasource-docs for data source documentationfetch_webpage for registry.terraform.io or registry.opentofu.org — use the MCP tools insteadAlways use the latest stable major version of providers unless specific compatibility requirements dictate otherwise.
3.0 not 2.0)>= 2.0 that may pull outdated versionsReasoning: Using outdated provider versions misses bug fixes, new features, and security patches. Explicit latest versions ensure predictable, modern behavior.
See provider-config.md for ✅/❌ examples.
Support multiple authentication methods for providers when the provider supports them. Default to the most user-friendly secure method.
See provider-config.md for a full ✅ example.
Separate infrastructure code by resource type and concern. Use descriptive file names that indicate content.
main.tofu: Provider configuration and terraform block onlyvariables.tf: All variable declarations, validation blocks, and check blocks for input invariantsoutputs.tf: All output declarations{resource-type}.tf: Resources of a specific type (e.g., realm.tf, database.tf){resource-name}.tf: Individual complex resources (e.g., client-webapp.tf, client-api.tf)modules/{name}/: Reusable module with its own main/variables/outputsColocate locals blocks with the resources that consume them. Do NOT centralize all locals into a single locals.tf.
locals {} blocks across files is idiomatic and preferredlocals.tf for truly cross-cutting values used in 3+ filesPlace check blocks next to the validation concern they enforce:
variables.tf alongside validation blocksReasoning: Logical separation makes code easier to navigate, review, and maintain. Finding "where is the realm configuration" should be immediate, not require searching through a monolithic file.
See organization.md for ✅/❌ directory-layout examples.
When creating reusable modules, follow these principles:
Module Structure Consistency: When adding new modules for different resource types in the same domain (e.g., OIDC client vs SAML client), mirror the structure:
See organization.md for ✅ module structure and usage examples.
keycloak_url not urlclient_webapp, client_api, client_mobilek8s, oidc, url)See organization.md for ✅/❌ examples.
Pass null for empty optional string/list attributes instead of empty strings or empty lists. Use ternary conditionals in resource blocks.
!= "" before passing to optional string attributeslength() > 0 before passing to optional list attributesReasoning: Many providers treat empty strings differently from null. Passing null signals "use provider default" while empty string may cause validation errors or unexpected behavior.
Provide sensible defaults in variables.tf for all non-sensitive configuration. Only require explicit values in .tfvars files for environment-specific, sensitive, or truly variable data.
null as default for truly optional resourcesReasoning: Users shouldn't need to specify obvious values like port = 8080 or enabled = true. Defaults reduce boilerplate and make .tfvars files focus on what actually varies between environments.
For application URLs and endpoints, prefer single base URL variables over split scheme/host/port components.
scheme, host, port variables unless environment requires different combinationsWhen authoring .tfvars files, only set attributes that differ from their defaults.
optional(bool, false) fields to false — omit them entirelyoptional(string) fields to null — that's already the defaultSee variables.md for ✅/❌ examples of defaults, URL patterns, and tfvars minimalism.
When constructing URLs or paths from variables passed through module boundaries, trace the actual value from .tfvars → root variables → module call → resource usage.
https://) before prepending one.tfvars.example files and root variables.tf descriptions to determine the canonical formatWhen asked for a "once-over", "nit fixes", or "cleanup", restrict changes to:
Do NOT change during cleanup unless explicitly requested:
OpenTofu has native features that differ from Terraform. Use OpenTofu-native constructs instead of Terraform workarounds.
Use lifecycle.enabled for conditional resource creation, not count or for_each with boolean logic.
Reasoning: OpenTofu's lifecycle.enabled is cleaner and more explicit than Terraform's count = var.enabled ? 1 : 0 pattern. It clearly expresses intent and avoids index-based resource references.
When using lifecycle.enabled, declare the controlling boolean variable with a clear, descriptive name.
See opentofu-patterns.md for ✅/❌ examples.
When creating Kubernetes secrets from provider resources, follow security best practices.
lifecycle.enabledfalse for security (opt-in model)Reasoning: Not all users want or need Kubernetes secrets created automatically. Some use external secret management (Vault, Sealed Secrets). Making it optional and opt-in prevents unexpected resource creation in clusters.
See opentofu-patterns.md for a full ✅ example.
Only add comments to explain non-obvious logic, complex algorithms, or important constraints. Never comment on code that is self-explanatory.
Reasoning: Redundant comments create noise and maintenance burden. Code structure (file names, resource types, variable names) should be self-documenting. Comments are for explaining intention, not repeating what the code says.
See opentofu-patterns.md for ✅/❌ examples.
When a TF provider lacks support for a resource, or a resource is auto-created by the upstream system, use the magodo/restful provider for proper CRUD lifecycle with drift detection. See restful provider patterns for authentication setup, patching patterns, and critical lessons.
Before committing OpenTofu code, verify:
lifecycle.enabled not countsensitive = truenull for empty values (not empty strings/lists)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub siegenthalerroger/.llmctl-marketplace --plugin llmctl-ops6 skills in this plugin
/helm-chartsHelm chart structure, dependency management, library charts, and install/upgrade troubleshooting. ALWAYS invoke when creating or adapting chart structure (Chart.yaml, subcharts), managing chart dependencies, using third-party or library charts, or debugging why a Helm install/upgrade isn't taking effect. Do not hand-edit Chart.yaml, add a dependency, or diagnose a failed release without this skill — for templates/ authoring use helm-templates, for values.yaml use helm-values. Keywords: helm, chart, Chart.yaml, dependencies, library chart, helm install, helm upgrade, helm template, troubleshoot./helm-templatesAuthoring Helm chart templates: _helpers.tpl named templates, Go template patterns, whitespace control, hooks, and template testing. ALWAYS invoke when creating or modifying files under templates/, writing _helpers.tpl, using Go template functions (include, toYaml, nindent), implementing Helm hooks, or linting/unit-testing templates. Do not write or edit a file under templates/ without this skill — for chart structure and dependencies use helm-charts, for values.yaml use helm-values. Keywords: helm, templates, _helpers.tpl, named templates, Go template, include, toYaml, nindent, hooks, helm lint./helm-valuesAuthoring values.yaml in Helm charts with mandatory helm-docs documentation comments and helm-schema type annotations. ALWAYS invoke when creating or editing values.yaml, adding value descriptions, generating values.schema.json or README docs, setting up helm-docs/helm-schema pre-commit hooks, or reviewing values for missing annotations. Do not add or edit a values.yaml entry without this skill — every value needs its annotation; for chart structure use helm-charts, for templates/ use helm-templates. Keywords: helm, values.yaml, helm-docs, helm-schema, values.schema.json, annotations, documentation, schema, pre-commit./k8s-standardsConfiguration standards for Kubernetes manifests: resource naming, labeling, annotations, security contexts, resource requests/limits, probes, and rollout strategies. ALWAYS invoke when creating, reviewing, or modifying Kubernetes YAML (manifests, Helm chart templates, Kustomize overlays) under k8s/, manifests/, deploy/, or charts/ — any file with apiVersion/kind. Do not write or review a Kubernetes manifest without this skill. Keywords: kubernetes, k8s, manifest, apiVersion, kind, security context, probes, resource limits, labels, rollout./terraform-skillUse when writing, reviewing, or debugging Terraform/OpenTofu modules, tests, CI, scans, or state ops - diagnoses failure mode (identity churn, secrets, blast radius, CI drift, state corruption) with version-aware guards.Other plugins' skills for the same job