agentleFS
lobehublobehub/lobe-editor/.cursor/rules/documentation-standards.mdc

lobe-editor / rules

Cursor rule180 starsChanged 12 days agoMITView on GitHub

Documentation standards and formatting guidelines for LobeHub Editor

We split this documentation-standards.mdc into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow AGENTS.md ("Writing Docs") and the using-docs-kit skill.

    line 9
  2. Very specific:

    Do not use dumi fields (nav, group, atomId).

    line 36
  3. Very specific:

    Put demos in <folder>/demos/ (index.tsx for the basic one), one export default component per file.

    line 40
  4. Very specific:

    Import the library by package name (@lobehub/editor, @lobehub/editor/react).

    line 42
  5. Very specific:

    Do not use dumi <code src="...">.

    line 56
  6. Very specific:

    Do not hand-edit compatibility.json (legacy URL inventory) unless you move or rename an existing page.

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “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
documentation-standards.mdc
---
description: Documentation standards and formatting guidelines for LobeHub Editor
globs: *.md,*.mdx
---

# Documentation Standards

The docs site (<https://editor.lobehub.com>) is built with `@lobehub/docs-kit` (`lobedocs`).
Follow [AGENTS.md](mdc:AGENTS.md) ("Writing Docs") and the
[using-docs-kit skill](mdc:.agents/skills/using-docs-kit/SKILL.md); this rule summarises them.

## Where Pages Live

- One `index.mdx` per documented folder. Only files named `index.mdx` become pages
  (`index.md` is ignored).
- [docs.config.ts](mdc:docs.config.ts) `atomDirs` are `src/react`, `src/plugins` and
  `src/renderer`, so:
  - `src/plugins/hr/index.mdx` → `/components/plugins/hr`
  - `src/react/SendButton/index.mdx` → `/components/react/send-button`
- Site-level pages live in `docs/` (`docs/components.mdx`, `docs/changelog.mdx`); the home page
  is `docs/index.tsx`.

## Frontmatter

```yaml
---
title: Horizontal Rule
description: One or two plain sentences; used for search, SEO and llms.txt.
category: Plugins
---
```

- Required: `title`, `description`, `category`.
- Reuse existing categories: `Core`, `Plugins` (plugins); `General`, `Data Entry`, `Layout`,
  `Playground`, `Providers` (React components); `Renderer`.
- Do not use dumi fields (`nav`, `group`, `atomId`).

## Demos

- Put demos in `<folder>/demos/` (`index.tsx` for the basic one), one `export default`
  component per file.
- Import the library by package name (`@lobehub/editor`, `@lobehub/editor/react`); the docs
  config aliases it to `src`.
- Reference demos with the `?demo` query and `<Demo of>`:

```mdx
import DemoIndex from './demos/index.tsx?demo';

## Basic Usage

<Demo editable={false} of={DemoIndex} />
```

- Common `<Demo>` props: `editable={false}` for editor playgrounds, `layout="bare"` for
  full-width demos, `isolated` for demos that use portals or global CSS.
- Do not use dumi `<code src="...">`.

## Page Structure

- The `title` is the H1; start the body at `##`.
- Typical sections: `## Introduction`, `## Basic Usage`, feature sections, then `## APIs`.
- API tables are written by hand and must match the TypeScript types:

```markdown
| Property     | Description           | Type      | Default |
| ------------ | --------------------- | --------- | ------- |
| enableHotkey | Enable list shortcuts | `boolean` | `true`  |
```

- Escape `|` inside table cells as `\|` (e.g. `` `'top' \| 'bottom'` ``).
- Code fences need a language (`tsx`, `typescript`, `bash`, ...).

## Checking

```bash
pnpm dev          # lobedocs dev; restart after editing docs.config.ts
pnpm docs:build   # runs all docs validations (frontmatter, demo references, links)
pnpm lint:md      # remark lint on Markdown files
```

- Do not hand-edit `compatibility.json` (legacy URL inventory) unless you move or rename an
  existing page.
- `skills.md` and `llms.txt` on the docs site are generated by `lobedocs build`; do not write
  them by hand.

## README

`README.md` covers installation, a quick start and links; detailed API docs belong on the docs
site. Update the README only when installation or the quick-start example changes.

Download now (ZIP)

Does it work?

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

Reviews can't be read right now.

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.