docs(stacks-svelte): generate llms friendly docs from storybook content #2012
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.
SPARK-93
Attention: 2 vibe coded files are checked in as part of this PR
This PR introduces a script that analyze the content of the stacks-svelte source and related storybook docs and generates a
llms.txtsummarizing all that content in markdown easily digestible by LLMs.The only package I could find out there to take storybook docs and make them LLMs friendly was this one. Unfortunately though the package support only storybook v7 and v8 and we are using v9. It also uses playwright under the hood.
Until there’s a more established package that supports converting Storybook docs to Markdown, I’ve opted to vibe code what we need in a very isolated tools folder. In general, I’m not in favor of checking in code generated by LLMs unless we fully understand it. However, for this specific use case, I think it’s acceptable — the script is unlikely to need ongoing maintenance, and even if it breaks, the only loss would be something primarily useful for LLMs.
How to test
npm run storybook:build -w @stackoverflow/stacks-sveltepackages/stacks-svelte/netlify/dist/llms.txtand check the generated markdownDeployment Preview: https://deploy-preview-2012--stacks-svelte.netlify.app/llms.txt