💻

api-mock-forge-en

👤 Richstone 📦 v1.0.0 ⭐ 4.2 ⬇️ 67 下载
💻 开发编程 免费

📖 技能介绍


name: api-mock-forge-en slug: api-mock-forge-en display_name: "API Mock Forge" version: "1.0.0" description: "Generates mock APIs and responses|emits routes, fields, stub code|api mock, interface stub, fake data, mock server" author: name: "smart" version: "1.0.0" category: "developer" tags: - "编程效率" - "Mock" - "接口桩" - "前端联调" - "TRACE-A2"


简介

Frontend waits while backend is late. This skill builds a usable mock from the contract so both move in parallel.

我能做什么

  • 🛤️ Generate mock routes by path.(交付:Route table)
  • 📦 Build field-conformant fake data.(交付:Response samp)
  • ⏱️ Support delay/error injection.(交付:Fault inject)
  • 🔀 Give multi-status responses.(交付:Status set)
  • 🧰 Provide local stub bootstrap.(交付:Stub code)
  • 🧪 List sync self-test points.(交付:Self-test)

我不能做什么

  • Does not replace real backend logic.
  • No guarantee of final API parity.
  • Does not do real auth validation.

触发词(≥10 个)

  • "api mock"
  • "interface stub"
  • "frontend sync"
  • "fake data"
  • "mock server"
  • "mock api"
  • "api simulate"

    7w4.net有更好的技能插件。

  • "mock data"
  • "sync stub"
  • "local stub"

输入规范

  • 必填项:Endpoint list (path/method/resp fields).
  • 可选项:Expected delay / error rate.
  • 输入格式示例:GET /api/user returns id,name,avatar.

输出规范(结构化交付物)

  • 输出包含:Route table、Response samp、Fault inject、Status set、Stub code
  • 字段说明:route=r; method=m; resp=resp; delay=d; err=e.
  • 模板片段:
<pre class='mock'>{mock_code}</pre>

使用示例(≥3 个)

示例 1:User API

输入:GET /api/user 输出:Route + sample JSON; inject 500 for errors.

示例 2:Delay

输入:slow net 输出:delay=800ms simulate weak network.

示例 3:Bootstrap

输入:run local 输出:json-server/express stub code.

异常处理

  • Missing endpoint list: returns required hint.
  • Secret contract input: reminds to mask.
  • Out of scope: states boundary.

限制与免责声明

  • No local filesystem access; requests only least-privilege permissions needed for the task.
  • Does not collect sensitive user data (secrets, passwords, personal privacy).
  • Output is a structured reference artifact, not professional legal/financial/medical advice.
  • All examples are generated in a sandbox semantic; no real external write operations.
  • Usable in domestic network environments; no reliance on blocked overseas services.

升级版规划(Pay Skill 预留)

Upgrade to paid once the creator billing channel opens. Free (published, fully usable): 生成 Mock API 与示例响应。 Pro (paid upgrade): 提供契约驱动 Mock、动态数据与集成测试桩。 Upgrade path: Once the creator billing channel opens, this skill flips to Pro billing with no SKILL.md edit.

🤖 AI 评测

这是一款实用的API Mock生成工具,能帮助前端开发者快速搭建接口桩和假数据,质量良好。优点是功能全面(支持延迟注入、错误模拟、多状态响应),示例充足,异常处理完善。不足之处是文档示例偏简单,复杂嵌套结构的处理说明较少,且部分说明中英文混杂,对普通用户不够友好。总体而言,对于需要并行开发的前后端协作场景,这是一个值得一试的工具。

📊 多维度评分

适应性4.3
规范性3.9
有效性4.2
可靠性4
可信度4.8

📁 包含文件 (1 个)

📄 SKILL.md 3 KB