refactor-dependencies

Audits Python dependency graphs in pyproject.toml and requirements.txt for unused, transitive, or overly pinned packages.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/cyberpunk042/devops-expert-local-ai --skill refactor-dependencies
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-dependencies
Source: https://github.com/cyberpunk042/devops-expert-local-ai/tree/main/.claude/skills/refactor-dependencies
Command: npx skills add https://github.com/cyberpunk042/devops-expert-local-ai --skill refactor-dependencies

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audit and reshape the Python dependency graph for a project, identifying unused, transitive, or overly pinned packages in pyproject.toml and requirements.txt to reduce risk and footprint.

Core Features & Use Cases

  • Audit declared vs actually-used dependencies across pyproject.toml and requirements.txt.
  • Prune unused dependencies, tighten or loosen pins, and separate dev vs runtime groups.
  • Improve security posture by isolating CVE-flagged packages and replacing transitive direct-dependents with explicit declarations.
  • Use-case: before a fleet rollout, sanitize the dependency graph to ensure stable, reproducible installs.

Quick Start

Run the dependency audit workflow to prune unused packages and tighten pins.

Frequently Asked Questions about refactor-dependencies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find and remove unused Python dependencies in pyproject.toml and requirements.txt?

Audit and reshape your Python dependency graph by comparing declared packages against actual usage to identify and prune unused dependencies. This reduces your project's risk and footprint in one pass.

What is the best way to separate dev and runtime Python dependencies?

Separating dev and runtime dependencies involves auditing your pyproject.toml and requirements.txt to isolate packages into distinct groups. This ensures stable, reproducible installs by isolating CVE-flagged packages.

How do I replace transitive Python dependencies with explicit declarations?

Reshape your dependency graph by replacing transitive direct-dependents with explicit declarations in your project configuration. This improves your security posture and ensures stable installs.

Can I tighten or loosen overly pinned Python package versions automatically?

You can tighten or loosen overly pinned packages during a dependency audit. The skill regenerates lock files and runs tests to enforce changes and ensure the runtime CLI remains functional.

Does Python dependency cleanup work for pre-release security remediation?

Pre-release security remediation targets unused, transitive, or overly pinned packages to sanitize the dependency graph. This ensures stable, reproducible installs before a fleet rollout.