openshift/lightspeed-service · Archived

find-dead-code

Find unused functions, classes, imports, and unreachable code paths. Use when the user asks to find dead code, unused code, cleanup candidates, or wants to reduce codebase size.

First seen May 16, 2026

Installation

$ npx skills add openshift/lightspeed-service --skill find-dead-code

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from openshift/lightspeed-service · top by installs.

npx skills add openshift/lightspeed-service

Browse all from openshift/lightspeed-service

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 71
License LICENSE
Default branch main
Open issues 1
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,606 B
  • docs SUMMARY.md 199 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 4 installs

SKILL.md

Find Dead Code

Detect unused code that can be safely removed.

Rules

  • Report findings, do not delete. Removal is a separate task.
  • Focus on production code (ols/). Skip tests unless explicitly asked.
  • Vulture has false positives — classify each finding before recommending removal.
  • Code used only via dynamic dispatch (e.g. Pydantic validators, FastAPI dependencies) is not dead.

Step 1: Determine Scope

Ask the user:

  • Branch mode: only files changed in the current branch vs main.
  • Full mode: scan the entire ols/ directory.

For branch mode:

git diff --name-only origin/main -- 'ols/' | grep '\.py$'

Step 2: Run Vulture

uvx vulture <target> --min-confidence 80

--min-confidence 80 reduces noise. Lower confidence findings are more likely false positives.

Step 3: Run Pylint Unused Checks

uv run pylint --disable=all --enable=unused-import,unused-variable,unused-argument,unreachable <target>

Cross-reference with vulture findings to increase confidence.

Step 4: Filter False Positives

Common false positives in this codebase:

Pattern Why it's not dead
Pydantic modelvalidator, fieldvalidator Called by Pydantic, not directly
FastAPI dependency functions Injected via Depends()
eq, hash, str Called implicitly by Python
Constants used in config YAML Referenced by config loader
Abstract method implementations Called via base class interface
Imports re-exported from init.py Used by external consumers

Step 5: Classify Findings

For each finding, classify:

Category Criteria Action
Remove Clearly unused, no dynamic references Safe to delete
Verify Possibly used dynamically or externally Search for string references before removing
False positive Pydantic/FastAPI/magic method Skip

For "Verify" findings, search for string-based references:

rg "<function_or_class_name>" ols/ tests/

Step 6: Report

For each finding:

  1. File and line number
  2. What is unused (function, class, import, variable)
  3. Confidence level (vulture %)
  4. Classification (remove / verify / false positive)

Summary: total findings, how many safe to remove, estimated lines saved.