Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Docker.Shrink Requirements

БесплатноБез исполняемых скриптовНе проверен

Find unused packages in requirements.txt not needed by the project code

gpsaggeseот gpsaggese★ 158 звёзд на GitHub

Об этом скилле

Goal

  • Act as an expert in Docker
  • Given a project dir <TARGET_DIR>, find the packages in requirements.txt that its code does not need

Plan Only (--only_plan)

  • With --only_plan, follow .claude/skills/skill.rules.md section "Create Only a Plan with --only_plan"
  • Write the plan to docker.shrink_requirements.<INPUT_REF>.md, then stop without executing the skill

Workflow

Methodology

  • Find actual imports in all .py files in <TARGET_DIR> with grep -r "import <PKG>" or AST-based analysis
  • Map each package in requirements.txt to its import name (e.g., Pillow -> PIL, scikit-learn -> sklearn, PyYAML -> yaml)
  • Also check setup.py, pyproject.toml, tasks.py, and Makefile for indirect or tool-level usage
  • Flag but do NOT remove packages that are:
    • Runtime plugins or extras loaded dynamically (e.g., via importlib)
    • Transitive dependencies pulled in by other listed packages
    • Used only in test files (mark them as "test-only")

Output

  • Save a table to docker.shrink_requirements.<INPUT_REF>.report.md in the current dir
    • <INPUT_REF> comes from <TARGET_DIR>, as in .claude/skills/skill.rules.md ### Name the Output File
  • Say in the file how it was generated, with this line right after the title:
    - Generated by `.claude/skills/docker.shrink_requirements/SKILL.md`
    
  • Print the table and the path of the file
  • The table has the columns:
    package | import_name | used_in_code | verdict
    
    • verdict is one of: remove, keep, investigate, test-only
  • Propose the trimmed requirements.txt contents and write it to disk

Verification

  • --only_plan (check only this item): the plan is in docker.shrink_requirements.<INPUT_REF>.md in the current dir, has the Generated by line, and nothing was executed
  • The output file is docker.shrink_requirements.<INPUT_REF>.report.md in the current dir and has the Generated by line
  • Confirm every package in requirements.txt has a verdict
  • Confirm no package marked remove is still imported anywhere in <TARGET_DIR>
  • Confirm the trimmed requirements.txt was written to disk

Установить Docker.Shrink Requirements в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Docker.Shrink Requirements?

Find unused packages in requirements.txt not needed by the project code

Как установить скилл Docker.Shrink Requirements?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Docker.Shrink Requirements запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Docker.Shrink Requirements с