[Repo Assist] Add llms.txt/llms-full.txt generation#980
[Repo Assist] Add llms.txt/llms-full.txt generation#980github-actions[bot] wants to merge 9 commits intomainfrom
Conversation
Implements support for generating llms.txt and llms-full.txt files alongside the documentation output when --generatellmstxt is passed to fsdocs build or fsdocs watch. - llms.txt: title/link index of all docs and API reference entries - llms-full.txt: same with full page content included Files follow the llmstxt.org convention, making project documentation easily consumable by LLMs and AI coding assistants. Closes #951 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Pull request created: #980 |
|
/repo-assist change the flag in this PR to |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Commit pushed: |
|
🤖 This is an automated response from Repo Assist. Done! Renamed
|
|
/repo-assist We need some kind of testing added for this |
Extract llms.txt generation logic into LlmsTxt module and add 8 unit tests covering: header generation, empty entries, Docs/API Reference section separation, index-only vs full-content modes, blank content skipping, and conditional section omission. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Commit pushed: |
|
🤖 This is an automated response from Repo Assist. Done! Added testing for the
The
All 8 tests pass (
|
src/fsdocs-tool/BuildCommand.fs
Outdated
| [<Option("clean", Required = false, Default = false, HelpText = "Clean the output directory.")>] | ||
| member val clean = false with get, set | ||
|
|
||
| [<Option("llms", |
There was a problem hiding this comment.
I think it makes more sense to have this as fsproj/msbuild configuration rather than a new feature flag.
nojaf
left a comment
There was a problem hiding this comment.
Having to pass --llm on everything invocation doesn't seem the way to go for me.
I'd rather enable this once and then never forget about it.
Yup agreed. It's possible it should be on by default too? Gven use of LLMs is now normal. |
Seems like a reasonable default yes. |
|
/repo-assist update this PR taking this into account:
Please make sure all docs are updated. |
…enabled by default) Instead of requiring users to pass --llms on every fsdocs build/watch invocation, read the new <FsDocsGenerateLlmsTxt> MSBuild property from the project file or Directory.Build.props. The property defaults to true, so llms.txt and llms-full.txt are generated automatically. Projects that want to opt out can set <FsDocsGenerateLlmsTxt>false</FsDocsGenerateLlmsTxt>. Closes #951 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Commit pushed: |
|
🤖 This is an automated response from Repo Assist. Done! Replaced the What changed:
Behaviour:
The property can be set in the project file (
|
|
/repo-assist Make the default for the MSBuild property for llms text to be on by default please and adjust test and documentation for this. Update release notes |
… (on by default) The LlmsTxt tests were added when this was a CLI flag. Update the section comment to accurately describe the current implementation as an MSBuild property that is enabled by default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Commit pushed: |
|
🤖 This is an automated response from Repo Assist. Done! Here's a summary of the current state of this PR:
What was just updated:
Current state of the PR:
|
|
/repo-assist I tried this out on a local project and asked a fellow LLM what it thought about the output llm.txt and llm-full.txt Overall: Yes, this is useful. Having llms.txt (the index file)
llms-full.txt (the full content)
Suggestions
Please added the suggestions! |
- Decode HTML entities (e.g. " -> ", > -> >) in content written to llms-full.txt - Strip FSharp.Formatting --eval warning lines from content - Trim API Reference index in llms.txt to type/module level only (exclude per-member entries with '#' anchors) - Use heading format (### [title](url)) per entry in llms-full.txt for better navigation structure - Add tests for all new behaviours Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Commit pushed: |
|
🤖 This is an automated response from Repo Assist. I've applied all four suggestions from the LLM feedback to this PR. Here's a summary of what changed: Changes made
All existing tests continue to pass, and I've added 6 new tests covering the new behaviours (HTML decoding, eval-warning stripping, member filtering in index, heading format in full file).
|
|
/repo-assist I'm still not entirely happy with the output here. Example Notice that are a lot of blank lines between sections. Improve the code and verify your own work by running
this will create files in |
… blank lines - Trim and collapse internal whitespace in entry titles so link text is always on a single line (e.g. 'Fantomas\n' → 'Fantomas') - Collapse 3+ consecutive newlines to at most 2 in cleaned content, preventing large gaps between sections in llms-full.txt - Trim leading/trailing whitespace from cleaned content - Add two new tests covering both behaviours Addresses feedback from @nojaf on PR #980. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Commit pushed: |
|
🤖 This is an automated response from Repo Assist. I've addressed your feedback from the latest review: What was fixed:
Two new tests covering both behaviours were added and all 15 LlmsTxt tests pass.
|
🤖 This is an automated PR from Repo Assist, an AI assistant for this repository.
Closes #951
Summary
Adds a
--generatellmstxtflag tofsdocs buildandfsdocs watch. When enabled, two files are written to the output root:llms.txt— a Markdown index with links to all documentation pages and API reference entries, following the [llmstxt.org]((llmstxt.org/redacted) conventionllms-full.txt— same as above but with full page content included after each entryThis makes it easy to add documentation context for F# projects to LLMs and AI coding assistants.
Usage
Trade-offs
llms-full.txtcan be large for projects with extensive API docs. Users can choose which file to expose.Test Status
dotnet build src/fsdocs-tool/fsdocs-tool.fsproj -c Release— succeeded, 0 errorsdotnet test tests/FSharp.ApiDocs.Tests/FSharp.ApiDocs.Tests.fsproj -c Release— 68 passed, 0 failed