@skyramp/mcp
Version:
Skyramp MCP (Model Context Protocol) Server - AI-powered test generation and execution
86 lines (73 loc) • 3.02 kB
JavaScript
/**
* Register the test health analysis prompt
*
* This prompt guides the AI to perform EXPLICIT TOOL CHAINING:
* 1. Call skyramp_discover_tests (If user provides a list of tests, skip this step)
* 2. Call skyramp_analyze_test_drift (with stateFile from discovery or list of tests)
* 3. (Optional) Call skyramp_execute_tests_batch (with stateFile)
* 4. Call skyramp_calculate_health_scores (with stateFile)
* 5. Call skyramp_actions (with stateFile) to perform test updates
*/
export function registerTestHealthPrompt(server) {
server.registerPrompt("skyramp_test_health_analysis", {
title: "Skyramp Test Health Analysis",
argsSchema: {},
}, () => {
const messages = [
{
role: "user",
content: {
type: "text",
text: `Check health of test suite
Analyze the health of my test suite.
Repository: /path/to/repository`,
},
},
{
role: "assistant",
content: {
type: "text",
text: `I'll analyze your test suite health through explicit tool chaining with state files for maximum efficiency.
**CRITICAL: YOU MUST DISPLAY BELOW MESSAGE BEFORE ANY TOOL CALL:**
** This tool is currently in Early Preview stage. Please verify the results. **
**The Analysis Process (State File Mode - 98% Token Reduction):**
1. **Discovery (Optional)** - Call \`skyramp_discover_tests\` → Returns stateFile
2. **Drift Analysis** - Call \`skyramp_analyze_test_drift\` with stateFile → Returns updated stateFile
3. **Execution** - Call \`skyramp_execute_tests_batch\` with stateFile (Optional, only if user requests) → Returns updated stateFile
4. **Health Scoring** - Call \`skyramp_calculate_health_scores\` with stateFile → Returns updated stateFile with health data
5. **Perform Actions** - Call \`skyramp_actions\` with stateFile → Performs test updates
**State File Benefits:**
- Reduces token usage by 98%+ (from ~2.6MB to ~25KB for 100 tests)
- Faster processing
- Intermediate results saved to /tmp for debugging
Before I start, should I execute your tests (Step 3)?
**YES** (~5-10 min, requires Docker):
- Most comprehensive assessment
- Identifies actually failing tests
**NO** (~2-3 min):
- Faster, drift-based analysis only
Please respond "yes" or "no".`,
},
},
{
role: "user",
content: {
type: "text",
text: "no",
},
},
{
role: "assistant",
content: {
type: "text",
text: `Perfect! I'll run the analysis without execution. Starting now:
**Step 1: Discovering tests...**
I'll call \`skyramp_discover_tests\` to find all Skyramp tests in your repository.`,
},
},
];
return {
messages,
};
});
}