docs: add per-page directives section for agents config#4654
docs: add per-page directives section for agents config#4654
Conversation
Co-Authored-By: Kapil Gowru <k.gowru@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
🌿 Preview your docs: https://fern-preview-devin-1774971166-llms-config-docs.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
Co-Authored-By: Kapil Gowru <k.gowru@gmail.com>
|
|
||
| ## Per-page directives in llms.txt | ||
|
|
||
| You can now add a directive that is automatically prepended to every page when it's served to AI agents — both individual Markdown page URLs and each page section within `llms-full.txt`. The directive is only visible to agents requesting Markdown; human-facing documentation is unaffected. |
There was a problem hiding this comment.
[FernStyles.Current] Avoid time-relative terms like 'now' that become outdated
|
|
||
| ## Per-page directives in llms.txt | ||
|
|
||
| You can now add a directive that is automatically prepended to every page when it's served to AI agents — both individual Markdown page URLs and each page section within `llms-full.txt`. The directive is only visible to agents requesting Markdown; human-facing documentation is unaffected. |
There was a problem hiding this comment.
🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'that's' instead of 'that is'.
|
|
||
| Fern also bundles your entire site's Markdown into [`llms.txt` and `llms-full.txt`](/learn/docs/ai-features/llms-txt) files for AI consumption. These files use the same underlying Markdown you see when viewing a single page and respect the same `<llms-only>` and `<llms-ignore>` content controls. | ||
|
|
||
| You can configure a [per-page directive](/learn/docs/ai-features/llms-txt#per-page-directives) that is automatically prepended to every page's Markdown output when served to AI agents. This is useful for pointing agents to your `llms.txt` index so they can discover the rest of your docs. The directive is only visible to agents — human-facing documentation is unaffected. |
There was a problem hiding this comment.
🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'that's' instead of 'that is'.
|
|
||
| ## Per-page directives in llms.txt | ||
|
|
||
| You can now add a directive that's automatically prepended to every page when it's served to AI agents — both individual Markdown page URLs and each page section within `llms-full.txt`. The directive is only visible to agents requesting Markdown; human-facing documentation is unaffected. |
There was a problem hiding this comment.
[FernStyles.Current] Avoid time-relative terms like 'now' that become outdated
Summary
Adds a new "Per-page directives" section to the
llms.txtdocumentation page, documenting theagentsconfig key indocs.yml:This is an optional string that is automatically prepended to every page's Markdown when served via LLM endpoints (individual
.md/.mdxURLs and each page section withinllms-full.txt). This replaces the current pattern of manually adding<Markdown src="/snippets/agent-directive.mdx"/>to every MDX page.Companion implementation PRs:
agentsconfig to docs.yml fern#14338Updates since last revision
llmstoagentspage-directive-prependandpage-directive-appendinto a singlepage-directivefield (prepend-only)Review & Testing Checklist for Human
<ParamField>component and YAML code block render correctly with the updatedagents/page-directivenaming.agents.page-directiveconfig matches the actual implementation in the companion PRs (fern-platform #9203 and fern #14338).Notes
<Markdown src="/snippets/agent-directive.mdx"/>pattern that Payabli and others currently use manually on every page, which this feature replaces.Link to Devin session: https://app.devin.ai/sessions/82483503e57146aaae7cce1d21759d42
Requested by: @kgowru