Skip to content

Commit 3e28eca

Browse files
refactor(skill): extract capability reference into references/capabilities.md (#15)
Moves the capability field list, the per-field comparison policy (must-match / suggested-default / user-controlled), and the Appium-runtime opt-in special-case handling out of `SKILL.md` and into a new `references/capabilities.md`. Closes #5. Per Anthropic's progressive-disclosure convention for skills, the main SKILL.md should be orchestration-shaped ("how to think about the task") and detail content should live in `references/` ("the specific values to use"). Reference content is loaded on-demand by Claude when the topic becomes relevant, rather than on every skill invocation. Changes: Before: SKILL.md = 152 lines (capability list + comparison rules inline) After: SKILL.md = 137 lines (-15) references/capabilities.md = 57 lines (new) The two `references/capabilities.md` link-references in SKILL.md use the relative path `references/capabilities.md` (sibling subdirectory). The existing `references/templates/appium.ejs` is unchanged and still resolved by `scripts/render-capabilities.js` — `pnpm test` confirms the 8 render-capabilities test cases still pass against the template. Validate + test pass: $ pnpm run validate All checks passed. $ pnpm test Test Files 2 passed (2) Tests 22 passed (22) Signed-off-by: Jeremy Longshore <jeremy@intentsolutions.io> Co-authored-by: Jeremy Longshore <jeremy@intentsolutions.io>
1 parent 48b89a0 commit 3e28eca

2 files changed

Lines changed: 59 additions & 17 deletions

File tree

skills/run-automation-suite/SKILL.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,10 @@ Detect the language and runtime from the file extension:
6464
| `.cs` / `.csproj` | .NET | `dotnet test` |
6565
| `.java` | Java | `mvn test` or `java -cp ...` |
6666

67-
Read the script file and extract key capabilities from the source code:
68-
69-
- `platformName` (Android / iOS)
70-
- `udid` (hardcoded or parameterized)
71-
- `app` (app URL or kobiton-store reference)
72-
- `sessionName`, `sessionDescription`
73-
- `automationName` (UiAutomator2, XCUITest, etc.)
74-
- `browserName` (if browser-based test)
75-
- `deviceOrientation`
76-
- Any `kobiton:*` vendor extensions (especially `kobiton:runtime`)
67+
Read the script file and extract key capabilities from the source code. The full field list, the Appium-runtime opt-in special case, and the per-field comparison policy live in [`references/capabilities.md`](references/capabilities.md).
7768

7869
Identify how the UDID is passed into the script (CLI argument, environment variable, or hardcoded) so it can be overridden with the selected device.
7970

80-
**Appium runtime:** Check if the script contains `'kobiton:runtime': 'appium'` or equivalent. If it does NOT, do not inject it — the default Kobiton runtime will be used. Only if the user explicitly asks to use the Appium runtime should you suggest adding `'kobiton:runtime': 'appium'` to the script's capabilities.
81-
8271
**Validate capabilities:** After parsing the script, run the render script to generate the correct capabilities for the selected device and app:
8372

8473
```
@@ -94,11 +83,7 @@ node skills/run-automation-suite/scripts/render-capabilities.js \
9483

9584
For web testing, replace `--app <app>` with `--browserName <browser> --testingType web`.
9685

97-
Compare the JSON output against the parsed script capabilities:
98-
99-
- **Must-match** (`platformName`, `platformVersion`, `appium:udid`, `appium:deviceName`, `appium:app`/`browserName`, `appium:automationName`): If different, show what will change and edit the script automatically. These must match the selected device/app.
100-
- **Suggested defaults** (`kobiton:sessionName`, `kobiton:sessionDescription`, `kobiton:deviceOrientation`, `kobiton:captureScreenshots`, `appium:noReset`, `appium:fullReset`): If different or missing, show the diff and ask the user before changing. The user may have intentionally set different values.
101-
- **User-controlled**: Any capabilities in the user's script that are not in the rendered output — leave untouched. Never inject or modify `kobiton:runtime` unless the user explicitly asks.
86+
Apply the per-field comparison policy from [`references/capabilities.md`](references/capabilities.md) to reconcile the rendered output against the parsed script capabilities (must-match → auto-edit, suggested-default → ask, user-controlled → leave untouched).
10287

10388
### 4. Confirm & execute
10489

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Capabilities reference
2+
3+
This document is the reference for the capability fields the `run-automation-suite` skill parses from local Appium test scripts and reconciles against Kobiton device-cloud requirements.
4+
5+
The skill body in `SKILL.md` orchestrates the parsing flow; this reference catalogs the field set, the per-field comparison policy, and the Appium-runtime special-case handling. Loaded on-demand by Claude when capability-detail context is needed; not loaded as part of the default skill body.
6+
7+
## Capability fields parsed from the user's script
8+
9+
The skill extracts the following capability values from the test script source code:
10+
11+
| Field | Notes |
12+
|---|---|
13+
| `platformName` | Android / iOS |
14+
| `udid` | hardcoded or parameterized |
15+
| `app` | app URL or kobiton-store reference |
16+
| `sessionName`, `sessionDescription` | Kobiton session metadata |
17+
| `automationName` | UiAutomator2, XCUITest, etc. |
18+
| `browserName` | if browser-based test |
19+
| `deviceOrientation` | portrait / landscape |
20+
| Any `kobiton:*` vendor extensions | especially `kobiton:runtime` (see special-case section below) |
21+
22+
The skill identifies how the UDID is passed into the script (CLI argument, environment variable, or hardcoded) so it can be overridden with the device the user selected in workflow Step 2.
23+
24+
## Per-field comparison policy after rendering
25+
26+
After running `scripts/render-capabilities.js`, the skill compares the rendered JSON capabilities against the parsed script capabilities and applies one of three policies per field:
27+
28+
### Must-match (auto-edit)
29+
30+
Fields: `platformName`, `platformVersion`, `appium:udid`, `appium:deviceName`, `appium:app` / `browserName`, `appium:automationName`.
31+
32+
If different from the rendered output: show what will change and edit the script automatically. These must match the selected device and app — divergence will break the run.
33+
34+
### Suggested defaults (ask first)
35+
36+
Fields: `kobiton:sessionName`, `kobiton:sessionDescription`, `kobiton:deviceOrientation`, `kobiton:captureScreenshots`, `appium:noReset`, `appium:fullReset`.
37+
38+
If different from the rendered output or missing: show the diff and ask the user before changing. The user may have intentionally set different values.
39+
40+
### User-controlled (leave untouched)
41+
42+
Any capabilities in the user's script that are not in the rendered output. Never inject or modify `kobiton:runtime` unless the user explicitly asks (see special-case below).
43+
44+
## Appium runtime — special-case handling
45+
46+
Check if the script contains `'kobiton:runtime': 'appium'` or equivalent.
47+
48+
- If it does **NOT**, do not inject it. The default Kobiton runtime will be used.
49+
- Only if the user explicitly asks to use the Appium runtime should `'kobiton:runtime': 'appium'` be added to the script's capabilities.
50+
51+
This is a deliberate opt-in — silent injection of `kobiton:runtime` would change which test runner Kobiton dispatches and may produce surprising results for users who were relying on the default.
52+
53+
## Related references
54+
55+
- `references/templates/appium.ejs` — the EJS template `render-capabilities.js` consumes to emit the rendered capabilities JSON
56+
- `scripts/render-capabilities.js` — the renderer (the only runtime code in this skill); reads the template, applies CLI flags + defaults, emits JSON
57+
- `scripts/render-capabilities.test.js` — vitest suite for the renderer

0 commit comments

Comments
 (0)