You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/commands/mcp_design_review.mdc
+13-3Lines changed: 13 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,10 @@ When the user types `/mcp_design_review`.
15
15
2. **Evaluate design against the guidelines**
16
16
For each tool and its surrounding design, check:
17
17
18
+
- **Confirmed target shape takes precedence**
19
+
- If the current spec, task, or explicit user feedback has already locked a shape (for example “this module must converge to one `queryXxx` and one `manageXxx`”), treat deviations as failures, not optional suggestions.
20
+
- Do not propose a locally elegant alternative if it breaks an already confirmed module boundary, naming style, or migration target.
21
+
18
22
- **Tool responsibility & naming**
19
23
- Single clear responsibility per tool (no “god” tools).
20
24
- Names follow `verbNoun` style and reflect the domain (e.g. `getFunctionLayers`, `writeFunctionLayers`).
@@ -25,11 +29,17 @@ When the user types `/mcp_design_review`.
25
29
- a manage tool: `manageXxx` – performs all mutations via a required `action` field.
26
30
- The `manageXxx` tool:
27
31
- Uses a string literal union for `action` (e.g. `"create" | "update" | "delete" | "attachLayer" | "detachLayer"`).
28
-
- Groups parameters by `action` (discriminated unions or clearly documented per‑action payload).
32
+
- Uses action-specific parameters that are easy for AI to map correctly. Prefer the repository’s established style first; do not invent namespaced actions or grouped payloads unless the surrounding modules already use that pattern.
29
33
- Treats missing/unknown `action` as invalid and fails safely.
30
34
- Tool count control: avoid creating many small tools (e.g. `createX`, `updateX`, `deleteX`) in the same domain when a single `manageXxx` with multiple actions is sufficient.
35
+
- Before approving any new fine-grained tool, explicitly check whether the capability can be merged into an existing `queryXxx` / `manageXxx` primary entrance in the same module.
31
36
- Safety & annotations: tools must clearly indicate whether they are read‑only or mutating in their metadata, and dangerous actions (delete, publish, reset, overwrite, etc.) must require explicit confirmation flags with safe defaults.
32
37
38
+
- **Cross-module consistency**
39
+
- Compare the proposed schema with neighboring modules in `mcp/src/tools/`, not just the local file.
40
+
- Flag designs that introduce one-off conventions, such as namespaced action strings or special payload grouping, when other modules use flat action names and top-level fields.
41
+
- Check whether target identifiers stay consistent across actions (`functionName`, `layerName`, `triggerName`) instead of mixing generic `name` with domain-specific names.
42
+
33
43
- **Read vs write separation**
34
44
- Read tools are side‑effect free and focused on querying.
35
45
- Write tools perform explicit mutations with clear targets and payloads.
@@ -63,7 +73,7 @@ When the user types `/mcp_design_review`.
63
73
- Output a markdown report with three sections:
64
74
- **Summary**: overall pass/fail status and high‑level observations.
65
75
- **Per‑tool checklist**: for each major tool group (`functions`, `env`, `database`, `storage`, etc.), list which guidelines are satisfied and which are violated or unclear.
66
-
- **Actionable recommendations**: concrete refactoring suggestions (e.g. “split X into read/write”, “add `nextActions` to Y”, “add `confirm` flag to Z delete operation”).
76
+
- **Actionable recommendations**: concrete refactoring suggestions (e.g. “merge X into existing `queryXxx`”, “keep flat actions to match other modules”, “add `confirm` flag to Z delete operation”).
67
77
68
78
4. **Optional follow‑up**
69
-
- 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`.
79
+
- 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