The Specification Shelf: Primary Documents Every Package Author Should Know
Blog posts about packaging age quickly and often disagree. The specifications they summarise change far more slowly. This page is an annotated shelf of the primary documents worth reading at least once, with a note on what each one settles and what it deliberately leaves open.
Versioning documents
- Semantic Versioning specification (semver.org)
- A short, numbered list of rules. It defines what MAJOR, MINOR and PATCH mean, how pre-release labels such as
-rc.1sort, and that build metadata after a+is ignored for precedence. It does not tell you what counts as your public API; that definition is your job, and the spec says so in its first rule. Read it end to end before you argue about it in a code review. - PEP 440: Version Identification and Dependency Specification
- The Python version scheme. It is not semver. It allows epochs, post-releases and dev releases, and it defines the comparison operators used in requirements, including the compatible-release operator
~=. If you publish to PyPI, this document is the one installers actually follow, so a version string that looks fine to you may be normalised or rejected by it. - Go Modules Reference
- The authoritative description of how
go.mod, minimal version selection, the module proxy and the checksum database work. The section on major version suffixes (/v2and later in the module path) explains a rule that surprises people coming from npm or PyPI.
Metadata documents
- PEP 621: Storing project metadata in pyproject.toml
- Defines the
[project]table: name, version, dependencies, optional dependencies, entry points and more. It is the reason build backends from different vendors can read the same file. The Python Packaging User Guide keeps a maintained version of this as the "pyproject.toml specification", which is easier to read than the original PEP. - npm Docs: package.json
- The reference for every field npm understands, from
nameandversiontoexports,files,enginesandpeerDependencies. Node.js has its own documentation on howexportsandtypeare resolved at runtime; read both, because npm decides what is published and Node decides what loads. - The Cargo Book: the manifest format
- Describes
Cargo.toml, including which fields crates.io requires before it accepts a publish, and how features are declared.
Licence and provenance documents
- SPDX License List and the SPDX specification
- The list gives every licence a short identifier such as
MITorApache-2.0. The specification defines licence expressions likeMIT OR Apache-2.0, which registries increasingly expect in metadata. - SLSA specification
- Describes levels of build integrity and what a provenance statement should record. Useful for understanding what npm provenance and similar features do and do not prove.
How to read a spec without getting lost
- Read the terminology section first. Most arguments come from two people using one word for different things.
- Note the normative keywords (MUST, SHOULD, MAY). Only MUST is a hard rule.
- Check the document's status. A PEP can be draft, accepted, final or superseded, and only some of those describe what tools do today.
- Keep a one-line summary per document in your project's contributing notes so newer maintainers know which source wins.
For terms used above, see the glossary; for a broader list of official sites by name, see resources. A longer explanation of version numbers is in semantic versioning explained.