cockroachdb-operator-patterns

cockroachdb-operator-patterns is a cursor rule for Cursor from cockroachdb/cursor-plugin. It costs 0 tokens per session (4,346 once invoked), scanned C, original, Apache-2.0.

A set of operating procedures for CockroachDB, a distributed SQL database that runs across multiple servers. It covers routine maintenance, monitoring, troubleshooting, backups, upgrades, and emergency response.

In plain words
What is it for?
Use it to prepare a cluster for production, monitor its health, investigate performance or hardware issues, manage backups and changefeeds, plan capacity, and handle upgrades or emergencies.
Why use it?
It gives operators practical checks and runbooks for keeping a database cluster reliable and diagnosing problems such as contention, hardware failures, or capacity limits.

Cursor rule for Cursor ✓ vendor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to prepare a cluster for production, monitor its health, investigate performance or hardware issues, manage backups and changefeeds, plan capacity, and handle upgrades or emergencies.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/cockroachdb/cursor-plugin/cockroachdb-operator-patterns
About the project

CockroachDB Plugin for Cursor connects the Cursor coding agent to CockroachDB clusters for database work such as exploring schemas, writing SQL, debugging queries, and managing distributed clusters. It supports self-hosted and CockroachDB Cloud connections, and its catalogue add-ons provide database-focused agents, skills, rules, and instructions.

cockroachdb/cursor-plugin · 2 stars · on GitHub

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.

Clone the repo
git clone --depth 1 https://github.com/cockroachdb/cursor-plugin

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cockroachdb-operator-patterns

README.md
[![agentmods](https://agentmods.dev/badge/rules/cockroachdb/cursor-plugin/cockroachdb-operator-patterns/github.svg)](https://agentmods.dev/rules/cockroachdb/cursor-plugin/cockroachdb-operator-patterns)
Your own site
<a href="https://agentmods.dev/rules/cockroachdb/cursor-plugin/cockroachdb-operator-patterns"><img src="https://agentmods.dev/badge/rules/cockroachdb/cursor-plugin/cockroachdb-operator-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cockroachdb-operator-patterns

Your own site · 80×15
<a href="https://agentmods.dev/rules/cockroachdb/cursor-plugin/cockroachdb-operator-patterns"><img src="https://agentmods.dev/badge/rules/cockroachdb/cursor-plugin/cockroachdb-operator-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 4,346 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.04346
Opus 5.5 $0.00000 $0.01738
Sonnet 5.5 $0.00000 $0.00869
Haiku 4.5 $0.00000 $0.00435

Measured 8d ago against content hash 91d749a73f18, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

cockroachdb-operator-patterns scanned grade C with 1 finding 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 8d ago.

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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

2. Remove the store directory: `rm -rf <store-path>`
rules/cockroachdb-operator-patterns.mdc · 500 lines

How it starts

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

CockroachDB Operator & SRE Patterns

Operational procedures from the CockroachDB Runbook Template, Query Parallelism, and cockroachdb-best-practices-demo.


1. Day-1 Operational Readiness

Before operating a CockroachDB cluster, verify this checklist:

Check Requirement
Clock sync NTP configured on all nodes, --max-offset set (default 500ms)
Load balancer HAProxy or cloud LB in front of all nodes
Connection pooling Configured per app (4 x vCPUs pool size)
Replication factor 3 for zone survival, 5 for region survival
Storage Dedicated SSDs for CockroachDB store directory
One node per OS/container Never run multiple cockroach processes on same host
DBA role Custom role with appropriate grants (never use root in production)
TLS certificates Generated and distributed; sslmode=verify-full enforced
Backup schedule Automated via CREATE SCHEDULE FOR BACKUP
Monitoring Metrics exported to Prometheus/Datadog/Grafana
Alerting Alert rules configured per Section 4 thresholds

Key terms:

  • Node = one cockroach server process (NOT the VM/container)
  • Cluster = set of connected CockroachDB nodes forming one system
  • Range = ~512MB chunk of data, the unit of replication and distribution

2. Pre-Check Before Any Maintenance

✅ ALWAYS: Run these before ANY maintenance operation

-- Verify all nodes are live and available
SELECT node_id, is_live, is_available FROM crdb_internal.gossip_nodes;

-- Check for running jobs that might conflict
SELECT job_id, job_type, description, status, fraction_completed
FROM crdb_internal.jobs WHERE status = 'running';

-- Verify range health
SELECT count(*) AS total_ranges,
       count(*) FILTER (WHERE array_length(replicas, 1) < 3) AS under_replicated
FROM crdb_internal.ranges;

Read the full file on GitHub · 500 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. 8d ago Changed 91d749a73f18
  2. 1mo ago First seen · 500 lines · 0 tokens per session scan C 566e39923aca

Subscribe to this mod's changes

cockroachdb-operator-patterns is a cursor rule published in the GitHub repository cockroachdb/cursor-plugin (2 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 4,346 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.