Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ledgerhq/package-public-api
A new-architecture package (shared/, domain/, features/) exposes its API through barrels that contain nothing but `export *`, and keeps its private code in an internals location. Read this when creating a package under shared/, domain/ or features/, when editing any `index.*` file, or when a `lint:structure` check fails.
Passed 23 of 23 test cases with the skill, and 12 of 23 without it.
and 16 more in the full report
11 fixed12 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 11 test cases the skill fixed. Same model, same prompt, with and without the skill.
During a code review, you see a PR containing: `export { User, Role } from "./types";` inside `src/index.ts`. Write a brief code review feedback explaining what needs to change and why.
| Checked | Without skill | With skill |
|---|---|---|
| Requests replacing selective named type re-exports with star exports. | Missed | Passed |
| Explains that picking specific exports indicates mixed public and private code in types.ts. | Missed | Passed |
The instructions your model reads when the skill loads.
An index.* file is a barrel: a pure regrouping point, nothing else.
// ✅
export * from "./schema";
export type * from "./types";
export { default } from "./useEnv"; // the one tolerated exception
// ❌ sorting in the export proves ./slice mixes public and private
export { accountNamesSlice, bulkSetAccountNames as setAccountNames } from "./slice";
// ❌ an index that contains code is not an index
export const CurrencySchema = z.discriminatedUnion("type", [...]);
Why the sorting matters. If you need to pick which names leave a file, that file holds both
public and private code. The fix is never a longer export list — it is moving the private part to
an internals location. export * then becomes honest: everything in that file is public.
Enforced by nx run <project>:lint:structure
(the plugin), on every index.* under
src/, at any depth.
Three recognised forms, usable at any depth:
| Form | Use for |
|---|---|
internals/ | a private area with several files |
internals.ts | one private helper in a folder |
<name>.internals.ts | the private half of a file, e.g. slice.ts + slice.internals.ts |
A barrel must never re-export any of them — that would make private code public and defeat the
point. Everything else can: a test sitting next to slice.internals.ts imports it directly, so
private code stays fully testable without being part of the package API.
test cases passed, vs 12 / 23 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.