Skip to content

ci: add extension docs generation pipeline#1067

Draft
makhnatkin wants to merge 2 commits intomainfrom
ci/docs-extensions
Draft

ci: add extension docs generation pipeline#1067
makhnatkin wants to merge 2 commits intomainfrom
ci/docs-extensions

Conversation

@makhnatkin
Copy link
Copy Markdown
Collaborator

Adds a multi-step pipeline for generating per-extension documentation pages.
All scripts live in scripts/docs/ and are invoked via a single CLI entry point node scripts/docs/index.mjs <command>.

  1. Deterministic extraction (pnpm docs:extract) — scans all extension directories, regex-parses TypeScript sources to collect nodes, marks, actions, keymaps, input rules, plugins, presets, options, and test examples into raw Markdown files + a JSON IR (docs-gen/raw/, docs-gen/extensions.json).
  2. AI enrichment (three paths):
    • pnpm docs:enrich — calls OpenAI API directly (requires OPENAI_API_KEY)
    • scripts/docs/enrich-agent.md — a standalone instruction file you hand to a Cursor/Claude agent without any API key; the agent reads raw docs + source code and writes enriched files
    • pnpm docs:enrich:prompts + pnpm docs:enrich:apply — export prompts as JSON, process externally, apply responses
  3. Assembly (pnpm docs:assemble) — merges enriched docs into docs-src/extensions/, patches toc.yaml and index.md.
  4. Full build (pnpm docs:build) — runs generate → extract → assemble → Diplodoc in one command.
    ~70% of each page is filled deterministically from code; ~30% (description, syntax guide, serialization notes, use cases) is AI-generated.

New scripts

Command What it does
pnpm docs:extract Extract extension metadata → docs-gen/raw/, docs-gen/extensions.json
pnpm docs:enrich:prompts Generate prompt JSONs for manual/external AI processing
pnpm docs:enrich Enrich via OpenAI API (needs OPENAI_API_KEY)
pnpm docs:enrich:agent Shows how to use the agent-based enrichment
pnpm docs:enrich:apply Apply manually prepared AI responses
pnpm docs:assemble Assemble final pages into docs-src/
pnpm docs:build Full pipeline: generate → extract → assemble → Diplodoc build

@makhnatkin makhnatkin requested a review from d3m1d0v as a code owner April 16, 2026 08:02
@makhnatkin makhnatkin marked this pull request as draft April 16, 2026 08:03
@gravity-ui
Copy link
Copy Markdown

gravity-ui Bot commented Apr 16, 2026

Storybook Deployed

@gravity-ui
Copy link
Copy Markdown

gravity-ui Bot commented Apr 16, 2026

🎭 Playwright Report

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.

1 participant