public-api-evolution
Skill0 starsChanged 47 days agoApache-2.0View on GitHub
Add, change or remove anything reachable from a package entry point, with a compiling consumer example and an explicit compatibility classification.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- changesets-releaseSkill
- local-ci-paritySkill
- npm-releaseSkill
- package-architectureSkill
- package-artifact-validationSkill
- pnpm-supply-chainSkill
- provider-adapter-developmentSkill
- runtime-contract-evolutionSkill
- runtime-lifecycle-coordinationSkill
- workspace-lifecycleSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 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.
3
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 adds, renames, removes or retypes anything reachable from a package's declared entry points — values, types, …
- Distinctive: line 19
Do not use this skill when:
- Very specific: line 65
Write the consumer proof: Add or extend a file under examples/consumer-smoke/src/.
- Very specific: line 67
import only from package specifiers (@relvo-labs/agent-runtime), never a path
- Very specific: line 69
avoid any, as unknown as, and @ts-expect-error except when the _point_ of the assertion is that something must not compile
≈ “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
Public API evolution
Trigger
Use this skill when a change adds, renames, removes or retypes anything reachable from a package's declared entry points — values, types, interfaces, enums, error classes, or the shape of a returned object.
Counter-trigger
Do not use this skill when:
- the symbol is not exported from an entry point (internal refactor — no policy applies)
- the change is only to a Zod schema's wire semantics — start with
runtime-contract-evolution, then return here for the TypeScript surface - the change is to build output or the
exportsmap itself — usepackage-artifact-validation
Owns
examples/consumer-smoke— the compiling consumer of every public entry pointdocs/adr/ADR-0011-public-api-and-versioning.md— compatibility classification rules
Does not own
packages/protocol/src— owned byruntime-contract-evolutionpackages/*/package.json#exports— owned bypackage-artifact-validation.changeset— owned bychangesets-release
Relationships
boundary-with→runtime-contract-evolution— wire compatibility is decided there; TypeScript-surface compatibility and the consumer example are decided here.boundary-with→package-artifact-validation— this skill decides the API; that skill proves it survives packing. A declaration that does not survive packing is not a public API, whatever the source says.delegates-to→changesets-release— this skill produces the classification; that skill turns it into a version bump.
Procedure
Classify before editing. Record the class in the PR body and the changeset.
Change Class Pre-1.0 bump add a new export additive minor add an optional property to a returned object additive minor add a required parameter, or a property to an input type breaking minor (0.x) narrow a return type / widen a parameter type additive minor widen a return type / narrow a parameter type breaking minor (0.x) remove or rename an export breaking minor (0.x) add a member to a union that consumers switchonbreaking-ish minor + note While the packages are
0.x, "breaking" still means a minor bump — but it must be flagged in the changeset body with aBREAKING:line so the changelog is honest.- Two exports maps, one truth. A symbol is public only if it is reachable from a path
listed in
exports. Anything else is internal even ifexported in source. Do not document internals. Write the consumer proof. Add or extend a file under
examples/consumer-smoke/src/. It must:- import only from package specifiers (
@relvo-labs/agent-runtime), never a path - exercise the new symbol in a way that would fail to compile if the type were wrong
- avoid
any,as unknown as, and@ts-expect-errorexcept when the point of the assertion is that something must not compile
examples/consumer-smokeis typechecked against the packed tarballs, not the source tree, so a symbol that is missing from the published.d.tsfails here.- import only from package specifiers (
- Deprecate before removing. Mark with
/** @deprecated use X instead */, keep for at least one minor, then remove in a change that says so. - No type-only escape hatches at the boundary. A public function must not accept or
return
any, a bareobject, or an un-exported type. If a consumer cannot name a type they receive, export it.
Verification
pnpm build
pnpm artifacts:check # packs, installs and typechecks examples/consumer-smoke
pnpm typecheck
pnpm gatepnpm artifacts:check runs Are The Types Wrong across the packed tarballs; a resolution
failure there (FalseESM, MissingExportEquals, masked .d.ts) is a release blocker,
not a warning.
Provenance
- Source: independent — authored for this repository against the npm semver specification, the TypeScript "declaration files / publishing" documentation, and the Are The Types Wrong problem catalogue.
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.

