All skills
lassejlv avatar

/gcp-account-cleanup

@36d2bea
by Lasselassejlv/skills50 stars
1

Safely inventory and remove Google Cloud project resources with mandatory dry-run-first discovery and explicit human confirmations. Use when the user asks to nuke, empty, clean up, delete everything in, or selectively remove resources from Google Cloud projects, including teardown preparation, sandbox reset, and cost cleanup.

Use this Skill: https://skilld.dev/gh/lassejlv/skills/gcp-account-cleanup

This session only. Nothing lands on disk.

referencesgcp-inventory.md

≈862 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Google Cloud Inventory Checklist

Use this reference only after the required access confirmation. Keep every dry-run command read-only. Replace PROJECT_ID with an exact project ID chosen by the user; do not copy commands with a placeholder into a shell.

Identity and Project

gcloud auth list --filter=status:ACTIVE
gcloud config list
gcloud config configurations list
gcloud projects list
gcloud projects describe PROJECT_ID --format=json

gcloud auth list and active configuration do not by themselves prove which principal an impersonated request uses. Check auth/impersonate_service_account and relevant CLOUDSDK_* overrides without printing credentials.

Project-Wide Discovery

gcloud asset search-all-resources --scope="projects/PROJECT_ID" --format=json

Cloud Asset Inventory requires permission and service availability. Failure or an empty result does not prove that all services are empty. Keep command errors in the inventory summary. For organization or folder cleanup, get separate scope authorization and use the corresponding organizations/NUMBER or folders/NUMBER scope; do not infer it from a project request.

Direct Service Checks

Run only checks relevant to the selected project and enabled services. Prefer explicit --project=PROJECT_ID. Some services need a location-specific list or describe call to capture full coverage.

gcloud compute instances list --project=PROJECT_ID --format=json
gcloud compute disks list --project=PROJECT_ID --format=json
gcloud compute snapshots list --project=PROJECT_ID --format=json
gcloud compute addresses list --project=PROJECT_ID --format=json
gcloud compute forwarding-rules list --project=PROJECT_ID --format=json
gcloud compute networks list --project=PROJECT_ID --format=json
gcloud compute subnetworks list --project=PROJECT_ID --format=json
gcloud compute firewalls list --project=PROJECT_ID --format=json
gcloud sql instances list --project=PROJECT_ID --format=json
gcloud container clusters list --project=PROJECT_ID --format=json
gcloud storage buckets list --project=PROJECT_ID --format=json
gcloud artifacts repositories list --project=PROJECT_ID --location=all --format=json
gcloud secrets list --project=PROJECT_ID --format=json
gcloud iam service-accounts list --project=PROJECT_ID --format=json
gcloud projects get-iam-policy PROJECT_ID --format=json

Check Cloud Run, Cloud Functions, App Engine, Pub/Sub, Cloud Scheduler, Eventarc, Cloud Tasks, Cloud DNS, KMS, Filestore, Bigtable, Spanner, Firestore, Logging, and Monitoring according to the services in use. Use current service-specific CLI documentation to choose exact location flags. For buckets, inspect object and version counts, retention policies, and holds before proposing deletion. For databases, inspect backups and deletion protection.

Summary Format

Principal: user@example.com (configuration: sandbox)
Project: example-sandbox (number: 123456789012)

Found:
- europe-west1-b Compute Engine: vm-a, disk-a
- europe-west1 Cloud SQL: sql-a
- global Cloud Storage: bucket-a (versioning enabled)

Coverage gaps:
- Cloud Asset Inventory: permission denied; direct checks used for listed services
- Cloud Run in other regions: not yet checked

Deletion blockers:
- sql-a has deletion protection enabled
- bucket-a has retained object versions

Choose `all` or list exact resources/services/locations to remove from example-sandbox.

Source: SKILL.md on GitHub

No alerts13d3 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    This skill provides a structured and safe methodology for inventorying and cleaning up Google Cloud Platform resources. It implements multi-stage human confirmation and mandatory dry-runs to prevent accidental or unauthorized deletions. No malicious code, obfuscation, or data exfiltration attempts were found.

  • Socket13d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

Signed by skilld at 36d2bea. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago

README badge

README badge for lassejlv/skills/gcp-account-cleanup