/oss-skills:license-and-legalfrom oss-skills
Guides choosing and applying open-source licenses (MIT/Apache-2.0/GPL/AGPL/BSL), adding SPDX headers, relicensing, setting up DCO/CLA, vendoring third-party code, and checking dependency license compatibility.
Ships in oss-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Licensing decisions are cheap before the first external contribution and expensive after. Get this right early.
This skill provides engineering guidance, not legal advice. For relicensing a project with outside contributors, employer IP questions, trademark disputes, or anything with money attached, tell the user to consult a lawyer. Say it once, clearly, then give the best engineering answer you can.
Ask what the user actually wants, in this order:
Do you want maximum adoption, including inside proprietary products? → MIT (shortest) or Apache-2.0 (adds an explicit patent grant + trademark clause). Apache-2.0 is the better default for anything with patent surface or corporate contributors. MIT is the better default for small libraries where brevity matters.
Do you want modifications to your code returned to the commons, but allow linking from proprietary software? → MPL-2.0 (file-level copyleft) or LGPL-3.0 (library-level, more restrictive in practice).
Do you want anything built on this to also be open source? → GPL-3.0. Understand the cost: many companies have blanket policies against GPL dependencies, so adoption drops sharply.
Same as 3, but the software will be run as a network service? → AGPL-3.0. Closes the "SaaS loophole." Adoption cost is even higher; some companies ban it outright.
Do you want to prevent competitors from offering it as a hosted service? → BSL 1.1, Elastic License 2.0, or SSPL. Be explicit with the user: these are not open source by the OSI definition. Do not call a BSL project "open source" — the community reaction to that mislabeling is consistently harsh. "Source-available" is the accurate term.
Defaults worth stating: Apache-2.0 for most new projects, MIT for small libraries, AGPL-3.0 if the business model is hosting, and honesty if the answer is source-available.
Fighting your ecosystem's convention costs adoption. Rust and Go lean permissive
(Rust commonly dual-licenses MIT OR Apache-2.0); npm skews MIT; Python is mixed but
permissive-leaning; the Linux kernel world is GPL-native. Match unless you have a
reason.
Direction matters — you can flow permissive into copyleft, never the reverse.
| Your license | Can include MIT/BSD | Apache-2.0 | MPL-2.0 | GPL-3.0 | AGPL-3.0 |
|---|---|---|---|---|---|
| MIT | Yes | Yes¹ | No² | No | No |
| Apache-2.0 | Yes | Yes | No² | No | No |
| MPL-2.0 | Yes | Yes | Yes | No | No |
| GPL-3.0 | Yes | Yes | Yes | Yes | No |
| AGPL-3.0 | Yes | Yes | Yes | Yes | Yes |
¹ You must preserve Apache-2.0's NOTICE file and attribution.
² MPL-2.0 files stay MPL-2.0; you may combine, but you cannot relicense those files.
Known trap: Apache-2.0 is incompatible with GPL-2.0-only (patent clause), though it is fine with GPL-3.0. If a project is GPL-2.0-only, Apache-2.0 dependencies are a problem.
# 1. Full license text at the repo root, verbatim, filename LICENSE (no extension)
curl -sL https://raw.githubusercontent.com/licenses/license-templates/master/templates/apache.txt -o LICENSE
# Fill in year and copyright holder in the Apache-2.0 appendix.
# 2. Declare it in the package manifest
# package.json: "license": "Apache-2.0"
# pyproject.toml: license = "Apache-2.0"
# Cargo.toml: license = "MIT OR Apache-2.0"
# 3. SPDX headers on source files (optional but increasingly expected)
# // SPDX-License-Identifier: Apache-2.0
Copyright line guidance: Copyright <year> <entity> where entity is you, your
company, or "The Authors". The last form scales — it avoids editing every
header when contributors join, and pairs with an AUTHORS file. Do not maintain
per-file per-contributor copyright lists; Git already tracks that.
Use reuse lint (REUSE spec) if the project needs machine-verifiable compliance.
| DCO | CLA | |
|---|---|---|
| Mechanism | Signed-off-by: in commit (git commit -s) | Contributor signs a document once |
| Says | "I have the right to submit this" | Grants the project rights, sometimes copyright |
| Friction | Low | High — blocks first PRs, needs a bot and storage |
| Enables relicensing later | No | Yes (if it grants that) |
| Use when | Almost always | A foundation requires it, or you need relicensing rights |
Default to DCO. Enforce with the DCO GitHub App.
Add to CONTRIBUTING.md:
By contributing, you certify the Developer Certificate of Origin. Sign commits with
git commit -s.
Adopt a CLA only with a concrete reason. Contributors are increasingly suspicious of CLAs that assign copyright — the "we might relicense later" subtext is read correctly. If you do use one, prefer a license-grant CLA over a copyright-assignment CLA, and say in plain language what it allows.
Every time code is copied in:
third_party/<name>/LICENSEthird_party/README.mdNOTICE file if your license or theirs requires attributionDo the same for AI-generated code whose provenance you cannot establish: if it looks like a verbatim reproduction of a known implementation, treat it as vendored code and find the source.
npx license-checker --summary # npm
pip-licenses --format=markdown # Python
cargo deny check licenses # Rust (config in deny.toml)
go-licenses report ./... # Go
Run this in CI for any project with commercial users. A GPL dependency arriving via a transitive upgrade into an MIT-licensed library is a real incident, and it is silent until someone's legal team finds it.
Hard, in proportion to contributor count. The mechanics:
CHANGELOG.md.
Old released versions remain under the old license permanently; you cannot revoke.git log --format='%aN <%aE>' -- <paths> | sort -u
Open a tracking issue, get explicit written consent, remove or rewrite code from
anyone unreachable. Projects have taken years on this.Going permissive → restrictive (MIT → AGPL/BSL) is legally simpler but socially costly; expect a fork of the last permissive commit. Plan the communication before the commit, and be honest about the business reason. Users forgive a stated commercial motive far more readily than a rationalization.
When asked about a third-party project, check LICENSE (not the README badge, which
is often stale), then:
NOTICE.LICENSE and the package manifest.package.json says MIT, LICENSE says Apache-2.0.
This gets found by automated scanners and looks careless.NOTICE propagation.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
open-source-licensing, spdx, dco, cla, license-compliance, copyleft
18 skills in this plugin
/api-designDesign public interfaces for libraries and tools that other people depend on. Use when designing or reviewing a public API surface, deciding what to export, naming functions and CLI flags, adding configuration options, planning deprecations, or when the user asks "is this a good API" or "how do I change this without breaking users". Covers minimal surface area, error design, async and extension patterns, CLI ergonomics, config precedence, and stability guarantees. Also use before a 1.0 release to freeze the interface./ci-pipelinesDesign continuous integration for an open-source repository. Use when setting up GitHub Actions from scratch, when CI is slow or flaky, when adding a build matrix across OS and language versions, when configuring caching, or when handling PRs from forks that need secrets. Covers workflow structure, concurrency and cancellation, caching strategy, required checks and branch protection, self-hosted runner risks, and keeping CI cheap. Also use for "our CI takes 40 minutes" or "why is CI failing on forks"./code-reviewReview a pull request the way a good open-source maintainer does. Use when reviewing an incoming PR, when the user asks "review this PR" or "is this ready to merge", when triaging a stale PR queue, or when writing review feedback to an external contributor. Covers what to check and in what order, severity levels, phrasing feedback so people come back, handling large or unwanted PRs, first-time contributors, AI-generated submissions, and closing PRs kindly. Complements the built-in /code-review command by adding the maintainer and community dimension.npx claudepluginhub the-open-agent/oss-skills --plugin oss-skillsOther plugins' skills for the same job