skills/code-review/SKILL.md
Guides AI-assisted code review of SCT pull requests. Use when reviewing a PR, checking a diff for correctness, evaluating method signature changes across class hierarchies, verifying override compatibility, checking import conventions, error handling patterns, backend impact, test coverage, or provision label requirements. Covers inheritance safety, polymorphic method audits, and SCT-specific review criteria.
npx skillsauth add scylladb/scylla-cluster-tests code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review SCT pull requests for correctness, safety, and convention compliance.
When a method signature changes on a base class, every subclass override MUST be updated.
SCT uses deep class hierarchies (e.g., BaseCluster -> AWSCluster -> MonitorSetEKS). A signature change in a parent class that isn't propagated to all overrides causes a runtime TypeError — invisible to linting, invisible in the diff, caught only in production. This is the single most dangerous class of bug in SCT because it passes all static checks and all existing tests.
Real incident: PR #13445 added ami_id to AWSCluster._create_instances() but missed MonitorSetEKS._create_instances() in cluster_k8s/eks.py. The bug survived multiple review rounds and broke EKS monitor provisioning at runtime (PR #14113 fixed it).
Why this must be check #1: LLMs process diffs, not the full class hierarchy. Without explicit instruction to search for overrides outside the diff, no reviewer — human or AI — will find them.
The diff shows what changed, not what broke.
Many SCT bugs come from code that was NOT modified but should have been. When reviewing:
defaults/ for missing default valuesSCT enforces strict conventions because inconsistency causes real failures in a multi-backend test framework.
Import ordering, error handling patterns, test style — these aren't style preferences. Inline imports cause circular dependency failures in production. unittest.TestCase breaks pytest fixture injection. Wrong provision labels mean backend regressions go untested.
The most valuable review comment is about code that should exist but doesn't.
Ask: Is there a test for this change? Is there a default value for this config option? Are there other backends that need the same fix? Is the docstring updated? Missing code is harder to spot than wrong code, and it's where AI reviewers add the most value.
writing-unit-tests skill)writing-integration-tests skill)writing-plans skill)fix-backport-conflicts skill)Detailed checklist with examples in review-checklist.md. Real incident catalog in common-issues.md.
Trigger: Any PR that adds, removes, or changes parameters on a method definition.
grep -rn "def <method_name>" sdcm/ unit_tests/super()unit_tests/ that mock or override the same methodHigh-risk polymorphic methods (sorted by override count):
| Method | Overrides | Key files to check |
|---|---|---|
| add_nodes | 18+ | All cluster_*.py, cluster_k8s/, unit_tests/ stubs |
| _create_instances | 5+ | cluster_aws.py, cluster_gce.py, cluster_azure.py, cluster_oci.py, cluster_k8s/eks.py |
| _create_on_demand_instances | 2+ | cluster_aws.py subclasses |
| _create_spot_instances | 2+ | cluster_aws.py subclasses |
| wait_for_init | 5+ | All backend cluster files |
| destroy | 5+ | All backend cluster and node files |
Trigger: Any new or modified import statement.
Trigger: Any try/except, raise, or error handling code.
catch(e) {} or bare except: passsilence() context manager over bare try/except where appropriateTrigger: Any non-trivial code change.
unit_tests/unittest.TestCasesetUp/tearDownTrigger: Any change to sdcm/sct_config.py or config-related files.
defaults/test_default.yaml or backend-specific filesdocs/configuration_options.md automaticallyTrigger: Any change to files in sdcm/cluster_*.py, sdcm/provision/, or sdcm/utils/*_utils.py.
Trigger: Every PR.
type(scope): subjectci, docs, feature, fix, improvement, perf, refactor, revert, style, test, unit-test, build, chore| File | Content | |------|---------| | review-checklist.md | Full review checklist with per-check details and examples | | common-issues.md | Catalog of real incidents with root cause analysis and prevention |
| Workflow | Purpose | |----------|---------| | review-a-pr.md | Step-by-step process for reviewing an SCT pull request |
A complete code review:
development
Guides writing and debugging unit tests for the SCT framework using pytest conventions. Use when creating new test files in unit_tests/, adding test cases, mocking external services, setting up fixtures, or reviewing test coverage. Covers network-blocking patterns, FakeRemoter, moto for AWS mocking, monkeypatch, and common pitfalls.
development
Use when asked to generate an implementation plan, draft a plan, save a plan, or design a feature rollout for the SCT repository. Supports two formats: full 7-section plans for multi-phase work (1K+ LOC, tracked in MASTER.md) and lightweight mini-plans for single-PR changes (under 1K LOC, stored in docs/plans/mini-plans/). Routes automatically based on PR plans label, user input, or task size estimate.
development
Guides writing new nemesis (chaos engineering disruptions) for the SCT framework. Use when creating a new NemesisBaseClass subclass, adding disruption logic, setting nemesis flags, or configuring target node pools. Covers the sdcm/nemesis/ package structure, auto-discovery, flag filtering, CI configuration, and unit testing patterns.
development
Guides writing and debugging integration tests for the SCT framework that interact with real external services. Use when creating tests requiring Docker, AWS, GCE, Azure, OCI, or Kubernetes backends. Covers service labeling, credential skip patterns, Docker Scylla fixtures, resource cleanup, and common pitfalls.