scan-for-license-compliance
Use when shipping third-party code and a license policy must be met. Inventories every dependency's license and flags copyleft or unknown terms before release.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 81
- Forks
- 17
01 前言 Front Matter
- name
- scan-for-license-compliance
- description
- Use when shipping third-party code and a license policy must be met. Inventories every dependency's license and flags copyleft or unknown terms before release.
02 资源文件 3
- 许可证LICENSE1.0 KB
- 参考文档SOURCE.md353 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
Scan for License Compliance
A single GPL dependency linked into a proprietary binary is a legal problem, and "unknown" licenses are the ones lawyers lose sleep over. Inventory licenses from the shipped graph and diff against an explicit allow list.
Procedure
- Scan the resolved dependencies, per ecosystem:
- Node:
npx license-checker --production --json > licenses.json - Python:
pip-licenses --format=json --with-license-file > licenses.json - Go:
go-licenses check ./...orgo-licenses csv ./... - Rust:
cargo license --jsonorcargo deny check licenses - JVM:
mvn license:aggregate-add-third-party
- Node:
- For deep or mixed trees use ScanCode:
scancode -clpieu --json out.json vendor/(it reads LICENSE files, not just metadata, and catches missing declarations). - Define the policy as data. Allow: MIT, Apache-2.0, BSD-2/3-Clause, ISC, MPL-2.0 (weak copyleft, per-file). Review: LGPL-2.1/3.0 (dynamic linking question). Deny: GPL-2.0/3.0, AGPL-3.0, SSPL, and any
UNKNOWN/empty license. - Compare and fail on deny-list hits or unknowns:
cargo deny check licenseswith[licenses] allow = ["MIT", "Apache-2.0"], or filterlicenses.jsonwithjq. - Handle transitive hits by traceback: find who pulls the GPL package (
npm ls <pkg>) and either replace it, drop the feature, or seek legal sign-off in writing. - For dual-licensed packages (e.g.
MIT OR Apache-2.0), record which side you rely on. - Ship the attribution file the licenses require (Apache-2.0 NOTICE, MIT copyright lines): generate
THIRD_PARTY_LICENSESand keep it in the release. - Re-run on every dependency change; a new transitive import is how violations enter.
Pitfalls
- Scanning only direct dependencies misses the transitive package that carries the GPL.
- Dev-only dependencies do not ship, so exclude them with
--production; reporting them as violations wastes review time. - A package with no
LICENSEfile may still be licensed by itspackage.jsonfield — check both before marking unknown. - SPDX expressions with
AND/ORdiffer from a bareMIT OR GPL-3.0; you must actually elect a branch. - Copying a license into a vendored tree does not satisfy attribution for a distributed binary; the notices travel with the artifact.
Verification
go-licenses check ./... && jq '[.[] | select(.licenses=="UNKNOWN")] | length' licenses.json
No deny-listed license and zero UNKNOWN entries, with the attribution file regenerated to match.
Report: "Scanned <N> shipped deps: <allowed classes>; 0 deny-listed, 0 unknown; THIRD_PARTY_LICENSES regenerated and attached."
04 同仓库更多 Skills
recipe-performance
Diagnose a specific MetaMask user flow's real-app performance and Sentry critical-user-flow telemetry with deterministic mm-harness recipes. Use for CUF boundaries, cold/warm/background-resume behavior, latency regressions, lifecycle tags, duplicate or blocking network requests, long tasks, layout/paint cost, screen redraws, React rerenders, or browser trace analysis where tests alone cannot prove the real app.
mexc-spot-websocket
MEXC Spot WebSocket workflows for public streams, protobuf handling, depth maintenance, listen keys, and private streams without exposing API keys.
mexc-spot-rest
MEXC Spot REST workflows for public data, signed account requests, orders, wallet/admin actions, and secure signing without exposing API keys.
mexc-futures-websocket
MEXC Futures WebSocket workflows for public streams, private account/order/position streams, ping/pong, subscriptions, and depth maintenance.
0xklen-version-and-refresh-sanctions-lists
暂无简介
verify-tests-cover-changed-lines
Use when a PR adds code that the existing suite may not exercise. Measures patch coverage — the share of newly changed lines hit by tests — before approving.