@skyramp/mcp 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,12 +13,35 @@ Only if NO existing function can be reused:
|
|
|
13
13
|
4. Parameterize the test function(s) with meaningful parameters to make it more flexible. Preserve the original order of code lines within each function.
|
|
14
14
|
5. Only extract reusable logical sections into helper functions. Use inline parameter types instead of creating interfaces or type definitions.
|
|
15
15
|
|
|
16
|
+
**IMPORT CLEANUP AFTER MODULARIZATION:**
|
|
17
|
+
After applying modularization principles:
|
|
18
|
+
1. **Analyze Remaining Imports**: Review all import statements at the top of the file
|
|
19
|
+
2. **Identify Unused Imports**: Check which imported modules, functions, or classes are no longer referenced in the modularized code
|
|
20
|
+
3. **Remove Unused Imports**: Delete any import statements that are not used in the final modularized code
|
|
21
|
+
4. **Preserve Required Imports**: Keep all imports that are actually used by the modularized functions
|
|
22
|
+
5. **Maintain Import Order**: Preserve the original ordering of remaining imports for consistency
|
|
23
|
+
|
|
24
|
+
**IMPORT REMOVAL RULES:**
|
|
25
|
+
- Only remove imports that are completely unused after modularization
|
|
26
|
+
- Keep imports used by any function, even if usage decreased
|
|
27
|
+
- Preserve imports for types used in function parameters (inline types)
|
|
28
|
+
- Do not remove imports for testing frameworks or utilities
|
|
29
|
+
- Maintain proper import syntax and formatting
|
|
30
|
+
|
|
31
|
+
**LANGUAGE-SPECIFIC IMPORT HANDLING:**
|
|
32
|
+
- **Python**: Remove unused import and from...import statements
|
|
33
|
+
- **JavaScript/TypeScript**: Remove unused import and require() statements
|
|
34
|
+
- **Java**: Remove unused import statements
|
|
35
|
+
- **All Languages**: Preserve framework-specific imports (testing libraries, etc.)
|
|
36
|
+
|
|
16
37
|
**CRITICAL CONSTRAINTS:**
|
|
17
38
|
- NO interfaces, classes, types, or data structures
|
|
18
39
|
- NO new test cases or logic
|
|
19
40
|
- NO additional files
|
|
20
41
|
- ONLY helper functions with inline types
|
|
21
42
|
- PRESERVE original functionality exactly
|
|
43
|
+
- REMOVE unused imports after modularization
|
|
44
|
+
- DO NOT CREATE/UPDATE package.json or requirements.txt or pom.xml or build.gradle file
|
|
22
45
|
|
|
23
46
|
**CRITICAL: If you skip any step, the modularization is incomplete. You MUST complete all steps before proceeding.FIX ERRORS IN MODULARIZED CODE USING skyramp_fix_errors TOOL**
|
|
24
47
|
`;
|
|
@@ -30,11 +53,20 @@ export function getFixErrorsPrompt() {
|
|
|
30
53
|
1. **Parameter Passing:** Identify functions using variables from outside scope (like 'page' object). Pass these as parameters.
|
|
31
54
|
2. **Validate Correctness:** Ensure code is free of reference errors, undefined variables, runtime issues.
|
|
32
55
|
3. **Import Paths:** Ensure import paths are correct and there are no circular imports.
|
|
33
|
-
4. **
|
|
34
|
-
5. **
|
|
56
|
+
4. **Import Validation:** Ensure all remaining imports are necessary and no missing imports cause reference errors.
|
|
57
|
+
5. **Unused Import Cleanup:** Verify that unused imports were properly removed without breaking functionality.
|
|
58
|
+
6. **UI State Management:** Check for UI state conflicts, modal interference, or element interaction issues.
|
|
59
|
+
7. **Sequential Operations:** Ensure UI operations don't interfere with each other when called in sequence.
|
|
60
|
+
|
|
61
|
+
**IMPORT ERROR DEBUGGING:**
|
|
62
|
+
- Check for missing imports that cause undefined reference errors
|
|
63
|
+
- Verify that import removal didn't break existing functionality
|
|
64
|
+
- Ensure all imported modules are actually available in the project
|
|
65
|
+
- Confirm that import syntax is correct for the target language
|
|
35
66
|
|
|
36
67
|
**KEY: Variables not defined within function scope MUST be passed as parameters.**
|
|
37
68
|
**UI KEY: Helper functions that perform UI operations must be self-contained and not leave modals/dialogs open.**
|
|
69
|
+
**IMPORT KEY: All imports must be either used in the code or properly removed.**
|
|
38
70
|
`;
|
|
39
71
|
}
|
|
40
72
|
export function getModularizationPromptForUI(filePath, language) {
|
|
@@ -93,8 +125,38 @@ STEPS:
|
|
|
93
125
|
- Array processing with null handling or special indexing
|
|
94
126
|
- Button clicks with complex selector chains that are unique to specific contexts
|
|
95
127
|
|
|
128
|
+
**IMPORT CLEANUP AFTER MODULARIZATION:**
|
|
129
|
+
After applying modularization principles:
|
|
130
|
+
1. **Analyze Remaining Imports**: Review all import statements at the top of the file
|
|
131
|
+
2. **Identify Unused Imports**: Check which imported modules, functions, or classes are no longer referenced in the modularized code
|
|
132
|
+
3. **Remove Unused Imports**: Delete any import statements that are not used in the final modularized code
|
|
133
|
+
4. **Preserve Required Imports**: Keep all imports that are actually used by the modularized functions
|
|
134
|
+
5. **Maintain Import Order**: Preserve the original ordering of remaining imports for consistency
|
|
135
|
+
|
|
136
|
+
**UI-SPECIFIC IMPORT CONSIDERATIONS:**
|
|
137
|
+
- Preserve all Playwright/testing framework imports (page, expect, test, etc.)
|
|
138
|
+
- Keep UI-specific utility imports even if usage appears reduced
|
|
139
|
+
- Maintain browser-specific imports that may be needed for UI operations
|
|
140
|
+
- Do not remove imports for UI components or page object models
|
|
141
|
+
- Preserve imports for locators, selectors, and UI interaction utilities
|
|
142
|
+
|
|
143
|
+
**IMPORT REMOVAL RULES FOR UI TESTS:**
|
|
144
|
+
- Only remove imports that are completely unused after modularization
|
|
145
|
+
- Keep imports used by any function, even if usage decreased
|
|
146
|
+
- Preserve imports for types used in function parameters (inline types)
|
|
147
|
+
- Do not remove imports for testing frameworks or utilities
|
|
148
|
+
- Maintain proper import syntax and formatting
|
|
149
|
+
- Be extra cautious with UI framework imports - they may be used in ways not immediately obvious
|
|
150
|
+
|
|
151
|
+
**LANGUAGE-SPECIFIC UI IMPORT HANDLING:**
|
|
152
|
+
- **Python**: Remove unused import and from...import statements, but keep pytest, playwright imports
|
|
153
|
+
- **JavaScript/TypeScript**: Remove unused import and require() statements, but preserve @playwright/test imports
|
|
154
|
+
- **Java**: Remove unused import statements, but keep testing framework imports
|
|
155
|
+
- **All Languages**: Always preserve UI testing framework and browser automation imports
|
|
156
|
+
|
|
96
157
|
**CRITICAL CONSTRAINTS:**
|
|
97
158
|
- NO interfaces, classes, types, or data structures
|
|
159
|
+
- DO NOT CREATE/UPDATE package.json or requirements.txt or pom.xml or build.gradle file
|
|
98
160
|
- NO changes to the core UI interaction sequence
|
|
99
161
|
- NO extraction of partial workflows that depend on external state
|
|
100
162
|
- NO generalization of complex logic patterns into loops or helper functions
|
|
@@ -108,6 +170,7 @@ STEPS:
|
|
|
108
170
|
- NAVIGATION STEPS MUST REMAIN IN THE MAIN TEST FUNCTION TO MAINTAIN PROPER PAGE STATE
|
|
109
171
|
- COMPLEX LOGIC PATTERNS MUST REMAIN IN THE MAIN TEST FUNCTION TO MAINTAIN EXACT BEHAVIOR
|
|
110
172
|
- SPECIFIC SELECTORS MUST BE PRESERVED TO ENSURE CORRECT ELEMENT TARGETING
|
|
173
|
+
- REMOVE unused imports after modularization (following UI-specific import rules)
|
|
111
174
|
|
|
112
175
|
**BEFORE SUBMITTING: Double-check that every navigation step, complex operation, and specific selector from the original test appears in the same position with the same logic in the main test function.**
|
|
113
176
|
|
|
@@ -153,8 +216,11 @@ export function getFixErrorsPromptForUI() {
|
|
|
153
216
|
8. **Unique Workflow Preservation**: If the original test has unique steps for similar operations, ensure these are preserved and not generalized incorrectly.
|
|
154
217
|
9. **Complete Workflow Validation**: Ensure that extracted helper functions contain COMPLETE workflows, not partial steps that depend on external state.
|
|
155
218
|
10. **Page State Management**: Verify that helper functions don't assume specific page states - the main test should handle navigation between different pages/states.
|
|
156
|
-
11. **
|
|
157
|
-
12. **Import
|
|
219
|
+
11. **Import Validation**: Ensure all remaining imports are necessary and no missing imports cause reference errors.
|
|
220
|
+
12. **Unused Import Cleanup**: Verify that unused imports were properly removed without breaking UI test functionality.
|
|
221
|
+
13. **UI Framework Import Preservation**: Ensure that critical UI testing imports (Playwright, testing frameworks) were not accidentally removed.
|
|
222
|
+
14. **Validate Correctness**: Ensure code is free of reference errors, undefined variables, runtime issues.
|
|
223
|
+
15. **Import Paths**: Ensure import paths are correct and there are no circular imports.
|
|
158
224
|
|
|
159
225
|
**TIMEOUT DEBUGGING CHECKLIST:**
|
|
160
226
|
- Are all navigation steps (navbar clicks, page.goto) in the main test function?
|
|
@@ -175,6 +241,13 @@ export function getFixErrorsPromptForUI() {
|
|
|
175
241
|
- Do button clicks use the same selector specificity as the original?
|
|
176
242
|
- Are there any ambiguous selectors that could match multiple elements?
|
|
177
243
|
|
|
244
|
+
**IMPORT ERROR DEBUGGING CHECKLIST:**
|
|
245
|
+
- Are there any undefined reference errors due to missing imports?
|
|
246
|
+
- Were any critical UI framework imports (page, expect, test) accidentally removed?
|
|
247
|
+
- Do all remaining imports correspond to actually used functionality?
|
|
248
|
+
- Are import paths correct and accessible in the project structure?
|
|
249
|
+
- Were any imports removed that are used in non-obvious ways (like in string templates)?
|
|
250
|
+
|
|
178
251
|
**SPECIFIC FIX FOR COMMON ERRORS:**
|
|
179
252
|
If you see timeout on button clicks or element interactions:
|
|
180
253
|
- Check if navigation steps were moved into helper functions and move them back to main test
|
|
@@ -186,10 +259,17 @@ If you see incorrect calculations or missing operations:
|
|
|
186
259
|
- Verify all operations from original test are present in modularized version
|
|
187
260
|
- Look for null value handling differences
|
|
188
261
|
|
|
262
|
+
If you see import or reference errors:
|
|
263
|
+
- Check if critical UI framework imports were accidentally removed
|
|
264
|
+
- Verify all remaining imports are necessary and properly used
|
|
265
|
+
- Restore any imports needed for UI interactions, even if usage seems minimal
|
|
266
|
+
- Confirm import paths match the project structure
|
|
267
|
+
|
|
189
268
|
**KEY: Every UI interaction from the original test must be present in the modularized version.**
|
|
190
269
|
**CRITICAL: Helper functions should only contain COMPLETE, self-contained workflows.**
|
|
191
270
|
**NAVIGATION KEY: Navigation steps between operations must remain in the main test flow to maintain proper page state.**
|
|
192
271
|
**CALCULATION KEY: Unique logic patterns should not be generalized if they produce different results.**
|
|
193
272
|
**SELECTOR KEY: Specific selectors must be preserved to ensure correct element targeting.**
|
|
273
|
+
**IMPORT KEY: All necessary imports must be preserved, especially UI framework imports.**
|
|
194
274
|
`;
|
|
195
275
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyramp/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@modelcontextprotocol/sdk": "^1.11.4",
|
|
45
|
-
"@skyramp/skyramp": "^1.2.
|
|
45
|
+
"@skyramp/skyramp": "^1.2.19",
|
|
46
46
|
"dockerode": "^4.0.6",
|
|
47
47
|
"zod": "^3.25.3"
|
|
48
48
|
},
|