Safely assess and recover from a stuck Terraform state lock.
SkillScore87Maintained
Automatic
◆DevOps & SRE pack
Last verified 8/3/2026
What it changes
Passed 20 of 23 test cases with the skill, and 18 of 23 without it.
Without skill78%
With skill87%
Checks it passed that the model alone missed
Recommends escalating to platform owners.
Rejects executing `terraform force-unlock`.
Recommends escalating if state corruption is suspected.
and 2 more in the full report
4 fixed16 passed either way1 still failing2 broke
Pass-rate lift
+9 pp
Tokens
-28%
Agent turns
0%
Response time
-45%
Model gemini-3.6-flashMeasured 8/3/2026v120 of 23 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 4
Prompt
After resolving a lock issue on a Google Cloud Storage backend, what two verification criteria must be satisfied before declaring the environment ready?
What was checked, without and with the skill
Checked
Without skill
With skill
Requires confirming that `terraform plan` completes successfully.
Passed
Passed
Requires confirming no concurrent runs are writing to state.
Missed
Passed
case-18 · gemini-3.6-flash · 8/3/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md43 linessingle file
When to use
Use when Terraform reports the state is locked and operations cannot proceed.
Preconditions
You have access to the workspace and can identify the last run/operator.
You understand the blast radius of forcing an unlock.
Procedure
Determine whether a Terraform operation is currently running (CI runner, TFC/TFE run, local terminal).
Identify lock metadata (who/when/operation).
If a run is active, wait or stop it cleanly.
If the lock is stale, coordinate and force-unlock only after confirming no active writers.
Run a plan to confirm state consistency.
Decision points
Active run present: do not force-unlock.
Stale lock (no active run, old timestamp): force-unlock may be appropriate.
Repeated lock issues: investigate backend connectivity and CI cancellation behavior.
Verification
A new terraform plan completes successfully.
No concurrent runs are writing to state.
Rollback / undo
If state becomes inconsistent, restore from backend versioning/snapshots.
If a partial apply occurred, reconcile with a fresh plan and targeted remediation.
Escalation
Escalate to platform/IaC owners if unlock requires backend admin privileges.