Terraform skill that makes AI diagnose before it plans
TerraShark exists to stop AI agents from hallucinating Terraform by forcing them to diagnose failure modes before they generate a single resource block.

What it does
TerraShark is a set of instructions—packaged as a skill for Claude Code, Codex, Gemini CLI, and Antigravity—that sits between you and the AI when writing Terraform or OpenTofu. Instead of letting the model improvise infrastructure from memory, it provides a tight, 86-line operational workflow that keeps the agent aligned with HashiCorp’s official best practices. The skill loads selectively from 19 focused reference files covering security, compliance, migration, and module patterns, so the AI gets context only for the specific risk at hand.
The interesting bit
The clever part is the token strategy. Most Terraform skills dump thousands of tokens of static reference into the context window and hope the model reads it; TerraShark’s core activation costs roughly 600 tokens and forces the agent to identify the failure mode—identity drift, secret leakage, blast radius—before loading any deeper references. It treats hallucination not as a knowledge gap but as a workflow bug, replacing the read-the-manual approach with a diagnostic checklist that makes the AI state its assumptions, tradeoffs, and rollback plan before writing code.
Key highlights
- Activation cost of ~600 tokens, compared to the ~4,400 tokens the README cites for competing skills.
- 19 granular reference files loaded on demand rather than front-loading a monolithic manual.
- Explicit compliance mappings for ISO 27001, SOC 2, FedRAMP, GDPR, PCI DSS, and HIPAA.
- Good, bad, and neutral code examples to steer the model away from common anti-patterns.
- Structured output contract requiring assumptions, tradeoffs, validation steps, and rollback notes.
Verdict
If you are using Claude Code or Codex to write Terraform and watching the model invent resource arguments or ignore state-file hygiene, this is worth the two minutes to wire up. If you already have a locked-down, human-reviewed IaC pipeline with no AI assistance, TerraShark has nothing to offer you.
Frequently asked
- What is LukasNiessen/terrashark?
- TerraShark exists to stop AI agents from hallucinating Terraform by forcing them to diagnose failure modes before they generate a single resource block.
- Is terrashark open source?
- Yes — LukasNiessen/terrashark is open source, released under the MIT license.
- How popular is terrashark?
- LukasNiessen/terrashark has 716 stars on GitHub.
- Where can I find terrashark?
- LukasNiessen/terrashark is on GitHub at https://github.com/LukasNiessen/terrashark.