依存パッケージのライセンス監査(npm・Python、オフライン)

Offline dependency license audit for npm and Python

package.json・lockfile・requirements.txt・pyproject.toml から依存パッケージを洗い出し、インストール済みのファイルから宣言ライセンスを読み取って、GPL などのコピーレフトや不明なものを一覧にします。

ClaudeHermes AgentCodexCursorMIT(改変・再配布・商用利用可)Python

できること

リポジトリの依存パッケージとそのライセンスを、ネットワークに接続せず手元のファイルだけで一覧にします。

  • 対応ファイル: 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.lock and Pipfile.lock
  • License sources: each package's package.json in node_modules, the lockfile license field, METADATA in 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) and report.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, or pip install into 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.yaml is not parsed (only direct dependencies from package.json are listed).
  • It reads declared licenses only and does not inspect source files.

インストール方法

  1. ダウンロードしたZIPを展開します(中に dependency-license-audit/ フォルダと SKILL.md があります)。
  2. フォルダごと、使うエージェントのスキル置き場にコピーします。
    • Claude:~/.claude/skills/(プロジェクト単位なら .claude/skills/)
    • Hermes Agent:~/.hermes/skills/
    • Codex:~/.agents/skills//Cursor:~/.cursor/skills/
    • Claude アプリ(claude.ai):「カスタマイズ → スキル」からZIPをアップロード
  3. エージェントを再起動し、スキル一覧に表示されることを確認します。

Windows・Mac 別、エージェント別のインストール手順

出品者

AI Skill Market 公式

出品スキル 44 件

出品者のプロフィールとスキル一覧