agentleFS
yeaight7yeaight7/agent-powerups/skills/dependency-cleanup/SKILL.md

dependency-cleanup

Skill6 starsChanged 4 months agoApache-2.0View on GitHub

Use when package manifests carry unused or redundant third-party dependencies that slow builds, widen the security surface, or complicate updates.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search build scripts, configs, and CI files too — not just src/.

    line 38
  2. Very specific:

    Remove with the package manager: If there are zero usages, use the native command (e.g., npm uninstall lodash or pip uninstall ...).

    line 40
  3. Very specific:

    Consolidate duplicates: If multiple libraries serve the exact same purpose (e.g., moment and date-fns), flag it to the user for future …

    line 42
  4. Distinctive:

    Validate: Run the build and test suite to ensure the removed dependency wasn't implicitly required by a build script or runtime environment.

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Purpose

Bloated dependencies slow down builds, increase security surface area, and complicate updates. Audit manifests against actual imports, remove unused packages via the package manager (so lockfiles stay correct), and validate with the build.

When to Use

  • The dependency list has grown without review
  • Installs/builds are slow, or audits report vulnerabilities in packages nobody remembers using
  • Multiple libraries in the manifest serve the same purpose

Inputs

  • The package manifest(s) — package.json, requirements.txt, Cargo.toml, or equivalent
  • The repo's build and test commands

Workflow

  1. Audit the manifest. List declared dependencies:

    npm ls --depth=0           # JavaScript/TypeScript
    pip list --not-required    # Python: packages nothing else depends on
  2. Verify usage — manifest vs imports. For any suspect dependency, perform a global search across the codebase:

    grep -rn "from ['\"]lodash\|require(['\"]lodash" .
    grep -rn "^import requests\|^from requests" .     # Python import forms
    npx depcheck                                      # JS/TS: automated manifest-vs-import report, if available

    Search build scripts, configs, and CI files too — not just src/.

  3. Remove with the package manager. If there are zero usages, use the native command (e.g., npm uninstall lodash or pip uninstall ...). Do not just manually edit the manifest unless absolutely necessary, to ensure lockfiles are updated correctly.
  4. Consolidate duplicates. If multiple libraries serve the exact same purpose (e.g., moment and date-fns), flag it to the user for future consolidation. Do not attempt a massive library migration autonomously.
  5. Validate. Run the build and test suite to ensure the removed dependency wasn't implicitly required by a build script or runtime environment.

Output

  • Removed dependencies, each with its zero-usage search evidence
  • Duplicate-purpose libraries flagged for user decision
  • Build/test result after removal

Verification

  • Every removal backed by a zero-usage search, not the manifest alone
  • Build scripts, configs, and CI files included in the search
  • Removal done via the package manager — lockfile updated
  • Build and test suite green after removal
  • Duplicate-purpose libraries flagged, not auto-migrated

Failure Modes

  • Manifest-only edits — hand-editing the manifest desyncs the lockfile.
  • src-only searches — build scripts, configs, and CI files also import packages.
  • Autonomous mega-migration — consolidating duplicate libraries is a flagged decision, not a cleanup side effect.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.