code-review

Review Pebble code, PRs, and diffs for correctness issues.

6.0k|573|Updated Jul 17, 2018
One-click install
npx skills add https://github.com/cockroachdb/pebble --skill code-review-cockroachdb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-review
Source: https://github.com/cockroachdb/pebble/tree/main/.claude/skills/code-review
Command: npx skills add https://github.com/cockroachdb/pebble --skill code-review-cockroachdb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Review Pebble code reviews for structured detection of correctness issues, resource leaks, and concurrency bugs that can lead to bugs or data corruption. Use when asked to review code, a pull request, diff, or changes.

Core Features & Use Cases

  • Resource Leak Detection: Flag patterns where Get() callers return a closer that must be closed and ensure proper deferral of Close().
  • Concurrency Safety: Enforce per-goroutine iterators and safe lock handling to avoid race conditions.
  • Iterator Misuse Prevention: Ensure proper positioning before accessing Key/Value and verify iteration errors via Error() after loops.
  • Lint Compliance: Highlight common lint violations and coding standards to maintain Pebble's quality bar.
  • PR/Diff Review Guidance: Provide a standardized review checklist to accelerate code reviews and maintainability.

Quick Start

Review the latest Pebble PR or code diff to surface correctness and safety issues.

Frequently Asked Questions about code-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect resource leaks in Pebble code during review?

Resource leak detection flags patterns where Get() callers return a closer that must be closed. Ensure proper deferral of Close() to prevent leaked resources that can degrade performance or cause failures in Pebble applications.

What concurrency issues should I watch for when reviewing Pebble iterators?

Enforce per-goroutine iterators and safe lock handling to avoid race conditions. Each goroutine must have its own iterator instance, and locks must be held consistently to prevent concurrent access that corrupts data.

How do I review a Pebble pull request for correctness and safety?

Apply a standardized review checklist covering resource management, iterator safety, lint compliance, and concurrency patterns. This accelerates code reviews and maintains Pebble's quality bar by catching correctness issues early.

What iterator patterns in Pebble code indicate misuse?

Iterator misuse occurs when code accesses Key or Value before proper positioning, or fails to verify iteration errors via Error() after loops. Correct positioning and error checking prevent panics and data corruption in Pebble operations.

Can I use this for reviewing Pebble diffs and code changes?

Yes, this review process applies to code diffs, pull requests, and changes requested by maintainers across the Pebble codebase. It codifies patterns for resource management and iterator safety to surface issues during any review workflow.