digitalspeed/ai-skills · Archived

license-checker

Audits node_modules for package licenses. Uses bash to resolve SPDX IDs without reading file contents into context. LLM inference is a last resort for a small residual set.

First seen Feb 28, 2026

Installation

$ npx skills add digitalspeed/ai-skills --skill license-checker

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from digitalspeed/ai-skills.

npx skills add digitalspeed/ai-skills

Browse all from digitalspeed/ai-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1
License license-checker
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,901 B
  • docs SUMMARY.md 195 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 8 installs

SKILL.md

License Checker

Scan all packages in node_modules and produce a license compliance report. Never read raw file contents into context — use bash to pattern-match first; only buffer the irreducible unknown set.

1. Execution Workflow

Step 1 — Bulk resolve (single bash call, handles scoped packages, zero file reads in context):

SPDX='MIT|ISC|BSD-[0-9]+-Clause|Apache-2\.0|GPL-[23]\.0(-only|-or-later)?|LGPL-[23]\.0|AGPL-3\.0|MPL-2\.0|Unlicense|CC0-1\.0|CDDL-1\.[01]|EPL-[12]\.0|EUPL-1\.[12]'

find node_modules -mindepth 2 -maxdepth 3 -name 'package.json' \
  ! -path '*/.bin/*' ! -path '*/node_modules/*/node_modules/*' | while read pjson; do
  dir=$(dirname "$pjson")
  row=$(jq -r '[.name, .version, (.license // (.licenses | if type=="array" then map(.type//"") | join(" OR ") else (.//"") end) // ""), (.repository.url // .repository // "")] | @tsv' "$pjson" 2>/dev/null)
  lic=$(printf '%s' "$row" | cut -f3)
  if [ -z "$lic" ]; then
    lfile=$(find "$dir" -maxdepth 1 \( -iname 'license*' -o -iname 'licence*' -o -iname 'copying*' \) 2>/dev/null | head -1)
    match=$(grep -iom1 -E "$SPDX" "$lfile" 2>/dev/null | head -1)
    if [ -n "$match" ]; then
      printf '%s\t%s*\tgrep\n' "$(printf '%s' "$row" | cut -f1-2,4)" "$match"
    else
      printf '%s\tUNKNOWN\t—\n' "$(printf '%s' "$row" | cut -f1-2,4)"
    fi
  else
    printf '%s\tpackage.json\n' "$row"
  fi
done

Output is TSV: name version license repository. Rows where license is UNKNOWN proceed to step 2.

Step 2 — LLM inference for residual unknowns only: For each UNKNOWN package, read the first 500 chars of its license file (or README if absent). Apply:

SPDX ID only. Append * if inferred from file (not package.json). Text:
[500-char buffer]

Step 3 — Render report using the format in §2.

2. Output Format

Tree format sorted alphabetically by name@version. An * suffix on a license means it was inferred from a file, not package.json.

├─ [email protected]
│  ├─ repository: https://github.com/lodash/lodash
│  └─ licenses: MIT
├─ [email protected]
│  ├─ repository: https://github.com/some/lib
│  └─ licenses: GPL-3.0*
└─ [email protected]
   └─ licenses: UNKNOWN

Omit the repository line if the field is empty. Use ├─ for all entries except the last, which uses └─. Sub-fields always use │ ├─ / │ └─ (or ├─ / └─ under a └─ parent).

Summary line after the tree:

Scanned: N  |  Confirmed: N  |  Inferred (*): N  |  Unknown: N
⚠️  Copyleft: [packages with GPL / LGPL / AGPL / MPL / EUPL licenses]