[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-54e081bc-1d1f-4459-bdaa-8ee8406ba485":3,"$fZjj8MR3KrFLjn0vBk3H8xRcD6j1uxv9AYTGW-M0wz8Q":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"54e081bc-1d1f-4459-bdaa-8ee8406ba485","gcp-cloud-architect","为初创企业和企业设计GCP架构。在需要设计谷歌云基础设施、部署到GKE或Cloud Run、配置BigQuery管道、优化GCP成本或迁移到GCP时使用。涵盖Cloud Run、GKE、Cloud Functions、Cloud SQL、BigQuery和成本优化。","cat_coding_devops","mod_coding","alirezarezvani,coding","---\nname: \"gcp-cloud-architect\"\ndescription: \"Design GCP architectures for startups and enterprises. Use when asked to design Google Cloud infrastructure, deploy to GKE or Cloud Run, configure BigQuery pipelines, optimize GCP costs, or migrate to GCP. Covers Cloud Run, GKE, Cloud Functions, Cloud SQL, BigQuery, and cost optimization.\"\n---\n\n# GCP Cloud Architect\n\nDesign scalable, cost-effective Google Cloud architectures for startups and enterprises with infrastructure-as-code templates.\n\n---\n\n## Workflow\n\n### Step 1: Gather Requirements\n\nCollect application specifications:\n\n```\n- Application type (web app, mobile backend, data pipeline, SaaS)\n- Expected users and requests per second\n- Budget constraints (monthly spend limit)\n- Team size and GCP experience level\n- Compliance requirements (GDPR, HIPAA, SOC 2)\n- Availability requirements (SLA, RPO\u002FRTO)\n```\n\n### Step 2: Design Architecture\n\nRun the architecture designer to get pattern recommendations:\n\n```bash\npython scripts\u002Farchitecture_designer.py --input requirements.json\n```\n\n**Example output:**\n\n```json\n{\n  \"recommended_pattern\": \"serverless_web\",\n  \"service_stack\": [\"Cloud Storage\", \"Cloud CDN\", \"Cloud Run\", \"Firestore\", \"Identity Platform\"],\n  \"estimated_monthly_cost_usd\": 30,\n  \"pros\": [\"Low ops overhead\", \"Pay-per-use\", \"Auto-scaling\", \"No cold starts on Cloud Run min instances\"],\n  \"cons\": [\"Vendor lock-in\", \"Regional limitations\", \"Eventual consistency with Firestore\"]\n}\n```\n\nSelect from recommended patterns:\n- **Serverless Web**: Cloud Storage + Cloud CDN + Cloud Run + Firestore\n- **Microservices on GKE**: GKE Autopilot + Cloud SQL + Memorystore + Cloud Pub\u002FSub\n- **Serverless Data Pipeline**: Pub\u002FSub + Dataflow + BigQuery + Looker\n- **ML Platform**: Vertex AI + Cloud Storage + BigQuery + Cloud Functions\n\nSee `references\u002Farchitecture_patterns.md` for detailed pattern specifications.\n\n**Validation checkpoint:** Confirm the recommended pattern matches the team's operational maturity and compliance requirements before proceeding to Step 3.\n\n### Step 3: Estimate Cost\n\nAnalyze estimated costs and optimization opportunities:\n\n```bash\npython scripts\u002Fcost_optimizer.py --resources current_setup.json --monthly-spend 2000\n```\n\n**Example output:**\n\n```json\n{\n  \"current_monthly_usd\": 2000,\n  \"recommendations\": [\n    { \"action\": \"Right-size Cloud SQL db-custom-4-16384 to db-custom-2-8192\", \"savings_usd\": 380, \"priority\": \"high\" },\n    { \"action\": \"Purchase 1-yr committed use discount for GKE nodes\", \"savings_usd\": 290, \"priority\": \"high\" },\n    { \"action\": \"Move Cloud Storage objects >90 days to Nearline\", \"savings_usd\": 75, \"priority\": \"medium\" }\n  ],\n  \"total_potential_savings_usd\": 745\n}\n```\n\nOutput includes:\n- Monthly cost breakdown by service\n- Right-sizing recommendations\n- Committed use discount opportunities\n- Sustained use discount analysis\n- Potential monthly savings\n\nUse the [GCP Pricing Calculator](https:\u002F\u002Fcloud.google.com\u002Fproducts\u002Fcalculator) for detailed estimates.\n\n### Step 4: Generate IaC\n\nCreate infrastructure-as-code for the selected pattern:\n\n```bash\npython scripts\u002Fdeployment_manager.py --app-name my-app --pattern serverless_web --region us-central1\n```\n\n**Example Terraform HCL output (Cloud Run + Firestore):**\n\n```hcl\nterraform {\n  required_providers {\n    google = {\n      source  = \"hashicorp\u002Fgoogle\"\n      version = \"~> 5.0\"\n    }\n  }\n}\n\nprovider \"google\" {\n  project = var.project_id\n  region  = var.region\n}\n\nvariable \"project_id\" {\n  description = \"GCP project ID\"\n  type        = string\n}\n\nvariable \"region\" {\n  description = \"GCP region\"\n  type        = string\n  default     = \"us-central1\"\n}\n\nresource \"google_cloud_run_v2_service\" \"api\" {\n  name     = \"${var.environment}-${var.app_name}-api\"\n  location = var.region\n\n  template {\n    containers {\n      image = \"gcr.io\u002F${var.project_id}\u002F${var.app_name}:latest\"\n      resources {\n        limits = {\n          cpu    = \"1000m\"\n          memory = \"512Mi\"\n        }\n      }\n      env {\n        name  = \"FIRESTORE_PROJECT\"\n        value = var.project_id\n      }\n    }\n    scaling {\n      min_instance_count = 0\n      max_instance_count = 10\n    }\n  }\n}\n\nresource \"google_firestore_database\" \"default\" {\n  project     = var.project_id\n  name        = \"(default)\"\n  location_id = var.region\n  type        = \"FIRESTORE_NATIVE\"\n}\n```\n\n**Example gcloud CLI deployment:**\n\n```bash\n# Deploy Cloud Run service\ngcloud run deploy my-app-api \\\n  --image gcr.io\u002F$PROJECT_ID\u002Fmy-app:latest \\\n  --region us-central1 \\\n  --platform managed \\\n  --allow-unauthenticated \\\n  --memory 512Mi \\\n  --cpu 1 \\\n  --min-instances 0 \\\n  --max-instances 10\n\n# Create Firestore database\ngcloud firestore databases create --location=us-central1\n```\n\n> Full templates including Cloud CDN, Identity Platform, IAM, and Cloud Monitoring are generated by `deployment_manager.py` and also available in `references\u002Farchitecture_patterns.md`.\n\n### Step 5: Configure CI\u002FCD\n\nSet up automated deployment with Cloud Build or GitHub Actions:\n\n```yaml\n# cloudbuild.yaml\nsteps:\n  - name: 'gcr.io\u002Fcloud-builders\u002Fdocker'\n    args: ['build', '-t', 'gcr.io\u002F$PROJECT_ID\u002Fmy-app:$COMMIT_SHA', '.']\n\n  - name: 'gcr.io\u002Fcloud-builders\u002Fdocker'\n    args: ['push', 'gcr.io\u002F$PROJECT_ID\u002Fmy-app:$COMMIT_SHA']\n\n  - name: 'gcr.io\u002Fgoogle.com\u002Fcloudsdktool\u002Fcloud-sdk'\n    entrypoint: gcloud\n    args:\n      - 'run'\n      - 'deploy'\n      - 'my-app-api'\n      - '--image=gcr.io\u002F$PROJECT_ID\u002Fmy-app:$COMMIT_SHA'\n      - '--region=us-central1'\n      - '--platform=managed'\n\nimages:\n  - 'gcr.io\u002F$PROJECT_ID\u002Fmy-app:$COMMIT_SHA'\n```\n\n```bash\n# Connect repo and create trigger\ngcloud builds triggers create github \\\n  --repo-name=my-app \\\n  --repo-owner=my-org \\\n  --branch-pattern=\"^main$\" \\\n  --build-config=cloudbuild.yaml\n```\n\n### Step 6: Security Review\n\nVerify security configuration:\n\n```bash\n# Review IAM bindings\ngcloud projects get-iam-policy $PROJECT_ID --format=json\n\n# Check service account permissions\ngcloud iam service-accounts list --project=$PROJECT_ID\n\n# Verify VPC Service Controls (if applicable)\ngcloud access-context-manager perimeters list --policy=$POLICY_ID\n```\n\n**Security checklist:**\n- IAM roles follow least privilege (prefer predefined roles over basic roles)\n- Service accounts use Workload Identity for GKE\n- VPC Service Controls configured for sensitive APIs\n- Cloud KMS encryption keys for customer-managed encryption\n- Cloud Audit Logs enabled for all admin activity\n- Organization policies restrict public access\n- Secret Manager used for all credentials\n\n**If deployment fails:**\n\n1. Check the failure reason:\n   ```bash\n   gcloud run services describe my-app-api --region us-central1\n   gcloud logging read \"resource.type=cloud_run_revision\" --limit=20\n   ```\n2. Review Cloud Logging for application errors.\n3. Fix the configuration or container image.\n4. Redeploy:\n   ```bash\n   gcloud run deploy my-app-api --image gcr.io\u002F$PROJECT_ID\u002Fmy-app:latest --region us-central1\n   ```\n\n**Common failure causes:**\n- IAM permission errors -- verify service account roles and `--allow-unauthenticated` flag\n- Quota exceeded -- request quota increase via IAM & Admin > Quotas\n- Container startup failure -- check container logs and health check configuration\n- Region not enabled -- enable the required APIs with `gcloud services enable`\n\n---\n\n## Tools\n\n### architecture_designer.py\n\nRecommends GCP services based on workload requirements.\n\n```bash\npython scripts\u002Farchitecture_designer.py --input requirements.json --output design.json\n```\n\n**Input:** JSON with app type, scale, budget, compliance needs\n**Output:** Recommended pattern, service stack, cost estimate, pros\u002Fcons\n\n### cost_optimizer.py\n\nAnalyzes GCP resources for cost savings.\n\n```bash\npython scripts\u002Fcost_optimizer.py --resources inventory.json --monthly-spend 5000\n```\n\n**Output:** Recommendations for:\n- Idle resource removal\n- Machine type right-sizing\n- Committed use discounts\n- Storage class transitions\n- Network egress optimization\n\n### deployment_manager.py\n\nGenerates gcloud CLI deployment scripts and Terraform configurations.\n\n```bash\npython scripts\u002Fdeployment_manager.py --app-name my-app --pattern serverless_web --region us-central1\n```\n\n**Output:** Production-ready deployment scripts with:\n- Cloud Run or GKE deployment\n- Firestore or Cloud SQL setup\n- Identity Platform configuration\n- IAM roles with least privilege\n- Cloud Monitoring and Logging\n\n---\n\n## Quick Start\n\n### Web App on Cloud Run (\u003C $100\u002Fmonth)\n\n```\nAsk: \"Design a serverless web backend for a mobile app with 1000 users\"\n\nResult:\n- Cloud Run for API (auto-scaling, no cold start with min instances)\n- Firestore for data (pay-per-operation)\n- Identity Platform for authentication\n- Cloud Storage + Cloud CDN for static assets\n- Estimated: $15-40\u002Fmonth\n```\n\n### Microservices on GKE ($500-2000\u002Fmonth)\n\n```\nAsk: \"Design a scalable architecture for a SaaS platform with 50k users\"\n\nResult:\n- GKE Autopilot for containerized workloads\n- Cloud SQL (PostgreSQL) with read replicas\n- Memorystore (Redis) for session caching\n- Cloud CDN for global delivery\n- Cloud Build for CI\u002FCD\n- Multi-zone deployment\n```\n\n### Serverless Data Pipeline\n\n```\nAsk: \"Design a real-time analytics pipeline for event data\"\n\nResult:\n- Pub\u002FSub for event ingestion\n- Dataflow (Apache Beam) for stream processing\n- BigQuery for analytics and warehousing\n- Looker for dashboards\n- Cloud Functions for lightweight transforms\n```\n\n### ML Platform\n\n```\nAsk: \"Design a machine learning platform for model training and serving\"\n\nResult:\n- Vertex AI for training and prediction\n- Cloud Storage for datasets and model artifacts\n- BigQuery for feature store\n- Cloud Functions for preprocessing triggers\n- Cloud Monitoring for model drift detection\n```\n\n---\n\n## Input Requirements\n\nProvide these details for architecture design:\n\n| Requirement | Description | Example |\n|-------------|-------------|---------|\n| Application type | What you're building | SaaS platform, mobile backend |\n| Expected scale | Users, requests\u002Fsec | 10k users, 100 RPS |\n| Budget | Monthly GCP limit | $500\u002Fmonth max |\n| Team context | Size, GCP experience | 3 devs, intermediate |\n| Compliance | Regulatory needs | HIPAA, GDPR, SOC 2 |\n| Availability | Uptime requirements | 99.9% SLA, 1hr RPO |\n\n**JSON Format:**\n\n```json\n{\n  \"application_type\": \"saas_platform\",\n  \"expected_users\": 10000,\n  \"requests_per_second\": 100,\n  \"budget_monthly_usd\": 500,\n  \"team_size\": 3,\n  \"gcp_experience\": \"intermediate\",\n  \"compliance\": [\"SOC2\"],\n  \"availability_sla\": \"99.9%\"\n}\n```\n\n---\n\n## Output Formats\n\n### Architecture Design\n\n- Pattern recommendation with rationale\n- Service stack diagram (ASCII)\n- Monthly cost estimate and trade-offs\n\n### IaC Templates\n\n- **Terraform HCL**: Production-ready Google provider configs\n- **gcloud CLI**: Scripted deployment commands\n- **Cloud Build YAML**: CI\u002FCD pipeline definitions\n\n### Cost Analysis\n\n- Current spend breakdown with optimization recommendations\n- Priority action list (high\u002Fmedium\u002Flow) and implementation checklist\n\n---\n\n## Anti-Patterns\n\n| Anti-Pattern | Why It Fails | Better Approach |\n|---|---|---|\n| Using default VPC for production | No isolation, shared firewall rules | Create custom VPC with private subnets |\n| Over-provisioning GKE node pools | Wasted cost on idle capacity | Use GKE Autopilot or cluster autoscaler |\n| Storing secrets in environment variables | Visible in Cloud Console, logs | Use Secret Manager with Workload Identity |\n| Ignoring sustained use discounts | Missing 20-30% automatic savings | Right-size VMs for consistent baseline usage |\n| Single-region deployment for SaaS | One region outage = full downtime | Multi-region with Cloud Load Balancing |\n| BigQuery on-demand for heavy workloads | Unpredictable costs at scale | Use BigQuery slots (flat-rate) for consistent workloads |\n| Running Cloud Functions for long tasks | 9-minute timeout, cold starts | Use Cloud Run for tasks > 60 seconds |\n\n---\n\n## Cross-References\n\n| Skill | Relationship |\n|-------|-------------|\n| `engineering-team\u002Faws-solution-architect` | AWS equivalent — same 6-step workflow, different services |\n| `engineering-team\u002Fazure-cloud-architect` | Azure equivalent — completes the cloud trifecta |\n| `engineering-team\u002Fsenior-devops` | Broader DevOps scope — pipelines, monitoring, containerization |\n| `engineering\u002Fterraform-patterns` | IaC implementation — use for Terraform modules targeting GCP |\n| `engineering\u002Fci-cd-pipeline-builder` | Pipeline construction — automates Cloud Build and deployment |\n\n---\n\n## Reference Documentation\n\n| Document | Contents |\n|----------|----------|\n| `references\u002Farchitecture_patterns.md` | 6 patterns: serverless, GKE microservices, three-tier, data pipeline, ML platform, multi-region |\n| `references\u002Fservice_selection.md` | Decision matrices for compute, database, storage, messaging |\n| `references\u002Fbest_practices.md` | Naming, labels, IAM, networking, monitoring, disaster recovery |\n","","imported","https:\u002F\u002Fgithub.com\u002Falirezarezvani\u002Fclaude-skills","user_system_seed","SkillOPIC",true,67,1299,"2026-05-16 13:56:26",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"编程开发","coding","mdi-code-braces","代码生成、调试、审查，提升开发效率",2,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"DevOps","devops","mdi-cog-outline","CI\u002FCD、容器化、部署运维",3,162,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"651fcf17-d27b-4d22-8b66-64a7ff062719","1.0.0","gcp-cloud-architect.zip",39180,"uploads\u002Fskills\u002F54e081bc-1d1f-4459-bdaa-8ee8406ba485\u002Fgcp-cloud-architect.zip","84b8f64b516f8526d5dcb2450f6bef5ae75675978400e58049e0183d882a3b85","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":12905},{\"path\":\"references\u002Farchitecture_patterns.md\",\"isDirectory\":false,\"size\":17984},{\"path\":\"references\u002Fbest_practices.md\",\"isDirectory\":false,\"size\":12693},{\"path\":\"references\u002Fservice_selection.md\",\"isDirectory\":false,\"size\":14053},{\"path\":\"scripts\u002Farchitecture_designer.py\",\"isDirectory\":false,\"size\":34842},{\"path\":\"scripts\u002Fcost_optimizer.py\",\"isDirectory\":false,\"size\":20184},{\"path\":\"scripts\u002Fdeployment_manager.py\",\"isDirectory\":false,\"size\":23921}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]