---
name: "cassandra-nodetool-compaction-tuning"
description: "Maintain cluster health, repair anti-entropy, and tune SSTable compactions in Apache Cassandra."
metadata:
  author: "Apache Software Foundation"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "run cassandra nodetool repair"
  - "fix cassandra tombstones"
  - "choose cassandra compaction strategy"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Apache Cassandra Nodetool & Compaction Strategy

Administers Apache Cassandra clusters: running incremental repairs with nodetool repair, tuning SizeTiered vs Leveled compaction strategies, resolving tombstone accumulation, and analyzing gossip states.

## When to Invoke
Invoke this skill whenever you need to:
- run cassandra nodetool repair
- fix cassandra tombstones
- choose cassandra compaction strategy

## Execution SOP & Rules
1. Execute nodetool repair --partitioner-range (or use Cassandra Reaper) within gc_grace_seconds window.
2. Select LeveledCompactionStrategy (LCS) for read-heavy tables to guarantee single SSTable read lookups.
3. Inspect table statistics using nodetool tablestats <keyspace>.<table_name> to check tombstone counts.
4. Monitor pending compactions and compaction throughput using nodetool compactionstats.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
