Skip to content

chore(chartkit): LLM-ready README validation + docs in npm tarball - #912

Merged
dgaponov merged 5 commits into
mainfrom
chore/readme-llm-ready
Jul 25, 2026
Merged

chore(chartkit): LLM-ready README validation + docs in npm tarball#912
dgaponov merged 5 commits into
mainfrom
chore/readme-llm-ready

Conversation

@dgaponov

Copy link
Copy Markdown
Contributor

Part of DATAUI-3745 — AI/LLM-ready documentation for Gravity UI. This PR brings the LLM-ready README contract + docs-in-npm bundling to this package, per the ai-adoption-plan (README validation, docs-in-npm, readme-template).

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.
  • See the shared VALIDATION-REPORT.md for per-repo baseline→after details.

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: renamed ## Get started## Getting started (validator Usage alias); docs/ guides bundled to build/docs (2 files).

ZCode added 3 commits July 23, 2026 00:11
…AI agents block

- Add .github/workflows/validate-readme.yml (gravity-ui/readme-validator@v1)
- Rename ## Get started -> ## Getting started (validator-accepted Usage alias; fix TOC anchor)
- Add ## License section
- Add ## For AI agents block (positioning, when to use/not vs charts/yagr/dashkit, common pitfalls)
- Passes gravity-readme --package
- Add scripts/build-docs.mjs: builds cleaned README + docs/ guides into build/docs
- Add gulp 'copy-docs' task to the build series
- Add 'build:docs' npm script + @gravity-ui/readme-validator devDependency
- Verified: INDEX.md + guides/testing.md land in build/docs and ship 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.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 18.64% 286 / 1534
🔵 Statements 18.73% 296 / 1580
🔵 Functions 14.5% 48 / 331
🔵 Branches 12.95% 149 / 1150
File CoverageNo changed files found.
Generated in workflow #241 for commit 6d8c0f9 by the Vitest Coverage Report Action

@gravity-ui-bot

Copy link
Copy Markdown
Contributor

🎭 Tests Report is ready.
🎭 Coverage Report is ready.

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.
korvin89
korvin89 previously approved these changes Jul 23, 2026
…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. 'build:docs' now runs 'gulp copy-docs'.
@dgaponov
dgaponov merged commit 4ca204e into main Jul 25, 2026
6 checks passed
@dgaponov
dgaponov deleted the chore/readme-llm-ready branch July 25, 2026 09:10
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