agentleFS
Gzyms69Gzyms69/agent-setup-bundle/skills/skill-devops-cloud/SKILL.md

skill-devops-cloud

Skill0 starsChanged 3 months agoMITView on GitHub

DevOps, Docker container orchestration, CI/CD pipelines, and cloud infrastructure management. MUST ACTIVATE when working with Docker containers, Docker Compose, GitHub Actions/GitLab CI, Kubernetes, Google Cloud/AWS/OCI, or local deployment environments.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When writing application business logic.

    line 20
  2. Distinctive:

    When working on local UI/UX design without deployment concerns.

    line 21
  3. Very specific:

    Unified Environment: Use docker-compose.yml to define the entire stack (Frontend, Backend, DB, Cache).

    line 24
  4. Very specific:

    Hot-Reload: Ensure npm run dev (Vite) and uvicorn --reload (FastAPI) are used within containers for instant feedback by using volume mounts …

    line 27
  5. Distinctive:

    Multi-Stage Builds: Always use multi-stage builds to create minimal final images (e.g., build in a Node image, serve with Alpine/Nginx).

    line 30
  6. Very specific:

    Non-Root Users: Create and switch to a dedicated non-root user (e.g., USER appuser) before the CMD instruction.

    line 35
  7. Very specific:

    Use docker MCP tools (list_containers, get_logs, inspect_container) for deterministic container status checks and live log inspections.

    line 37
  8. Very specific:

    Avoid spawning hanging background bash commands like docker compose logs -f or docker attach that block the agent execution loop.

    line 38
  9. Distinctive:

    VPC & Private IP: Use Serverless VPC Access Connectors to route traffic from Cloud Run to private Cloud SQL instances without exposing the …

    line 47
  10. Distinctive:

    Cloud Storage Patterns: Use signed URLs for client-side uploads/downloads to reduce load on the backend API.

    line 48
  11. Very specific:

    Configuration: Use cloudbuild.yaml to define steps (Lint, Test, Build, Push, Deploy).

    line 53
  12. Distinctive:

    Rollback Procedures: Ensure every deployment creates a unique revision tag (e.g., git SHA) to allow instant traffic splitting back to the …

    line 55
  13. Distinctive:

    Log-Based Alerts: Create custom metrics from Cloud Logging (e.g., 5xx error rates) and trigger alerts.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

DevOps & Cloud Infrastructure Skill

This skill manages the transition from local development to production-grade cloud infrastructure on Google Cloud Platform.

Overview

A strong DevOps culture starts with reproducible local environments and ends with secure, automated, and observable production infrastructure. This skill provides the blueprint for building reliable systems on GCP.

When to Use

  • Setting up a new project's infrastructure.
  • Containerizing applications with Docker.
  • Designing GCP architecture (Cloud Run, Cloud SQL).
  • Creating CI/CD pipelines.

When NOT to Use

  • When writing application business logic.
  • When working on local UI/UX design without deployment concerns.

1. Local Development Setup

  • Unified Environment: Use docker-compose.yml to define the entire stack (Frontend, Backend, DB, Cache).
  • .env Management: Maintain a .env.example file in source control. Never commit .env. Provide a script to initialize secrets.
  • Port Mapping Conventions: Standardize local ports (e.g., 3000 for frontend, 8000 for API, 5432 for PostgreSQL).
  • Hot-Reload: Ensure npm run dev (Vite) and uvicorn --reload (FastAPI) are used within containers for instant feedback by using volume mounts for source code.

2. Docker Best Practices & MCP Tooling

  • Multi-Stage Builds: Always use multi-stage builds to create minimal final images (e.g., build in a Node image, serve with Alpine/Nginx).
  • .dockerignore: Exclude node_modules, .git, .env, and test artifacts to minimize build context.
  • Health Checks: Embed HEALTHCHECK instructions in Dockerfiles to allow orchestrators to restart unhealthy containers.
  • Security Scanning: Integrate trivy or grype in CI to scan images for CVEs before pushing to registries.
  • Layer Caching: Order Dockerfile commands from least frequently changed (OS dependencies) to most frequently changed (source code).
  • Non-Root Users: Create and switch to a dedicated non-root user (e.g., USER appuser) before the CMD instruction.
  • Docker MCP Operations (docker server):
    • Use docker MCP tools (list_containers, get_logs, inspect_container) for deterministic container status checks and live log inspections.
    • Avoid spawning hanging background bash commands like docker compose logs -f or docker attach that block the agent execution loop.

3. Google Cloud Architecture (Cloud Run)

  • Deployment Target: Deploy Frontend and Backend as independent, stateless Cloud Run services.
  • Cloud Run Checklist:
    • Region: Deploy close to users/databases (e.g., us-central1).
    • CPU/Memory: Right-size limits based on load testing.
    • Concurrency: Tune concurrent requests per instance (default 80, adjust for I/O vs CPU bound).
    • Instances: Set --min-instances to reduce cold starts and --max-instances to control costs.
  • VPC & Private IP: Use Serverless VPC Access Connectors to route traffic from Cloud Run to private Cloud SQL instances without exposing the DB to the public internet.
  • Cloud Storage Patterns: Use signed URLs for client-side uploads/downloads to reduce load on the backend API.

4. CI/CD Pipeline (Cloud Build & Deploy)

  • Source: Connect GitHub repositories directly to Cloud Build.
  • Build Triggers: Trigger tests on PRs, and build/deploy on merges to main.
  • Configuration: Use cloudbuild.yaml to define steps (Lint, Test, Build, Push, Deploy).
  • Deployment Stages: Implement isolated environments (dev, staging, prod) using Cloud Deploy.
  • Rollback Procedures: Ensure every deployment creates a unique revision tag (e.g., git SHA) to allow instant traffic splitting back to the previous known good revision.

5. Secret Management

  • Google Secret Manager: Store all production credentials (DB passwords, API keys, certificates) in Secret Manager.
  • Injection: Mount secrets directly as environment variables or files into Cloud Run at runtime (never bake them into images).
  • Rotation: Implement automated rotation for high-value secrets using Cloud Functions and schedule it periodically.

6. Monitoring & Alerting

  • Cloud Monitoring Setup: Enable comprehensive monitoring for all GCP services.
  • Log-Based Alerts: Create custom metrics from Cloud Logging (e.g., 5xx error rates) and trigger alerts.
  • Uptime Checks: Configure public uptime checks for health endpoints from multiple geographic regions.
  • SLO Definition: Define Service Level Objectives (e.g., 99.9% availability, P90 latency < 200ms) and alert on burn rates.

7. Production Readiness Checklist

  • TLS/SSL: Enforced via Google-managed certificates or Load Balancer.
  • CORS: Strict origin policies configured on the backend API.
  • Rate Limiting: Implemented via Cloud Armor or API Gateway to prevent abuse.
  • Graceful Shutdown: Containers intercept SIGTERM to finish processing active requests before exiting.
  • Health Endpoints: Dedicated /health and /ready endpoints returning deep dependency status.

8. Anti-Rationalization Table

RationalizationCorrection
"I'll add Docker health checks later"BLOCKED: Without health checks, orchestration cannot recover failed states automatically.
"Running as root in the container is fine for development"BLOCKED: Dev environments must mirror production to catch permissions errors early.
"We don't need staging, just deploy to prod"BLOCKED: Staging is mandatory for verifying configuration and integration before affecting users.
"Secrets in environment variables are secure enough"BLOCKED: Unmanaged .env files leak easily. Use Secret Manager for production and local tools like sops.
"Monitoring can wait until we have users"BLOCKED: Visibility is required on day 1 to diagnose launch issues. Set up basic logging and alerting now.

9. Red Flags

  • Committing .env files or hardcoded credentials.
  • Using latest tag for base Docker images.
  • Cloud resources deployed manually via ClickOps instead of Infrastructure as Code (Terraform/gcloud scripts).
  • Containers running as root.
  • Lack of CI testing before deployment.

10. Verification Gates

  1. Does the container build and run locally without errors?
  2. Are all secrets sourced from Secret Manager in the deployment config?
  3. Is there a CI pipeline that runs tests on Pull Requests?
  4. Are health checks defined in both the Dockerfile and the deployment config?

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.