Skip to content

Commit 13755ad

Browse files
committed
chore(commands): add mcp design review slash command
Made-with: Cursor
1 parent edcf09a commit 13755ad

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
### `/mcp_design_review`
2+
3+
**Function**
4+
Check whether all MCP tools and specs follow the unified MCP design guidelines.
5+
6+
**Trigger Condition**
7+
When the user types `/mcp_design_review`.
8+
9+
**Behavior**
10+
11+
1. **Collect design sources**
12+
- Read MCP-related specs (e.g. `specs/agent-functionality/`, `specs/interactive-tools/`, `specs/code-quality-analysis/REFACTORING_CHECKLIST.md`, `specs/function-tool-ai-ergonomics/` if present).
13+
- Read MCP implementation files (primarily `mcp/src/tools/*.ts`, especially `functions.ts`, `env.ts`, `storage.ts`, etc).
14+
15+
2. **Evaluate design against the guidelines**
16+
For each tool and its surrounding design, check:
17+
18+
- **Tool responsibility & naming**
19+
- Single clear responsibility per tool (no “god” tools).
20+
- Names follow `verbNoun` style and reflect the domain (e.g. `getFunctionLayers`, `writeFunctionLayers`).
21+
22+
- **Read vs write separation**
23+
- Read tools are side‑effect free and focused on querying.
24+
- Write tools perform explicit mutations with clear targets and payloads.
25+
26+
- **Declarative vs lifecycle design**
27+
- Prefer declarative APIs when a target state can be described in one shot.
28+
- Only use lifecycle / multi‑step flows where necessary (e.g. create → attach → detach → delete), with each step independently callable and retryable.
29+
30+
- **Return envelope & AI ergonomics**
31+
- All tools return a consistent envelope, roughly:
32+
- `success: boolean`
33+
- `data: …` (stable, well‑typed structure)
34+
- `message: string` (human/AI‑friendly summary)
35+
- Optional `errorCode` or similar for programmatic checks
36+
- Optional `nextActions: { tool, action, reason }[]` suggesting follow‑up calls.
37+
- Logs / raw stdout are not mixed into `data` but exposed via dedicated log/diagnostic tools where needed.
38+
39+
- **Parameter design & safety**
40+
- Parameters use clear, strongly‑typed fields (enums/union types where possible), avoiding `any` and giant anonymous blobs.
41+
- Dangerous operations (delete, overwrite, publish, reset) require explicit confirmation flags (`confirm`, `force`, `dryRun`, etc) with safe defaults.
42+
43+
- **Environment & auth conventions**
44+
- Tools obtain CloudBase environment and credentials via unified config, not by forcing the caller to pass raw secrets.
45+
- Patterns for env usage are consistent across tools.
46+
47+
- **Long‑running operations & logs**
48+
- Long‑running or multi‑step operations expose status/progress in structured form, not just plain text.
49+
- Tool descriptions clarify time/side‑effects and where to look for detailed logs.
50+
51+
3. **Produce a structured report**
52+
- Output a markdown report with three sections:
53+
- **Summary**: overall pass/fail status and high‑level observations.
54+
- **Per‑tool checklist**: for each major tool group (`functions`, `env`, `database`, `storage`, etc.), list which guidelines are satisfied and which are violated or unclear.
55+
- **Actionable recommendations**: concrete refactoring suggestions (e.g. “split X into read/write”, “add `nextActions` to Y”, “add `confirm` flag to Z delete operation”).
56+
57+
4. **Optional follow‑up**
58+
- If requested, generate a prioritized refactoring plan based on the findings (smallest, safest changes first), referencing the existing refactoring checklist in `specs/code-quality-analysis/REFACTORING_CHECKLIST.md`.

0 commit comments

Comments
 (0)