/tsh-stack-gcp:auditing-gcp-costfrom TSH Stack: GCP
Runs an evidence-based GCP cost and labelling audit: reads Terraform, validates against live project with read-only gcloud calls, finds drift and shadow resources, checks label compliance, and attributes spend from BigQuery billing export. Produces a presentation-ready report for FinOps or cost review.
Ships in TSH Stack: GCP. 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.
Read the code, then check reality, then diff the two. The findings that matter most are usually the ones with no infrastructure code behind them at all.
The project's own labelling convention outranks the standard below — reconcile to its keys and report the difference rather than introducing a second scheme.
Verify current machine types, pricing tiers and regional availability with context7
before recommending any specific size. This is mandatory: a recommendation for a
machine type unavailable in the customer's region wastes the whole finding.
| Severity | Rule |
|---|---|
| MUST | Run read-only. list, describe, get only. The bundled gcp-gcloud server can run mutating gcloud commands; an audit never does. |
| MUST | Base right-sizing on utilization metrics or Recommender output. A recommendation with no observed utilization behind it is a guess and must be labelled as one. |
| MUST | Separate measured spend from estimate. Only the BigQuery billing export gives measured cost; anything derived from machine type and runtime hours is an estimate and the report says so. |
| MUST | Warn explicitly before proposing any change to a resource labelled as production. |
| MUST | Save the report file before presenting results, then state its path. |
| NEVER | Propose deleting a resource whose purpose you have not established. An unattached disk may be the only copy of something. |
| NEVER | Present a code-only audit as though it reflected the live project. If access does not resolve, say so in the executive summary. |
| Reference | Load when | Covers |
|---|---|---|
| Service inventory | Always — this is the checklist the audit walks | Every service family, what to check in each, GCP-specific waste patterns |
| Report format | Producing the report | The exact required structure and formatting rules |
gcp-gcloud MCP server, restricted to list, describe and get. Confirm the
active project first with gcloud config get-value project. Falls back to the
gcloud CLI via Bash where the server is unavailable.gcp-storage for bucket inventory, lifecycle policies and storage classes, and
gcp-observability for logging and monitoring configuration — including
retention and exclusions, usually the largest observability line item.gcloud billing budgets list shows what alerting
exists. Without an export, cost is estimated and the report must say so.gcloud recommender recommendations list with
--recommender=google.compute.instance.MachineTypeRecommender for utilization-backed
right-sizing, plus the idle-resource recommenders for waste.context7 — current machine types, pricing tiers, and Terraform Google provider
docs for remediation code.| Workload | Purchase option | Saving |
|---|---|---|
| Steady-state, 24/7 | Committed use discount, 1 or 3 year | 30–70% |
| Variable or bursty | On-demand with autoscaling, plus sustained-use discount | baseline |
| Fault-tolerant batch | Spot VMs | up to 91% |
| Event-driven | Cloud Run or Cloud Functions | per-use |
Sustained-use discounts apply automatically on Compute Engine, so the comparison is committed-use versus already-discounted on-demand — not against list price.
| Access pattern | Class |
|---|---|
| Frequent | Standard |
| Infrequent, 30+ days | Nearline |
| Rare, 90+ days | Coldline |
| Archive, 365+ days | Archive |
Always pair a class with a lifecycle rule that transitions automatically. Note the minimum storage duration per class — deleting from Coldline early still bills the remainder.
GCP labels permit only lowercase letters, numbers, dashes and underscores:
| Label | Example | Purpose |
|---|---|---|
cost_center | cc-102 | Chargeback |
environment | dev, staging, prod | Deployment stage |
service | auth-api | The workload |
owner | platform-team | Responsible team |
data_class | public, confidential, pii | Security classification |
Also check: model_id and training_job_id on GPU instances and Vertex AI endpoints;
data_class on every storage and database resource without exception; and schedule on
anything labelled environment: dev running 24/7 — a development resource with no
schedule is the most common cheap win.
Read labels project-wide with gcloud asset search-all-resources --format=json.
Audit progress:
- [ ] 1. Scope confirmed (project, region, service focus)
- [ ] 2. Infrastructure code analysed
- [ ] 3. Live state inventoried
- [ ] 4. Drift and shadow resources identified
- [ ] 5. Waste and right-sizing found
- [ ] 6. Label compliance checked
- [ ] 7. Cost attributed, savings estimated
- [ ] 8. Report saved, then presented
*.tf, terragrunt.hcl); Deployment
Manager lost support on 2026-04-01 and is turned down after 2027-06-30, so treat
any remaining templates as a migration finding, not a source. Extract everything that drives cost: machine_type,
disk_size_gb, disk_type, tier, availability_type, node counts. Note
anti-patterns — hardcoded machine types, missing lifecycle rules, over-provisioned
module defaults, uncapped disk autoresize.The audit is analysis-only. Generate remediation Terraform only after the user names which opportunities to implement, and show a diff before writing to any existing file.
Cloud-agnostic cost framework, labelling governance and provisioning checklists live in
optimizing-cloud-cost in the tsh-platform-engineering plugin. Provisioning patterns
are implementing GCP Terraform in this plugin.
What SKILL.md sets; muted values are Claude Code's defaults
Trigger on: 'audit our GCP costs', a Google Cloud bill that jumped, a FinOps or cost-optimization review of a project, right-sizing Compute Engine or Cloud SQL, finding unattached persistent disks, reserved unused static IPs, orphaned snapshots or idle load balancers, Cloud NAT or Cloud Logging ingestion spend, GCP label compliance, committed use discounts versus on-demand, Cloud Storage class and lifecycle review, or GKE node pool and Cloud Run sizing.
npx claudepluginhub thesoftwarehouse/agentic-collections --plugin tsh-stack-gcp2 skills in this plugin
Other plugins' skills for the same job