[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EF29CD1FQZHKT0JM7EGJRC":3,"skill-same:01M6EF29CD1FQZHKT0JM7EGJRC":59},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":22,"linkOnly":23,"markdownContent":24,"markdownBody":24,"frontMatter":25,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M6EF29CD1FQZHKT0JM7EGJRC","gcp-cloud-functions",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fgcp-cloud-functions\u002FSKILL.md",[],[18,19,20,21],"cloud","gcp","functions","gcp cloud functions","2026-11-10 10:12:30",false,"# GCP Cloud Functions\n\nGoogle Cloud Functions is a serverless execution environment for building event-driven applications. Write single-purpose functions that respond to HTTP requests, Pub\u002FSub messages, Cloud Storage events, or Firestore changes — no infrastructure to manage.\n\n## Core Concepts\n\n- **HTTP Function** — triggered by HTTP requests, returns a response\n- **Event Function** — triggered by cloud events (Pub\u002FSub, Storage, Firestore)\n- **Gen 2** — latest version, built on Cloud Run, longer timeouts, concurrency\n- **Trigger** — the event source that invokes the function\n- **Runtime** — language environment (Node.js, Python, Go, Java, etc.)\n\n## HTTP Functions\n\n```javascript\n\u002F\u002F index.js — HTTP function that processes webhook payloads\nconst functions = require('@google-cloud\u002Ffunctions-framework');\n\nfunctions.http('handleWebhook', (req, res) => {\n  const { event, data } = req.body;\n\n  if (req.method !== 'POST') {\n    return res.status(405).send('Method not allowed');\n  }\n\n  console.log(`Received event: ${event}`, data);\n\n  switch (event) {\n    case 'order.created':\n      \u002F\u002F Process new order\n      res.json({ status: 'processed', orderId: data.id });\n      break;\n    default:\n      res.json({ status: 'ignored', event });\n  }\n});\n```\n\n```bash\n# Deploy an HTTP function (Gen 2)\ngcloud functions deploy handle-webhook \\\n  --gen2 \\\n  --runtime nodejs20 \\\n  --region us-central1 \\\n  --source . \\\n  --entry-point handleWebhook \\\n  --trigger-http \\\n  --allow-unauthenticated \\\n  --memory 256Mi \\\n  --timeout 60 \\\n  --set-env-vars \"NODE_ENV=production\"\n```\n\n## Pub\u002FSub Triggered Functions\n\n```python\n# main.py — process Pub\u002FSub messages\nimport base64\nimport json\nimport functions_framework\n\n@functions_framework.cloud_event\ndef process_message(cloud_event):\n    \"\"\"Triggered by a Pub\u002FSub message.\"\"\"\n    data = base64.b64decode(cloud_event.data[\"message\"][\"data\"]).decode()\n    message = json.loads(data)\n\n    print(f\"Processing order: {message['order_id']}\")\n\n    # Process the order\n    result = fulfill_order(message)\n    print(f\"Order {message['order_id']} fulfilled: {result}\")\n```\n\n```bash\n# Deploy Pub\u002FSub triggered function\ngcloud functions deploy process-order \\\n  --gen2 \\\n  --runtime python312 \\\n  --region us-central1 \\\n  --source . \\\n  --entry-point process_message \\\n  --trigger-topic order-events \\\n  --memory 512Mi \\\n  --timeout 120 \\\n  --set-secrets \"DATABASE_URL=db-url:latest\"\n```\n\n## Cloud Storage Triggered Functions\n\n```python\n# main.py — process uploaded files\nimport functions_framework\nfrom google.cloud import storage, vision\n\n@functions_framework.cloud_event\ndef process_upload(cloud_event):\n    \"\"\"Triggered when a file is uploaded to Cloud Storage.\"\"\"\n    data = cloud_event.data\n    bucket_name = data[\"bucket\"]\n    file_name = data[\"name\"]\n\n    if not file_name.lower().endswith(('.jpg', '.png', '.jpeg')):\n        print(f\"Skipping non-image file: {file_name}\")\n        return\n\n    print(f\"Processing image: gs:\u002F\u002F{bucket_name}\u002F{file_name}\")\n\n    # Generate thumbnail, run OCR, etc.\n    client = storage.Client()\n    bucket = client.bucket(bucket_name)\n    blob = bucket.blob(file_name)\n    image_data = blob.download_as_bytes()\n\n    # Process image...\n    print(f\"Processed {file_name} ({len(image_data)} bytes)\")\n```\n\n```bash\n# Deploy Storage triggered function\ngcloud functions deploy process-upload \\\n  --gen2 \\\n  --runtime python312 \\\n  --region us-central1 \\\n  --source . \\\n  --entry-point process_upload \\\n  --trigger-event-filters=\"type=google.cloud.storage.object.v1.finalized\" \\\n  --trigger-event-filters=\"bucket=my-uploads-bucket\" \\\n  --memory 1Gi \\\n  --timeout 300\n```\n\n## Firestore Triggered Functions\n\n```javascript\n\u002F\u002F index.js — react to Firestore document changes\nconst functions = require('@google-cloud\u002Ffunctions-framework');\nconst { Firestore } = require('@google-cloud\u002Ffirestore');\n\nfunctions.cloudEvent('onUserCreated', async (cloudEvent) => {\n  const data = cloudEvent.data;\n  const newValue = data.value.fields;\n\n  const email = newValue.email.stringValue;\n  const name = newValue.name.stringValue;\n\n  console.log(`New user created: ${name} (${email})`);\n\n  \u002F\u002F Send welcome email, create default settings, etc.\n  const db = new Firestore();\n  await db.collection('user-settings').doc(data.value.name.split('\u002F').pop()).set({\n    theme: 'light',\n    notifications: true,\n    createdAt: Firestore.FieldValue.serverTimestamp()\n  });\n});\n```\n\n```bash\n# Deploy Firestore triggered function\ngcloud functions deploy on-user-created \\\n  --gen2 \\\n  --runtime nodejs20 \\\n  --region us-central1 \\\n  --source . \\\n  --entry-point onUserCreated \\\n  --trigger-event-filters=\"type=google.cloud.firestore.document.v1.created\" \\\n  --trigger-event-filters=\"database=(default)\" \\\n  --trigger-event-filters-path-pattern=\"document=users\u002F{userId}\" \\\n  --memory 256Mi\n```\n\n## Managing Functions\n\n```bash\n# List deployed functions\ngcloud functions list --gen2 --region us-central1\n```\n\n```bash\n# View function details\ngcloud functions describe process-order --gen2 --region us-central1\n```\n\n```bash\n# View logs\ngcloud functions logs read process-order --gen2 --region us-central1 --limit 50\n```\n\n```bash\n# Delete a function\ngcloud functions delete process-order --gen2 --region us-central1\n```\n\n## Local Development\n\n```bash\n# Run function locally\nnpx @google-cloud\u002Ffunctions-framework --target=handleWebhook --port=8080\n```\n\n```bash\n# Test locally with curl\ncurl -X POST http:\u002F\u002Flocalhost:8080 \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"event\":\"order.created\",\"data\":{\"id\":\"12345\"}}'\n```\n\n## Best Practices\n\n- Use Gen 2 for all new functions (better performance, concurrency support)\n- Set memory and timeout based on actual needs — don't over-provision\n- Use Secret Manager for credentials, not environment variables\n- Implement idempotent handlers — events may be delivered more than once\n- Use structured logging for better observability in Cloud Logging\n- Set min-instances to avoid cold starts for latency-sensitive functions\n- Use the functions framework for local development and testing\n- Keep functions focused — one function, one purpose\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fgcp-cloud-functions",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill gcp-cloud-functions",{"tool":41,"command":42},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill gcp-cloud-functions",{"tool":44,"command":45},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill gcp-cloud-functions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fgcp-cloud-functions\u002FSKILL.md",true,[49,55],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"README.md","REFERENCE","参考文档",1957,"https:\u002F\u002Fgithub.com\u002Fxiaoshudian555\u002Fprivate-skills\u002Fblob\u002Fmain\u002Fskills\u002Flog-analysis\u002Flog-analysis-locate-guide\u002FREADME.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"reference-example.md",1149,"https:\u002F\u002Fgithub.com\u002Fxiaoshudian555\u002Fprivate-skills\u002Fblob\u002Fmain\u002Fskills\u002Flog-analysis\u002Flog-analysis-locate-guide\u002Freference-example.md",[60,69,78,87,93,99],{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":22},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[66,67,68],"model","model hierarchy","model hierarchy skill",{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":22},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[75,76,77],"MCP","zoom","zoom mcp",{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":22},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[84,85,86,76],"sdk","zoom apps sdk","apps",{"skillNo":88,"name":89,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":22},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[89],{"skillNo":94,"name":95,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":22},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[95],{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":22},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[101]]