Skip to content

feat: ship version-matched agent docs in the npm package (#21) - #53

Merged
YaelAnaya merged 1 commit into
mainfrom
feat/21-package-agent-docs
Dec 5, 2026
Merged

YaelAnaya merged 1 commit into
mainfrom
feat/21-package-agent-docs

Conversation

@YaelAnaya

Copy link
Copy Markdown
Contributor

Summary

Ships the generated agent docs inside the npm package, so a consumer's coding agent reads the docs for the version it installed.

Closes #21.

Decision

Option Verdict
(a) docs/generated/ in package.json#files, same path as the repo Chosen. Relative links in llms.txt (components/<slug>.md, components.manifest.json) resolve unchanged inside node_modules, and agents read files by path
(b) Also expose through exports Chosen, additive: ./llms.txt and ./components.manifest.json, for tools that resolve module specifiers. Existing entries are untouched
(c) Docs site only Rejected: not version-matched to an installed copy, and the site isn't deployed yet

The Robomous agent skills (#23, #24) are for contributors to this repo, so they are not shipped to consumers. That is deferred unless a consumer use case appears.

Measured cost (npm pack --dry-run)

Before After
Tarball 125,126 B 369,043 B
Unpacked 563,254 B 1,859,249 B
Files 179 236 (+57 in docs/generated/)

Most of the increase is the demo sources inside the 54 references and the manifest's prop tables. I recorded the number in CONTRIBUTING.

Freshness at publish

release.yml runs pnpm verify, which runs docs:check. That includes manifest:check and agents:check, so a stale docs/generated/, such as a version bump without pnpm docs:agents, fails the release before npm publish. CONTRIBUTING Releasing says to run pnpm docs:agents after the bump.

Tests (tests/package/consumer.test.ts, now 14)

  • The existing "nothing repository-only" check now allows only docs/generated/ under docs/. Anything else (docs/architecture, docs/superpowers, docs/adr…) still fails it.
  • New: the installed package contains llms.txt, the manifest, its schema and a reference for every src/components/*.tsx. The packed manifest's package and version match package.json. Every relative link in llms.txt lands on a file inside the installed package.
  • New: import.meta.resolve("@robomous/ui-core/llms.txt") and …/components.manifest.json resolve, from the consumer, to those installed files.

Testing evidence

  • pnpm format:check ✓
  • pnpm lint ✓
  • pnpm test: 228 passed
  • pnpm docs:check: generated docs current, 0 errors, 62 pages
  • pnpm test:package: 14 passed

Docs

  • README: a new For coding agents section with a snippet consumers paste into their own AGENTS.md/CLAUDE.md.
  • CONTRIBUTING: the distribution decision and its cost, and the updated Releasing step.

Public API / dependency changes

Two additive exports entries, and docs/generated in files. No runtime dependency change.

docs/generated/ (llms.txt, one Markdown reference per component, the
manifest and its schema) joins package.json#files at the same path, so a
consumer's agent reads node_modules/@robomous/ui-core/docs/generated/llms.txt
for the version it installed, and llms.txt's relative links still resolve.
./llms.txt and ./components.manifest.json are added to the exports map; the
existing entries are unchanged.

Measured cost: the tarball grows from 125,126 B to 369,043 B (563 KB to
1.86 MB unpacked, 57 files), mostly demo sources and prop tables.

The packed-consumer test now checks that every reference ships, that every
llms.txt link resolves inside the package, that the packed manifest's
version matches package.json, that both exports resolve, and that nothing
else under docs/ is packed. The README tells consumers how to point their
AGENTS.md at the docs; CONTRIBUTING records the decision and the cost.

Closes #21
@YaelAnaya YaelAnaya added area: build Build and packaging area: agent-tooling Agent instructions, skills, and workflows area: documentation Documentation and component catalog type: feature New functionality labels Dec 5, 2026
@YaelAnaya YaelAnaya self-assigned this Dec 5, 2026
@YaelAnaya
YaelAnaya merged commit 69df4af into main Dec 5, 2026
1 check passed
@YaelAnaya
YaelAnaya deleted the feat/21-package-agent-docs branch December 5, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: agent-tooling Agent instructions, skills, and workflows area: build Build and packaging area: documentation Documentation and component catalog type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[08] DOC-04 · Ship version-matched agent docs inside the npm package

1 participant