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
- Distinctive: line 9
Follow AGENTS.md ("Writing Docs") and the using-docs-kit skill.
- Very specific: line 36
Do not use dumi fields (nav, group, atomId).
- Very specific: line 40
Put demos in <folder>/demos/ (index.tsx for the basic one), one export default component per file.
- Very specific: line 42
Import the library by package name (@lobehub/editor, @lobehub/editor/react).
- Very specific: line 56
Do not use dumi <code src="...">.
- Very specific: line 81
Do not hand-edit compatibility.json (legacy URL inventory) unless you move or rename an existing page.
≈ “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.
Files
---
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.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/coding-standards.mdcCursor rule
- .cursor/rules/debug-logging.mdcCursor rule
- .cursor/rules/environment-setup.mdcCursor rule
- .cursor/rules/hotkey-standards.mdcCursor rule
- .cursor/rules/plugin-development.mdcCursor rule
- .cursor/rules/project-structure.mdcCursor rule
- .cursor/rules/react-development.mdcCursor rule
- building-landing-homeSkill
- using-docs-kitSkill
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.

