agentleFS
web-infra-devweb-infra-dev/rslib/.agents/skills/rspress-description-generator/SKILL.md

rspress-description-generator

Skill1k starsChanged 19 days agoMITView on GitHub

Generate missing description frontmatter for Rspress Markdown/MDX pages, including new docs pages and site-wide SEO metadata updates.

We split this skill into the rules it gives an agent

11 rules. 3 are common, 0 are distinctive, and 8 are very specific to this project.

  • 3

    Common

    Most of the 3 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the config and extract the root option.

    line 13
  2. Very specific:

    If root is set, resolve it relative to the config file's directory.

    line 15
  3. Very specific:

    If root is not set, default to docs relative to the config file's directory.

    line 16
  4. Very specific:

    Check if the docs root contains language subdirectories (two-letter codes like en, zh, ja, ko, etc.).

    line 33
  5. Common:

    If there are no language subdirectories, treat the entire docs root as a single-language site.

    line 35
  6. Very specific:

    Check for existing description in frontmatter: If it exists and is non-empty, skip.

    line 48
  7. Very specific:

    If the file has frontmatter with a title field, insert description on the line after title.

    line 52
  8. Very specific:

    If the file has frontmatter without title, insert description as the first field.

    line 53
  9. Common:

    If the file has no frontmatter block, add one:

    line 54
  10. Common:

    If the description contains colons, quotes, or other special YAML characters, wrap in double quotes:

    line 70
  11. Very specific:

    After processing all files, do a quick scan to ensure no files were missed — re-glob and check for any remaining files without description.

    line 80

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rspress description generator

The description field in Rspress frontmatter generates <meta name="description" content="..."> tags, which are used for search engine snippets, social media previews, and AI-oriented formats like llms.txt.

Step 1 — locate the docs root

  1. Find the Rspress config file. Search for rspress.config.ts, .js, .mjs, or .cjs. It may be at the project root or inside a subdirectory like website/.
  2. Read the config and extract the root option.
    • The value might be a plain string (root: 'docs') or a JS expression (root: path.join(__dirname, 'docs')). In either case, determine the resolved directory path.
    • If root is set, resolve it relative to the config file's directory.
    • If root is not set, default to docs relative to the config file's directory.
  3. Confirm the directory exists. If neither docs nor the configured root exists, check for doc as a fallback.

Step 2 — detect i18n structure

Rspress i18n projects place language subdirectories (e.g., en/, zh/) directly under the docs root:

docs/
├── en/
│   ├── guide/
│   └── index.md
└── zh/
    ├── guide/
    └── index.md

Check if the docs root contains language subdirectories (two-letter codes like en, zh, ja, ko, etc.). If so, process each language directory separately — the description language should match the content language.

If there are no language subdirectories, treat the entire docs root as a single-language site.

Step 3 — scan and process files

Glob for **/*.md and **/*.mdx under the docs root. Exclude:

  • node_modules, build output (doc_build, .rspress, dist)
  • _meta.json / _nav.json (sidebar/nav config files, not doc pages)
  • **/shared/** directories (reusable snippets included via @import, not standalone pages)

For each file:

  1. Read the file.
  2. Check for existing description in frontmatter. If it exists and is non-empty, skip.
  3. Check pageType in frontmatter. For home pages, derive the description from the hero.text / hero.tagline fields or the features list, not from body content.
  4. Generate a description following the writing guidelines below.
  5. Insert description into frontmatter:
    • If the file has frontmatter with a title field, insert description on the line after title.
    • If the file has frontmatter without title, insert description as the first field.
    • If the file has no frontmatter block, add one:

      ---
      description: Your generated description here
      ---

YAML formatting

Most descriptions can be bare YAML strings:

description: Step-by-step guide to setting up your first Rspress site

If the description contains colons, quotes, or other special YAML characters, wrap in double quotes:

description: 'API reference for Rspress configuration: plugins, themes, and build options'

Step 4 — batch processing

For sites with many files, use parallel agent calls to process independent files simultaneously. Group by directory (e.g., all files in guide/, then all in api/) to maintain focus and consistency within each section.

After processing all files, do a quick scan to ensure no files were missed — re-glob and check for any remaining files without description.

Description writing guidelines

The description serves three audiences: search engines (Google snippet), AI systems (llms.txt, summarization), and humans (scanning search results). A good description helps all three.

Rules

  • Length: 50–160 characters. Under 50 is too vague for search engines; over 160 gets truncated in snippets.
  • Language: Match the document content. Chinese docs get Chinese descriptions, English docs get English descriptions.
  • Be direct: State what the page covers. Avoid starting with "This document", "This page", "Learn about" — jump straight to the substance.
  • Be specific: Mention concrete technologies, APIs, or concepts the page covers. "Configure Rspress plugins for search, analytics, and internationalization" beats "How to use plugins."
  • No markdown: Plain text only, no formatting syntax.

Examples

Good:

ContentDescription
Plugin development guideCreate custom Rspress plugins using the Node.js plugin API and runtime hooks
MDX component usageImport and use React components in MDX documentation files
Rspress 快速开始从安装到本地预览,搭建 Rspress 文档站点的完整流程
主题配置自定义 Rspress 主题的导航栏、侧边栏、页脚和暗色模式
Home page (pageType: home)Rspress documentation framework — fast, MDX-powered static site generator

Bad:

DescriptionWhy
"About plugins"Too vague — which plugins? what about them?
"This page explains how to configure the Rspress theme"Wastes characters on "This page explains how to"
"Learn everything about Rspress!"Marketing fluff, says nothing specific

Documentation

Download now (ZIP)

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 2 mentionsMay 2026: 1 mentionJun 2026: 0 mentionsJul 2026: 8 mentionsAug 2026: 9 mentionsSep 2026: 8 mentionsOct 2026: 2 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the web-infra-dev/rslib repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about web-infra-dev/rslib

The biggest 5 of 41 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 41

Talked about on GitHub and Bluesky (41 times).

On GitHub · 39

34 more on GitHub

On Bluesky · 2

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.