Skip to content

chore(dynamic-forms): LLM-ready README validation + docs in npm tarball - #392

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

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

Conversation

@dgaponov

@dgaponov dgaponov commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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: docs/ guides bundled to build/docs (6 files) via gulp copy-docs task.

ZCode added 3 commits July 23, 2026 00:05
- 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 uikit/dialog-fields, 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 (runs after compile/styles)
- Add 'build:docs' npm script + @gravity-ui/readme-validator devDependency
- Verified: 6 doc files (INDEX.md + 5 guides) 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.

@gravity-ui-bot

Copy link
Copy Markdown
Contributor

Playwright Test Component 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. 'build:docs' now runs 'gulp copy-docs'.
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.

2 participants