gcp-expert — Claude Code skill: Google Cloud recipes
A skill that hands your agent working GCP examples: Cloud Functions, BigQuery, Firestore, Pub/Sub and gcloud commands. Useful when the code targets Google Cloud.
npx skills add personamanagmentlayer/pcl --skill gcp-expert -a claude-codeWhat gcp-expert does
The skill gives the agent a reference for Google Cloud services: Compute Engine, App Engine, Cloud Run, Cloud Functions, Cloud Storage, BigQuery, Firestore, Pub/Sub and GKE. It ships Python snippets for HTTP and Pub/Sub functions, BigQuery queries and CSV loads, Firestore document writes and queries, and Pub/Sub publishing. There are gcloud and gsutil commands too: create an instance, deploy App Engine, make a bucket, upload a file.
Two more sections cover best practices and anti-patterns. The agent gets a list of what to avoid: credentials in code, missing IAM policies, overly broad permissions, ignored costs, single-region deployments. That shifts the answers you get when you ask for infrastructure code.
The skill allows file reads and edits, and only gcloud among shell commands. So the gsutil examples in it are not something the agent can run — worth checking how you actually manage buckets. Running the Python samples needs google-cloud-bigquery, google-cloud-firestore, google-cloud-pubsub and functions-framework, plus working access to a project.
What it helps with
- write an HTTP Cloud Function handler
- build a BigQuery query with grouping and a limit
- load a CSV file into a BigQuery table
- subscribe to a Pub/Sub topic and ack messages
- deploy App Engine or create a compute instance with
gcloud
Example prompts for the agent
- Write a Cloud Function that takes JSON and stores a document in Firestore
- Give me a BigQuery query for the top 10 names by row count
- Show how to subscribe to a Pub/Sub topic and ack messages
How to install gcp-expert
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill gcp-expert -a claude-code2Manually: put the files in place
~/.claude/skills/gcp-expert/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/gcp-expert/
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill gcp-expert -a codex2Manually: put the files in place
.agents/skills/gcp-expert/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill gcp-expert -a cursor2Manually: put the files in place
.cursor/skills/gcp-expert/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install personamanagmentlayer/pcl gcp-expert2Manually: put the files in place
.github/skills/gcp-expert/SKILL.md1Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill gcp-expert -a gemini-cli2Platform CLI
gemini skills install https://github.com/personamanagmentlayer/pcl --path stdlib/cloud/gcp-expertManually: put the files in place
.devin/skills/gcp-expert/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add personamanagmentlayer/pcl --skill gcp-expert -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about gcp-expert
How do I install gcp-expert in Claude?
Run npx skills add personamanagmentlayer/pcl --skill gcp-expert -a claude-code. The skill lands at ~/.claude/skills/gcp-expert/SKILL.md.
What does gcp-expert do?
It feeds the agent code samples and commands for Google Cloud services: Cloud Functions, BigQuery, Firestore, Pub/Sub, Cloud Storage and GKE, plus best practices and anti-patterns.
Which tools can the skill use?
File reads, writes and edits, and gcloud for shell commands. The gsutil examples in it are not runnable by the agent.
Source text
SKILL.md · Apache-2.0
---
name: gcp-expert
version: 1.1.0
description: >-
Expert-level Google Cloud Platform, services, and cloud architecture. Use when the user
mentions Google Cloud, Cloud Functions, BigQuery, or Firestore.
category: cloud
tags: [gcp, google-cloud, cloud-functions, bigquery, firestore]
allowed-tools:
- Read
- Write
- Edit
- Bash(gcloud:*)
---
# Google Cloud Platform Expert
Expert guidance for Google Cloud Platform services and cloud-native architecture.
## Core Concepts
- Compute Engine, App Engine, Cloud Run
- Cloud Functions (serverless)
- Cloud Storage
- BigQuery (data warehouse)
- Firestore (NoSQL database)
- Pub/Sub (messaging)
- Google Kubernetes Engine (GKE)
## gcloud CLI
```bash
# Initialize
gcloud init
# Create Compute Engine instance
gcloud compute instances create my-instance \
--zone=us-central1-a \
--machine-type=e2-medium \
--image-family=ubuntu-2004-lts \
--image-project=ubuntu-os-cloud
# Deploy App Engine
gcloud app deploy
# Create Cloud Storage bucket
gsutil mb gs://my-bucket-name/
# Upload file
gsutil cp myfile.txt gs://my-bucket-name/
```
## Cloud Functions
```python
import functions_framework
from google.cloud import firestore
@functions_framework.http
def hello_http(request):
request_json = request.get_json(silent=True)
name = request_json.get('name') if request_json else 'World'
return f'Hello {name}!'
@functions_framework.cloud_event
def hello_pubsub(cloud_event):
import base64
data = base64.b64decode(cloud_event.data["message"]["data"]).decode()
print(f'Received: {data}')
```
## BigQuery
```python
from google.cloud import bigquery
client = bigquery.Client()
# Query
query = """
SELECT name, COUNT(*) as count
FROM `project.dataset.table`
WHERE date >= '2024-01-01'
GROUP BY name
ORDER BY count DESC
LIMIT 10
"""
query_job = client.query(query)
results = query_job.result()
for row in results:
print(f"{row.name}: {row.count}")
# Load data
dataset_id = 'my_dataset'
table_id = 'my_table'
table_ref = client.dataset(dataset_id).table(table_id)
job_config = bigquery.LoadJobConfig(
source_format=bigquery.SourceFormat.CSV,
skip_leading_rows=1,
autodetect=True
)
with open('data.csv', 'rb') as source_file:
job = client.load_table_from_file(source_file, table_ref, job_config=job_config)
job.result()
```
## Firestore
```python
from google.cloud import firestore
db = firestore.Client()
# Create document
doc_ref = db.collection('users').document('user1')
doc_ref.set({
'name': 'John Doe',
'email': '[email protected]',
'age': 30
})
# Query
users_ref = db.collection('users')
query = users_ref.where('age', '>=', 18).limit(10)
for doc in query.stream():
print(f'{doc.id} => {doc.to_dict()}')
# Real-time listener
def on_snapshot(doc_snapshot, changes, read_time):
for doc in doc_snapshot:
print(f'Received document: {doc.id}')
doc_ref.on_snapshot(on_snapshot)
```
## Pub/Sub
```python
from google.cloud import pubsub_v1
# Publisher
publisher = pubsub_v1.PublisherClient()
topic_path = publisher.topic_path('project-id', 'topic-name')
data = "Hello World".encode('utf-8')
future = publisher.publish(topic_path, data)
print(f'Published message ID: {future.result()}')
# Subscriber
subscriber = pubsub_v1.SubscriberClient()
subscription_path = subscriber.subscription_path('project-id', 'subscription-name')
def callback(message):
print(f'Received: {message.data.decode("utf-8")}')
message.ack()
streaming_pull_future = subscriber.subscribe(subscription_path, callback=callback)
```
## Best Practices
- Use service accounts
- Implement IAM properly
- Use Cloud Storage lifecycle policies
- Monitor with Cloud Monitoring
- Use managed services
- Implement auto-scaling
- Optimize BigQuery costs
## Anti-Patterns
❌ No IAM policies
❌ Storing credentials in code
❌ Ignoring costs
❌ Single region deployments
❌ No data backup
❌ Overly broad permissions
## Resources
- GCP Documentation: https://cloud.google.com/docs
- gcloud CLI: https://cloud.google.com/sdk/gcloud
© personamanagmentlayer · Apache-2.0 · personamanagmentlayer/pcl