Skip to content

chore(dashkit): LLM-ready README validation + docs in npm tarball#312

Open
dgaponov wants to merge 5 commits into
mainfrom
chore/readme-llm-ready
Open

chore(dashkit): LLM-ready README validation + docs in npm tarball#312
dgaponov wants to merge 5 commits into
mainfrom
chore/readme-llm-ready

Conversation

@dgaponov

@dgaponov dgaponov commented Jul 23, 2026

Copy link
Copy Markdown

Part of AI/LLM-ready documentation for Gravity UI. This PR brings the LLM-ready README contract + docs-in-npm bundling to this package.

What's included

1. README validation workflow

2. LLM-ready README

  • Adds a ## For AI agents block (positioning + When to use / When not to use with pointers to neighbor packages + Common pitfalls / hallucination traps).
  • Fills any missing required sections (## Install, ## Usage, ## License) so the README passes gravity-readme --package.
  • For component packages: component READMEs are fixed to the component contract (one-sentence description, ## Properties, code example).

3. Docs in the npm tarball (buildDocs)

  • Adds scripts/build-docs.mjs calling buildDocs() from @gravity-ui/readme-validator — at build time it copies the cleaned README + guides into <outDir>/docs/ so an agent in a consumer project reads docs matching the installed version from node_modules/<pkg>/<out>/docs/.
  • Wired into the build pipeline (gulp copy-docs task / appended to the build npm script).
  • @gravity-ui/readme-validator added to devDependencies.

4. Docs pointer

  • Appends a ## Documentation for AI agents section pointing at the bundled node_modules/<pkg>/<out>/docs/INDEX.md.

Verification

  • gravity-readme --package README.md → ✓ (0 errors).
  • npm pack --dry-run confirms the generated docs tree ships in the tarball.

Notes

  • No runtime/code changes — docs and build-pipeline only.
  • The ## For AI agents block is the last human-facing section; the docs pointer sits after it (it correctly closes the agent block for the validator).

Repo-specific: INDEX.md (package overview) bundled to build/docs — no docs/ or component READMEs yet.

ZCode added 3 commits July 23, 2026 00:07
- Add .github/workflows/validate-readme.yml (gravity-ui/readme-validator@v1)
- Add ## License section
- Add ## For AI agents block (positioning, when to use/not vs charts/chartkit, common pitfalls)
- Passes gravity-readme --package
- Add scripts/build-docs.mjs: generates INDEX.md (package overview from For AI agents)
  into build/docs (no docs/ guides or component READMEs yet)
- Add gulp 'copy-docs' task to the build series
- Add 'build:docs' npm script + @gravity-ui/readme-validator devDependency
- Verified: INDEX.md lands in build/docs and ships in the tarball
Append a pointer to the agent-readable docs bundled in the npm tarball
(node_modules/<pkg>/<out>/docs/INDEX.md) at the end of the README.
@gravity-ui-bot

Copy link
Copy Markdown
Contributor

Preview is ready.

ZCode added 2 commits July 23, 2026 22:06
The uikit-style validate-components job (type: component, paths: src/components/*/
README.md) was copied from the template but this repo has no component READMEs, so it
is dead weight (and its paths entry spuriously widens the PR trigger). Keep only
validate-package.
…cs.mjs)

Call buildDocs() directly in the gulp task via require('@gravity-ui/readme-validator')
instead of spawning a node process that runs scripts/build-docs.mjs. Remove the now-
unused script (and the empty scripts/ dir it created). 'build:docs' now runs 'gulp copy-docs'.
Comment thread README.md

## Documentation for AI agents

Agent-readable documentation for the installed version is located in `node_modules/@gravity-ui/dashkit/build/docs/INDEX.md`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it valid link for this package?
We are already in @gravity-ui/dashkit/

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is valid because the documentation will be stored in the compiled bundle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants