skills/arkts-sta-playground/SKILL.md
Execute ArkTS-Sta code snippets and files via the Playground HTTP API. Use this for testing ArkTS syntax, learning ArkTS features, verifying code logic, or demonstrating code execution results.
npx skillsauth add openharmonyinsight/openharmony-skills arkts-sta-playgroundInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill runs ArkTS-Sta code using the ArkTS-Sta Playground HTTP API, providing fast and reliable code execution without browser automation.
Run an ArkTS-Sta file:
python3 scripts/run_playground.py path/to/code.ets
Run code directly as a string:
python3 scripts/run_playground.py --code "let x: number = 42; console.log(x);"
Get JSON output for programmatic parsing:
python3 scripts/run_playground.py --json --code "console.log('Hello');"
Install Python dependencies:
pip install -r scripts/requirements.txt
Required package: requests>=2.31.0
When testing ArkTS-Sta syntax or verifying code logic:
python3 scripts/run_playground.py --code "
enum Numbers {
A = 10,
B = 2.57,
C = 0x2B7F,
D = -1.5,
E = 12
}
"
For testing multiple files:
for file in test/*.ets; do
python3 scripts/run_playground.py --json "$file" > "results/$(basename $file .ets).json"
done
The script uses the HTTP API endpoint:
https://arkts-play.cn.bz-openlab.ru:10443/compileBase URL: https://arkts-play.cn.bz-openlab.ru:10443/compile
Method: POST
Request:
{
"code": "your ArkTS-Sta code here"
}
Response:
{
"output": "execution output or empty",
"error": "error message if compilation failed, null otherwise"
}
If you get connection errors:
# Test connectivity
curl -X POST https://arkts-play.cn.bz-openlab.ru:10443/compile \
-H "Content-Type: application/json" \
-d '{"code":"let x: number = 42;"}'
Increase timeout if the API is slow:
python3 scripts/run_playground.py --timeout 60 path/to/code.ets
If you encounter SSL certificate issues, you may need to:
Test and explore ArkTS language features:
python3 scripts/run_playground.py --code "
// Test union types
let value: string | number = 'hello';
value = 42;
console.log(value);
"
Verify code logic before integrating into your project:
python3 scripts/run_playground.py --code "
function calculateSum(a: number, b: number): number {
return a + b;
}
console.log('Sum:', calculateSum(10, 20));
"
Find compilation errors in your code:
# Run with JSON output for programmatic checking
python3 scripts/run_playground.py --json problem.ets
# Check exit status
if python3 scripts/run_playground.py code.ets; then
echo "Compilation successful"
else
echo "Compilation failed"
fi
The script returns a JSON structure (with --json flag):
{
"success": true,
"output": "Execution result here...",
"error": null,
"has_error": false
}
Fields:
success: Boolean indicating if the API request succeededoutput: Code output or compilation outputerror: Error message if compilation failed, null otherwisehas_error: Boolean indicating if the code has compilation errorsTest if enum with non-integer values causes errors:
python3 scripts/run_playground.py --code "
enum Numbers {
A = 10,
B = 2.57,
C = 0x2B7F,
D = -1.5,
E = 12
}
"
Expected result: Should fail with an error about enum values needing to be integers.
--json)testing
--- name: ohos-req-value-decision description: Use after review meeting to record decision and route to next step. Triggers: 评审决策纪要, 评审结论回流, value decision, 评审接纳, 评审不接纳, 评审退回, 下次重新上会. Do NOT use for feature baseline (ohos-req-feature-baseline), review gate checks (ohos-req-review-gate), or IR generation (ohos-req-feature-to-ir). metadata: author: openharmony scope: common stage: requirements capability: value-decision version: 0.3.0 status: draft tags: - sdd - requirements
development
Use when converting an OpenHarmony requirement document, spec, or design proposal into an OpenHarmony review slide deck (需求评审 / 需求变更评审 / 设计评审 PPTX) — produces the fixed OpenHarmony-branded review-deck structure (OH logo on every page) with architecture/flow diagrams and field tables. Triggers on "需求评审PPT", "需求变更评审", "把需求文档转成评审PPT", "spec转评审PPT", "requirement/spec to review deck". NOT for arbitrary or generic slide decks unrelated to OpenHarmony requirement/design review.
testing
Use when performing the Phase 0 Step 0.5 Review Ready Gate on a 04-feature.md, especially when the user says "evaluate gate", "review readiness", "feature ready?", "should we generate IR", or when the ohos-req-intake-orchestration main session needs a structured Ready / Conditional Ready / Not Ready judgment instead of doing the check inline. Reads 01-04, runs seven fixed checks plus a conditional-items check, and returns a machine-readable JSON summary plus a human-readable table that the main session can route on. Do NOT use for feature baseline generation (ohos-req-feature-baseline), value decision recording (ohos-req-value-decision), or IR generation (ohos-req-feature-to-ir).
testing
--- name: ohos-req-requirement-intake description: Use when importing an OHOS requirement into Phase 0.1, especially for 01-requirement.md, requirement intake, background, user value, scenarios, scope, FR/NFR, affected modules, or priority. Triggers: 需求导入, 01-requirement, 需求基线, RR单号. Do NOT use for feasibility analysis (ohos-req-feasibility-analysis), architecture decision (ohos-req-arch-decision), or feature baseline (ohos-req-feature-baseline). metadata: author: openharmony scope: common