Thank you for your interest in contributing to the CockroachDB Skills repository! This guide will help you create high-quality Agent Skills that encode CockroachDB expertise in a structured, machine-executable format.
- Welcome and Overview
- Before You Start
- Proposing a New Skill
- Development Workflow
- Skill Requirements
- Quality Standards
- Testing and Validation
- Review Process
- Domain Structure
- Getting Help
CockroachDB Skills are structured capabilities that AI agents, automation systems, and developer tools can invoke to perform CockroachDB operations. Each skill follows the Agent Skills Specification and encodes expertise from experienced CockroachDB practitioners.
What makes a good contribution:
- Solves a specific, well-defined CockroachDB operational challenge
- Provides clear guidance on when and how to use the skill
- Includes safety guardrails for operations that can affect data or availability
- References official CockroachDB documentation rather than duplicating it
- Can be easily discovered and invoked by AI agents
- Review existing skills - Browse the
skills/directory to understand the style and scope - Check the specification - Read the Agent Skills Specification
- Understand domain boundaries - Review the Domain Structure section below
- Search existing issues - Make sure your idea hasn't already been proposed
Before implementing a skill, open an issue using the new skill proposal template. This ensures:
- Alignment on scope and domain placement
- No duplication of effort
- Feedback on approach before significant work
- Opportunity to collaborate with maintainers
In your proposal, include:
- Skill name - Following naming conventions (lowercase, hyphens, gerund form preferred)
- Domain - Which of the 9 domains this skill belongs to
- Description - What the skill does and when to use it (include trigger keywords)
- Scope and boundaries - What's included and what's explicitly out of scope
- Expected inputs/outputs - What information the skill needs and provides
- Safety considerations - Any risks or guardrails needed
- References - Links to relevant CockroachDB documentation
- Use case - Why this skill is needed and who will benefit
git clone https://github.com/YOUR-USERNAME/cockroachdb-skills.git
cd cockroachdb-skillsUse the naming convention: skill/domain/skill-name
git checkout -b skill/performance-and-scaling/analyzing-slow-queriesmkdir -p skills/performance-and-scaling/analyzing-slow-queriesCreate skills/domain/skill-name/SKILL.md with required frontmatter and content.
Minimal example:
---
name: analyzing-slow-queries
description: Identifies and diagnoses slow queries using CockroachDB's built-in observability tools. Use when query performance degrades or users report slow response times.
---
# Analyzing Slow Queries
This skill guides you through identifying, diagnosing, and resolving slow query performance in CockroachDB.
## When to Use This Skill
- Application users report slow response times
- Monitoring alerts indicate high query latency
- You need to understand which queries are consuming the most resources
- You're investigating performance regressions after schema changes
## Prerequisites
- Access to CockroachDB DB Console or SQL shell
- Appropriate permissions to view system tables
- Basic understanding of SQL query execution
## Steps
### 1. Identify Slow Queries
[Detailed step-by-step guidance...]
### 2. Analyze Execution Plans
[Detailed analysis guidance...]
## Safety Considerations
- Avoid running `EXPLAIN ANALYZE` on production queries that modify data
- Be cautious when adding indexes to high-traffic tables during peak hours
## References
- [CockroachDB Docs: Troubleshoot SQL Performance](https://www.cockroachlabs.com/docs/stable/query-performance-best-practices.html)
- [CockroachDB Docs: EXPLAIN Statement](https://www.cockroachlabs.com/docs/stable/explain.html)git add skills/performance-and-scaling/analyzing-slow-queries/
git commit -m "Add analyzing-slow-queries skill
This skill helps users identify and diagnose slow queries using
CockroachDB's built-in observability tools.
git push origin skill/performance-and-scaling/analyzing-slow-queriesUse the pull request template and reference your proposal issue.
Every SKILL.md must include YAML frontmatter with:
name(required) - Lowercase, hyphens only, max 64 characters, matches directory namedescription(required) - Max 1024 characters, third person, includes "when to use" triggers
Example:
---
name: migrating-from-postgres
description: Guides migration from PostgreSQL to CockroachDB, addressing schema compatibility, data transfer, and application changes. Use when planning or executing a Postgres to CockroachDB migration.
---license- SPDX identifier (defaults to repository license)compatibility- Version constraints (e.g., "CockroachDB >=22.1")metadata- Arbitrary key-value pairs for tooling
Skill names must:
- Use lowercase letters, numbers, and hyphens only
- Be max 64 characters
- Not include reserved words: "anthropic", "claude"
- Not include XML tags like
<,> - Match the parent directory name exactly
Preferred forms:
- ✅ Gerund (verb-ing):
analyzing-slow-queries,migrating-from-postgres - ✅ Present participle:
tuning-index-strategies - ❌ Imperative:
analyze-slow-queries(works but gerund is preferred) - ❌ Nouns:
slow-query-analysis(less clear about action)
Good descriptions:
- Explain WHAT the skill does (first sentence)
- Explain WHEN to use it (second sentence or "Use when..." clause)
- Include trigger keywords agents can match on
- Are concise (max 1024 chars)
- Use third person ("Guides...", "Diagnoses...", not "This skill guides...")
Examples:
✅ Good: "Identifies and diagnoses slow queries using CockroachDB's built-in observability tools. Use when query performance degrades or users report slow response times."
❌ Too vague: "Helps with query performance."
❌ Missing trigger: "Analyzes query execution plans and suggests optimizations." (When should this be used?)
❌ Too long: Descriptions exceeding 1024 characters
Each skill should address one specific task. If your skill tries to do multiple things, consider splitting it.
Good scope:
- ✅
diagnosing-contention-hotspots- Focused on one problem - ✅
validating-backup-integrity- Single verification task
Too broad:
- ❌
database-performance-tuning- Many different tasks - ❌
cockroachdb-administration- Entire operational domain
Skills that can modify data, affect availability, or have financial impact must include:
- Prerequisites section - Required permissions, backups, maintenance windows
- Safety considerations - Explicit warnings about risks
- Rollback guidance - How to undo changes if something goes wrong
- Validation steps - How to verify the operation succeeded
Example guardrails:
## Safety Considerations
⚠️ **This operation will temporarily increase cluster load**
- Run during off-peak hours when possible
- Monitor cluster metrics during execution
- Have a rollback plan ready
## Prerequisites
- [ ] Backup completed within last 24 hours
- [ ] Maintenance window scheduled
- [ ] Rollback plan documented and testedAlways link to official CockroachDB documentation rather than duplicating content. This ensures:
- Skills stay accurate as documentation evolves
- Users get the most up-to-date information
- Skills remain concise and focused
Good references:
## References
- [CockroachDB Docs: Multi-Region Overview](https://www.cockroachlabs.com/docs/stable/multiregion-overview.html)
- [CockroachDB Docs: Backup and Restore](https://www.cockroachlabs.com/docs/stable/backup-and-restore-overview.html)Skills should clearly define:
- What information is needed - Cluster topology, workload characteristics, error messages
- What the skill provides - Diagnostic reports, configuration recommendations, action plans
Example:
## Inputs
- Current cluster topology (number of nodes, regions)
- Query performance metrics (p50, p99 latencies)
- Application access patterns (read/write ratios)
## Outputs
- Recommended multi-region configuration
- Expected latency improvements
- Migration plan with rollback stepsBefore opening a PR, validate your skill locally:
# Install dependencies
pip install -r scripts/requirements.txt
# Run validation
python scripts/validate-spec.py skills/
# Validate specific skill
python scripts/validate-spec.py skills/performance-and-scaling/analyzing-slow-queries/All pull requests are automatically validated via GitHub Actions. The CI checks:
- ✅ Directory structure compliance
- ✅ Required SKILL.md frontmatter fields
- ✅ Naming conventions
- ✅ Character limits
- ✅ Best practices (warnings for improvements)
If CI fails:
- Review the error messages in the GitHub Actions log
- Fix the issues locally
- Commit and push the fixes
- CI will re-run automatically
Recommended testing approach:
- Use the skill with an AI agent (Claude, GPT, or other LLM)
- Verify the agent can understand when to invoke the skill
- Confirm the guidance provided is accurate and actionable
- Test with realistic scenarios from your own experience
- Specification compliance - Follows Agent Skills Specification requirements
- Scope discipline - Focused on one specific task
- Clear triggers - Description makes it obvious when to use the skill
- Accurate guidance - Technical content is correct and up-to-date
- Safety - Appropriate guardrails for risky operations
- References - Links to official CockroachDB docs
- Writing quality - Clear, concise, well-organized
- Address all reviewer comments (or explain why you disagree)
- Push new commits rather than force-pushing (preserves review history)
- Mark conversations as resolved once addressed
- Re-request review after making changes
Skills are organized into 9 operational domains. Choose the domain that best matches your skill's primary purpose:
Getting started with CockroachDB and moving workloads into the system.
- Migration planning and execution
- Data ingestion strategies
- Initial cluster setup
- PostgreSQL compatibility handling
Designing schema and writing queries that are compliant to CockroachDB SQL dialect and follow CockroachDB best practices.
- Schema design
- Generating queries
- Optimizing queries
Building applications that use CockroachDB effectively.
- Transaction handling
- ORM configuration
- Connection pooling
Optimizing query performance and scaling clusters.
- Query optimization
- Index tuning
- Contention diagnosis
- Throughput scaling
Day-to-day cluster operations and version management.
- Cluster upgrades
- Node management
- Configuration changes
- Routine maintenance
Ensuring high availability and preparing for failures.
- Backup strategies
- Restore procedures
- Failover testing
- RPO/RTO planning
Monitoring, alerting, and diagnosing health issues.
- Metrics interpretation
- Alert configuration
- Issue diagnosis
- Performance troubleshooting
Access control, compliance, and data protection.
- RBAC configuration
- Encryption setup
- Audit logging
- Compliance controls
Connecting CockroachDB to external tools and platforms.
- CDC/changefeed setup
- Third-party integrations
- Infrastructure-as-code
- Monitoring integration
Understanding and optimizing resource consumption.
- Storage analysis
- Compute optimization
- Usage forecasting
- Cost attribution
If your skill spans multiple domains, choose the primary domain based on the main problem it solves.
- Open a discussion - Use GitHub Discussions for general questions
- File an issue - Use the documentation improvement template for unclear guidelines
- Ask in your proposal - Clarify scope and approach in your skill proposal issue
- Skill bugs - Use the bug report template
- Documentation issues - Use the documentation improvement template
Thank you for contributing to CockroachDB Skills! Your expertise helps make CockroachDB more accessible to developers, operators, and AI agents worldwide.