content
它能做什么
这项技能指导智能体在 Content 工作区中创建、编辑和发布 Markdown 文档,包括存放在代码仓库中的文档。适合用 Markdown 保存文档或博客文章的作者和开发者。
适用场景
- ✓当你需要编写或更新文档页面、博客文章或资源页面的时候。
- ✓当你希望编辑 Markdown 或 MDX 文件,同时不破坏其 frontmatter 的时候。
- ✓当文档存放在代码仓库中,并应通过 Content 工具进行编辑的时候。
技能链接
https://github.com/BuilderIO/agent-native/blob/main/skills/content/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请更新我们文档中的设置指南,添加一个关于 API 密钥的章节,并保持现有格式。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体先阅读页面,然后通过 Content 工具进行精确的查找替换编辑,或完整重写。如果这些工具不可用,它会直接编辑已配置的文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Content
Use the Content app when a workflow is about authoring, editing, reviewing, or publishing Markdown/MDX documents: docs sites, blogs, resource libraries, marketing pages, internal notes, and local MDX components. Content gives the agent a document tree, a rich editor, normal document actions, and optional local-file source of truth.
Choose The Path
- Use Content actions when the Content MCP/action tools are available:
list-documents,search-documents,get-document,pull-document,create-document,edit-document,update-document,delete-document,share-local-file-document,list-local-component-files, andwrite-local-component-file. - Use
pull-documentorget-documentbefore editing a page. Useedit-documentfor precise find/replace changes andupdate-documentfor full rewrites or new content. - In Local File Mode, Content actions read and write the repo files declared in
agent-native.json; SQL remains cache/history/search glue, not the source of truth for those pages. - If Content tools are not visible and no local Content app or Desktop bridge is
running, treat this skill as repo-editing guidance. Edit configured
.md/.mdxfiles directly, preserve frontmatter and MDX imports, and tell the user the Content action surface was not available.
Action Examples
Prefer JSON input for action calls:
pnpm action list-documents
pnpm action get-document '{"id":"local-file:..."}'
pnpm action edit-document '{"id":"local-file:...","find":"old copy","replace":"new copy"}'
pnpm action update-document '{"id":"local-file:...","content":"# Updated\n\nBody"}'
pnpm action share-local-file-document '{"id":"local-file:..."}'
Run refresh-list after create/update/delete operations when you need the open
Content UI sidebar to repaint immediately.
Local File Mode
Install into an existing repo with:
npx @agent-native/core@latest skills add content --mode local-files --scope project
The installer copies this skill and writes or updates agent-native.json with
Content roots for docs/, blog/, content/, and resources/, plus a
components/ folder for local MDX components. A typical manifest looks like:
{
"version": 1,
"apps": {
"content": {
"mode": "local-files",
"roots": [
{
"name": "Docs",
"path": "docs",
"kind": "docs",
"extensions": [".md", ".mdx"]
},
{
"name": "Blog",
"path": "blog",
"kind": "blog",
"extensions": [".md", ".mdx"]
},
{
"name": "Content",
"path": "content",
"kind": "content",
"extensions": [".md", ".mdx"]
},
{
"name": "Resources",
"path": "resources",
"kind": "resources",
"extensions": [".md", ".mdx"]
}
],
"components": "components",
"extensions": "extensions",
"hide": ["**/_*.md", "**/_*.mdx"]
}
}
}
Local File Mode does not make the host language model local, and the hosted Content app cannot read private repo files by itself. File access requires a local Content app, Agent-Native Desktop, or another trusted local bridge.
MDX And Components
- Preserve frontmatter keys you do not understand. Preserve MDX imports, exports, JSX, and expression props unless the user explicitly asks to change them.
- Use local components from the configured
componentsfolder. Components should be PascalCase exports from.tsxfiles; simple editable input metadata can live next to them asComponentNameInputs. - Use
list-local-component-filesandwrite-local-component-filefor component source changes when Content tools are available. Otherwise edit the component files directly like normal repo source.
Boundaries
- Moving, renaming, and reordering local-file pages are not first-class Content UI operations yet. Use normal file operations when the user asks for those, then let Content rediscover the file tree.
- Do not push/pull Notion, Builder.io, or other provider-backed content unless the user explicitly asks for provider sync.
- Do not paste secrets, private provider data, or credential-looking values into docs, generated pages, frontmatter, examples, or local components.
常见问题
智能体什么时候应直接编辑文件?
只有在 Content 工具不可用时。否则它使用 Content 操作。
编辑页面之前,智能体做什么?
它会先读取或拉取文档,因此总是基于当前版本进行工作。
Content 支持本地文件模式吗?
支持。在该模式下,代码仓库中的文件是唯一来源,数据库仅作为缓存和搜索辅助。
详情
作者的原始描述
Use Content for repo-backed Markdown/MDX docs, blogs, resources, rich document editing, local components, shareable copies, and Content local-file workspaces. Prefer Content actions over raw filesystem writes when available.
repo: BuilderIO/agent-native
热度
- GitHub 星标
- 7.6k
- 排名
- #13207
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …