package-artifact-validation
Skill0 starsChanged 47 days agoApache-2.0View on GitHub
Validate what a package actually publishes by inspecting packed tarballs, exports maps, declarations, publint and Are The Types Wrong rather than trusting the source tree.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- changesets-releaseSkill
- local-ci-paritySkill
- npm-releaseSkill
- package-architectureSkill
- pnpm-supply-chainSkill
- provider-adapter-developmentSkill
- public-api-evolutionSkill
- runtime-contract-evolutionSkill
- runtime-lifecycle-coordinationSkill
- workspace-lifecycleSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Use this skill when a change touches any of:
- Distinctive: line 23
Do not use this skill when:
- Very specific: line 50
The source tree lies. The tarball does not: Never validate packaging by importing from packages/*/src.
- Very specific: line 70
Always export ./package.json.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Package artifact validation
Trigger
Use this skill when a change touches any of:
- a package
exports,main,types,files,sideEffectsorpublishConfigfield tsdown.config.tsor build output layout.npmignore/ packing behaviourtools/repo/check-artifacts.ts- any report from
publintor@arethetypeswrong/cli
Counter-trigger
Do not use this skill when:
- you are deciding whether a symbol should be public — use
public-api-evolution - you are adding a package or a workspace dependency edge — use
package-architecture - you are choosing a version number — use
changesets-release
Owns
packages/*/package.json#exports— theexports,files,typesandpublishConfigfieldspackages/*/tsdown.config.ts— build input, output layout and declaration emissiontools/repo/check-artifacts.ts— pack, inspect, install, smokedocs/adr/ADR-0007-module-format-and-exports.md— the ESM-only decision record
Does not own
packages/protocol/src— owned bypublic-api-evolutionfor export decisions and byruntime-contract-evolutionfor schemaspnpm-workspace.yaml#packages— owned bypackage-architecturepnpm-workspace.yaml#catalog— owned bypnpm-supply-chain
Relationships
boundary-with→public-api-evolution— that skill decides the API; this skill proves the API survives publication.boundary-with→package-architecture— that skill owns package existence and layering; this skill owns build and packaging mechanics.boundary-with→local-ci-parity— this skill defines the artifact checks; that skill guarantees they run identically in CI.
Procedure
- The source tree lies. The tarball does not. Never validate packaging by importing
from
packages/*/src. Alwayspnpm pack, extract, install into a scratch project and import by package specifier. Required
package.jsonshape for every publishable package:{ "type": "module", "exports": { ".": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }, "./package.json": "./package.json", }, "files": ["dist", "README.md", "LICENSE", "NOTICE"], "sideEffects": false, "publishConfig": { "access": "public", "provenance": true }, }typesmust be first in every export condition object.- Always export
./package.json; tooling reads it. - npm provenance must stay enabled so a future public release is attributable
to its build environment; the artifact gate rejects
falseor omission. - No
main/module/typestop-level fallbacks that disagree withexports. - This repository is ESM-only. Do not add a CJS condition without an ADR amendment — dual publishing re-introduces the dual-package hazard for our stateful registry.
- Every entry point needs a declaration.
tsdownemits.d.tsper entry. A subpath export without a matchingtypescondition is invisible tonode16/bundlerresolution and will be reported by ATTW. Inspect the file list, not just the exit code:
pnpm --filter <pkg> pack --pack-destination /tmp/artifacts tar -tzf /tmp/artifacts/<pkg>-<v>.tgz | sortReject the tarball if it contains:
src/,test/,*.tsbuildinfo,tsconfig*.json,*.mapyou did not intend, or a missingLICENSE/NOTICE.Run the two independent linters. They catch different classes:
publint— malformedexports, wrong file extensions, unresolvable pathsattw --pack— resolution-mode failures (FalseESM,NoResolution,MissingExportEquals, masked types)
Neither may be waived by a config exclusion without an inline comment naming the reason and an issue link.
- Consumer smoke from the tarball.
tools/repo/check-artifacts.tsinstalls the packed tarballs into a throwaway directory with a clean store and runsexamples/consumer-smoke. This is what catches a missing runtime dependency that the workspace symlink was silently satisfying.
Verification
pnpm build
pnpm artifacts:check
pnpm gatepnpm artifacts:check is expected to be slow (it performs a real install). It must never
be skipped locally before requesting review, and it must never be given network access to
a registry other than the one in .npmrc.
Provenance
- Source: independent — authored for this repository against the Node.js "Modules:
Packages" documentation, the npm
package.jsonreference, the publint rule list and the Are The Types Wrong problem catalogue. - Incorporated:
rolldown/tsdown@f7f0cc3adb70d2589216d479a59f226869ac4b08(MIT) — the entry/exports/declaration expectations in step 2 and the "validate the packed artefact" ordering follow tsdown's documented publishing guidance.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

