Custom skills

Beta
以 Markdown 格式查看

Fern Docs sites can serve your own Agent Skills so your users can discover and install them with the skills CLI. You can also add an “Install skills” button to your docs UI that opens a modal with the install command and your skill list.

This is separate from installing Fern’s own fern-docs skill into your agent.

1

Lay out the bundle

Place your skills in your fern/ folder under .well-known/agent-skills/ (the current v0.2.0 spec) or .well-known/skills/ (the legacy v0.1.0 layout). Both are supported and can coexist. Each skill is a subdirectory holding at least a SKILL.md, with optional supporting files alongside it.

fern
docs.yml
.well-known
agent-skills
index.json# discovery manifest (required)
plant-care
SKILL.md# skill instructions
garden-planner
SKILL.md
references
api.md# supporting files (optional)
2

Write each SKILL.md

Each SKILL.md needs YAML frontmatter with name and description, following the Agent Skills spec:

fern/.well-known/agent-skills/plant-care/SKILL.md
1---
2name: plant-care
3description: Guide for diagnosing and treating common plant diseases.
4---
5
6# Plant Care
7
8When diagnosing a plant issue, check for...
3

Add the discovery manifest

The index.json at the root of the skills directory is required. It enumerates every skill so clients can discover them in a single request, referencing each by url and digest:

fern/.well-known/agent-skills/index.json
1{
2 "$schema": "https://schemas.agentskills.io/discovery/0.2.0/schema.json",
3 "skills": [
4 {
5 "name": "plant-care",
6 "type": "skill-md",
7 "description": "Guide for diagnosing and treating common plant diseases.",
8 "url": "/.well-known/agent-skills/plant-care/SKILL.md",
9 "digest": "sha256:c4d5e6f7..."
10 }
11 ]
12}

The legacy v0.1.0 manifest lists a files array per skill instead of url and digest.

4

Publish

Fern uploads the bundle during fern generate --docs and serves the files as-is — no docs.yml configuration is required. fern check validates the bundle at upload time, flagging a missing or unparseable index.json and any SKILL.md whose frontmatter doesn’t conform to the spec.

Once published, skills are served at:

  • https://your-docs-domain.com/.well-known/agent-skills/index.json (discovery manifest)
  • https://your-docs-domain.com/.well-known/agent-skills/<skill-name>/SKILL.md (individual skill)
  • https://your-docs-domain.com/.well-known/skills/index.json (legacy v0.1.0 manifest)

For sites with a basepath like /docs, the endpoints live under that basepath (e.g., https://example.com/docs/.well-known/agent-skills/index.json).

5

Install the skills

With the bundle published, anyone can install your skills with:

$npx skills add https://your-docs-domain.com

The https:// scheme is required: a bare domain is treated as a GitHub repository shorthand.

6

Configure the Install skills button

Surface your skills in the docs UI by adding an “Install skills” button to the page action bar. Set page-actions.options.skills in docs.yml and the button opens a modal with a copyable install command, the list of available skills, and an optional link to the source repository.

docs.yml
1page-actions:
2 options:
3 skills:
4 title: Plant API Skills
5 description: Skills for working with the Plant Store API.
6 repository: https://github.com/your-org/plant-api-skills
7 install-command: npx skills add https://your-docs-domain.com
8 skills:
9 - name: plant-care
10 description: Guide for diagnosing and treating common plant diseases.
11 url: https://github.com/your-org/plant-api-skills/tree/main/plant-care
12 - name: garden-planner
13 description: Plan garden layouts and planting schedules.

Install skills properties

Configure the Install skills button under page-actions.options.skills in docs.yml.

page-actions.options.skills
object

Enables the “Install skills” page action and configures the modal it opens. Omit to hide it.

page-actions.options.skills.title
string

Overrides the modal title.

page-actions.options.skills.description
string

Overrides the modal description.

page-actions.options.skills.learn-more-url
string

URL for a “Learn more” link shown alongside the description.

page-actions.options.skills.repository
string

Source repository URL displayed as a “View source” button in the modal.

page-actions.options.skills.install-command
string or list of strings

Command(s) shown as a copyable block in the modal. A single string is shown as-is; an array is joined with newlines for multi-step installs. Defaults to npx skills add https://<your-docs-domain> when omitted.

page-actions.options.skills.skills
list of objects

List of skills displayed in the modal. Each entry has a name (required), description (optional), and url (optional link to the skill source). When the site serves a /.well-known/agent-skills/index.json or /.well-known/skills/index.json manifest, the manifest replaces this list.