agentleFS
vasceannievasceannie/slopgate/.cursor/rules/infrastructure.mdc

slopgate / rules

Cursor rule1 starsChanged 51 days agoMITView on GitHub

Terraform infrastructure-as-code standards for multi-cloud (AWS, GCP, Azure, OCI) provisioning

We split this infrastructure.mdc into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    OIDC First: Use OIDC/IAM roles for CI/CD authentication instead of long-lived credentials

    line 15
  2. Very specific:

    Plan Before Apply: Always run terraform validate, terraform fmt, terraform plan before apply

    line 16
  3. Distinctive:

    No Secrets in Code: Never hardcode passwords, API keys, or tokens in .tf files

    line 19
  4. Distinctive:

    Environment Sizing: Use environment-based sizing (smaller for dev/staging, production-grade for prod)

    line 21
  5. Distinctive:

    Policy as Code: Run OPA/Sentinel and security scanning (Checkov, tfsec) in CI/CD before apply

    line 22
  6. Very specific:

    No Auto-Approve: Never use auto-approve in production.

    line 25
  7. Distinctive:

    Drift Detection: Never skip drift detection in production

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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
infrastructure.mdc
---
description: "Terraform infrastructure-as-code standards for multi-cloud (AWS, GCP, Azure, OCI) provisioning"
globs: "**/*.{tf,tfvars,hcl}"
alwaysApply: false
---

<!-- Generated by oh-my-agent. Source: .agents/rules/infrastructure.md -->

# Infrastructure Standards

## Core Rules

1. **Provider-Agnostic**: Detect cloud provider from project context before writing any HCL
2. **Remote State**: Store state in remote backend (S3, GCS, Azure Blob) with versioning and locking
3. **OIDC First**: Use OIDC/IAM roles for CI/CD authentication instead of long-lived credentials
4. **Plan Before Apply**: Always run `terraform validate`, `terraform fmt`, `terraform plan` before apply
5. **Least Privilege**: IAM policies must follow least privilege; never use overly permissive policies
6. **Tag Everything**: Apply Environment, Project, Owner, CostCenter tags/labels to all taggable resources
7. **No Secrets in Code**: Never hardcode passwords, API keys, or tokens in .tf files
8. **Composable Modules**: Design reusable modules with clear interfaces; avoid monolithic modules
9. **Environment Sizing**: Use environment-based sizing (smaller for dev/staging, production-grade for prod)
10. **Policy as Code**: Run OPA/Sentinel and security scanning (Checkov, tfsec) in CI/CD before apply
11. **Version Pinning**: Pin all providers and modules; use `for_each` over `count`
12. **Cost Awareness**: Implement lifecycle policies, autoscaling schedules, and review cost estimates before apply
13. **No Auto-Approve**: Never use `auto-approve` in production; never `terraform destroy` without backup
14. **Drift Detection**: Never skip drift detection in production

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.