依存パッケージのライセンス監査(npm・Python、オフライン)
Offline dependency license audit for npm and Python
package.json・lockfile・requirements.txt・pyproject.toml から依存パッケージを洗い出し、インストール済みのファイルから宣言ライセンスを読み取って、GPL などのコピーレフトや不明なものを一覧にします。
できること
リポジトリの依存パッケージとそのライセンスを、ネットワークに接続せず手元のファイルだけで一覧にします。
- 対応ファイル:
package.json、package-lock.json(v1〜v3)、npm-shrinkwrap.json、yarn.lock(v1)、requirements*.txt、pyproject.toml(PEP 621・Poetry)、poetry.lock、uv.lock、Pipfile.lock - ライセンスの読み取り元:
node_modules内の各package.json、lockfile の license 欄、site-packages のMETADATA(License-Expression・License・分類子)、同梱の LICENSE ファイル - リポジトリ内の仮想環境(
.venvなど)を自動で見つける - 「許容型」「弱いコピーレフト(LGPL・MPL など)」「強いコピーレフト(GPL)」「ネットワーク型コピーレフト(AGPL)」「制限付き」「不明」に分類
licenses.json・licenses.csv(Excel で開ける)・report.mdを出力。CI 用に、指定した分類があれば終了コード 1 にできる
使い方
python scripts/license_audit.py . --out ./license-audit
python scripts/license_audit.py . --no-dev --fail-on strong-copyleft,network-copyleft,unknown
エージェントが要確認のパッケージを一つずつ確かめ、根拠つきで報告します。
必要な環境
- Python 3.11 以上(標準ライブラリのみ。3.10 以下では TOML ファイルを読み飛ばします)
- 正確に調べるには、依存パッケージがインストール済みであること(
npm ciや仮想環境へのpip install)
注意点
- 法的な助言ではありません。判断が必要なものは専門家の確認をおすすめします。
- インストールされていないパッケージは「不明」になります。
- lockfile がない Python プロジェクトでは、直接の依存だけが対象です。
pnpm-lock.yamlは解析しません(package.jsonの直接の依存だけを一覧にします)。- パッケージが宣言しているライセンスを読むだけで、ソースコードの中身は調べません。
English description
Lists dependencies from package.json, lockfiles, requirements.txt and pyproject.toml, reads declared licenses from installed files, and flags copyleft, restricted and unknown ones.
What it does
Lists a repository's dependencies and their declared licenses using only local files, with no network access.
- Reads
package.json,package-lock.json(v1 to v3),npm-shrinkwrap.json,yarn.lock(v1),requirements*.txt,pyproject.toml(PEP 621 and Poetry),poetry.lock,uv.lockandPipfile.lock - License sources: each package's
package.jsoninnode_modules, the lockfile license field,METADATAin site-packages (License-Expression, License, classifiers) and bundled LICENSE files - Finds virtualenvs inside the repository (such as
.venv) automatically - Classifies each license as permissive, weak copyleft (LGPL, MPL), strong copyleft (GPL), network copyleft (AGPL), restricted or unknown
- Writes
licenses.json,licenses.csv(opens in Excel) andreport.md; for CI it can exit with code 1 when chosen levels are present
How to use
python scripts/license_audit.py . --out ./license-audit
python scripts/license_audit.py . --no-dev --fail-on strong-copyleft,network-copyleft,unknown
The agent then verifies each flagged package and reports with evidence.
Requirements
- Python 3.11+ (standard library only; on 3.10 and older, TOML files are skipped)
- For accurate results, dependencies should be installed (
npm ci, orpip installinto a virtualenv)
Caveats
- This is not legal advice; get professional review for decisions.
- Packages that are not installed show as unknown.
- Python projects without a lockfile only list direct dependencies.
pnpm-lock.yamlis not parsed (only direct dependencies frompackage.jsonare listed).- It reads declared licenses only and does not inspect source files.
インストール方法
- ダウンロードしたZIPを展開します(中に
dependency-license-audit/フォルダとSKILL.mdがあります)。 - フォルダごと、使うエージェントのスキル置き場にコピーします。
- Claude:
~/.claude/skills/(プロジェクト単位なら.claude/skills/) - Hermes Agent:
~/.hermes/skills/ - Codex:
~/.agents/skills//Cursor:~/.cursor/skills/ - Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
- Claude:
- エージェントを再起動し、スキル一覧に表示されることを確認します。
出品者
AI Skill Market 公式
出品スキル 44 件