Skip to navigation

Fern Agent

View as Markdown

Fern Agent edits your documentation and analyzes your organization’s Fern data, including traffic, reader questions, deployments, and site configuration. It’s an expert in Fern configuration, from docs.yml and components to versioning, redirects, and access control.

The Fern Agent chat panel in the Fern Dashboard

Talk to it in the Fern Dashboard chat panel, or integrate it with your Slack or your coding agent (via MCP) in one click. Fern Agent can open a PR or iterate live in the visual editor.

Editing requires a GitHub repository, since Fern Agent delivers changes as pull requests and GitLab and other Git providers aren’t supported. Every other tool, including analysis and insights, works regardless of your Git provider.

What it can do

Fern Agent reads your docs site’s source repository and makes the changes you describe.

Requests can be about structure and settings as much as page copy, because Fern Agent knows how Fern sites are put together: navigation and product switchers, versions, redirects, the component library, and authentication and RBAC. It writes the configuration the way Fern expects it, so a moved page gets its redirect and a new page gets its navigation entry.

Add a new page
Add a page about authentication to my getting-started guide.

Rewrite existing content
Identify which pages in my documentation could be more concise.

Fern Agent queries pageviews, visitors, sessions, 404s, referring domains, search queries, reader feedback, and LLM bot traffic for any docs site in your organization. Ask for a fix alongside the question and it carries the specifics it found into the change it makes.

Check traffic
List the pages with the most traffic last month.

Repair broken URLs
List the top 404 paths on my site over the last 30 days and add redirects for them.

Reorganize navigation
Give me suggestions about how to optimize my navigation based on site analytics.

Follow up on empty searches
Find the search queries that returned no results, then add the missing content to the API reference guide.

Rewrite an underperforming page
Find the page with the worst reader feedback and rewrite it to address what readers complained about.

Fern Agent summarizes what readers ask Ask Fern, including resolution rates and individual conversations, so you can find topics that need better coverage — then write that coverage without leaving the conversation.

Summarize reader questions
Summarize what readers asked Ask Fern this week and suggest ways I can expand our documentation based off of those topics.

Find unresolved conversations
List the unresolved Ask Fern conversations.

Close a documentation gap
Find the most common unresolved Ask Fern question this week and draft a page that answers it.

Fern Agent reports a site’s deployment history, connected git repository, Fern CLI version, custom domain, and reader-facing settings such as search behavior and password protection. Since it reads the same docs.yml it edits, it can trace a failed build back to the configuration that caused it and fix it.

Check deployments
List the recent deployments for docs.plantstore.com.

Review site settings
List the features enabled on docs.plantstore.com.

Account administration stays read-only: it can’t create API keys, change members, or update billing. When you ask Fern Agent to perform an administration action, it links you to the page that does it.

Check organization members
List the admins in my organization.

Update billing
Where can I update billing information for my organization?

Setup

Open the Fern Dashboard and start a conversation in the chat panel. From the chat panel, you can also:

  • Connect Fern Agent to Slack. Click Connect Slack, select the workspace, and add Fern to the Slack channels where your team discusses documentation. Authorizing the app requires Slack admin access.
  • Connect your agents. Click Onboard your agent to connect your coding agent to Fern’s MCP server.

Alternatively, install manually. Connect Slack with your Fern API key and the organization field from fern/fern.config.json:

curl -X POST https://fai.buildwithfern.com/slack/agent/install \
-H "Authorization: Bearer <FERN_TOKEN>" -H "Content-Type: application/json" \
-d '{"org_id":"<org>"}'

Onboard your agent by handing it this prompt:

Set up Fern Agent in your terminal
Fetch and execute the appropriate instructions to set me up for Fern from [https://buildwithfern.com/learn/docs/ai-features/agent-setup.md](https://buildwithfern.com/learn/docs/ai-features/agent-setup.md)

Making requests in Slack

Tag @Fern in a channel where it has been added and describe the change you need or analysis you want to conduct. It only responds when directly tagged. Fern replies to your prompt and opens PRs on your documentation as needed. At any time, you can click a link to continue your session in the Fern Dashboard.

Image and file attachments provide additional context. When tagged in an existing thread, Fern Agent reads the full conversation before responding. Request changes by replying in the thread, and merge the pull request like any other once it meets your requirements.

Fern Agent vs. Fern Writer

Fern Agent is an expansion of Fern Writer. Fern Writer opened documentation pull requests from Slack, and it still does — existing installations keep working and the request flow is unchanged.

What Fern Agent adds is context on your organization and more places to work from. Alongside editing, it answers questions about your traffic, reader questions, deployments, and site configuration, and the same capabilities are now available in the Fern Dashboard and in your coding agent over MCP rather than in Slack alone.

Automations

Create an automation on the Automations page of the Fern Dashboard. You can also describe the recurring work you want done in the chat panel or @Fern in Slack, and Fern Agent sets up the automation for you.

Each run starts a fresh conversation from the prompt, works it in a single turn, and reports back on what it did, found, or skipped. An automation only changes the docs when the prompt explicitly requests it.

Setup

1

Write the prompt

Open Automations, select New automation (pick a Blank automation or one of Fern’s templates), and describe what each run should produce. Prompts hold up to 2,000 characters.

2

Set the schedule

Choose daily or a day of the week, a time of day, and timezone. A schedule fires at most once every 20 hours.

3

Check what a run produces

Save your new automation.

After creating your automation, select Run now to test the prompt. Manually running an automation doesn’t affect the next scheduled run. Runs take a few minutes, and finished runs are reported via email or Slack when you connect Fern Agent to Slack.

Everyone in your organization sees every automation, and only its creator can change, delete, or run one. Turning an automation off keeps its prompt and history, while deleting it discards both — pull requests its runs opened are unaffected. Run history covers the last 30 days.

Examples

Fix what readers complained about
Review the feedback readers left on our docs pages and fix the pages they said were missing information, wrong, or unclear. Make the changes and open a pull request. Ignore feedback about the product rather than the docs.

Report on how the docs are doing
Report on how our docs are doing: the pages readers spend the most time on, where they drop off, the searches that return nothing, and what changed since last week.

Clerk

Clerk watches the pull requests in your product repositories and keeps your docs in step with them. Where a scheduled automation runs a prompt at a set time, Clerk runs on code changes: it reviews each pull request, decides whether the docs need updating, and opens a docs pull request when they do.

Set up Clerk

On the Automations page, select Set up Clerk. Setup has four steps.

1

Connect your code

Select Install on GitHub to install the Fern GitHub App on the repositories Clerk should review, then pick them from the list. You can also enter a repository by name, as owner/name or its GitHub URL. An automation watches up to 20 repositories, all under the same GitHub owner as the repository your docs site publishes from.

2

Choose how Clerk works

Answer three questions:

  • When should Clerk review a pull request? See Review trigger.
  • What should Clerk do when the docs need to change? See Observe only.
  • How should docs changes be grouped? See Grouping.

Ignored paths, folded under the questions, is optional. See Ignored paths.

3

Pick the docs to keep current

Choose the docs site Clerk keeps current. Clerk opens its docs pull requests in the repository the site publishes from, so the Fern GitHub App must be installed on that repository too. If your organization has no docs site yet, select Generate docs from your code to have Fern write a first version, or Create a docs site to set one up in a new tab.

4

Turn on Clerk

Name the automation, then select Authorize to let Clerk act as you. Reviews run with nobody watching, so Clerk uses your access and sees and changes only what you can. One authorization covers all your automations. Select Turn on Clerk, or turn off the toggle and select Create paused to set it up without reviewing anything yet.

Review trigger

TriggerWhat Clerk does
On each merge (default)Reviews a pull request once it merges into the repository’s default branch.
While openReviews a pull request when it opens, and again as new commits arrive. Clerk keeps one draft docs pull request for it, titled Docs for <repo>#<number>: <title>, and one comment on the source pull request that it updates in place. When the source pull request merges, Clerk marks the draft ready to merge.

With While open, each pull request gets its own draft, so grouping doesn’t apply.

Grouping

When Clerk reviews on each merge, grouping controls when it writes the docs changes those reviews call for. Reviews themselves always happen as each merge arrives.

GroupingWhen Clerk writes docs changes
With each merge (default)Right after each review. A merge that needs a docs change gets its own docs pull request, and Clerk comments on the merged pull request.
Daily digestEvery day at 09:00 Coordinated Universal Time (UTC).
Weekly digestEvery Monday at 09:00 UTC.

A digest suits repositories that merge often. Clerk holds the merges that need a docs change, and the digest opens one docs pull request covering them all, adding to the automation’s previous docs pull request if it’s still open. Clerk comments only on the merged pull requests the digest updated docs for. A digest with no merges waiting does nothing.

While merges are waiting, the automation’s Overview tab shows how many and when the digest runs. Select Open it now to write the digest early. Switching back to With each merge writes the waiting merges without waiting for the next digest.

Observe only

What should Clerk do when the docs need to change? controls whether Clerk acts on its reviews:

  • Open pull requests (default): Clerk opens or adds to a docs pull request and comments on the source pull request.
  • Observe only: Clerk records what it would change and posts nothing to GitHub. Each review shows up on the automation’s page as the merge arrives. If you later switch to Open pull requests, reviews from observe mode stay marked Observed. Observing first is a safe way to see how Clerk judges your merges before it opens pull requests.

Ignored paths

Ignored paths lists source paths that never need docs changes, one glob per line:

infra/**
admin/**
*.sql

Clerk marks a merge that touches only ignored paths as needing no docs change, without reviewing it. A merge that also touches other files is reviewed on those files alone. Your globs add to Fern’s built-in skips for tests, lockfiles, CI configuration, generated files, and credential files such as .env and keys. Clearing the field leaves only the built-in skips. A list holds up to 50 globs of up to 200 characters each, and globs that match every file, such as *, **, or **/*, are rejected.

Docs site profile

Clerk reviews each merge against a short profile of your docs site: what it documents, who reads it, its main areas, and what it doesn’t cover. Fern writes the profile from your published site, so Clerk doesn’t propose docs changes for products or surfaces your site leaves out. Every automation that points at the same docs site shares one profile.

The profile appears under What Clerk knows about your docs on the automation’s Settings tab. A profile marked Generated from the site shows how many pages Fern read and when, and Fern regenerates it automatically once it’s more than 7 days old. To describe the site in your own words, edit the text (up to 4,000 characters) and select Save profile. The profile is then marked Edited by your team and isn’t regenerated automatically. Regenerate from the site reads the published site again and replaces the profile, including an edited one. If no profile exists yet, the card shows Not written yet and a Generate from the site button.

Generate docs from your code

If you don’t have a docs site, Clerk can have Fern write a first version from a repository. Select Generate docs from your code during setup or on the automation’s Settings tab, then choose:

  • Connect your code: the one repository Fern documents.
  • Where the docs go: the same repository, in its fern/ folder, or a separate repository. When the docs live in the same repository, Clerk ignores changes under fern/, so it doesn’t review its own docs pull requests.
  • Brand (optional): your website, which Fern pulls colors and a logo from so the first version matches your brand.
  • Tone & style (optional): guidance on voice, audience, terminology, and dos and don’ts, up to 4,000 characters. Fern follows it when it writes the site and saves it as fern/AGENTS.md in the docs repository, so Clerk applies it to later updates too. Edit that file to change it.

Before it starts, Fern checks that your GitHub account can read the repository and write to the docs repository, and asks you to Connect GitHub if it isn’t connected. Fern then reads the repository, plans the site, writes the pages, checks that the docs build, and opens a pull request. The pull request adds up to three workflow files (check, preview, and publish), skipping any the repository already has, and a FERN_TOKEN secret if it doesn’t have one. Merging the pull request publishes the docs, and Clerk starts reviewing merges once they’re published.

A repository can have one run in progress at a time. Each repository can start 3 runs a day and each organization 10. If a run fails with a retryable error, select Retry on the run.

Automation page

Each Clerk automation has its own page. The header shows the automation’s status, such as Live, Waiting for a merge, No repositories, Generating docs, Needs authorization, or Paused, along with an on/off toggle. The page has three tabs:

  • Overview: counts of merges reviewed, merges that needed a docs change, docs pull requests, and failed reviews over a time range you choose, plus the most recent reviews and any merges waiting for a digest.
  • Reviews: every pull request Clerk has reviewed, filterable to Docs updates, No change, or Failed, with what Clerk decided and the resulting docs pull request. Mark each decision right or wrong with the thumbs up and thumbs down buttons. Review recent merges has Clerk review your last 10 merged pull requests without posting anything to GitHub, which shows how it judges your changes without waiting for the next merge.
  • Settings: the repositories, the review trigger, mode, grouping and ignored paths, the docs site, the docs site profile, and Delete automation. Deleting removes Clerk’s review history but leaves the docs pull requests it opened.

Permissions and data

Everyone in the organization sees every Clerk automation. Clerk acts as the person who set it up, and only they can change, pause, or delete it, or edit its docs site profile. If their GitHub authorization stops working, the status changes to Reconnect needed and Clerk pauses until they grant it again.

Clerk redacts secrets from pull request content before reviewing it, skips credential files, and can’t send anything to outside hosts during a review. It scans its docs edits for secrets before committing them.

Privacy and data handling

Fern Agent acts with your own Fern permissions on every surface, so it reads and edits only the sites, analytics, and organization data your account can already see. Requests are scoped to a single session: the prompt, any Slack message or thread you tag it in, and attached files are stored to complete the task and aren’t retained afterward.

Editing is powered by Devin from Cognition. Neither Fern nor Devin uses your data to train AI models: Fern configures its Devin integration to opt out of any data collection for model training, so your messages, code, and documentation content are never used for training.