test-guided-debloating — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited test-guided-debloating (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Remove unnecessary code from a repository while preserving exactly the behavior exercised by a given test suite.
Inputs needed:
Clarify scope:
Generate test coverage data to identify exercised code. See coverage_tools.md for language-specific commands.
Python example:
pytest --cov=. --cov-report=json --cov-report=htmlJavaScript example:
npm test -- --coverage --coverageReporters=json --coverageReporters=htmlJava example:
mvn clean test jacoco:reportVerify:
Use scripts/analyze_coverage.py to identify removal candidates:
python scripts/analyze_coverage.py coverage.json --output analysis.jsonThe script identifies:
Manual review checklist:
Remove code incrementally, validating after each step. See debloating_strategy.md for detailed strategy.
Removal order (safest to riskiest):
# Remove unused import statements
# Run tests after removal # Remove file
rm path/to/unused_file.py
# Run tests
pytest # Remove function definition
# Run tests # Before: if condition that's always true
if always_true_condition:
do_something()
else:
never_executed() # Remove this branch
# After:
do_something() # Remove class definition if never instantiated
# Run testsAfter each removal:
# Run full test suite
<test_command>
# Verify all tests pass
# Check for import errors
# Verify build succeedsFinal validation:
Run tests multiple times to catch flaky tests or timing issues.
Generate removal report:
DEBLOATING SUMMARY
==================
Removed Elements:
- 15 unused files
- 42 unused functions
- 8 unused classes
- 156 unused imports
- 23 dead branches
Total lines removed: 3,847
Tests passing: 156/156
Preservation Justification:
All test-defined behavior is preserved because:
1. All test-covered code remains intact
2. All transitive dependencies of test-covered code remain
3. No side effects required by tests were removed
4. Build succeeds and all 156 tests passTest-Defined Behavior: The test suite is the single source of truth for required functionality.
Conservative Removal: When in doubt, keep the code. Only remove code you're confident is unused.
Incremental Validation: Remove code in small batches and run tests after each change.
Never Modify Tests: Test files define the required behavior and must not be changed.
Preserve Side Effects: Be cautious with code that has side effects (logging, initialization, registration).
Avoid removing:
Watch for:
The analyze_coverage.py script automates coverage analysis:
# Analyze Python coverage
python scripts/analyze_coverage.py coverage.json
# Analyze JavaScript coverage
python scripts/analyze_coverage.py coverage-final.json --format javascript
# Save detailed analysis
python scripts/analyze_coverage.py coverage.json --output analysis.jsonOutput includes:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.