Cursor
使用 Cursor IDE 编写 Jamdesk 文档,包含 MDX 格式规则、组件自动补全以及 MCP 服务器访问,以获取实时文档上下文。
Cursor 是基于 VS Code 构建的 AI 代码编辑器。其内联编辑(Cmd+K)和聊天(Cmd+L)功能非常适合迭代式编写 MDX:选中一段文字,描述您的需求,Cursor 即可就地改写。
快速设置
1
打开文档项目在 Cursor 中打开您的 Jamdesk 文档目录。
2
添加 Cursor 规则创建 .cursor/rules/jamdesk-docs.mdc,写入您的文档规范。Cursor 的 AI 会遵循其中的约定。
3
连接 MCP 服务器将您的文档 MCP 端点添加到 .cursor/mcp.json。之后 Cursor 即可搜索您已发布的文档。
Cursor 规则模板
在项目根目录中创建 .cursor/rules/jamdesk-docs.mdc:
.cursor/rules/jamdesk-docs.mdc
---
description: Rules for writing Jamdesk documentation in MDX
globs: "**/*.mdx"
---
# Jamdesk MDX Rules
## Page Structure
Every page follows this pattern — no exceptions:
1. Frontmatter with `title` and `description`
2. Opening paragraph (no heading before it)
3. Content sections with ## headings
4. "What's Next?" section at the end with Card links inside Columns
## Components
Only use these — do not invent others:
Layout: Card, Columns, Tabs, Tab, Accordion, AccordionGroup, Steps, Step, Expandable, Frame, CodeGroup
Callouts: Note, Info, Warning, Tip, Check, Danger
| Use | For |
|-----|-----|
| Tabs | Mutually exclusive choices (npm/yarn, OS variants) |
| Steps | Ordered procedures the reader follows |
| Accordion | Optional detail that would clutter the page |
| Card + Columns | Navigation links and feature grids |
| Note/Tip/Warning | Important context — use sparingly |
Cards always go inside Columns: `<Columns cols={2}><Card ... /></Columns>`
Icons are Font Awesome Light names: "rocket", "code", "terminal", "book-open"
## Style
- Active voice: "Run this command" not "This command should be run"
- Start with why, then how
- One idea per paragraph
- Code examples must be complete and copy-pasteable
- Write like a person — no filler ("It's important to note"), no hedging ("you might want to consider"). If it sounds like a chatbot, rewrite it shorter.
## Common Mistakes
- `<CodeBlock>`, `<Alert>`, `<Section>` don't exist — use the components listed above
- `<Card>` without `<Columns>` wrapper won't render correctly
- Missing `description` in frontmatter breaks search and link previews
- Raw HTML tags should be MDX components instead
## New Pages
When creating a page, add it to `docs.json` navigation. Without this, the page won't appear in the sidebar. Read `docs.json` first to understand the group structure.MCP 配置
创建 .cursor/mcp.json 以连接您已发布的文档:
.cursor/mcp.json
{
"mcpServers": {
"my-docs": {
"url": "https://your-project.jamdesk.app/_mcp"
}
}
}将 your-project 替换为您的 Jamdesk 子域名。如果您已上线自定义域名,请改用该域名:"url": "https://docs.acme.com/_mcp"。端点详情请参阅 MCP 服务器。
工作流
在 MDX 文件中选中文本,然后按 Cmd+K 描述您希望修改的内容。适用于以下场景:
- 重写某一节以使其更清晰
- 添加代码示例
- 将文本转换为组件(例如,将步骤包裹在
<Steps>中)
/update-jamdesk 技能
安装 /update-jamdesk 技能,以便在代码变更时自动更新文档:
npx skills add jamdesk/skills --skill update-jamdesk -a cursor
完整指南请参阅 自动更新。
