/package-manager-development:package-manager-registries-and-installationfrom package-manager-development
Covers package registry design, client-side installation, content-addressed storage, layout strategies (flat, nested, isolated, PnP), version coexistence, runtime resolution, publishing, and authentication evolution from API tokens to OIDC trusted publishing with Sigstore and SLSA.
Ships in package-manager-development. 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.
Part 2 of 5 of the Package Manager Development reference (plugin
package-manager-development), covering §5–§7. Sibling skills:package-manager-versioning-and-resolution(§0–§4),package-manager-supply-chain-and-workspaces(§8–§10),package-manager-ux-ecosystems-and-governance(§11–§14),package-manager-reference(§15–§20). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: Verified August 2026. See §17 →
package-manager-referencefor the currency snapshot and what goes stale first.
How to read this. Reference, not tutorial. Sections are independent. Three markers:
- [DURABLE] — computer science, or a lesson every ecosystem has independently learned. Does not expire.
- [ECOSYSTEM] — specific to npm, PyPI, crates.io, Go, etc. Verify against that ecosystem's current docs.
- [CONTESTED] — the ecosystems have made genuinely different, defensible choices, or the practitioners disagree. Both cases given.
⚠️ GOTCHA boxes mark the design mistakes that produce unreproducible builds, wedged caches, exponential resolutions, or supply-chain compromise.
The framing that organizes everything below: a package manager is a distributed systems problem wearing a CLI. It is a cache-coherency problem, a constraint-solving problem, a trust-and-identity problem, and a compatibility-contract problem, all of which happen to be invoked by typing
install. Every serious difficulty in this document is one of those four, and treating it as "just downloading files" is the root of most bad designs.
GET /packages/{name} → all versions + metadata (the resolver's hot path)
GET /packages/{name}/{version} → one version's metadata
GET /packages/{name}/{version}/dl → the artifact (usually a CDN redirect)
POST /packages → publish (authenticated)
DELETE / POST /yank → yank/unyank (NOT delete — see 5.2)
GET /search, /index, /changes → discovery and incremental sync
Design notes that matter at scale:
package-manager-versioning-and-resolution).ETag, If-None-Match, a change
feed). Mirrors and CI caches depend on it.package-manager-supply-chain-and-workspaces).[DURABLE] A published (name, version) must never change its bytes. Consequences of getting this wrong are severe and every ecosystem has learned it, usually the hard way:
left-pad incident (2016) — an unpublished package broke thousands of builds —
established that unpublishing must be tightly restricted.The correct primitive is a yank (or quarantine), not a delete:
⚠️ And immutability has a security cost you must design for: Go's proxy.golang.org
and sum.golang.org provide extremely strong reproducibility — but that same immutability
means a malicious module version, once published and cached, persists and continues to be
served even after the source repository is removed. Reproducibility and takedown are in
direct tension. Have a documented answer for it.
Even with immutable versions, most registries historically allowed adding new files to an existing release (e.g. a new wheel for a new Python version, months later). That's a poisoning vector: a stolen token lets an attacker add a malicious artifact to a long-trusted release.
PyPI closed this in July 2026: new files are rejected on releases older than 14 days. The reasoning is instructive — the change was proposed during PEP 740 discussions in January 2024, stalled, and was revived by the March 2026 LiteLLM and Telnyx compromises. Before shipping, PyPI measured the impact: of the top 15,000 projects, only 56 had uploaded a Python 3.14-compatible wheel more than 14 days after the release first appeared. Seth Larson's stated rationale is worth internalizing: it prevents releases from entering "an indeterminate and confusing state of both compromised and not compromised, where only a subset of files could be poisoned."
[DURABLE] That's the template for registry policy changes: identify the vector, measure the legitimate usage you'd break, publish the numbers, then change the default.
| Model | Example | Trade-off |
|---|---|---|
| Flat, first-come | npm (unscoped), PyPI, crates.io | Simple; land-grab, typosquatting, permanent name exhaustion |
| Scoped/namespaced | @org/pkg (npm), NuGet prefixes | Ties identity to an owner; reduces squatting |
| Domain-derived | Go (github.com/user/mod), Maven (reverse-DNS groupId) | Namespace is inherited from an existing trust root. Elegant; couples you to the host |
| Content-addressed | Nix, Guix | Names are labels, identity is a hash |
[DURABLE] Go's and Maven's approach — deriving the namespace from a domain or repo you already control — eliminates an entire class of problems (squatting, name disputes, ownership transfer ambiguity) at the cost of coupling package identity to a hosting provider. If you're designing new, seriously consider it.
Whatever you choose, you need policy for: name similarity (§8.3 → package-manager-supply-chain-and-workspaces), abandoned packages,
ownership transfer, trademark disputes, and reuse of deleted names (never reuse a name —
that's the "repojacking" attack).
[DURABLE] The right shape for a package cache is a global, content-addressed store.
~/.cache/pm/
index/ metadata, keyed by (name, version), immutable → cacheable forever
files/ file blobs keyed by content hash (sha256)
packages/ package trees, assembled from file blobs
tmp/ staging — assemble here, then atomically rename into place
Properties you get for free: deduplication across projects, integrity verification by construction, safe concurrent access (a hash-named file either exists and is correct, or doesn't exist), and trivial garbage collection.
Write atomically: download to tmp/, verify the hash, then rename() into place.
A partially-written cache entry that looks complete is the classic "wedged cache" bug that
users fix by deleting the whole cache and cursing your name.
pnpm's contribution was demonstrating how much this matters: a single content-addressed
store hard-linked into each project's node_modules means one copy of a given package
version on the whole machine, saving developers with many projects tens of gigabytes.
This is the JavaScript ecosystem's defining argument, and it generalizes.
| Layout | Mechanism | Ecosystem | Trade-off |
|---|---|---|---|
| Nested | Each package gets its own node_modules | npm v2 | Correct; enormous duplication; Windows path-length failures |
| Flat / hoisted | Everything flattened to the top, conflicts nested | npm v3+, Yarn Classic, Bun (default) | Compact, compatible; allows phantom dependencies (§6.3) |
| Isolated / symlinked | Content-addressed store + hardlinks + a symlink tree mirroring the true graph | pnpm, Bun --linker isolated | Strict — packages can only see what they declared; occasional postinstall scripts assume a hoisted shape and break |
| No node_modules | A .pnp.cjs map from import to zip archive | Yarn Berry PnP | Fastest, strictest, "zero installs"; requires runtime cooperation and breaks tools that stat the filesystem |
⚠️ GOTCHA — phantom dependencies are a correctness bug, not a style issue. Under a hoisted layout,
require('lodash')works even if you never declared lodash, because something else hoisted it to the top. Your code then breaks when that transitive dependency changes — a failure with no visible cause in your own manifest. Strict layouts exist entirely to make this impossible, and that, not disk space, is their real argument.
[DURABLE] The generalizable lesson: you're choosing between the real dependency graph
and a flattened approximation that the runtime finds easier. Flattening is faster and
more compatible; it is also lying to the program about what it can see. Ecosystems whose
runtime resolution is explicit (Python's sys.path per-venv, Cargo's compiler-passed
--extern, Go's import paths) never had this problem, because the layout was never the
lookup mechanism.
If your runtime can load two versions of the same package simultaneously (npm, Cargo), the
resolver can escape most conflicts (§3.5 → package-manager-versioning-and-resolution) — at the cost of duplicated code, larger
artifacts, and singleton bugs. If it can't (Python, Java on one classpath), a conflict
is fatal and must be reported, which makes resolution failures far more common and your
error messages far more important.
Cargo's rule is a good middle: semver-compatible versions are unified into one; semver-
incompatible versions coexist. This maximizes deduplication while keeping the escape
hatch, and the "expected foo::Type, found foo::Type" error is the price.
The package manager's job doesn't end at install; the runtime has to find the code.
node_modules — the reason
layout is resolution.sys.path, one environment per virtualenv — flat, one version of anything.--extern paths — no filesystem search
at all, which is why Rust can have two versions of a crate without ambiguity./v2) — semantic import versioning,
so two majors are literally different packages.[DURABLE] If you're designing a new ecosystem, make runtime resolution explicit and independent of directory layout. It removes phantom dependencies, path-length limits, and hoisting entirely.
Gen 1 username + password → phishable, reused, no scoping
Gen 2 long-lived API token → phishable, exfiltratable, "harvest now use later"
Gen 3 token + 2FA on the account → helps login, does NOT help a stolen CI token
Gen 4 TRUSTED PUBLISHING (OIDC) → no long-lived credential exists at all ★
+ provenance attestations → and the artifact proves where it came from
[DURABLE] Trusted publishing is the current best practice and the direction every major registry has moved. The mechanism:
.github/workflows/release.yml on repo org/repo, environment release, may publish
package X."PyPI shipped this in April 2023; npm added it in response to Shai-Hulud; crates.io has it GA. PEP 807 proposes standardizing the mechanism so any Python index can implement it, encapsulating PyPI's existing implementation.
Its explicit security properties, as PEP 807 states them: credentials are short-lived and minimally scoped, limiting blast radius; automatic expiry means attackers cannot mount "harvest now, use later" campaigns; and the upload is conceptually linked to the CI identity authorized to perform it.
⚠️ GOTCHA — trusted publishing is only as good as its trust configuration. Trust by full repository, not by org or wildcard. Trust by branch or environment, not by any ref. A trusted-publishing config that accepts any workflow on any branch is worse than a token, because it looks secure. The 2026 attacks specifically exploited this class of misconfiguration.
The vocabulary, precisely — people conflate these constantly:
Sigstore's keyless model is why this became practical: instead of maintainers managing long-lived signing keys (which historically nobody did well — see the PGP-on-PyPI experience), you generate an ephemeral keypair, exchange a CI OIDC token with the Fulcio CA for a short-lived X.509 certificate binding that key to the CI identity, sign, publish the signature to the Rekor transparency log, and throw the key away. No key management, and anyone can verify both the signature and the identity that made it.
Registry state as of 2026:
pypa/gh-action-pypi-publish v1.11.0+ when using trusted publishing. Over 132,000
PyPI packages carried attestations as of March 2026.sum.golang.org,
but no build provenance; achieving higher SLSA levels goes through the build platform,
not the registry.[DURABLE, and the sentence to remember] Provenance does not prove a package is safe. It
proves it came from the build pipeline its maintainers claim. That is precisely enough to
detect the dominant 2025–26 attack pattern — a malicious version published from a stolen
token outside the project's normal CI — and precisely not enough to detect a maintainer who
was themselves compromised (§8.1 → package-manager-supply-chain-and-workspaces).
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/package-manager-referenceUse when reviewing a package manager or registry design for known anti-patterns, weighing contested questions (MVS vs constraint solving, multiple versions coexisting, hoisted vs isolated vs PnP, lockfiles for libraries, one standard lockfile format, whether SemVer is worth it, package manager as build tool, cooldowns vs patch latency, vendoring), checking whether an ecosystem or tooling claim is still current (snapshot verified August 2026), finding the foundational writing and primary sources, or needing the build-it-in-order checklist, diagnostic first moves, and numbers. Companion to the other package-manager-development skills./package-manager-supply-chain-and-workspacesUse when hardening a package ecosystem against supply-chain attacks or designing build and monorepo features. Covers the 2025–2026 npm worm era, the attack taxonomy (typosquatting, dependency confusion, account takeover, install-time malware), registry-side controls worth building, client-side controls including install cooldowns, lifecycle scripts — the problem, why they exist and how ecosystems escaped them, running them safely — binary distribution design, workspaces, non-registry dependencies (git, path, URL), and overrides./package-manager-ux-ecosystems-and-governanceUse when making a package manager fast and usable, comparing ecosystems, or running one as infrastructure. Covers performance (parallel fetching, caching, lockfile fast paths), CLI UX and error messages as the product, the cross-ecosystem comparison of npm/pnpm/yarn, pip/uv, Cargo, Go modules, Maven, NuGet, apt/dnf, and Nix, and governance and sustainability — the registry as critical infrastructure, the policies you will need (deprecation, yanking, name disputes, takedowns), and the regulation that now reaches package managers./package-manager-versioning-and-resolutionUse when designing or debugging the core of a package manager: the anatomy every package manager shares (the router for the whole package-manager-development reference), semantic versioning and what it really promises, the version-scheme decision and constraint syntax, what belongs in a manifest vs a lockfile, dependency resolution stated formally (NP-complete), the algorithm families, PubGrub and why it won, MVS as the radical simplification, escape hatches when there is no solution, making resolution fast, and lockfile design — what it must contain, the properties that matter, whether libraries should commit lockfiles, and the Python standardization story.npx claudepluginhub the-vibey-project/vibey --plugin package-manager-development