Code Quality Guide
SkillDatabases & dataThe code-quality skill is a set of coding rules an AI agent follows when it writes code. It covers general correctness, Rust patterns, comment policy, and avoiding over-engineering. Loading the code quality skill means the agent handles all errors, asserts invariants, and crashes rather than corrupting data.
Use Code Quality Guide in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Code Quality Guide and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Code Quality Guide skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Have an AI agent that can load skills.
What your AI can do with it
- Applies correctness rules to code the agent writes
- Requires all errors to be handled
- Asserts invariants in written code
- Prefers crashing over corrupting data
- Uses Rust patterns such as enums and exhaustive matching
- Skips comments except SAFETY notes
Getting started
- Have an AI agent that can load skills.
- Add the code-quality skill to that agent's available skills.
- Configure the agent to apply the skill whenever it writes code.
- Check that the agent follows the rules in the code it produces.
What this skill tells your AI
The instructions your AI receives, as published by tursodatabase/turso in .claude/skills/code-quality/SKILL.md and read by ahel’s review.
Core Principle
Production database. Correctness paramount. Crash > corrupt.
Correctness Rules
- No workarounds or quick hacks. Handle all errors, check invariants
- Assert often. Never silently fail or swallow edge cases
- Crash on invalid state if it risks data integrity. Don't continue in undefined state
- 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 branches are expected paths.
Comments
- Don't add code comments, except for rust
SAFETYcomments.
Avoid Over-Engineering
- Only changes directly requested or clearly necessary
- Don't add features beyond what's asked
- Don't add docstrings/comments to unchanged code
- Don't add error handling for impossible scenarios
- Don't create abstractions for one-time operations
- Three similar lines > premature abstraction
Index Mutations
When code involves index inserts, deletes, or conflict resolution, double-check the ordering against SQLite. Wrong ordering causes index inconsistencies. and easy to miss.
Ensure understanding of IO model
Cleanup
- Delete unused code completely
- No backwards-compat hacks (renamed
_vars, re-exports,// removedcomments)
Single-use helpers
If a helper function has no meaning outside of a single use case, move it inside the function that uses it:
fn do_something() {
something_specific();
fn something_specific() {
}
}
Signals
- GitHub stars
- 24k
- Forks
- 1k
- Last commit
- Sep 2026
Questions
- What does the code-quality skill do?
- It loads coding rules the agent must follow when writing code: handle all errors, assert invariants, crash rather than corrupt data, use Rust patterns like enums and exhaustive matching, avoid over-engineering, and skip comments except SAFETY notes.
- Does it cover Rust patterns?
- Yes. It includes Rust patterns such as enums and exhaustive matching.
- What is the comment policy?
- The agent skips comments except SAFETY notes.
- Does it tell the agent to avoid over-engineering?
- Yes. Avoiding over-engineering is one of the rules in the skill.
- What should the agent do instead of corrupting data?
- The skill says the agent should crash rather than corrupt data.
Advanced
- Item type
- skill
- Key
code-quality-tursodatabase- Source
- github.com/tursodatabase/turso
github.com/tursodatabase/turso