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: packages/mcp-provider-scale-products/README.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,12 +78,22 @@ To unlock **runtime-aware severity** powered by ApexGuru, the tool needs access
78
78
79
79
| Level | Meaning |
80
80
|---|---|
81
-
|**Minor**|Low-impact issue; fix when convenient |
82
-
|**Major**|Moderate performance risk; should be addressed|
83
-
|**Critical**|High-impact hotspot; fix with priority|
81
+
|**Minor**|Deviates from quality standards; fix when convenient |
82
+
|**Major**|Reduces usability or causes a crucial part of your software to fail|
83
+
|**Critical**|Highest priority; issues with run time, count, and other factors that result in software failure|
84
84
85
85
When runtime metrics are available (org connected + ApexGuru enabled), severity is calculated from actual production execution data rather than static heuristics.
86
86
87
+
## Best Practices
88
+
89
+
If your MCP client isn't calling the Scale tools you expect, try these tips:
90
+
91
+
1.**Scope tool execution.** Use the `--toolsets scale-products` argument in your MCP config files to improve tool resolution. Too many registered tools make it difficult for your MCP host to resolve the correct one. Disable any tools you don't actively use.
92
+
93
+
2.**Reference tools explicitly.** Reference the tool by name in your prompt so the LLM knows exactly which tool to invoke. For example:
94
+
95
+
> *Scan MyClass.cls for performance antipatterns using the `scan_apex_class_for_antipatterns` MCP tool.*
96
+
87
97
## Development
88
98
89
99
Ensure you are in the monorepo root or the package directory.
1. ALWAYS start with a clear header indicating whether runtime analysis from production org was used:
446
+
- If runtime metrics were used: '🔬 Analyzing with Production Metrics from [OrgId]'
447
+
- Otherwise: do not use the runtime header.
448
+
2. Display the SEVERITY LEGEND prominently at the beginning of your response.
449
+
450
+
${runtimeHeader}
451
+
**SEVERITY LEGEND**
452
+
- 🟡 Minor: Deviates from quality standards
453
+
- 🟠 Major: Reduces usability or causes failure
454
+
- 🔴 Critical: Highest priority, causes failure
455
+
- 💡 Severity from Production Metrics
456
+
457
+
**Presentation:** Be concise, conversational, direct, and positive. Address the reader as "you." Use a casual tone but avoid jargon and slang. Avoid "please" and "sorry"; use exclamation points sparingly. Design text for easy scanning.
458
+
459
+
## Antipattern Scan Results for '${className}'
460
+
461
+
Found ${totalIssues} issue(s) across ${scanResult.antipatternResults.length} antipattern type(s).
462
+
${this.getRuntimeDataMessage(runtimeDataStatus)}
463
+
464
+
## Scan Results
465
+
466
+
Results are grouped by antipattern type. Each type has:
467
+
- **fixInstruction**: How to fix this antipattern type (applies to all instances)
468
+
- **detectedInstances**: All detected instances of this type
469
+
470
+
\`\`\`json
471
+
${JSON.stringify(displayResult,null,2)}
472
+
\`\`\`
473
+
474
+
## Instructions for Code Fixes
475
+
476
+
When applying fixes in code, include the following in comments:
477
+
- For each antipattern, include the appropriate severity dot (🟡/🟠/🔴)
478
+
- Add 💡 next to severity dot when runtime metrics were used to calculate severity
479
+
480
+
The scan result contains multiple antipattern types. For each type:
481
+
1. Read the \`fixInstruction\` - this explains how to fix this antipattern
482
+
2. For each instance in \`detectedInstances\`:
483
+
- Examine \`codeBefore\` (the problematic code)
484
+
- Consider \`severity\` (critical/major/minor)
485
+
- Generate the fixed code following the instruction
486
+
487
+
Generate fixes for all detected instances across all antipattern types.
0 commit comments