$npx skillfedfor your agent

code-quality

code-quality establishes standards for writing reliable database code in Rust, prioritizing data integrity over silent failures. It covers error handling discipline, exhaustive pattern matching, and invariant checking to prevent corruption. The guide emphasizes crashing on invalid state rather than continuing in undefined conditions, and avoiding premature abstractions or workarounds.

code-quality helps you write crash-safe, correct production database code in Rust by enforcing strict error handling and invariant checking.

AI-generated summary based on this skill's SKILL.md

23,479 1,211 MITupdated by tursodatabase

Decision gist · record as of 2026-07-28

code-quality helps you write crash-safe, correct production database code in Rust by enforcing strict error handling and invariant checking. code-quality establishes standards for writing reliable database code in Rust, prioritizing data integrity over silent failures. It covers error handling discipline, exhaustive pattern matching, and invariant checking to prevent corruption. The guide emphasizes crashing on invalid state rather than continuing in undefined conditions, and avoiding premature abstractions or workarounds.

manual: git clone https://github.com/tursodatabase/turso → cp -r turso/.claude/skills/code-quality ~/.claude/skills/code-quality
.claude/skills/code-quality/SKILL.md · version 12166fdc

Use it when

  • code-quality emphasizes handling errors and edge cases without silent failures through disciplined error handling patterns.
  • code-quality teaches applying Rust patterns to make illegal states unrepresentable.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

tursodatabase/turso/code-quality · repository language: Rust

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How does code-quality help write correct production database code?

code-quality establishes standards for writing reliable database code in Rust by prioritizing data integrity over silent failures. It covers error handling discipline, exhaustive pattern matching, and invariant checking to prevent corruption. The guide emphasizes crashing on invalid state rather than continuing in undefined conditions, ensuring your database operations remain safe and predictable in production environments.

What rust error handling patterns does code-quality recommend?

code-quality emphasizes handling errors and edge cases without silent failures through disciplined error handling patterns. The guide prioritizes crashing on invalid state rather than continuing in undefined conditions, and advocates for exhaustive pattern matching to catch all cases. This approach prevents subtle bugs where errors go unnoticed, protecting data integrity in production systems.

How can I make illegal states unrepresentable in Rust?

code-quality teaches applying Rust patterns to make illegal states unrepresentable, using techniques like enums over strings and exhaustive pattern matching. By leveraging Rust's type system, you encode valid states directly into your types, making it impossible to represent invalid combinations at compile time. This prevents entire categories of runtime errors and corrupted database states.

Should code-quality guide me on avoiding silent failures in rust?

Yes, code-quality prioritizes avoiding silent failures by establishing standards that treat crashes on invalid state as preferable to continuing in undefined conditions. The guide emphasizes invariant checking and exhaustive pattern matching to catch edge cases early. This discipline ensures errors surface immediately rather than corrupting data silently in production.

What does code-quality say about optimizing Rust for performance?

code-quality addresses optimizing Rust code for performance and memory efficiency, including heap allocation optimization and CPU-friendly code patterns. However, the guide balances optimization with correctness and maintainability, avoiding premature abstractions or workarounds that sacrifice clarity for marginal gains.

How should I write maintainable code according to code-quality?

code-quality recommends writing maintainable code with effective comments and no over-engineering. The guide emphasizes clarity over premature optimization, advocating for straightforward implementations that follow Rust's safety guarantees. Focus on correctness and data integrity first, then optimize only where profiling shows it matters.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

Code Quality Guide

Core Principle

Production database. Correctness paramount. Crash > corrupt.

Correctness Rules

  1. No workarounds or quick hacks. Handle all errors, check invariants
  2. Assert often. Never silently fail or swallow edge cases
  3. Crash on invalid state if it risks data integrity. Don't continue in undefined state
  4. Consider edge cases. On long enough timeline, all possible bugs will happen

Rust Patterns

  • Make illegal states unrepresentable
  • Exhaustive pattern matching
  • Prefer enums over strings/sentinels
  • Minimize heap allocations
  • Write CPU-friendly code (microsecond = long time)

If-Statements

Wrong:

if condition {
    // happy path
} else {
    // "shouldn't happen" - silently ignored
}

Right:

// If only one branch should ever be hit:
assert!(condition, "invariant violated: ...");
// OR
return Err(LimboError::InternalError("unexpected state".into()));
// OR
unreachable!("impossible state: ...");

Use if-statements only when both

(truncated - see the full file via the links below)

File tree — 1 file
.claude/skills/code-quality/SKILL.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Write correct, crash-safe production database code in Rust”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

yield-injections
by tursodatabase · tursodatabase/turso

yield-injections provides test-only infrastructure for injecting cooperative yields and synthetic failures into resumable state machines. Use it to test state-machine re-entry safety, interleaving behavior, and abandonment cleanup by marking yield points and controlling when they fire. Includes fixed injectors for unit tests and simulator support for randomized deterministic coverage.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
transaction-correctness
by tursodatabase · tursodatabase/turso

This guide explains Turso's Write-Ahead Logging system, covering how transactions are written, read, and checkpointed back to the main database file. It details the concurrency model where one writer coexists with multiple readers, checkpoint strategies from passive to truncate modes, and the recovery process after crashes. The guide also maps Turso's implementation to its core storage layer, distinguishing per-connection state from shared WAL structures.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
debugging
by tursodatabase · tursodatabase/turso

This guide walks through Turso's debugging toolkit for tracking down database problems. Compare bytecode between SQLite and Turso to pinpoint code generation bugs versus VM issues, enable trace logging for core components, run stress tests with ThreadSanitizer to catch threading problems, and use deterministic simulation with seeds to reproduce elusive bugs. Corruption debugging tools help diagnose WAL and integrity failures.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
mvcc
by tursodatabase · tursodatabase/turso

This skill documents Turso's experimental Multi-Version Concurrency Control system, which allows readers and writers to operate simultaneously without blocking through row-level snapshot isolation. It covers enabling MVCC via pragma, the versioning model tracking begin/end timestamps, and the architecture built on lock-free data structures. The guide also details checkpointing behavior, current limitations like garbage collection and recovery gaps, and testing patterns for MVCC-enabled code.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
storage-format
by tursodatabase · tursodatabase/turso

This guide breaks down how SQLite organizes data on disk, from the 100-byte header through page types, B-tree layouts, and cell formats. It covers record encoding with serial types, overflow page chains for large payloads, and freelist structures for space reuse. Includes Turso implementation details and debugging commands.

MITfor claude-codeupdated Jul 2026
★ 23,479repo stars
design-patterns
by rtk-ai · rtk-ai/rtk

This skill covers seven Rust design patterns applied to RTK's CLI filter architecture, from type-safe wrappers and configuration builders to stateful parsers and resource management. Each pattern includes practical examples showing when to use it, when to skip it, and how it fits RTK's single-threaded, zero-overhead design philosophy.

Apache-2.0for claude-codeupdated Jul 2026
★ 73,568repo stars

More skills cdc (MIT)

Tags
production-safetycrash-first-designtype-safetyinvariant-checkingrust-idiomsdata-integrityperformance-consciouserror-handling-strategy