Skip to content

docs: add per-page directives section for agents config#4654

Open
kgowru wants to merge 4 commits intomainfrom
devin/1774971166-llms-config-docs
Open

docs: add per-page directives section for agents config#4654
kgowru wants to merge 4 commits intomainfrom
devin/1774971166-llms-config-docs

Conversation

@kgowru
Copy link
Copy Markdown
Contributor

@kgowru kgowru commented Mar 31, 2026

Summary

Adds a new "Per-page directives" section to the llms.txt documentation page, documenting the agents config key in docs.yml:

agents:
  page-directive: "For a complete page index, fetch https://docs.example.com/llms.txt"

This is an optional string that is automatically prepended to every page's Markdown when served via LLM endpoints (individual .md/.mdx URLs and each page section within llms-full.txt). This replaces the current pattern of manually adding <Markdown src="/snippets/agent-directive.mdx"/> to every MDX page.

Companion implementation PRs:

Updates since last revision

  • Renamed config key from llms to agents
  • Consolidated page-directive-prepend and page-directive-append into a single page-directive field (prepend-only)

Review & Testing Checklist for Human

  • Merge timing: This documents a feature that depends on the two companion PRs being merged and deployed first. Do not merge this until the feature is live, or users will see config options that don't work yet.
  • Preview the rendered page (preview link) to verify the <ParamField> component and YAML code block render correctly with the updated agents / page-directive naming.
  • Config shape alignment: Verify the documented agents.page-directive config matches the actual implementation in the companion PRs (fern-platform #9203 and fern #14338).

Notes

  • Section is placed between "Control visibility" and "Analytics and monitoring", following the logical flow: what LLMs see → how to customize it → how to monitor it.
  • The closing paragraph references the <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


Open with Devin

Co-Authored-By: Kapil Gowru <k.gowru@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Co-Authored-By: Kapil Gowru <k.gowru@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title docs: add per-page directives section for llms config docs: add per-page directives section for agents config Apr 2, 2026

## 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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[FernStyles.Current] Avoid time-relative terms like 'now' that become outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants