agentleFS
kryptophonikkryptophonik/SRE-Skills/skills/sre-gcp/SKILL.md

sre-gcp

Skill4 starsChanged 23 days agoMITView on GitHub

Use when the system runs on Google Cloud: Cloud Monitoring, Cloud Logging, GKE/Compute/Cloud Run/Cloud SQL status, audit logs, quotas. Viewer roles via gcloud or MCP allowlist; writes need approval.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.

    line 12
  2. Very specific:

    Keep --freshness and --limit on every logging read.

    line 48
  3. Distinctive:

    If neither the gcloud MCP server nor gcloud is available, output the commands for the human and stop.

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Google Cloud

Safety gates (REQUIRED)

  1. Read-only diagnosis first.
  2. Propose each change with risk (low/med/high) and reversibility.
  3. Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
  4. Act only as approved, verify, and stop and escalate if anything gets worse.

Full rules: sre-safety-gates. Read-only MCP setup: sre-safety-gates/references/mcp.md.

Process skills: sre-engineer, sre-k8s-triage (GKE), sre-dr-backup-test, sre-capacity-planning, sre-cloud-cost-review, sre-security-incident-triage.

Rules

  • Pin the target on every command: --project=<PROJECT_ID>, plus --region=<REGION> or --zone=<ZONE> where they apply.
  • Credentials: Application Default Credentials, or --impersonate-service-account=<VIEWER_SA>@<PROJECT_ID>.iam.gserviceaccount.com with viewer roles. Never create or download service account keys.
  • Writes (create, update, delete, resize, reset, deploy, update-traffic, restore, IAM changes) need approval. Never pass --quiet on writes; keep confirmation prompts on.
  • --format field paths (e.g. status.conditions, quotas.metric) come from the REST resources; verify them in your environment.

Always first

gcloud config list --format="value(core.account,core.project)"

Health and status (read-only)

gcloud container clusters list --project=<PROJECT_ID> --limit=50
# kubectl needs gke-gcloud-auth-plugin for GKE (https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl)
# USER STEP (software install, not run by the agent): gcloud components install gke-gcloud-auth-plugin, or the OS package google-cloud-cli-gke-gcloud-auth-plugin
KUBECONFIG=./kubeconfig-<cluster> gcloud container clusters get-credentials <cluster> --region=<REGION> --project=<PROJECT_ID>   # per-incident file; ~/.kube/config untouched
KUBECONFIG=./kubeconfig-<cluster> kubectl config current-context                                                              # confirm the context it set
gcloud compute instances list --project=<PROJECT_ID> --filter="status!=RUNNING" --limit=50
gcloud run services describe <svc> --region=<REGION> --project=<PROJECT_ID> --format="yaml(status.conditions,status.traffic)"
gcloud sql instances describe <instance> --project=<PROJECT_ID> --format="value(state)"
gcloud compute instance-groups managed list-instances <mig> --region=<REGION> --project=<PROJECT_ID> --limit=50

Logging and monitoring (read-only)

Keep --freshness and --limit on every logging read. --freshness defaults to 1d, works only with descending order, and is ignored if the filter contains a timestamp.

gcloud logging read 'severity>=ERROR AND resource.type="k8s_container" AND resource.labels.namespace_name="<ns>"' --project=<PROJECT_ID> --freshness=30m --limit=50
gcloud logging read 'resource.type="cloud_run_revision" AND httpRequest.status>=500' --project=<PROJECT_ID> --freshness=1h --limit=50
gcloud monitoring policies list --project=<PROJECT_ID> --format="table(displayName,enabled)" --limit=100

Common remediations (WRITE — approval required, no --quiet)

ActionCommandRiskReversible
Shift Cloud Run traffic to previous revisiongcloud run services update-traffic <svc> --region=<REGION> --project=<PROJECT_ID> --to-revisions=<prev-rev>=100lowyes
Resize MIGgcloud compute instance-groups managed resize <mig> --size=<n> --region=<REGION> --project=<PROJECT_ID>lowyes
Resize GKE node poolgcloud container clusters resize <cluster> --node-pool=<pool> --num-nodes=<n> --region=<REGION> --project=<PROJECT_ID>medyes

Bundled scripts and references

PROJECT_ID=<PROJECT_ID> bash scripts/preflight.sh            # always first; stop if it fails
bash scripts/triage-snapshot.sh <PROJECT_ID> <REGION> 1h 50  # read-only bundle; refuses non-read verbs
  • references/iam-readonly-roles.md · references/logging-queries.md · references/gcloud-mcp.md · references/gcloud-mcp-readonly-allowlist.json (the single maintained allowlist)

If neither the gcloud MCP server nor gcloud is available, output the commands for the human and stop.

Output

  • Project confirmed, findings with commands used, proposed actions with risk/reversibility

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.