Installs and runs Terraform-on-AWS checks: fmt, validate, TFLint, Checkov with graph policies, mocked tests, baseline recording, and GitHub Actions plan/approve/apply workflows with plan provenance. Also verifies deployed resources against checkout.
Ships in aws-infrastructure-skills. 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; scripts run unread.
The harness turns rules into checks that fail. It installs scripts and config under harness/ and one section of AGENTS.md, and never edits the project's Terraform.
Hooks provide feedback; authority comes from IAM and protected CI. The agent's role must not be able to apply.
python3 "${CLAUDE_SKILL_DIR}/scripts/apply_harness.py" /path/to/project [--workflows] [--dry-run]
${CLAUDE_SKILL_DIR} is this skill's folder; Codex doesn't set it, so use the folder this file is in.
harness/{check,baseline,plan_summary,plan_provenance,verify_deployment}.py, harness/.tflint.hcl, harness/checkov/*.yaml and the harness section of AGENTS.md. harness/lock.json records what it wrote.conflict (exit 1) instead of overwriting them. Merge a conflict by hand, or delete the file and rerun.--workflows adds .github/workflows/harness-checks.yml and terraform-deploy.yml. Leave it off when the project deploys through Atlantis, HCP Terraform or another runner: wire harness/check.py and harness/plan_summary.py into that runner instead. Never run two apply paths for one state.Before telling the user the workflows are ready, go through the administrator checklist in references/deployment-workflows.md with them: branch protection, environment reviewers, the two OIDC trust policies, repository variables, private visibility. YAML cannot enforce any of these.
python harness/check.py . # every root
python harness/check.py . --changed infra/main.tf # only the affected roots
Per root: fmt, init -backend=false, validate, tflint, checkov once per environment file (*.tfvars in envs/, env/ or environments/, or each --var-file), terraform-test; plus app-tests when app/tests exists. Last line: harness check: PASS|FAIL|UNVERIFIED (...). Exit 0/1/2.
UNVERIFIED means the check could not run: a tool is missing, init failed (network, provider constraint), a root has no environment file (Checkov would guess variable values; name one with --var-file), or no tests/*.tftest.hcl. It is never a pass. init needs network for providers and modules; run checks sequentially, because Terraform's plugin cache is not safe for concurrent use.
Coverage, and why each custom check exists: references/coverage.md.
A person (not the agent) records today's findings:
python harness/baseline.py record . --owner TEAM --reason "pre-harness, TICKET-1" --expires 2027-05-01
Each entry tolerates one finding (check ID + root + resource). A new instance of the same rule still fails, as does a new finding that replaces a fixed one. Rules are never disabled. Expired entries stop tolerating. baseline.py prune removes entries whose finding is gone. Review harness/baseline.json changes like code.
Some findings are wrong for the code. For example, tflint reports a data source as unused when it exists only for its postcondition. The baseline is for old findings, not for code that is right. A reviewer, not the agent, suppresses such a finding where it occurs, with the reason on the line above:
# Exists only for the postcondition: every subnet must be in var.vpc_id.
# tflint-ignore: terraform_unused_declarations
data "aws_subnet" "private" {
The general form is # tflint-ignore: <rule>; for Checkov, #checkov:skip=<ID>: <reason> inside the resource, or an entry in .checkov.yaml for a rule that does not apply to the whole project. Name one rule, never all, and review the line like code.
uv run --with boto3 python harness/verify_deployment.py verify . \
--profile sandbox --expect-account 123456789012 --expect-region us-east-1
Order: target (exit 3 before any request if the credentials or Terraform outputs point elsewhere) → artifact (deployed CodeSha256 = local package = app/) → probes from .verify/probes.json (signed when the API uses IAM, plus an unsigned request that must be rejected) → logs found by request ID with the correlation ID → trace, alarms, alerting (reported, not deciding the exit: traces are sampled, alarms lag, a confirmed subscriber is not a delivered message).
A probe with repeat sends the request up to 50 times (within max_seconds, at most 120). expect_distinct {"key": "instance", "at_least": 2} then needs two instances to answer, and expect_same needs the named keys equal in every response. A service that runs two or more where only one answered is FAIL; a service that runs one is UNVERIFIED, reported. A service always runs two copies at some moment (a rollout, a scale-out), so the ecs-web and alb-ec2 probes ask for two.
Exit 0 PASS, 1 FAIL, 2 UNVERIFIED (for example, logs not in yet: rerun, do not report a pass), 3 wrong target. Paste the last line as evidence.
verify fails while a rollout runs. To probe through one, run verify_deployment.py watch-rollout . --expect-account ... --expect-region ... next to the apply: it fails on any failed request and lists the instances and source_sha256 values that answered. references/deployment-workflows.md has the results and how a workflow runs it. The repeated probes and watch-rollout are unit-tested only, not yet run against a sandbox account.
After a sandbox teardown, verify_deployment.py residue --project-tag NAME --environment ENV ... lists anything still tagged with the project.
Checkov's checkov.cmd runs the first python on PATH. With uv/pipx installs that python usually lacks Checkov; point the launcher at the tool environment's python.exe, or pass --checkov.
assets/project/AGENTS.section.md (opens in a new tab)assets/project/harness/checkov/HARNESS_AWS_1.yaml (opens in a new tab)assets/project/harness/checkov/HARNESS_AWS_2.yaml (opens in a new tab)assets/project/harness/checkov/HARNESS_AWS_3.yaml (opens in a new tab)assets/project/harness/checkov/HARNESS_AWS_4.yaml (opens in a new tab)assets/project/harness/checkov/HARNESS_AWS_5.yaml (opens in a new tab)references/coverage.md (opens in a new tab)references/deployment-workflows.md (opens in a new tab)scripts/apply_harness.py (opens in a new tab)scripts/baseline.py (opens in a new tab)scripts/check.py (opens in a new tab)scripts/plan_provenance.py (opens in a new tab)scripts/plan_summary.py (opens in a new tab)scripts/verify_deployment.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/aws-infrastructure-skills:aws-iac-team-harnessfrom aws-infrastructure-skills
npx claudepluginhub a-pavithraa/aws-serverless-skill --plugin aws-infrastructure-skills7 skills in this plugin
/aws-connectUse when writing or reviewing Terraform for Amazon Connect: contact flows and flow modules, a Lambda function invoked from a flow, queues, routing profiles, security profiles and access-control tags, users, approved origins, adopting console-built resources, PHI in flow logs and contact attributes, or contact events to EventBridge and SQS. Not for general Lambda tuning (aws-serverless) or IAM and pipelines (terraform-aws)./aws-dynamodbUse when designing or reviewing a DynamoDB table: access patterns, partition and sort keys, single-table design, GSIs and sparse indexes, hot partitions, one-to-many and many-to-many modeling, capacity mode and cost, or the Terraform for the table./aws-ecs-fargateUse when writing or reviewing Terraform that deploys a container service to ECS Fargate: task definitions, secrets injected from Secrets Manager, image tags and ECR lifecycle, deployment rollback and alarms, a service behind a load balancer or in a VPC that a platform team owns, why a task does not start, or running more than one task. Not for a new service from a template (creating-aws-projects) or Lambda (aws-serverless)./aws-serverlessUse when designing, debugging or reviewing Lambda, API Gateway, SQS, SNS, EventBridge or Step Functions code and configuration: cold starts and INIT billing, Lambda Layers, packaging and shared dependencies, deployment package size, concurrency, runtime choice, Powertools, logging and tracing, alarms, retries and DLQs, payload limits, or choosing HTTP API or REST API, Lambda or Step Functions, Lambda or ECS. Not for creating a new service from a template (creating-aws-projects)./creating-aws-projectsUse when starting a new AWS application in Terraform: an HTTP API on Lambda, and later ECS web services, SQS workers, Step Functions APIs or EC2 services; choosing the pattern, runtime profile and inputs; rendering the tested Copier template; and checking the result. Not for changing an existing deployed project or for EKS./terraform-awsUse when writing or reviewing Terraform for AWS: module layout, naming, one root deployed to several environments, state backends and locking, resources also edited in the console, IAM least privilege and confused-deputy conditions, KMS key policies, keeping secrets out of state, OIDC for CI, GitHub Actions plan and apply pipelines, or promoting one build to each environment. Not for creating a new application (creating-aws-projects) or installing repository checks (aws-iac-team-harness).