@skyramp/mcp 0.1.6 → 0.1.7
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.
- package/build/prompts/initialize-workspace/initializeWorkspacePrompt.js +150 -153
- package/build/prompts/test-recommendation/diffExecutionPlan.js +290 -0
- package/build/prompts/test-recommendation/fullRepoCatalog.js +271 -0
- package/build/prompts/test-recommendation/recommendationShared.js +68 -0
- package/build/prompts/test-recommendation/test-recommendation-prompt.js +8 -640
- package/build/prompts/testbot/testbot-prompts.js +12 -2
- package/build/prompts/testbot/testbot-prompts.test.js +20 -3
- package/build/services/ScenarioGenerationService.js +3 -0
- package/build/services/TestGenerationService.js +3 -0
- package/build/tools/code-refactor/codeReuseTool.js +3 -0
- package/build/tools/code-refactor/enhanceAssertionsTool.js +3 -0
- package/build/tools/code-refactor/modularizationTool.js +3 -0
- package/build/tools/workspace/initializeWorkspaceTool.js +1 -1
- package/build/utils/docker.test.js +1 -1
- package/build/utils/featureFlags.test.js +2 -2
- package/build/utils/gitStaging.js +18 -0
- package/build/utils/gitStaging.test.js +87 -0
- package/build/utils/utils.js +2 -2
- package/build/utils/versions.js +1 -1
- package/node_modules/playwright/lib/mcp/browser/context.js +2 -0
- package/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +2 -2
- package/node_modules/playwright/lib/mcp/skyramp/traceRecordingBackend.js +17 -26
- package/package.json +2 -2
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { getPersonaPrefix } from "../personas.js";
|
|
2
2
|
import { AUTH_TYPES_PROMPT_LIST } from "../../utils/workspaceAuth.js";
|
|
3
|
-
export const INIT_WORKSPACE_INSTRUCTIONS = `${getPersonaPrefix()}Your task is to scan this repository, discover ALL services, and call the
|
|
4
|
-
|
|
5
|
-
After scanning the workspace, before calling the \`skyramp_init_workspace\` tool, you MUST:
|
|
6
|
-
|
|
7
|
-
**1. Output a \`<thinking>\` block** to justify the reasoning behind each field mapping for every discovered service.
|
|
8
|
-
|
|
9
|
-
**2. Then output a Discovery Summary** with the exact services array you will pass to the tool:
|
|
3
|
+
export const INIT_WORKSPACE_INSTRUCTIONS = `${getPersonaPrefix()}Your task is to scan this repository, discover ALL services, and call the skyramp_init_workspace tool with the discovered services array and the scanToken.
|
|
10
4
|
|
|
5
|
+
After scanning the workspace, before calling the skyramp_init_workspace tool, you MUST:
|
|
6
|
+
1. Output a <thinking> block to justify the reasoning behind each field mapping for every discovered service. Follow the scanning sections first, then field definitions, then verification.
|
|
7
|
+
2. Then output a Discovery Summary with the exact services array you will pass to the tool:
|
|
11
8
|
\`\`\`json
|
|
12
9
|
[
|
|
13
10
|
{
|
|
@@ -18,160 +15,160 @@ After scanning the workspace, before calling the \`skyramp_init_workspace\` tool
|
|
|
18
15
|
"api": { "schemaPath": "<path-or-url>", "baseUrl": "<url>", "authType": "<type>", "authHeader": "<header>" },
|
|
19
16
|
"runtimeDetails": { "runtime": "<runtime>", "serverStartCommand": "<command>", "dockerNetwork": "<network>" }
|
|
20
17
|
}
|
|
21
|
-
// ... one entry per discovered service
|
|
22
18
|
]
|
|
23
19
|
\`\`\`
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
### List all top-level directories
|
|
22
|
+
<list_directories>
|
|
27
23
|
Run a directory listing of the workspace root. Every top-level directory is a potential service. Common layouts:
|
|
28
|
-
|
|
29
24
|
| Layout | Example dirs | Expect |
|
|
30
25
|
|--------|-------------|--------|
|
|
31
26
|
| Monorepo | apps/web, apps/api, packages/shared | 1 service per app |
|
|
32
27
|
| Microservices | services/auth, services/orders | 1 service per service dir |
|
|
33
28
|
| Single service | src/, lib/ | 1 service (the root) |
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- package.json
|
|
41
|
-
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
30
|
+
If the repo is a monorepo, check for workspace manifests BEFORE scanning individual directories:
|
|
31
|
+
1. JavaScript/TypeScript monorepos:
|
|
32
|
+
- If pnpm-workspace.yaml exists, read the packages array to find all package directories (for example, ["apps/*", "packages/*"]).
|
|
33
|
+
- If turbo.json exists, read the root package.json workspaces field to enumerate all packages.
|
|
34
|
+
- If lerna.json exists, read the packages array in lerna.json (for example, ["packages/*"]).
|
|
35
|
+
- If the root package.json has a "workspaces" field, use the glob patterns to identify all packages.
|
|
36
|
+
- If nx.json exists, scan the projects in nx.json or project.json files in subdirectories.
|
|
37
|
+
2. Java monorepos:
|
|
38
|
+
- If a parent pom.xml has a <modules> section, each listed module is a separate service (Maven multi-module project).
|
|
39
|
+
- If settings.gradle or settings.gradle.kts has include statements, each included project is a separate service (Gradle multi-project).
|
|
40
|
+
3. Python monorepos:
|
|
41
|
+
- If a pyproject.toml has a [tool.poetry.packages] or [tool.setuptools.packages] section with multiple paths, each is a potential service.
|
|
42
|
+
- If multiple directories each contain their own pyproject.toml or requirements.txt, treat each as an independent service.
|
|
43
|
+
When any of these exist, use the workspace manifest to enumerate ALL packages and apps. Each package with its own server entry point, API routes, or UI framework is a separate service. Do NOT skip frontend packages. A Next.js app, React SPA, or Vue app in the monorepo is a service.
|
|
44
|
+
</list_directories>
|
|
45
|
+
|
|
46
|
+
### Inspect every candidate directory
|
|
47
|
+
<inspect_directories>
|
|
48
|
+
For each top-level directory, check for service indicator files.
|
|
49
|
+
|
|
50
|
+
Language indicators (presence of any means an independent service):
|
|
51
|
+
1. package.json indicates typescript or javascript
|
|
52
|
+
2. requirements.txt, pyproject.toml, or Pipfile indicates python
|
|
53
|
+
3. pom.xml or build.gradle indicates java
|
|
54
|
+
|
|
55
|
+
Test framework (look inside the service directory):
|
|
56
|
+
1. playwright.config.* indicates playwright
|
|
57
|
+
2. pytest.ini, conftest.py, or pyproject.toml [tool.pytest] indicates pytest
|
|
58
|
+
3. junit in pom.xml indicates junit
|
|
59
|
+
|
|
60
|
+
API schemas (look inside the service directory and check known framework defaults):
|
|
61
|
+
1. openapi.json/yaml or swagger.json/yaml provides the schema file path
|
|
62
|
+
2. FastAPI projects serve the schema at http://localhost:{port}/openapi.json
|
|
63
|
+
3. Express with swagger-ui serves at http://localhost:{port}/api-docs
|
|
64
|
+
4. Spring Boot serves at http://localhost:{port}/v3/api-docs
|
|
65
|
+
</inspect_directories>
|
|
66
|
+
|
|
67
|
+
### Check root-level runtime config
|
|
68
|
+
<runtime_config>
|
|
57
69
|
Inspect the repo root (and subdirectories like .devcontainer/) for shared runtime configuration:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
- Every service has \`api.baseUrl\` set to a valid, discoverable URL — localhost for local services, or the actual deployment URL for cloud/external services. Never fabricate a URL.
|
|
164
|
-
- Every service with \`authType: apiKey\` has \`authHeader\` explicitly set to the actual custom header name (e.g. \`"X-API-Key"\`, \`"X-Admin-Key"\`). If you cannot find the header name in the source code, env vars, or README, do NOT use \`authType: apiKey\` — use \`authType: none\` and add a YAML comment explaining auth is unresolved.
|
|
165
|
-
- \`framework\` matches \`language\` (python → pytest/robot | typescript/javascript → playwright | java → junit)
|
|
166
|
-
- \`testDirectory\` follows the stable resolution rules above: framework config file when present (Playwright: \`testDir\` in playwright.config.ts | pytest: \`testpaths\` in pytest.ini/pyproject.toml | JUnit: test source dir in pom.xml/build.gradle); otherwise the deterministic default (\`tests/\` for a single service, \`tests/<serviceName>\` for multiple services).
|
|
167
|
-
- \`serverStartCommand\` matches \`runtime\`
|
|
168
|
-
- For services in docker-compose.yml: runtime MUST be "docker" and command MUST be a docker command (e.g. "docker compose up -d <service-name>").
|
|
169
|
-
- NEVER use application-level commands (uvicorn, npm, node, python, java, etc.) with runtime "docker".
|
|
170
|
-
- \`dockerNetwork\` is set only when runtime is "docker"
|
|
171
|
-
- \`k8sNamespace\` and \`k8sContext\` are set only when runtime is "k8s"
|
|
172
|
-
|
|
173
|
-
Once verified, call \`skyramp_init_workspace\` with:
|
|
174
|
-
- \`workspacePath\`: the repository root path
|
|
175
|
-
- \`services\`: the array built above
|
|
176
|
-
- \`scanToken\`: the token returned by the first call to \`skyramp_init_workspace\` (called with only workspacePath)
|
|
177
|
-
- \`force\`: defaults to false — only set to true if the user explicitly asks to overwrite an existing \`.skyramp/workspace.yml\``;
|
|
70
|
+
1. CLAUDE.md or AGENTS.md: if either file exists at the repo root, check it for dev/test/CI setup instructions including how to start services, required environment variables, and runtime configuration.
|
|
71
|
+
2. Docker Compose files: scan for ALL compose files including docker-compose.yml, docker-compose.yaml, docker-compose.*.yml (such as docker-compose.testbot.yml or docker-compose.dev.yml), compose.yml, and compose.*.yaml in the repo root and subdirectories. Distinguish between application compose files and infrastructure-only compose files. Infrastructure compose files contain only supporting services like databases, Redis, Minio, mail servers, or message queues and do NOT run the application itself. Application compose files contain the actual application services that build from the repo source code (look for "build:" directives pointing to the repo, or services that map to discovered application directories). Only use application compose files for determining runtime and serverStartCommand. When a non-default compose file is found, the serverStartCommand must reference it explicitly (such as "docker compose -f docker-compose.testbot.yml up -d <service-name>"). Docker Compose ALWAYS prefixes the network name with the project name. If compose has "networks: { my-net: ... }", the actual network name is "<project-name>_my-net". If there is no explicit networks section, the default network is "<project-name>_default". The project name is the basename of the working directory where docker compose runs.
|
|
72
|
+
3. Makefile: extract start and dev targets.
|
|
73
|
+
4. Root package.json scripts: extract workspace-level commands.
|
|
74
|
+
</runtime_config>
|
|
75
|
+
|
|
76
|
+
### Build the complete services array
|
|
77
|
+
<build_services>
|
|
78
|
+
Create one service entry per deployable unit. You MUST include every backend/API service (Python, Java, Go, Node.js) and every frontend service (React, Vue, Angular, Next.js). Set runtime fields from docker-compose.yml if present.
|
|
79
|
+
</build_services>
|
|
80
|
+
|
|
81
|
+
### Basic fields
|
|
82
|
+
<basic_fields>
|
|
83
|
+
1. serviceName (required): A unique identifier for the service. Use the format <repoName>-<serviceName>-<frontend or backend> for consistency. For example: directus-api-backend, directus-app-frontend. For single-service repos where the service directory is the root, omit the directory portion such as onlineBoutique-frontend.
|
|
84
|
+
2. language (required): One of python, typescript, javascript, or java. Detect from package.json (typescript or javascript), requirements.txt or pyproject.toml (python), or pom.xml or build.gradle (java).
|
|
85
|
+
3. framework (required): One of playwright, pytest, robot, or junit. Detect from pytest.ini, playwright.config, jest.config, or junit in pom.xml. The framework MUST match the language: python uses pytest or robot, typescript or javascript uses playwright, and java uses junit.
|
|
86
|
+
4. testDirectory (required): A stable path relative to the repo root where generated tests for this service will be placed. For each service, use the test directory configured by that service's test framework when one is discoverable:
|
|
87
|
+
- Playwright: Read playwright.config.ts (or .js/.mjs) and extract the testDir value.
|
|
88
|
+
- pytest: Read pytest.ini, pyproject.toml [tool.pytest.ini_options], or setup.cfg [tool:pytest] for testpaths.
|
|
89
|
+
- JUnit: Usually src/test/java. Check pom.xml or build.gradle for custom test source directories.
|
|
90
|
+
If no framework-configured test directory is available, use the Skyramp deterministic fallback:
|
|
91
|
+
- Single service: set testDirectory to tests/skyramp.
|
|
92
|
+
- Multiple services or monorepos: set testDirectory to tests/skyramp/<serviceDirName>, where <serviceDirName> is the service directory name with path separators and whitespace replaced by hyphens.
|
|
93
|
+
Framework config takes precedence. Use the Skyramp deterministic fallback only when no framework-configured test directory is available.
|
|
94
|
+
</basic_fields>
|
|
95
|
+
|
|
96
|
+
### API fields
|
|
97
|
+
<api_fields>
|
|
98
|
+
1. api.schemaPath: Path or URL to an OpenAPI or Swagger schema. Search for openapi.json, openapi.yaml, swagger.json, or swagger.yaml files. Framework defaults are: FastAPI serves /openapi.json, Express serves /api-docs, and Spring serves /v3/api-docs. For locally-run services, use a localhost URL. For cloud or externally hosted services (such as Salesforce, Vercel, or Cloudflare), use the actual deployment URL found in config or documentation.
|
|
99
|
+
2. api.baseUrl (required): The base URL where the service is reachable, such as "http://localhost:3000" or "https://api.example.com". Derive from docker-compose ports, app config, README, or environment variables. Use localhost for services run locally and the actual deployment URL for cloud or externally hosted services. NEVER fabricate a URL. Only use URLs found in config files, README, or environment variables.
|
|
100
|
+
3. api.authType (required): The authentication type. Valid values are: ${AUTH_TYPES_PROMPT_LIST}
|
|
101
|
+
Detect by checking in the following order (language-agnostic, apply whichever signals match):
|
|
102
|
+
a. Dependencies and packages (package.json, requirements.txt, go.mod, Gemfile, composer.json, pom.xml, build.gradle):
|
|
103
|
+
- jsonwebtoken, passport-jwt, @nestjs/jwt, jose, fastapi[security], PyJWT, python-jose, github.com/golang-jwt/jwt, jjwt, or spring-security-oauth2 indicates bearer. Spring exception: if spring-security is present but the security config uses HttpSecurity.formLogin() or sessionManagement() without a JwtDecoder bean, the actual auth is session cookies so use cookie. Check the SecurityConfig or WebSecurityConfigurerAdapter class before assigning bearer to any Spring service.
|
|
104
|
+
- passport-http or Spring basic auth indicates basic.
|
|
105
|
+
- passport-oauth2, openid-client, doorkeeper, keycloak-connect, spring-security-oauth2-resource-server, or github.com/coreos/go-oidc indicates oauth.
|
|
106
|
+
- rest_framework with TokenAuthentication or djangorestframework-simplejwt (Token scheme) indicates token.
|
|
107
|
+
- express-session, cookie-session, iron-session, next-auth, gorilla/sessions, or laravel/session indicates cookie.
|
|
108
|
+
- laravel/sanctum or laravel/passport on API routes indicates bearer; on frontend web routes indicates cookie.
|
|
109
|
+
b. Environment variables (.env, docker-compose, README):
|
|
110
|
+
- JWT_SECRET, ACCESS_TOKEN_SECRET, FIREBASE_SECRET, or SUPABASE_JWT_SECRET indicates bearer.
|
|
111
|
+
- API_KEY, X_API_KEY, ADMIN_KEY, or SERVICE_KEY (used as header value, not JWT signing) indicates apiKey.
|
|
112
|
+
- CLIENT_ID paired with CLIENT_SECRET, OAUTH_CLIENT_*, or OIDC_* indicates oauth.
|
|
113
|
+
- SESSION_SECRET, COOKIE_SECRET, or NEXTAUTH_SECRET indicates cookie.
|
|
114
|
+
c. Source code and middleware patterns (auth, middleware, or security config files):
|
|
115
|
+
- Node/Express: req.headers.authorization split "Bearer" indicates bearer. "Authorization: Token" indicates token. Custom header check indicates apiKey. Session or cookie middleware indicates cookie.
|
|
116
|
+
- FastAPI/Starlette: HTTPBearer, OAuth2PasswordBearer, or Depends(get_current_user) indicates bearer. SessionMiddleware indicates cookie.
|
|
117
|
+
- Django/DRF: TokenAuthentication indicates token. JWTAuthentication indicates bearer. SessionAuthentication indicates cookie.
|
|
118
|
+
- Spring: JwtDecoder or JwtAuthenticationFilter indicates bearer. HttpSecurity.formLogin() with sessions indicates cookie.
|
|
119
|
+
- Go: ParseWithClaims or GetHeader("Authorization") indicates bearer. gorilla/sessions indicates cookie.
|
|
120
|
+
- Rails: authenticate_or_request_with_http_token indicates bearer. before_action :authenticate_user! (Devise) indicates cookie.
|
|
121
|
+
- Laravel: auth:sanctum on API indicates bearer. middleware("auth") on web indicates cookie.
|
|
122
|
+
- Rust/Axum: Authorization<Bearer> extraction indicates bearer.
|
|
123
|
+
d. Query-parameter auth: Some APIs pass credentials as a URL query param rather than a header (such as ?key=<key>, ?api_key=<key>, or ?access_token=<token>). Signals include source code reading credentials from req.query.key, request.query_params["api_key"], or @RequestParam("token"), and API docs or README showing auth examples like /endpoint?key=<your-key>.
|
|
124
|
+
e. Fallback: For frontend or UI services, use none. For backend APIs with no header-based auth signals, use bearer.
|
|
125
|
+
4. api.authHeader: The exact HTTP header name carrying the credential.
|
|
126
|
+
- For bearer, basic, oauth, or token: always "Authorization" (inferred automatically, so you may omit it).
|
|
127
|
+
- For cookie or session: always "Cookie" (also inferred automatically).
|
|
128
|
+
- For apiKey: this is required. Set to the actual custom header name such as "X-API-Key" or "X-Admin-Key".
|
|
129
|
+
- For none: set authHeader to "".
|
|
130
|
+
5. api.authScheme: The Authorization header prefix (the word before the token). Standard types derive this automatically: bearer uses "Bearer", token uses "Token", and basic uses "Basic". Set explicitly only for custom or non-standard schemes (for example, Hawk uses "Hawk" and Digest uses "Digest"). Omit for cookie, session, or apiKey since they do not use the Authorization header.
|
|
131
|
+
</api_fields>
|
|
132
|
+
|
|
133
|
+
### Runtime fields
|
|
134
|
+
<runtime_fields>
|
|
135
|
+
1. runtimeDetails.runtime (required): One of local, docker, or k8s. Detect per service:
|
|
136
|
+
- If the service is listed in an application docker compose file (one that builds or runs the application, not infrastructure-only files containing only databases, caches, or queues) or has a Dockerfile as its intended run method, use "docker".
|
|
137
|
+
- If k8s manifests exist (charts/, k8s/, deploy/), use "k8s".
|
|
138
|
+
- If the service has no Docker or k8s configuration and is run directly via a language runtime (npm, python, java, etc.), use "local".
|
|
139
|
+
A repo may have MIXED runtimes. A backend in docker-compose.yml uses "docker" while a frontend run with pnpm or npm locally uses "local". Include ALL services regardless of runtime.
|
|
140
|
+
If the frontend is bundled inside the API Docker container (no separate frontend service in the compose file), both frontend and backend services should use runtime "docker", share the same baseUrl (the container's exposed URL), and use the same serverStartCommand since they run in the same container.
|
|
141
|
+
2. runtimeDetails.serverStartCommand: The command to start or deploy the service. It MUST match the runtime:
|
|
142
|
+
- For "docker" runtime: Use a Docker command such as "docker compose up -d <service-name>" for the default docker-compose.yml, or "docker compose -f <compose-file> up -d <service-name>" when using a non-default compose file. This is always derivable from the application docker compose file and service name.
|
|
143
|
+
- For "k8s" runtime: Use a deploy command such as "kubectl apply -f deploy/", "helm install myrelease .", or "skaffold run". This is always derivable from the manifests or charts present in the repo.
|
|
144
|
+
- For "local" runtime: Use an application command such as "uvicorn main:app", "npm run dev", or "java -jar app.jar". Derive from Makefile, package.json scripts, or README. If no start command is discoverable, omit this field entirely.
|
|
145
|
+
NEVER mix runtime types with incompatible commands (for example, using "uvicorn" with runtime "docker" will cause errors). For "local" runtime, NEVER fabricate a command. Only use commands found in Makefile, package.json scripts, or README.
|
|
146
|
+
3. runtimeDetails.dockerNetwork: Docker network name. ONLY set when runtime is "docker". NEVER set for "local" or "k8s".
|
|
147
|
+
4. runtimeDetails.k8sNamespace: Kubernetes namespace. ONLY set when runtime is "k8s". NEVER set for "local" or "docker".
|
|
148
|
+
5. runtimeDetails.k8sContext: Kubernetes context. ONLY set when runtime is "k8s". NEVER set for "local" or "docker".
|
|
149
|
+
</runtime_fields>
|
|
150
|
+
|
|
151
|
+
### Verification
|
|
152
|
+
<verification>
|
|
153
|
+
Before calling skyramp_init_workspace, confirm all of the following:
|
|
154
|
+
1. Always scan the repo and find services. A repo should have at least one service.
|
|
155
|
+
2. ALL services are included, both backend and frontend. The workspace config is a complete registry of the entire repo, not just the service relevant to your current task. A fullstack or monorepo MUST have multiple services. If you found only one, re-scan every top-level directory before proceeding.
|
|
156
|
+
3. Services NOT in docker-compose.yml (such as a frontend run with pnpm or npm locally) MUST still be included with runtime "local".
|
|
157
|
+
4. Every service has api.baseUrl set to a valid, discoverable URL. Use localhost for local services or the actual deployment URL for cloud or external services. Never fabricate a URL.
|
|
158
|
+
5. Every service with authType apiKey has authHeader explicitly set to the actual custom header name (such as "X-API-Key" or "X-Admin-Key"). If you cannot find the header name in the source code, env vars, or README, do NOT use authType apiKey. Use authType none instead and add a YAML comment explaining auth is unresolved.
|
|
159
|
+
6. framework matches language (python uses pytest or robot, typescript or javascript uses playwright, java uses junit).
|
|
160
|
+
7. testDirectory follows the stable resolution rules above: framework config file when present (Playwright testDir in playwright.config.ts, pytest testpaths in pytest.ini or pyproject.toml, JUnit test source dir in pom.xml or build.gradle); otherwise the deterministic default (tests/skyramp for a single service, tests/skyramp/<serviceDirName> for multiple services).
|
|
161
|
+
8. If serverStartCommand is provided, it matches the runtime.
|
|
162
|
+
9. For services in docker-compose.yml: runtime MUST be "docker" and the command MUST be a docker command such as "docker compose up -d <service-name>". Always include it since it is derivable from the service name.
|
|
163
|
+
10. NEVER use application-level commands (uvicorn, npm, node, python, java, etc.) with runtime "docker".
|
|
164
|
+
11. For "local" runtime: if no start command is discoverable from Makefile, package.json scripts, or README, omit serverStartCommand rather than guessing.
|
|
165
|
+
12. dockerNetwork is set only when runtime is "docker".
|
|
166
|
+
13. k8sNamespace and k8sContext are set only when runtime is "k8s".
|
|
167
|
+
14. If force-recreating a workspace.yml due to a schema validation error, correct the schema error but keep any valid system-under-test setup (serviceName, baseUrl, auth config, runtime details) as it is.
|
|
168
|
+
</verification>
|
|
169
|
+
|
|
170
|
+
Once verified, call skyramp_init_workspace with:
|
|
171
|
+
- workspacePath: the repository root path
|
|
172
|
+
- services: the array built above
|
|
173
|
+
- scanToken: the token returned by the first call to skyramp_init_scan
|
|
174
|
+
- force: defaults to false. Set to true only if the user explicitly asks to overwrite an existing .skyramp/workspace.yml, or if the existing file must be regenerated due to a validation failure such as a schema mismatch, unknown fields, or a parse error.`;
|