Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →publishConfig rules for public npm packages in the Trezor Suite monorepo. Use when adding or editing publishConfig, exports, or preparing a package for npm publishing.
.claude/skills/trezor-publish-config/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 44% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -18% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -29% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -24% | 0% |
| case-16 | ✗→✓ | ▲ Improved | -25% | 0% |
Validated by requirePublishConfig in @trezor/requirements (packages/requirements/src/requirements/package-json/requirePublishConfig.ts).
Applies to any package with publishConfig.
main — required (e.g. "./src/index.ts").files — must include "lib/".publishConfig.main and publishConfig.types — both required.publishConfig.exports["."].default and publishConfig.exports["."].types — must export the same files as in Rule 3../lib/*) must be a passthrough string ("./lib/*") — an object would double the .js extension.index.js, e.g. "./lib/protocol-thp": { "types": "./lib/protocol-thp/index.d.ts", "default": "./lib/protocol-thp/index.js" } — without this, the wildcard would resolve to protocol-thp.js instead of protocol-thp/index.js."types" must come before "default" in every condition object (recursive). TypeScript evaluates conditions in declaration order.type — must declare top-level "type": "module". Do not duplicate it under publishConfig.type — publishConfig would only shadow the top level with the same value at publish time, so we keep a single source of truth.jsonc{ "name": "@trezor/example", "main": "./src/index.ts", // Rule 1 "type": "module", // Rule 8 "files": ["lib/", "CHANGELOG.md"], // Rule 2 "publishConfig": { "main": "./lib/index.js", // Rule 3 "types": "./lib/index.d.ts", // Rule 3 "exports": { ".": { // Rule 4: exact shape required "types": "./lib/index.d.ts", // Rule 7: "types" before "default" "default": "./lib/index.js", }, // Rule 5: ESM wildcard — passthrough string "./lib/*": "./lib/*", }, }, }
Other measured skills in the registry, with their headline benchmark lift.