cockroachdb-sql
Skill2 starsChanged 27 days agoMITView on GitHub
Use when writing, generating, or optimizing SQL for CockroachDB, designing CockroachDB schemas, or when the user asks about CockroachDB-specific SQL patterns, type mappings, and distributed database best practices. Also use when encountering CockroachDB anti-patterns like missing primary keys, sequential ID hotspots, or incorrect type usage.
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- cockroachdb/claude-pluginedited, first seen Oct 13, 2026
- DineshKumar8399/aegis-governed-memory-fleetedited, first seen Aug 18, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- cockroachdb/claude-plugin★ 465% same
- DineshKumar8399/aegis-governed-memory-fleet★ 065% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository192 other files it gives its agents.
- clickhouse-architecture-advisor/AGENTS.mdAGENTS.md
- clickhouse-best-practices/AGENTS.mdAGENTS.md
- unsafe-checker/AGENTS.mdAGENTS.md
- alertmanager-querySkill
- analyzing-range-distributionSkill
- analyzing-schema-change-storage-riskSkill
- argocdSkill
- aspire-configurationSkill
- aspire-integration-testingSkill
- aspire-service-defaultsSkill
- auditing-cloud-cluster-securitySkill
- auditing-table-statisticsSkill
- benchmarking-transaction-patternsSkill
- cepthSkill
- chdb-datastoreSkill
- chdb-sqlSkill
- clickhouse-architecture-advisorSkill
- clickhouse-best-practicesSkill
- clickhousectl-cloud-deploySkill
- clickhousectl-local-devSkill
- coding-guidelinesSkill
- configuring-audit-loggingSkill
- configuring-ip-allowlistsSkill
- configuring-log-exportSkill
- configuring-private-connectivitySkill
- configuring-sso-and-scimSkill
- create-technical-architecture-documentSkill
- csharp-mstestSkill
- csharp-tunitSkill
- csharp-xunitSkill
- designing-application-transactionsSkill
- designing-multi-region-applicationsSkill
- domain-cliSkill
- domain-cloud-nativeSkill
- domain-embeddedSkill
- domain-fintechSkill
- domain-iotSkill
- domain-mlSkill
- domain-webSkill
- dotnet-aot-wasmSkill
- dotnet-aspire-patternsSkill
- dotnet-benchmarkdotnetSkill
- dotnet-blazor-authSkill
- dotnet-blazor-componentsSkill
- dotnet-blazor-patternsSkill
- dotnet-blazor-testingSkill
- dotnet-channelsSkill
- dotnet-ci-benchmarkingSkill
- dotnet-cli-architectureSkill
- dotnet-cli-distributionSkill
- dotnet-cli-packagingSkill
- dotnet-cli-release-pipelineSkill
- dotnet-containersSkill
- dotnet-cryptographySkill
- dotnet-csharp-dependency-injectionSkill
- dotnet-csharp-modern-patternsSkill
- dotnet-csharp-nullable-reference-typesSkill
- dotnet-csharp-source-generatorsSkill
- dotnet-maui-doctorSkill
- dotnet-maui-doctorSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 11 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
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
- Distinctive: line 40
Check for existing schema context in conversation
- Distinctive: line 41
If connected to DB, query existing schema:
- Distinctive: line 44
Ask clarifying questions if needed:
- Distinctive: line 53
Ensure compliance with CockroachDB best practices
- Distinctive: line 64
ALWAYS run EXPLAIN on every generated SQL query when connected to DB.
- Distinctive: line 65
If EXPLAIN returns a parsing/syntax error, fix the query and re-run EXPLAIN until it passes.
- Distinctive: line 72
When skill is invoked, ALWAYS:
- Distinctive: line 73
Immediately detect connection: before any other action or response:
- Distinctive: line 74
Check if connection string is provided in the prompt (postgresql://...).
- Very specific: line 75
If provided, use cockroach sql --url "<provided-url>" -e "SQL" to run queries.
- Very specific: line 77
If set, use cockroach sql --url $COCKROACH_URL -e "SQL" to run queries.
- Distinctive: line 82
Keep user-facing content CockroachDB-specific regardless of internal PostgreSQL rules.
- Distinctive: line 88
When optimizing, at each step 1- Explain the step's purpose.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
CockroachDB SQL Skill
Converts natural language questions into CockroachDB-compliant SQL queries, following CockroachDB best practices. Use it for schema design, writing queries and optimizing query.
When to Use This Skill
Activate this skill when:
- User asks for SQL query generation for CockroachDB
- User provides natural language descriptions of database operations
- User asks questions like:
- "How do I query recent orders in CockroachDB?"
- "Generate a CockroachDB table for user management"
- "Convert this to CockroachDB SQL: [description]"
- "What's the CockroachDB way to [operation]?"
- When you encounter:
- CREATE TABLE statements
- ALTER TABLE modifications
- DML Operations (INSERT, UPDATE, DELETE)
- SELECT queries
- Performance optimization requests
- Backup/restore operations
How to Apply this Skill
- Connection Detection — already performed on skill invocation; reuse active connection.
- Parse Natural Language Intent
- Identify the operation type (SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, etc.)
- Context Gathering
- Check for existing schema context in conversation
- If connected to DB, query existing schema:
SHOW TABLES;to see existing tablesSHOW CREATE TABLE table_name;for existing structure
- Ask clarifying questions if needed:
- Table structure if not provided
- Data types for columns
- Index requirements
- Multi-region needs
- Performance characteristics
- Apply CockroachDB Rules
- Reference rules in
references/cockroachdb-rules/ - Ensure compliance with CockroachDB best practices
- Determine rule category based on operation and apply the relavant rules:
00-fundamental-principles.md- Always apply these first01-schema-design.md- Table creation and structure02-dml-operations.md- Data modification03-query-patterns.md- Query construction04-optimization.md- Performance, Optimization and anti-patterns05-operational.md- Admin and maintenance
- Validate against anti-patterns in 04-optimization.md
- Reference rules in
- Validate against DB(MANDATORY)
- ALWAYS run EXPLAIN on every generated SQL query when connected to DB.
- If EXPLAIN returns a parsing/syntax error, fix the query and re-run EXPLAIN until it passes.
- Include the EXPLAIN output in the response.
Response Behavior
Initial Response
When skill is invoked, ALWAYS:
- Immediately detect connection before any other action or response:
- Check if connection string is provided in the prompt (postgresql://...).
- If provided, use
cockroach sql --url "<provided-url>" -e "SQL"to run queries. Do not use psql.
- If provided, use
- Else check COCKROACH_URL environment variable (
echo $COCKROACH_URL).- If set, use
cockroach sql --url $COCKROACH_URL -e "SQL"to run queries. Do not use psql.
- If set, use
- Else check for cockroach-cloud MCP server availability
- Check if connection string is provided in the prompt (postgresql://...).
- Focus exclusively on CockroachDB
- Emphasize "natural language to CockroachDB SQL" not "database conversion"
- Keep user-facing content CockroachDB-specific regardless of internal PostgreSQL rules.
Output Format
- Show generated SQL with explanatory comments
- List CockroachDB-specific features used
- Include performance considerations
- When optimizing, at each step 1- Explain the step's purpose. 2- Execute the step and report the outcome. 3- Summarize all findings and actions taken.
- Provide references used including the rules
Supporting Documentation
references/cockroachdb-rules/- CockroachDB SQL rulesreferences/EXAMPLES.md- SQL examples and patterns
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
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.

