Skip to content
Agentmart
Submit a tool

modao-generator

生成产品原型、页面、PRD时使用。通过墨刀 MCP 生成 HTML/React/Vue/PRD/图片,自动导入墨刀编辑器。

Skill by xgl1103

IndexedMIT
Write a review

Chalk Labs

Need help deploying modao-generator?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/xgl1103-modao-generator

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

生成产品原型、页面、PRD时使用。通过墨刀 MCP 生成 HTML/React/Vue/PRD/图片,自动导入墨刀编辑器。

Use cases: frontend, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/modao-generator

What's inside

Skill name
modao-generator
Description
生成产品原型、页面、PRD时使用。通过墨刀 MCP 生成 HTML/React/Vue/PRD/图片,自动导入墨刀编辑器。
License
MIT
Instructions
249 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# 墨刀生成器

通过墨刀 MCP 生成产品原型、应用、PRD 或图片,HTML 产物自动导入墨刀编辑器。

## 前置条件

- 墨刀 MCP 已配置并连接(`mcp.servers.modao` 存在且 enabled)
- 若工具列表中无 `modao__*` 工具,提示用户检查 MCP 配置

## client 参数说明

所有工具调用均使用 `client` 参数标识调用来源。默认值为 `"openclaw"`。若用户明确指定其他 client 值,则使用用户指定的值。

## 步骤

### 1. 确认需求

从用户输入中提取以下信息,缺失项主动询问:

- **做什么**:产品类型(页面/应用/文档/图片)
- **给谁用**:目标用户
- **核心内容**:页面范围、功能模块、关键流程
- **约束**:技术栈偏好、不要什么、风格要求

若用户未指定产物类型,按以下规则询问:

| 用户意图 | 推荐产物 | 对应工具 | 是否可导入墨刀编辑 |
|----------|----------|----------|-------------------|
| 看页面结构、布局、流程 | HTML 原型 | `generate_html` | ✅ 支持 |
| 要可交互 Demo,明确要 React | React 应用 | `generate_react` | ❌ 暂不支持导入 |
| 要可交互 Demo,明确要 Vue | Vue 应用 | `generate_vue` | ❌ 暂不支持导入 |
| 梳理需求、功能说明、验收标准 | PRD 文档 | `generate_prd` | 不需要导入 |
| 海报、插图、配图等视觉素材 | 图片 | `generate_image` | 不需要导入 |
| 无法归类 | 通用生成 | `generate` | 视产物类型而定 |

询问示例:「你想要哪种产物?1) HTML 原型(快速看页面结构,可直接导入墨刀编辑)2) React 应用(可交互 Demo,暂不支持导入墨刀)3) Vue 应用(同 React)4) PRD 文档(需求梳理)5) 图片(海报/插图)」

### 2. 检查积分余额

生成操作(`generate_*`)为付费操作,开始前先检查积分:

```
modao__get_account_status(client="openclaw")
```

向用户回复当前积分剩余情况,例如:「当前墨刀积分剩余:xxx。确认继续生成吗?」

若用户确认,进入下一步。若积分不足,提示用户充值后再试。

### 3. 构造需求描述

将用户输入整理为结构化 query,包含:

- 产品类型和目标用户
- 页面范围和核心功能
- 必须覆盖的状态和异常场景
- 明确不要什么(排除无关功能)
- 期望的产物类型

query 示例:
```
生成一个移动端用户访谈预约原型。
目标用户:收到研究邀请的注册用户。
页面范围:场次选择、信息填写、预约确认。
必须覆盖:场次已满、手机号校验失败、重复预约、提交失败和成功结果。
输出:可预览的 HTML 原型。
不要添加支付、社区或与预约无关的功能。
```

### 4. 调用生成工具

根据产物类型调用对应工具:

- HTML → `modao__generate_html(query=..., client="openclaw")`
- React → `modao__generate_react(query=..., client="openclaw")`
- Vue → `modao__generate_vue(query=..., client="openclaw")`
- PRD → `modao__generate_prd(query=..., client="openclaw")`
- 图片 → `modao__generate_image(query=..., client="openclaw")`
- 通用 → `modao__generate(query=..., client="openclaw")`

工具最多等待 100 秒。返回结果中记录 `task_id`。

### 5. 超时恢复(硬约束)

**背景**:MCP 客户端超时约 60 秒,但墨刀服务端可能仍在正常生成(2-3 分钟)。超时返回的错误信息中**没有 task_id**,但任务已在墨刀后台创建。

**超时后的处理流程**:

1. **禁止直接重试 `generate_*`**:重复调用会创建新任务,浪费积分并占满并发槽位(最多 3 个)
2. 调用 `modao__list_recent_tasks(limit=5, client="openclaw")`
3. 从返回的任务列表中,按 `updated_at` 找到**最新的、名称匹配的、status 为 running 的任务**
4. 用该 `task_id` 调用 `modao__get_task_result(task_id=..., client="openclaw")` 查询状态
5. 若仍为 running,等待 15 秒后再次查询(最多 3 次)
6. 3 次后仍 running,停止轮询,向用户返回 task_id 和任务链接,提示稍后查询

**判断「最新匹配任务」的规则**:
- `updated_at` 在最近 5 分钟内
- 任务名称与本次 query 的关键词匹配
- status 为 `running` 或 `completed`
- 若找不到匹配任务,向用户说明情况,等用户指示

### 6. 轮询任务状态

若返回状态为 `running`(正常返回 task_id 但任务未完成),采用指数退避策略轮询:

1. 告知用户「生成中,请稍候...」
2. 等待 **15 秒**后调用 `modao__get_task_result(task_id=..., client="openclaw")`
3. 若仍为 running,等待 **15 秒**后再次查询(第 2 次)
4. 若仍为 running,等待 **15 秒**后再次查询(第 3 次)
5. 3 次查询后仍为 running,停止轮询,向用户返回:
   - 生成任务仍在进行中
   - task_id 值
   - 提示用户稍后可用 `get_task_result` 查询结果,或用 `list_recent_tasks` 查看

不要重复创建相同任务。

### 6. 自动导入墨刀(仅 HTML 产物)

生成完成后,若产物为 HTML 类型,自动调用导入:

From xgl1103/ai-product-manager-employee, MIT.

More from xgl1103/ai-product-manager-employee

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 21, 2026 (9 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from xgl1103

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get modao-generator running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying modao-generator?

CallGet help
Cite this page

modao-generator skill. Agent Mart. https://agentmart.dev/skills/xgl1103-modao-generator (last updated 2026-10-24)