agentleFS
jpantsjohajpantsjoha/googlecloud-plugin/skills/cloud-storage/SKILL.md

cloud-storage

Skill4 starsChanged 4 months agoMITView on GitHub

Manage object storage on Google Cloud Storage. Covers bucket creation, IAM, uniform access control, lifecycle policies, signed URLs, and gsutil/gcloud CLI patterns. Enforces private-by-default: never creates public buckets without explicit intent and gcp-security sign-off. Use when the user mentions: GCS, upload to GCP, storage IAM, lifecycle policy, storage class.

The file

Files
SKILL.md

Cloud Storage

Highly durable, globally consistent object storage. Private by default — always review IAM before making anything public.

Safety Rule — Never Public by Default

New buckets must use uniform bucket-level access and must not grant allUsers or allAuthenticatedUsers without explicit design intent and gcp-security sign-off.

Core Patterns

Create a bucket (private, uniform access)

gcloud storage buckets create gs://BUCKET_NAME \
  --location=REGION \
  --uniform-bucket-level-access \
  --project=PROJECT_ID

Grant access (least-privilege)

gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME \
  --member="serviceAccount:SA@PROJECT.iam.gserviceaccount.com" \
  --role="roles/storage.objectViewer"

Upload / download

gcloud storage cp LOCAL_FILE gs://BUCKET_NAME/path/
gcloud storage cp gs://BUCKET_NAME/path/FILE ./local/

Lifecycle policy (auto-delete after N days)

cat > /tmp/lifecycle.json <<'EOF'
{
  "rule": [{
    "action": {"type": "Delete"},
    "condition": {"age": 90}
  }]
}
EOF
gcloud storage buckets update gs://BUCKET_NAME \
  --lifecycle-file=/tmp/lifecycle.json

Generate a signed URL (time-limited access)

# Signs as the service account through impersonation — no private key file
gcloud storage sign-url gs://BUCKET_NAME/OBJECT \
  --duration=1h \
  --impersonate-service-account=SA_NAME@PROJECT_ID.iam.gserviceaccount.com

Two identities, two permissions — both IAM grants a named human authorises:

  • The caller needs roles/iam.serviceAccountTokenCreator on the signing service account (to sign as it).
  • The signing service account needs storage.objects.get on the object, typically roles/storage.objectViewer on the bucket. Without it the URL signs successfully but returns 403 when used.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.