Skip to content

Commit 0e12b76

Browse files
authored
docs: streamline AGENTS.md file (#4931)
1 parent e3612b8 commit 0e12b76

3 files changed

Lines changed: 96 additions & 130 deletions

File tree

.claude/skills/changelog/SKILL.md

Lines changed: 0 additions & 112 deletions
This file was deleted.

.claude/skills/links/SKILL.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

AGENTS.md

Lines changed: 96 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,104 @@ The correct link is:
7575
- **Same-page anchors**: `#section-name` — these don't need a full path.
7676
- **Anchors on internal links**: `/learn/docs/config/navigation#section-availability` — append `#anchor` to the URL path.
7777

78-
## New pages
78+
## Changelog entries
7979

80-
Every new `.mdx` page created under `fern/pages/` or `fern/products/` must include the agent directive snippet. Add the following line:
80+
Changelog entries live in `fern/products/docs/pages/changelog/` and `fern/products/dashboard/pages/changelog/`. Filename format: `YYYY-MM-DD.mdx`.
8181

82-
- After the closing `---` of the front matter (if the page has front matter), or
83-
- At the very top of the file (if there is no front matter).
82+
### Rules
8483

84+
- Always include `tags` in YAML frontmatter. Pick 1–4 from the existing set (e.g., `api-reference`, `components`, `navigation`, `customization`, `search`, `ai`, `security`, `bug-fix`). Tags are categorical — describe the area, not the feature name.
85+
- Use `##` (h2) for each feature heading. No h1.
86+
- Lead with what the user can now do: "You can now..." or a direct capability statement.
87+
- Keep it short: 2–6 sentences per feature. Bullet points for lists of details.
88+
- End each feature section with a Button linking to the relevant docs page:
8589
```mdx
86-
<Markdown src="/snippets/agent-directive.mdx"/>
90+
<Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/section/page">Read the docs</Button>
8791
```
92+
- For dashboard entries, include a path to the feature in the UI before the Button.
93+
- Follow the link rules above — Button `href` values use `/learn/...` URL paths from the YAML config.
94+
95+
### Example
96+
97+
```mdx
98+
---
99+
tags: ["security"]
100+
---
101+
102+
## Password-protected pages
103+
104+
You can now restrict access to individual documentation pages with a password. Visitors see a prompt before the page content loads.
105+
106+
To configure this, go to **Settings** > **Page access** in the [Dashboard](https://dashboard.buildwithfern.com/).
107+
108+
<Button intent="none" outlined rightIcon="arrow-right" href="/learn/dashboard/settings/page-access">Read the docs</Button>
109+
```
110+
111+
### What not to do
112+
113+
- Don't use h1 (`#`) — the date serves as the title.
114+
- Don't describe implementation details — focus on user benefit.
115+
- Don't skip the Button CTA.
116+
- Don't invent new tags when an existing one fits.
117+
118+
Prefer existing tags when possible. Common tags include: `api-reference`, `components`, `navigation`, `customization`, `configuration`, `search`, `ai`, `security`, `bug-fix`, `performance`, `writing-content`.
119+
120+
## New component pages
121+
122+
When documenting a new component, follow the structure used by existing component pages
123+
in `fern/products/docs/pages/writing-content/components/`.
124+
125+
### Page structure
126+
127+
1. **Frontmatter**: `title` (component name) and `description` (one sentence starting with a verb).
128+
2. **Intro paragraph**: One or two sentences explaining what the component does and when to use it. Reference the component name in backtick-wrapped JSX format (e.g., `<Button>`).
129+
3. **Usage section** (`## Usage`): A live rendered example in a `<div>`, followed by the equivalent MDX in a code block with `jsx Markdown` syntax.
130+
4. **Variants section** (`## Variants`): One `###` subsection per variant, each with a rendered example and code block. Cover the most common use cases.
131+
5. **Properties section** (`## Properties`): One `<ParamField>` per prop. Include `path`, `type`, `required`, and `default` where applicable.
132+
133+
### Adding to the overview page
134+
135+
Add a `<Card>` to the `<CardGroup>` in the components overview page at
136+
`fern/products/docs/pages/writing-content/components/overview.mdx`.
137+
Insert it in alphabetical order:
138+
139+
```mdx
140+
<Card title="Component name" icon="fa-duotone fa-icon-name" href="/learn/docs/writing-content/components/slug">
141+
One-line description matching the page's frontmatter description
142+
</Card>
143+
```
144+
145+
### Example to follow
146+
147+
Use `accordion.mdx` or `button.mdx` as a reference — they demonstrate the full pattern including
148+
grouped variants, nested component examples, and complete `<ParamField>` documentation.
149+
150+
## LLM visibility tags
151+
152+
Use `<llms-only>` and `<llms-ignore>` to control what AI agents see vs. what human readers see on the docs site.
153+
154+
### `<llms-only>` — content for AI agents only
155+
156+
Use when content helps an agent execute a task but would clutter the page for human readers:
157+
158+
- Step-by-step instructions that are redundant with a UI walkthrough but useful for an agent following along programmatically
159+
- Prerequisite context like "this endpoint requires authentication via Bearer token" that a human would already know from the page layout
160+
- Explicit cross-references between related pages (e.g., "For rate limit details, see /learn/docs/api-reference/rate-limits")
161+
162+
### `<llms-ignore>` — content for human readers only
163+
164+
Use when content is useful to a human browsing the site but adds noise for an agent:
165+
166+
- Marketing CTAs, signup prompts, promotional callouts
167+
- Decorative content, hero images, or UI-only navigation hints
168+
- Internal comments or TODOs in source files
169+
170+
### Rules
171+
172+
- Don't overuse — most content should be visible to both audiences. Only tag content where the human and agent needs clearly diverge.
173+
- Keep `<llms-only>` blocks concise and actionable. If it's longer than a few sentences, it's probably regular content that should be visible to everyone.
174+
- Tutorials are a common use case: the human version might walk through a UI with screenshots, while an `<llms-only>` block can add the equivalent curl command or config snippet that an agent can execute directly.
175+
176+
### Example to follow
177+
178+
See `fern/products/docs/pages/getting-started/quickstart.mdx` for a working example of using `<llms-only>` blocks to make a tutorial executable for agents alongside the human-readable version.

0 commit comments

Comments
 (0)