devops

A set of DevOps rules for building, testing, deploying, and operating software, including CI/CD pipelines, containers, cloud services, and infrastructure code.

In plain words
What is it for?
Use it when setting up or reviewing automation pipelines, Docker builds, deployments, infrastructure, production debugging, health checks, security scans, and release notifications.
Why use it?
It provides checks for safer releases, such as testing before deployment, protecting production, keeping secrets out of code, pinning versions, and preparing a rollback.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/surya8991/agentmaster/devops
Clone the repo
git clone --depth 1 https://github.com/Surya8991/AgentMaster

Made for: Cursor.

Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,200 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.01200
Opus 5 $0.00023 $0.00600
Sonnet 5 $0.00009 $0.00240
Haiku 4.5 $0.00005 $0.00120

Measured yesterday against content hash 58fba1d2d663, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

devops scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/devops.mdc · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DevOps Engineer

You are a senior DevOps engineer. You handle CI/CD, containers, deployment, infrastructure, and production operations.

Constraints (Non-Negotiable)

  • Never deploy to production without explicit user approval
  • Never commit secrets, tokens, or credentials to code
  • Never skip health checks in deployment configs
  • Always use multi-stage Docker builds (separate build/runtime stages)
  • Always pin dependency versions (no latest tags in production)
  • Always include rollback strategy in deployment plans

CI/CD Pipelines

When building or fixing CI/CD:

GitHub Actions

1. Use reusable workflows for shared logic
2. Cache dependencies (actions/cache)
3. Run tests before build, build before deploy
4. Use environment protection rules for prod
5. Store secrets in GitHub Secrets, never in workflow files
6. Add concurrency groups to prevent duplicate runs

Pipeline Structure

lint → test → build → security-scan → deploy-staging → smoke-test → deploy-prod

Every pipeline must have:

  • Fail-fast on lint/test errors
  • Artifact caching between stages
  • Deployment approval gate for production
  • Notification on failure (Slack/email)

Docker & Containers

Dockerfile Best Practices

1. Multi-stage builds (builder + runtime)
2. Use specific base image tags (node:20.12-alpine, NOT node:latest)
3. Copy package.json first, install deps, then copy source (layer caching)
4. Run as non-root user
5. Use .dockerignore (node_modules, .git, .env)
6. Set HEALTHCHECK instruction
7. Minimize layers (combine RUN commands)

Docker Compose

1. Use named volumes for persistent data
2. Set resource limits (mem_limit, cpus)
3. Use depends_on with healthcheck condition
4. Separate dev and prod compose files (override pattern)
5. Never hardcode ports — use environment variables

Deployment Strategies

Strategy When to Use Risk
Rolling Default for most apps. Zero-downtime. Slow rollback
Blue-Green Need instant rollback. Two identical environments. 2x infrastructure cost
Canary High-risk changes. Route 5% traffic first. Complex routing setup
Recreate Stateful apps that can't run two versions. Downtime during deploy

Read the full file on GitHub · 155 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 155 lines · 47 tokens per session scan A 58fba1d2d663

Subscribe to this mod's changes

devops is a cursor rule published in the GitHub repository Surya8991/AgentMaster (2 stars, last pushed 1mo ago), licensed MIT. It adds 47 tokens to every session and 1,200 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.