Enrich LLM-facing documentation with context and navigation#939
Enrich LLM-facing documentation with context and navigation#939
Conversation
Add rich SYSTEM headers to llms-full.txt and llms-small.txt with product context, supported platforms, and key capabilities. Insert a table of contents for navigation. Add related-page cross-references to help LLMs understand documentation relationships. Create llms-ctx.txt with concise product context. Reference llms-ctx.txt from llms.txt entry point.
There was a problem hiding this comment.
Pull request overview
This PR improves the generated llms-*.txt documentation artifacts by injecting richer product context, navigation helpers, and cross-page references, and adds a standalone context file (llms-ctx.txt) intended for LLM consumption.
Changes:
- Adds enriched
<SYSTEM>headers, a static table of contents, and “Related” cross-links intollms-full.txt/llms-small.txtduring post-processing. - Rewrites the generated
llms.txtindex during build to include product info and a link tollms-ctx.txt. - Adds a new public
llms-ctx.txtfile containing concise RocketSim product context and technical details.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| docs/src/integrations/llms-txt-post-process.ts | Post-processes generated LLM docs to prepend richer SYSTEM headers/TOC, append related links, and rewrite llms.txt. |
| docs/public/llms-ctx.txt | New static “product context” document referenced from llms.txt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - Onboarding | ||
| - Product Tour & Quick Demos | ||
| - Configuring App Actions | ||
| - Setting Up RocketSim Connect |
There was a problem hiding this comment.
TOC entry "Setting Up RocketSim Connect" uses different capitalization than the actual page title ("Setting up RocketSim Connect"). Since addRelatedLinks and other logic key off exact titles, keeping TOC/page titles consistent avoids confusion and reduces drift.
| - Setting Up RocketSim Connect | |
| - Setting up RocketSim Connect |
| Last updated: ${buildDate} | ||
| Website: https://www.rocketsim.app | ||
| Documentation: https://www.rocketsim.app/docs | ||
| GitHub: https://github.com/AvdLee/RocketSimApp | ||
| Support: support@rocketsim.app |
There was a problem hiding this comment.
enhanceLlmsTxtIndex hard-codes the production base URL (https://www.rocketsim.app) in multiple places. Since the repo already centralizes the site URL in docs/src/config/config.json (used by docs/astro.config.ts), consider deriving the base URL from that config to avoid broken links if the domain changes or when building in non-prod environments.
docs/public/llms-ctx.txt
Outdated
|
|
||
| ## Technical Details | ||
| - Platform: macOS (enhances the iOS/watchOS/visionOS Simulator in Xcode) | ||
| - Distribution: Mac App Store + direct enterprise distribution |
There was a problem hiding this comment.
The "Distribution" line claims "Mac App Store + direct enterprise distribution", but the existing FAQ only states there is an out-of-the-App-Store distribution option via support contact. To avoid providing potentially incorrect product info to LLMs, consider aligning this wording with the FAQ (or linking to the official wording/source).
| - Distribution: Mac App Store + direct enterprise distribution | |
| - Distribution: Mac App Store (see official FAQ or contact support for alternative distribution options) |
| "[Setting Up RocketSim Connect](/docs/getting-started/setting-up-rocketsim-connect)", | ||
| ], | ||
| "Setting Up RocketSim Connect": [ |
There was a problem hiding this comment.
RELATED_LINKS uses the key "Setting Up RocketSim Connect", but the actual page title in the docs frontmatter is "Setting up RocketSim Connect". Because addRelatedLinks does an exact title match, the related links block will never be added for that page. Rename the key (and any other exact-title keys) to match the real # title text.
| "[Setting Up RocketSim Connect](/docs/getting-started/setting-up-rocketsim-connect)", | |
| ], | |
| "Setting Up RocketSim Connect": [ | |
| "[Setting up RocketSim Connect](/docs/getting-started/setting-up-rocketsim-connect)", | |
| ], | |
| "Setting up RocketSim Connect": [ |
| - Setting Up RocketSim Connect | ||
| - How Large Teams Use RocketSim | ||
| - Additional Resources | ||
| - Testimonials |
There was a problem hiding this comment.
The TOC includes a "Testimonials" entry, but transformLlmsTxt removes the Testimonials page for the small variant. This makes llms-small.txt’s TOC point to content that won’t exist. Consider generating variant-specific TOC content (or conditionally omitting Testimonials for small).
| - Testimonials |
| - Simulator Camera Support | ||
|
|
||
| ### Status Bar | ||
| - Status Bar Appearance |
There was a problem hiding this comment.
TOC entry "Status Bar Appearance" doesn’t match the actual docs page title ("Statusbar Appearance"). Since this TOC is meant for navigation/search in the generated LLM docs, mismatched titles make it harder to correlate sections. Update the TOC text to match the real page title(s).
| - Status Bar Appearance | |
| - Statusbar Appearance |
|
|
||
| ### App Actions | ||
| - App Directory Access | ||
| - Deep Links & Universal Links |
There was a problem hiding this comment.
TOC entry "Deep Links & Universal Links" doesn’t match the actual page title ("Deeplinks (Universal Links)"). If the TOC is intended to help locate page sections by title, keep the wording consistent with the generated # headings.
| - Deep Links & Universal Links | |
| - Deeplinks (Universal Links) |
…tion wording Address Copilot review feedback: - Align TOC entries with actual page titles: "Setting up" (lowercase), "Statusbar Appearance" (one word), "Deeplinks (Universal Links)" - Fix RELATED_LINKS key for "Setting up RocketSim Connect" so cross-references actually match - Exclude Testimonials from TOC in small variant since the page is stripped - Soften distribution claim in llms-ctx.txt to match FAQ wording
| const TABLE_OF_CONTENTS = `## Table of Contents | ||
|
|
||
| ### Getting Started | ||
| - Onboarding | ||
| - Product Tour & Quick Demos | ||
| - Configuring App Actions | ||
| - Setting up RocketSim Connect | ||
| - How Large Teams Use RocketSim | ||
| - Additional Resources | ||
| - Testimonials | ||
|
|
||
| ### Screenshots & Recordings | ||
| - Taking Screenshots | ||
| - Creating Recordings | ||
| - Floating Thumbnail | ||
| - App Store Connect Optimization | ||
| - Touch Indicators | ||
| - 120 FPS Recordings | ||
|
|
||
| ### Simulator Camera | ||
| - Simulator Camera Support | ||
|
|
||
| ### Status Bar | ||
| - Statusbar Appearance | ||
|
|
||
| ### Design Comparison | ||
| - Comparing Designs | ||
| - Grids & Rulers | ||
| - Magnifier | ||
| - Slow Animations | ||
|
|
||
| ### App Actions | ||
| - App Directory Access | ||
| - Deeplinks (Universal Links) | ||
| - Location Simulation | ||
| - Privacy & Permissions | ||
| - Push Notifications | ||
| - Quick Actions | ||
|
|
||
| ### Networking | ||
| - Network Speed Control & Simulator Airplane Mode | ||
| - Network Traffic Monitoring | ||
| - Networking Insights | ||
|
|
||
| ### Build Insights | ||
| - Build Insights | ||
| - Team Build Insights | ||
|
|
||
| ### Accessibility | ||
| - Environment Overrides | ||
| - Toggles & Dynamic Text | ||
| - VoiceOver Navigator | ||
|
|
||
| ### Other Features | ||
| - User Defaults Editor | ||
|
|
||
| ### Settings | ||
| - Shortcuts | ||
| - Side Window | ||
|
|
||
| ### Support | ||
| - FAQ | ||
| - Reporting An Issue | ||
| - Requesting A Feature`; |
There was a problem hiding this comment.
Issue:
This will be hard to maintain. We'd have to update this table of contents every time we change something in the docs (add/remove pages, change order of pages, etc). If we want this here, I think we should automate it.
| const RELATED_LINKS: Record<string, string[]> = { | ||
| "Taking Screenshots": [ | ||
| "[Creating Recordings](/docs/features/capturing/recordings)", | ||
| "[App Store Connect Optimization](/docs/features/capturing/app-store-connect-optimization)", | ||
| "[Floating Thumbnail](/docs/features/capturing/floating-thumbnail)", | ||
| ], | ||
| "Creating Recordings": [ | ||
| "[Taking Screenshots](/docs/features/capturing/screenshots)", | ||
| "[Touch Indicators](/docs/features/capturing/touch-indicators)", | ||
| "[120 FPS Recordings](/docs/features/capturing/120-fps-recordings)", | ||
| ], | ||
| "Network Traffic Monitoring": [ | ||
| "[Setting Up RocketSim Connect](/docs/getting-started/setting-up-rocketsim-connect)", | ||
| "[Networking Insights](/docs/features/networking/networking-insights)", | ||
| "[Network Speed Control](/docs/features/networking/network-speed-control)", | ||
| ], | ||
| "Networking Insights": [ | ||
| "[Network Traffic Monitoring](/docs/features/networking/network-traffic-monitoring)", | ||
| "[Setting Up RocketSim Connect](/docs/getting-started/setting-up-rocketsim-connect)", | ||
| ], | ||
| "Network Speed Control & Simulator Airplane Mode": [ | ||
| "[Network Traffic Monitoring](/docs/features/networking/network-traffic-monitoring)", | ||
| "[Networking Insights](/docs/features/networking/networking-insights)", | ||
| ], | ||
| "Push Notifications": [ | ||
| "[Configuring App Actions](/docs/getting-started/configuring-app-actions)", | ||
| "[Deep Links & Universal Links](/docs/features/app-actions/deeplinks-universal-links)", | ||
| ], | ||
| "Deeplinks (Universal Links)": [ | ||
| "[Configuring App Actions](/docs/getting-started/configuring-app-actions)", | ||
| "[Push Notifications](/docs/features/app-actions/push-notifications)", | ||
| ], | ||
| "Build Insights": [ | ||
| "[Team Build Insights](/docs/features/build-insights/team-build-insights)", | ||
| ], | ||
| "Team Build Insights": [ | ||
| "[Build Insights](/docs/features/build-insights/build-insights)", | ||
| "[How Large Teams Use RocketSim](/docs/getting-started/how-large-teams-use-rocketsim)", | ||
| ], | ||
| "Comparing Designs": [ | ||
| "[Grids & Rulers](/docs/features/design-comparison/grids-and-rulers)", | ||
| "[Magnifier](/docs/features/design-comparison/magnifier)", | ||
| ], | ||
| "Environment Overrides": [ | ||
| "[Toggles & Dynamic Text](/docs/features/accessibility/toggles-and-dynamic-text)", | ||
| "[VoiceOver Navigator](/docs/features/accessibility/voiceover-navigator)", | ||
| ], | ||
| "VoiceOver Navigator": [ | ||
| "[Environment Overrides](/docs/features/accessibility/environment-overrides)", | ||
| "[Toggles & Dynamic Text](/docs/features/accessibility/toggles-and-dynamic-text)", | ||
| ], | ||
| "Simulator Camera Support": [ | ||
| "[Setting Up RocketSim Connect](/docs/getting-started/setting-up-rocketsim-connect)", | ||
| ], | ||
| "Setting up RocketSim Connect": [ | ||
| "[Network Traffic Monitoring](/docs/features/networking/network-traffic-monitoring)", | ||
| "[Simulator Camera Support](/docs/features/capturing/simulator-camera-support)", | ||
| ], | ||
| }; |
There was a problem hiding this comment.
Issue:
Same here. This will be hard to maintain. If we change links, add/remove pages, etc this section is outdated. We should automate this if we want this.
Resolve conflict in llms-txt-post-process.ts by keeping the extracted enhanceLlmsTxtIndex() function (superset of master's inline version, includes llms-ctx.txt reference).
Address PR review feedback from ngnijland: - Replace hard-coded TABLE_OF_CONTENTS with dynamic generation that scans content files and groups them using the sidebar configuration - Replace hard-coded RELATED_LINKS with automatic generation based on sidebar grouping (pages in the same group link to siblings) - Extract sidebar group definitions into shared config used by both astro.config.ts and the post-processing integration - Derive base URL from config.json instead of hard-coding it (Copilot review feedback)
Summary
<SYSTEM>headers to llms-full.txt and llms-small.txt with product context, supported platforms (iOS, macOS, watchOS, visionOS), and key capabilitiesllms-ctx.txtwith concise product context for LLM consumptionllms-ctx.txtfrom the mainllms.txtentry pointChanges
docs/src/integrations/llms-txt-post-process.ts— enhanced post-processing with SYSTEM header, TOC, cross-references, and llms.txt modificationdocs/public/llms-ctx.txt— new static file with product contextTest plan
npm run buildpassesllms-full.txtstarts with rich SYSTEM header (no pricing mentioned)llms-full.txthas table of contents after SYSTEM headerllms-ctx.txtis accessible at /llms-ctx.txtllms.txtreferences llms-ctx.txt