chore(graph): LLM-ready README validation + docs in npm tarball#328
Open
dgaponov wants to merge 4 commits into
Open
chore(graph): LLM-ready README validation + docs in npm tarball#328dgaponov wants to merge 4 commits into
dgaponov wants to merge 4 commits into
Conversation
added 3 commits
July 23, 2026 00:08
…ts block - Add .github/workflows/validate-readme.yml (gravity-ui/readme-validator@v1) - Rename ## Examples -> ## Usage (validator-required section) - Add ## License section - Add ## For AI agents block (positioning, when to use/not vs charts/yagr, common pitfalls) - Passes gravity-readme --package
- Add scripts/build-docs.mjs: builds cleaned README + docs/ guides into build/docs - Append 'npm run build:docs' to the build and build:publish scripts - Add 'build:docs' npm script + @gravity-ui/readme-validator devDependency - Verified: 26 doc files (INDEX.md + 25 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.
Reviewer's GuideAdds AI/LLM-ready README content and validation, plus a docs build step that bundles cleaned documentation into the npm tarball, with no runtime code changes. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The hardcoded path in
## Documentation for AI agents(node_modules/@gravity-ui/graph/build/docs/INDEX.md) should stay in sync withbuildDocs’soutDirand INDEX naming; consider deriving or documenting this contract in one place to avoid future drift. - The README validation workflow only watches
src/components/*/README.md; if new components are added in nested or differently structured directories, the glob may need to be adjusted to ensure their READMEs are validated as well.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The hardcoded path in `## Documentation for AI agents` (`node_modules/@gravity-ui/graph/build/docs/INDEX.md`) should stay in sync with `buildDocs`’s `outDir` and INDEX naming; consider deriving or documenting this contract in one place to avoid future drift.
- The README validation workflow only watches `src/components/*/README.md`; if new components are added in nested or differently structured directories, the glob may need to be adjusted to ensure their READMEs are validated as well.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
|
Preview 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.github/workflows/validate-readme.ymlusinggravity-ui/readme-validator@v1(mirrorsuikit's workflow). Runs on PRs touchingREADME.mdand component READMEs.2. LLM-ready README
## For AI agentsblock (positioning +When to use/When not to usewith pointers to neighbor packages +Common pitfalls/ hallucination traps).## Install,## Usage,## License) so the README passesgravity-readme --package.## Properties, code example).3. Docs in the npm tarball (
buildDocs)scripts/build-docs.mjscallingbuildDocs()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 fromnode_modules/<pkg>/<out>/docs/.copy-docstask / appended to thebuildnpm script).@gravity-ui/readme-validatoradded todevDependencies.4. Docs pointer
## Documentation for AI agentssection pointing at the bundlednode_modules/<pkg>/<out>/docs/INDEX.md.Verification
gravity-readme --package README.md→ ✓ (0 errors).npm pack --dry-runconfirms the generated docs tree ships in the tarball.Notes
## For AI agentsblock is the last human-facing section; the docs pointer sits after it (it correctly closes the agent block for the validator).Repo-specific: renamed
## Examples→## Usage;docs/guides bundled tobuild/docs(26 files).Summary by Sourcery
Add AI/LLM-ready documentation support and README validation for the graph package, including bundling versioned docs into the npm build output.
New Features:
Enhancements:
Build:
CI:
Chores: