Checks requirements.txt, pyproject.toml, and package.json dependency manifests for surface-level direct-dependency footguns: standard-library shadowing pins, ab
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-dependency-doctor-4c47dd6e3217 ,按照其中的说明把「dependency-doctor」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Inspect one dependency manifest on the user's machine for direct, surface-level footguns. Explain each finding in plain language, then offer a small, reviewable fix. This does not diagnose a failed pip or uv resolution.
This is a local developer tool for a project the user chooses. It is not a repository-wide lint rule, a CI gate, or a proposal to enforce dependency policy across unrelated apps.
pip-audit, npm audit, or the project's
approved security scanner for CVE coverageUse the path the user names. If no path is given and several manifests exist, ask which one to inspect. Do not sweep the repository or edit anything merely because the skill was triggered.
Supported inputs:
requirements.txtpyproject.toml using PEP 621 or common Poetry dependency tablespackage.json dependency sectionsFrom this skill directory:
python3 scripts/dep_doctor.py /path/to/requirements.txt --json
The default path is fully offline. It reads only the selected manifest. The report shape is:
{
"file": "/path/to/requirements.txt",
"findings": [
{
"severity": "high",
"kind": "stdlib-shadowing",
"package": "pathlib",
"line": 4,
"why": "...",
"fix": "..."
}
],
"summary": {
"total": 1,
"by_severity": {"high": 1},
"by_kind": {"stdlib-shadowing": 1},
"online": false
}
}
The offline checks cover:
For package.json, Python-specific standard-library and backport checks do not
apply. The doctor still checks unpinned values and repeated dependency entries.
Read references/dependency-pitfalls.md before presenting findings. Lead with
high severity items, then medium and low. For each finding, include:
Do not call every range a conflict. The deterministic core reports conflicting constraints only when exact pins disagree. Compatible constraints split across multiple lines are duplicate entries that should be combined.
If there are no findings, say what was checked and note the limits. A clean report is not a CVE audit or a full dependency resolver.
The online check sends package names and exact pinned versions to pypi.org.
Ask for permission before enabling it, even if the user previously requested an
offline diagnosis.
python3 scripts/dep_doctor.py /path/to/requirements.txt --json --online
It reports an exact Python release only when every file for that release is marked yanked. Network failures become low-severity findings instead of hiding the offline diagnosis.
After explaining the report, offer a focused edit. Wait for approval before changing the manifest.
After any approved edit, rerun the offline diagnosis and the project's existing install or test command. Do not introduce a new CI gate.
scripts/dep_doctor.py: stdlib-only manifest parser and diagnosis enginereferences/dependency-pitfalls.md: reasoning guide for the reported risks