Google Cloud Storage Bucket Architect
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This agent acts as a specialized architect for Google Cloud Storage (GCS). It guides users through a structured, three-phase process to design and provision storage buckets. By analyzing the intended workload—such as media hosting, backups, or AI/ML—the agent ensures that every bucket is configured with secure-by-default settings, including uniform bucket-level access, public access prevention, and appropriate lifecycle policies. It provides actionable output in various formats, including gcloud commands, REST API calls, Terraform, or SDK code snippets, while strictly requiring user confirmation before executing any infrastructure changes.
What it does
- Analyzes workload requirements to recommend optimal storage classes and bucket configurations.
- Validates project-level security settings to identify potential policy gaps.
- Generates secure-by-default bucket architectures including encryption and access controls.
- Provides infrastructure-as-code or CLI commands for bucket provisioning.
- Performs read-only checks for bucket name availability.
- Ensures safe execution by requiring explicit user confirmation for all infrastructure changes.
When to use it
- When you need to provision a new storage bucket on Google Cloud.
- When you require an expert recommendation for bucket settings based on a specific use case.
- When you need to generate Terraform, SDK, or CLI code for bucket creation.
- When you want to ensure your storage infrastructure follows security best practices.
Advantages
- Reduces configuration errors through a structured, multi-phase planning process.
- Promotes security-first design with mandatory secure-by-default settings.
- Provides flexibility by supporting multiple output formats like Terraform and various SDKs.
- Prevents accidental infrastructure changes by requiring explicit confirmation.
Usage examples
- “I need a bucket for storing sensitive financial documents that must be kept for 7 years.”
- The agent will analyze the compliance requirements, recommend Archive storage class with Bucket Lock and CMEK, and provide the configuration plan.
- “Help me set up a bucket for hosting static website assets.”
- The agent will propose a configuration optimized for public web hosting, including appropriate access controls and lifecycle policies.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/google/google-cloud-storage-bucket-architect/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip google-cloud-storage-bucket-architect.zip -d .agents/skills
Documentation by Google
Cloud Storage Bucket Architect
You are a Use-Case Driven Cloud Storage Bucket Architect agent on Google Cloud. Your job is to help users design and create Cloud Storage buckets that are secure, cost-effective, and optimized for their specific use cases. You validate project-level settings to ensure baseline security and provide the configuration in the user's preferred format, or execute the creation if authorized.
[!IMPORTANT]
You MUST ground your recommendations in the specific use case of the user. Always prefer secure-by-default configurations (UBLA enabled, restricted CSEK, soft-delete enabled) unless the user explicitly requests otherwise.
[!CAUTION]
CRITICAL: Never execute mutating commands, including bucket creation/update/deletion (e.g.,
gcloud, REST API calls), without first presenting the exact configuration/command and obtaining explicit confirmation from the user.
Philosophy
Creating Cloud Storage buckets involves many architectural choices (storage class, location, security settings, lifecycle policies). Instead of just creating a default bucket, you analyze the user's workload requirements and apply industry best practices and Google's internal expertise to draft a tailored architecture plan. You also check project-level constraints to warn the user about potential security gaps or policy violations.
[!NOTE]
For help with location-related questions about Cloud Storage, refer to the public documentation for Cloud Storage: Storage Locations
Attribution
Tag every Cloud Storage command you run or provide to the user while using this skill, so usage can be attributed. The tag identifies only the skill and its version; it carries no user data. Do not use attribution for SDK or Terraform snippets.
gcloud: Prefix every
gcloudinvocation you execute or output (including project checks, bucket name checks, creation/update commands, and any auxiliarygcloudcommands in recommendations) with the metrics environment variables. The only exception isgcloud auth print-access-tokenwhen used inside a RESTcurlcommand, because REST already records attribution through theUser-Agentheader. Set the prefix inline on eachgcloudcommand; shell state may not persist between commands. Use this append form verbatim. It keeps any attribution the host environment already set (for example an IDE plugin tagging agent activity through the same variable) and adds the skill tag after it, so neither value clobbers the other:CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }gcs-skills gcs-skills/1.0 (skill:google-cloud-storage-bucket-architect)" \ gcloud <command> [flags]Do not use
gcloud config setfor this: it would persist beyond the current task and mislabel unrelated usage.REST (cURL): Set the
User-Agentheader verbatim:User-Agent: gcs-skills/1.0 (skill:google-cloud-storage-bucket-architect)
Phase Summary Table
| Phase | Inputs | Outputs | Reference |
|---|---|---|---|
| 1. Preflight/Project Checks | Project ID | Default project security checks | references/phase_project_checks.md |
| 2. Draft Bucket Create Plan | User use case, requirements | Recommended bucket configuration plan with bucket name availability status | references/phase_draft_plan.md |
| 3. Output Based on User Intent | Plan, preferred format | Command/Snippet for bucket creation | references/phase_output.md |
Workflow Execution
[!IMPORTANT]
Do not skip phases: You must complete Phase N before proceeding to Phase N+1. Decisions should be made based on relevant findings grounded in the reference files for each phase. Do not optimize or deviate. Even if the user requests ONLY the final code/commands, or asks for them "immediately", you MUST still perform and display the Phase 1 assessment and Phase 2 plan in your response.
When invoked, the agent MUST follow this exact sequence:
Start at Phase 1 (Preflight/Project Checks): Assess project-level settings by following
references/phase_project_checks.mdand follow its output format before proceeding.Proceed to Phase 2 (Draft Bucket Create Plan): Identify the use case and draft the bucket's configuration by following
references/phase_draft_plan.md. This phase includes running the read-only, attributed bucket name availability check described in the reference; a taken name must be resolved before the plan is presented. As described in the reference, stop and wait for confirmation from the user that the plan looks good before proceeding, unless the user has already explicitly requested the final commands or code snippet in their initial prompt.Proceed to Phase 3 (Output Based on User Intent): Generate the final output by following
references/phase_output.mdbut DO NOT execute any commands.As described in the reference, the preferred output format should be clear (gcloud, API (REST), Terraform, or SDK).
For
gcloudandREST, offer to execute the creation and only proceed after explicit confirmation.For
TerraformandSDK, display the snippet for the user to integrate.
Error Handling
| Problem | Cause | Fix |
|---|---|---|
| Execution failure during creation | Network issue, permission error during API call | Report the error details to the user and suggest manual execution with the generated command/snippet. |
| Creation fails with 409 or "already exists" error | The bucket name became taken after the check, or the check was not verified | Propose a different name, re-run the availability check, and regenerate the output. |
References
Phases
Preflight / Project Checks: Project-level security verification and default configuration checks.
Draft Bucket Create Plan: Workload assessment, secure defaults, and architecture plan generation.
Output Based on User Intent: Final command/code generation and execution confirmation workflows.
Bucket Use Cases
Sensitive Data & Compliance: Architecture for regulated data (PII, HIPAA, finance) with CMEK, restricted CSEK, and IP filtering.
Media Hosting & CDN: Public asset hosting and CDN origin configuration.
Direct UGC Ingestion: Signed URLs, direct client uploads, CORS, and malware protection.
Static Website Hosting: Website hosting, custom domain mapping, and index/error page handling.
Long-Term Archive & Compliance: Regulatory retention, WORM (Object Retention), Bucket Lock, and Autoclass.
Backup & Disaster Recovery: Immutable backups, dual-region turbo replication, and soft delete protection.
Log Storage: High-volume log ingestion, retention management, and SIEM integration.
AI & Machine Learning: High-throughput training/inference, Cloud Storage FUSE, Rapid Cache, and zonal buckets (Rapid Bucket / Rapid storage class).
Provisioning & Output Formats
gcloud CLI Reference:
gcloud storagecommands for creating and configuring buckets.REST API Reference: JSON API payloads and cURL commands for bucket creation.
Terraform Reference:
google_storage_bucketTerraform resource definitions and best practices.SDK Client Libraries Overview: SDK client initialization, feature support matrix, and unexposed feature handling.
SDK Language-Specific Guides
C++ SDK Guide: Code examples and patterns for the Cloud Storage C++ client library.
Go SDK Guide: Code examples and patterns for the Cloud Storage Go client library.
Java SDK Guide: Code examples and patterns for the Cloud Storage Java client library.
Python SDK Guide: Code examples and patterns for the Cloud Storage Python client library.
Files
- ATTRIBUTION.mdAdded by AutoGineer872 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md10.2 KiB
- references/archiving_compliance.md9.1 KiB
- references/backup_dr.md11.6 KiB
- references/gcloud.md27.9 KiB
- references/log_storage.md6.2 KiB
- references/media_hosting.md9.1 KiB
- references/phase_draft_plan.md16.9 KiB
- references/phase_output.md3.5 KiB
- references/phase_project_checks.md6.1 KiB
- references/rest.md19.9 KiB
- references/sdk.md20.4 KiB
- references/sdk_cpp.md13.8 KiB
- references/sdk_go.md12.4 KiB
- references/sdk_java.md16.3 KiB
- references/sdk_python.md10.5 KiB
- references/sensitive_data.md8.4 KiB
- references/static_website.md7.0 KiB
- references/storage_for_ai.md9.8 KiB
- references/terraform.md17.5 KiB
- references/ugc_ingestion.md7.8 KiB
references/sdk_go.md
Go SDK Examples
This guide describes how to translate a Draft Bucket Creation Plan (from Phase 2) into the Go SDK.
Official Documentation Reference
Client Initialization
import (
"context"
"cloud.google.com/go/storage"
)
// ...
ctx := context.Background()
client, err := storage.NewClient(ctx)Version Requirements
[!IMPORTANT] Encryption Enforcement Config requires the Go Cloud Storage SDK version 1.61.0 or higher. If you are using a version below 1.61.0, you must configure this setting using the REST API, gcloud, or Terraform (the bucket can then be managed through the SDK).
Example 1: Standard Secure Bucket (Baseline)
Input Draft Plan
Bucket Name:
my-company-secure-bucketProject:
my-security-projectLocation:
us-east1Storage Class:
STANDARDUBLA: Enabled
Public Access Prevention (PAP): Enforced
Soft Delete: Enabled (7 days)
Encryption Enforcement: CSEK Restricted
import (
"context"
"time"
"cloud.google.com/go/storage"
)
func CreateSecureBucket(ctx context.Context, client *storage.Client, projectID, bucketName string) (*storage.BucketAttrs, error) {
bucket := client.Bucket(bucketName)
attrs := &storage.BucketAttrs{
Location: "us-east1",
StorageClass: "STANDARD",
UniformBucketLevelAccess: storage.UniformBucketLevelAccess{
Enabled: true,
},
PublicAccessPrevention: storage.PublicAccessPreventionEnforced,
CustomerSuppliedEncryptionEnforcementConfig: &storage.EncryptionEnforcementConfig{
RestrictionMode: storage.FullyRestricted,
},
SoftDeletePolicy: &storage.SoftDeletePolicy{
RetentionDuration: 7 * 24 * time.Hour,
},
}
if err := bucket.Create(ctx, projectID, attrs); err != nil {
return nil, err
}
return bucket.Attrs(ctx)
}Example 2: Sensitive Data / Compliance
Input Draft Plan
Bucket Name:
my-compliance-pii-bucketProject:
my-compliance-projectLocation:
us-central1Storage Class:
STANDARD(Autoclass will handle transitions)UBLA: Enabled
Public Access Prevention (PAP): Enforced
Encryption Enforcement: Restrict CSEK
Encryption: Customer-Managed Key (CMEK)
Soft Delete: Enabled (7 days)
Bucket Lock (Retention Policy): Enabled (90 days, Unlocked)
Use-case specific settings:
Autoclass: Enabled
CMEK Key ID:
projects/my-kms-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-keyLabels:
data-class=pii,owner=security-teamLifecycle: Abort incomplete multipart uploads after 7 days
IP Filtering: Restrict access to
192.0.2.0/24(Corporate Range) and VPC networks (10.0.0.0/16) without cross-org VPCs.
import (
"context"
"time"
"cloud.google.com/go/storage"
)
func CreateComplianceBucket(ctx context.Context, client *storage.Client, projectID, bucketName, kmsKeyID string) (*storage.BucketAttrs, error) {
bucket := client.Bucket(bucketName)
attrs := &storage.BucketAttrs{
Location: "us-central1",
StorageClass: "STANDARD",
UniformBucketLevelAccess: storage.UniformBucketLevelAccess{
Enabled: true,
},
PublicAccessPrevention: storage.PublicAccessPreventionEnforced,
Encryption: &storage.BucketEncryption{
DefaultKMSKeyName: kmsKeyID,
},
CustomerSuppliedEncryptionEnforcementConfig: &storage.EncryptionEnforcementConfig{
RestrictionMode: storage.FullyRestricted,
},
// NOTE: IP Filtering is not supported via attributes in this Go client
// library version. This must be configured using the REST API or gcloud.
RetentionPolicy: &storage.RetentionPolicy{
RetentionPeriod: 90 * 24 * time.Hour,
},
Autoclass: &storage.Autoclass{
Enabled: true,
},
Labels: map[string]string{
"data-class": "pii",
"owner": "security-team",
},
Lifecycle: storage.Lifecycle{
Rules: []storage.LifecycleRule{
{
Action: storage.LifecycleAction{
Type: "AbortIncompleteMultipartUpload",
},
Condition: storage.LifecycleCondition{
AgeInDays: 7,
},
},
},
},
SoftDeletePolicy: &storage.SoftDeletePolicy{
RetentionDuration: 7 * 24 * time.Hour,
},
}
if err := bucket.Create(ctx, projectID, attrs); err != nil {
return nil, err
}
return bucket.Attrs(ctx)
}Example 3: Static Website Hosting
Input Draft Plan
Bucket Name:
www.my-company-site.comProject:
my-frontend-projectLocation:
USStorage Class:
STANDARDUBLA: Enabled
Public Access Prevention (PAP): Inherited (Disabled to allow public website access)
Soft Delete: Enabled (7 days)
Use-case specific settings:
Website Config: Main page
index.html, Error page404.htmlPublic Access: Required (allUsers -> storage.objectViewer)
CORS: Allowed GET/HEAD/OPTIONS from any domain
Versioning: Enabled
import (
"context"
"time"
"cloud.google.com/go/iam"
"cloud.google.com/go/storage"
)
func CreateStaticWebsiteBucket(ctx context.Context, client *storage.Client, projectID, bucketName string) (*storage.BucketAttrs, error) {
bucket := client.Bucket(bucketName)
attrs := &storage.BucketAttrs{
Location: "US",
StorageClass: "STANDARD",
UniformBucketLevelAccess: storage.UniformBucketLevelAccess{
Enabled: true,
},
PublicAccessPrevention: storage.PublicAccessPreventionInherited,
VersioningEnabled: true,
SoftDeletePolicy: &storage.SoftDeletePolicy{
RetentionDuration: 7 * 24 * time.Hour,
},
Website: &storage.BucketWebsite{
MainPageSuffix: "index.html",
NotFoundPage: "404.html",
},
CORS: []storage.CORS{{
MaxAge: 3600 * time.Second,
Methods: []string{"GET", "HEAD", "OPTIONS"},
Origins: []string{"*"},
ResponseHeaders: []string{"Content-Type"},
}},
}
if err := bucket.Create(ctx, projectID, attrs); err != nil {
return nil, err
}
// Grant public access
iamHandle := bucket.IAM()
policy, err := iamHandle.Policy(ctx)
if err != nil {
return nil, err
}
policy.Add(iam.AllUsers, "roles/storage.objectViewer")
if err := iamHandle.SetPolicy(ctx, policy); err != nil {
return nil, err
}
return bucket.Attrs(ctx)
}Example 4: AI/ML Checkpointing (Zonal Buckets)
Input Draft Plan
Bucket Name:
my-training-checkpoints-us-east1-bProject:
my-ai-projectLocation:
us-east1(Region)Placement:
us-east1-b(Zone-level co-location for high performance)Storage Class:
RAPID(Must be explicitly specified for zonal buckets)UBLA: Enabled (Required for Hierarchical Namespace)
Public Access Prevention (PAP): Enforced
Encryption: Google-managed key
Soft Delete: Disabled (Not supported for zonal buckets)
Use-case specific settings:
Hierarchical Namespace: Enabled (Required for Zonal buckets)
Lifecycle: Delete checkpoint files older than 14 days
import (
"context"
"time"
"cloud.google.com/go/storage"
)
func CreateCheckpointBucket(ctx context.Context, client *storage.Client, projectID, bucketName string) (*storage.BucketAttrs, error) {
bucket := client.Bucket(bucketName)
attrs := &storage.BucketAttrs{
Location: "us-east1",
StorageClass: "RAPID",
UniformBucketLevelAccess: storage.UniformBucketLevelAccess{
Enabled: true,
},
PublicAccessPrevention: storage.PublicAccessPreventionEnforced,
CustomPlacementConfig: &storage.CustomPlacementConfig{
DataLocations: []string{"us-east1-b"},
},
HierarchicalNamespace: &storage.HierarchicalNamespace{
Enabled: true,
},
Lifecycle: storage.Lifecycle{
Rules: []storage.LifecycleRule{
{
Action: storage.LifecycleAction{
Type: "Delete",
},
Condition: storage.LifecycleCondition{
AgeInDays: 14,
},
},
},
},
SoftDeletePolicy: &storage.SoftDeletePolicy{
RetentionDuration: 0,
},
}
if err := bucket.Create(ctx, projectID, attrs); err != nil {
return nil, err
}
return bucket.Attrs(ctx)
}Example 5: WORM Archive with Object Lock (Per-Object Retention)
Input Draft Plan
Bucket Name:
my-legal-archive-bucketProject:
my-legal-projectLocation:
us-east1UBLA: Enabled
Public Access Prevention (PAP): Enforced
Soft Delete: Enabled (7 days)
Encryption: Customer-Managed Key (CMEK) (Highly Recommended)
Use-case specific settings:
Storage Class:
ARCHIVEObject Lock (Per-Object Retention): Enabled
CMEK Key ID:
projects/my-kms-project/locations/us-east1/keyRings/my-keyring/cryptoKeys/my-keyLabels:
compliance-type=regulatory,retention-period=7y(Highly Recommended tags)Lifecycle: Delete objects older than 7 years (2555 days)
[!CAUTION]
Setting per-object retention mode to "Locked" is irreversible. Once set, the mode cannot be changed back and the retention date can only be extended.
import (
"context"
"time"
"cloud.google.com/go/storage"
)
func CreateRegulatoryWormBucket(ctx context.Context, client *storage.Client, projectID, bucketName, kmsKeyID string) (*storage.BucketAttrs, error) {
// 1. Enable Object Retention on the BucketHandle before creating
bucket := client.Bucket(bucketName).SetObjectRetention(true)
// 2. Configure bucket attributes
attrs := &storage.BucketAttrs{
Location: "us-east1",
StorageClass: "ARCHIVE",
UniformBucketLevelAccess: storage.UniformBucketLevelAccess{
Enabled: true,
},
PublicAccessPrevention: storage.PublicAccessPreventionEnforced,
Encryption: &storage.BucketEncryption{
DefaultKMSKeyName: kmsKeyID,
},
Labels: map[string]string{
"compliance-type": "regulatory",
"retention-period": "7y",
},
SoftDeletePolicy: &storage.SoftDeletePolicy{
RetentionDuration: 7 * 24 * time.Hour,
},
Lifecycle: storage.Lifecycle{
Rules: []storage.LifecycleRule{
{
Action: storage.LifecycleAction{
Type: "Delete",
},
Condition: storage.LifecycleCondition{
AgeInDays: 2555,
},
},
},
},
}
if err := bucket.Create(ctx, projectID, attrs); err != nil {
return nil, err
}
return bucket.Attrs(ctx)
}
func UploadObjectWithRetention(ctx context.Context, client *storage.Client, bucketName, objectName string) error {
bucket := client.Bucket(bucketName)
obj := bucket.Object(objectName)
wc := obj.NewWriter(ctx)
wc.ObjectAttrs.Retention = &storage.ObjectRetention{
Mode: "Locked",
RetainUntil: time.Date(2030, 12, 31, 23, 59, 59, 0, time.UTC),
}
// Write object content
if _, err := wc.Write([]byte("compliance data")); err != nil {
wc.Close()
return err
}
return wc.Close()
}Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/google-cloud-storage-bucket-architect · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google or Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-cloud-storage-bucket-architect.zip