一键导入
api-mock-designer
Designs realistic API mock servers. Goes beyond happy paths by designing stateful mocks (create order -> get order) for complex integrations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Designs realistic API mock servers. Goes beyond happy paths by designing stateful mocks (create order -> get order) for complex integrations.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create, optimize, critique, and programmatically structure prompts for AI systems. Use this skill whenever the user is designing or improving a static prompt, system prompt, coding prompt, agent prompt, workflow prompt, MCP-oriented prompt package, or an algorithmic prompt optimization pipeline. Also use it when the user asks to turn vague AI behavior into a precise instruction set, tool policy, agent spec, evaluation metric, or prompt architecture.
Enforce and manage DESIGN.md specifications, extract design systems from URLs, and combine design reasoning with token roles to prevent drift.
Assumption-first architecture review skill to stress-test project plans and expose hidden risks.
Forces the agent to act with a Claude-like product mindset, prioritizing user journey, UX states, and visual quality before coding.
Compiles and extracts session knowledge into a living, interconnected LLM-Wiki. Instead of writing isolated logs, it identifies key entities, updates cross-referenced topic files in docs/knowledgelib/, and maintains an index and chronological log. Use this to ensure persistent, compounding project knowledge.
Overrides the agent's behavior to enter an interactive, consulting mode. Instead of guessing or immediately executing a task, the agent will analyze the request and ask guiding, targeted questions to clarify intent, constraints, and requirements first.
| name | api-mock-designer |
| description | Designs realistic API mock servers. Goes beyond happy paths by designing stateful mocks (create order -> get order) for complex integrations. |
This skill allows mobile and frontend developers to construct robust UIs without waiting for the backend to be finished. It goes beyond simple static JSON stubs to provide a truly simulated environment that mimics production chaos.
Core assumption: If a frontend only tests against static 200 OK responses, it will break immediately in production when a 503 Service Unavailable or a 4-second latency spike occurs.
Analyze the API spec and design scenarios that consumers must handle:
429 Too Many Requests (Testing retry logic).500/503 (Testing error boundaries/toasts).A good mock server must be stateful in a single session.
POST /users, the next call to GET /users MUST include the newly created user in memory.Required Outputs (Must write BOTH to docs/api-report/):
docs/api-report/api-mock-report.md)### 🧪 API Mock Server Blueprint
**Tooling Recommendation:** WireMock or MSW (Mock Service Worker)
#### 🚥 Configured Scenarios
**1. Stateful Order Flow**
- `POST /orders`: Returns `201` and saves `{ id: 123 }` to memory.
- `GET /orders/123`: Returns the saved order instead of a random stub.
**2. The Chaos Endpoint (Latency & Reliability)**
- `GET /products`:
- 80% chance: Returns `200 OK` (with 500ms - 2000ms randomized latency).
- 15% chance: Returns `503 Service Unavailable` (to test failure UI).
- 5% chance: Returns `429 Too Many Requests`.
**3. Empty State Testing**
- `GET /notifications`: Purposefully returns an empty array `[]` to ensure the frontend displays the "All caught up!" screen correctly.
docs/api-report/api-mock-output.json){
"skill": "api-mock-designer",
"tooling": "MSW",
"scenarios": [
{"name": "Stateful Validation", "endpoint": "/orders", "method": "POST/GET"},
{"name": "Chaos Latency", "endpoint": "/products", "error_rate_pct": 20, "max_latency_ms": 2000},
{"name": "Empty State", "endpoint": "/notifications", "returns": []}
]
}
contract-first-designer's OpenAPI spec.