Agent skill · software engineering · rysweet
smart-test
Intelligent test selection based on code changes. Maps source files to tests via import analysis, implements tiered testing (fast < 1 min, impacted < 5 min, full suite), and tracks test reliability. Use when running tests after code changes to optimize feedback loops and CI time.
Why this skill is useful
Adds executable scripts for intelligent test selection and reliability tracking that optimize CI workflows.
What it needs
Requires bash, git, glob, grep, pytest installed locally. About 7k tokens when loaded. Last updated 2026-07-26. 71 stars on the source repository.
What this skill does
Smart Test Selection Skill Purpose Optimizes test execution by intelligently selecting which tests to run based on code changes. Instead of running the full test suite every time, this skill: 1. Maps code changes to affected test files using import dependency analysis 2. Provides tiered testing strategies for different feedback loop needs 3. Tracks test reliability to prioritize stable tests in fast runs When I Activate I automatically load when you mention: "run affected tests" or "run impacted tests" "smart test" or "intelligent testing" "which tests to run" or "test selection" "fast tests" or "quick tests" "tests for changes" or "tests for this PR" Core Concepts Test Tiers Tier 1: Fast Tests (< 1 minute) Directly affected unit tests (imports changed file) High-reliability tests only (no flaky tests) Run on every save or pre-commit Command: pytest -m "not slow and not integration" [selectedtests] Tier 2: Impacted Tests (< 5 minutes) All tests affected by changes (direct + transitive dependencies) Includes integration tests for changed modules Run before commit or on PR draft Command: pytest [selectedtests] Tier 3: Full Suite Complete test suite Run on PR ready-for-review or CI Command: pytest Import Dependency Analysis The skill builds a dependency graph by analyzing Python imports: Direct Tests: Files matching pattern test{module}.py or {module}test.py Indirect Tests: Tests that import modules which import the changed file Reliability Tracking Tests are scored on reliability (0.0 to 1.0): 1.0: Always passes (stable) 0.5-0.9: Occasional failures (investigate) < 0.5: Frequently fails (flaky - excluded from Tier 1) Reliability is tracked in ~/.amplihack/.claude/data/test-mapping/reliability.yaml Usage Analyze Changes and Get Test Commands Build or Refresh Mapping Cache Check Test Reliability Process Step 1: Identify Changed Files Filter to only Python source files (exclude tests themselves for mapping). …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills rysweet/smart-test--6ef6a8