Skip to main content

When a package ships files or bytes, keep them inside the package file. Consumer packages should receive named data or target replies, not random file paths into another package.

A help package ships markdown, a theme package ships images, and a file-preview package ships a small parser. A consumer wants the rendered result. The consumer should not read arbitrary files from the package folder.Package bytes should move with the package. Consumers should use public reads or requests, not private file paths that happen to work today.

Traditional app shape

or:
Now the consumer depends on the help package’s private file path. Rename the folder and consumers break.

Bitfield shape

The package decides what bytes it brings. The consumer uses the public name exposed by the package file.

Boundary example

The important part is not the exact content. The important part is the boundary: the package file reference stays inside the package.

Four file situations

Help markdown

Private help path

Prepared help read

The help package owns the file. The consumer reads prepared help content.

Preview HTML

Private preview bundle

Prepared preview surface

The preview package decides how the surface is prepared. The shell receives a public view.

Review template

Private template import

Prepared template read

The package can ship the template as package material. The caller should not read the package folder directly.

Search index

Private search index

Search through the package target

The caller asks for search results. The help package can change its index format without breaking the caller.

Consumer rules

What this prevents

React is one adapter that might render the bytes, but React does not define the package file. A web shell, native shell, terminal shell, or future adapter should receive named data from the same package-owned material.

Review checklist

Full before and after

Traditional feature request

“Add a help panel that shows package help and lets the user search it.”

Bad implementation

This consumer now depends on two package files and one package layout. If the help package changes how it stores content or search data, the consumer breaks.

Public package version

The consumer gets content and search through public names. The package can keep markdown, JSON, a generated index, or something else behind that boundary.For React, Swift, Kotlin, terminal, or future adapters, the consumer rule stays the same: do not read package files directly.

Good consumer code

React adapter example

The consumer asks for help content by public input name. It does not import or parse the package file that produced it.

Review check

If consumer code imports ../some-package/content/file.md, stop. Package files are package material. Consumers should read a data name or request a target.

Next

Last modified on May 10, 2026