AGENT SKILL
requirements.txt 冗余依赖排查
docker.shrink_requirements
找出 requirements.txt 中项目代码不需要的未使用依赖包。
适用职业软件开发工程师
使用场景开发环境与工具链管理
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 155
- Forks
- 170
01 前言 Front Matter
- model
- haiku
- description
- Find unused packages in requirements.txt not needed by the project code
02 资源文件 22
- 资产文件assets/template-basic.md2.1 KB
- 资产文件assets/template-business.md2.8 KB
- 资产文件assets/template-colorful.md2.7 KB
- 资产文件assets/template-dark.md2.3 KB
- 资产文件assets/template-gradient.md2.7 KB
- 资产文件assets/template-minimal.md1.9 KB
- 资产文件assets/template-tech.md2.8 KB
- 资产文件assets/theme-business.css3.6 KB
- 资产文件assets/theme-colorful.css2.9 KB
- 资产文件assets/theme-dark.css2.4 KB
- 资产文件assets/theme-default.css2.5 KB
- 资产文件assets/theme-gradient.css2.9 KB
- 资产文件assets/theme-minimal.css1.7 KB
- 资产文件assets/theme-tech.css3.5 KB
- 参考文档README.md7.5 KB
- 参考文档references/advanced-features.md6.6 KB
- 参考文档references/best-practices.md3.3 KB
- 参考文档references/image-patterns.md4.8 KB
- 参考文档references/marp-syntax.md3.5 KB
- 参考文档references/official-themes.md5.5 KB
- 参考文档references/theme-css-guide.md5.3 KB
- 参考文档references/theme-selection.md3.9 KB
03 SKILL.md 正文
Goal
- Act as an expert in Docker
- Given a directory
<TARGET_DIR>with a project, find which packages inrequirements.txtare not needed by the code in<TARGET_DIR>
Workflow
Methodology
- Use
grep -r "import <PKG>"or AST-based analysis to find actual imports across all.pyfiles in<TARGET_DIR> - Map package names in
requirements.txtto their import names (e.g.,Pillow->PIL,scikit-learn->sklearn,PyYAML->yaml) - Also check
setup.py,pyproject.toml,tasks.py, andMakefilefor 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")
- Runtime plugins or extras loaded dynamically (e.g., via
Output
- Print a table with columns:
package | import_name | used_in_code | verdictverdictis one of:remove,keep,investigate,test-only
- Propose the trimmed
requirements.txtcontents and write it to disk
Verification
- [ ] Confirm every package in
requirements.txthas a verdict - [ ] Confirm no package marked
removeis still imported anywhere in<TARGET_DIR> - [ ] Confirm the trimmed
requirements.txtwas written to disk
04 同仓库更多 Skills
Docker 文件同步与模板对齐
tutorial_in_60_mins.propagate_docker_changes
同步教程和课程项目的 Docker 文件,使其与 project_template 保持一致。
★ 155
Markdown 合并至 Jupyter Notebook
tutorial_in_60_mins.merge_markdown
将 Markdown 文件的内容合并到 Jupyter Notebook 中。
★ 155
60 分钟教程格式规范化
tutorial_in_60_mins.format
格式化目录,使其遵循「Learn X in 60 Minutes」(60 分钟学会 X)教程约定。
★ 155
60 分钟教程目录创建
tutorial_in_60_mins.create
按照「Learn X in 60 Minutes」(60 分钟学会 X)约定创建教程目录。
★ 155
todo.reorg_in_progress
Reorganize ai_task_queue.md so in-progress tasks, not-started tasks, and mislabeled topic headers sit under the right H1 stage
★ 155
todo.reorg_headers
Reorganize ai_task_queue.md .md so every H2 topic matches ALL TOPICS and every H3 task sits under the right topic, keeping its H1 stage
★ 155