Let the Agent directly call the activity Agent submission API(AK/SK authentication) to complete result submission (without any page/browser operations), and after successful submission, notify the user of the corresponding step points already earned.
Overview
This Skill lets the Agent directly call the Huawei Cloud "Open Capability Challenge" (activity_code = open-capability-2026-1024) 's Agent submission API(AK/SK authentication), automatically submitting the work link generated by the activity to the corresponding step, and reporting the points earned after success.
Core Features:
- Pure API calls: no page/browser operations involved; directly POST to the submission API.
- Fixed production environment: this skill always uses the production environment API and does not switch environments.
- Two-step sequential submission:
beginner(sandbox deployment, 1000 points) →intermediate(ECS persistent deployment, 2000 points). - AK/SK authentication: authenticated via request headers
X-HW-AK/X-HW-SK/X-HW-Security-Token, no dependency on hcloud CLI. - Additional request headers for ECS step:
intermediate, carried when submittingX-HW-PROJECT-ID/X-HW-REGION。 - Pure Node.js script:
submit.mjs(Node ≥ 18, no external dependencies), does not use KooCLI. - Optional exhibition hall publishing: always ask after sandbox deployment; if not published, ask again after ECS; if already published, do not ask again.
- Resource cleanup reminder: after successful ECS submission, remind the user to clean up pay-as-you-go resources.
When to Use
- When the user says "submit the work/result/sandbox link to the activity", "help me submit the challenge result", "submit the sandbox domain/public address", etc.
- When the activity has generated a sandbox work link (frontend site) and/or ECS public address that needs to be submitted to the corresponding step.
- Only for the activity
activity_code = open-capability-2026-1024。
Submission API
| Item | Value |
|---|---|
| Base address (production, fixed) | https://open-dataset.huaweicloud.com/api/v1/hdopenservice/agent |
| Submit | POST {base}/submit-activity-work |
Frontend page uses
/user/...(SSO login session); Agent uses/agent/...(AK/SK request headers); both haveidentical request body and response. This skill always uses the production environmentbase address and does not switch environments.
Authentication (AK/SK request headers):
X-HW-AK(required): Huawei Cloud Access KeyX-HW-SK(required): Huawei Cloud Secret KeyX-HW-Security-Token(optional): required when using STS temporary credentials
Additional request headers for ECS step(only carried when submitting intermediate(ECS persistent deployment)):
X-HW-PROJECT-ID: Project ID of the ECSX-HW-REGION: region of the ECS (e.g.,cn-north-4)
Credential priority: command-line arguments > environment variables (
HW_ACCESS_KEY/HW_SECRET_KEY/HW_SECURITY_TOKEN, compatible withHUAWEICLOUD_SDK_AK/HUAWEICLOUD_SDK_SK/HUAWEICLOUD_SDK_SECURITY_TOKEN、HW_AK/HW_SK)。Never write credentials into the repository.
Submission request body(Content-Type: application/json, consistent with /user/submit-activity-work ):
{
"activity_code": "open-capability-2026-1024",
"milestone": "beginner | intermediate",
"work_link": "https://xxx.devbridge-s2.hwtunnel.com",
"api_link": "http://<ECS_EIP>/hc-activity/index.html",
"summary": "作品说明(可选,≤500 字)"
}
Fields by step:
beginner(sandbox deployment): pass onlywork_link(Sandbox site link)intermediate(ECS persistent deployment): pass onlyapi_link(ECS public access address,must includeindex.html, e.g.http://<EIP>/hc-activity/index.html)
Response:{ "code": "success", "message": "..." };code === "success" means submission succeeded.
Steps, field mapping, validation and points
Two steps, must bein ordersubmit:beginner(sandbox deployment) → intermediate(ECS persistent deployment); the next step can only be submitted after the previous step passes.
Field/value mapping (important): backend
milestonevaluesfollow the old versionbeginner/intermediate(the page copy has been renamed to "Sandbox Deployment / ECS Persistent Deployment"); the oldadvancedstephas been removed, and does not exist.
Page step milestonevalueSubmission field Sandbox deployment beginnerwork_linkECS persistent deployment intermediateapi_link
--milestonealso accepts aliases:sandbox→beginner、ecs→intermediate(the script normalizes automatically).
Sandbox domain regex (same as frontend SANDBOX_RE):^https:\/\/[^/]*devbridge-s2\.hwtunnel\.com(\/|$)
| Step | milestone | Must submit | Validation | Points after success |
|---|---|---|---|---|
| Sandbox deployment | beginner |
Sandbox site link (work_link) |
Sandbox domain | 1000 points (¥100) |
| ECS persistent deployment | intermediate |
Public access address (api_link) |
http(s):// starts withand includes index.html(e.g. http://<EIP>/hc-activity/index.html) |
2000 points (¥200) |
Operating steps (Agent execution)
- Collect the link: for the sandbox step, use the public sandbox domain (
https://xxx.devbridge-s2.hwtunnel.com, after deployment firstcurl -sI <URL>to verify 200); for the ECS step, use the ECS public HTML address (http://<EIP>/)。 - Determine the current step: determine according to the flow — first submit the sandbox (
beginner), and after the sandbox passes, submit ECS (intermediate); submit only the currently completed step. - Validate the link format: the script automatically validates before submission (sandbox domain,
http(s)://prefix andindex.html, description ≤500 characters); if it does not pass, the reason will be printed; correct it and submit again. - Execute submission: run
submit.mjs(see below). Parameters correspond to step fields (this skill always uses the production environment API). - Report back to the user:
- Success: prompt "Submission succeeded, you have earned {Sandbox Deployment / ECS Persistent Deployment} corresponding points {1000 / 2000} points", and state that this step is complete and the next step can be continued.
- Failure: feed back verbatim the
message(e.g.里程碑参数不合法、当前里程碑需提交接口地址、作品链接无效、缺少请求头 X-HW-AK)。
- Publish to the works exhibition hall (user optional, see next section):
beginnerafter (sandbox deployment) is submitted successfullyalways askwhether the user wants to publish the work tothe developer works exhibition hall's challenge activity(at this point the script resets the publish statusto false); if the userhas not published, then afterintermediate(ECS persistent deployment) is submitted successfullyask once more; if the sandbox stagehas been published(galleryPublished=true), then in the ECS stagedo not ask again. After successful publishingrunnode submit.mjs --gallery-publishedto record the status。 - Resource cleanup (after everything is complete):
intermediate(ECS persistent deployment) upon successful submission,allCompleted=true,you mustuse thequestiontool to ask the user whether to clean up thepay-as-you-go resourcescreated in this activity (options: clean up all / delete ECS only / do not clean up for now), then execute or skip according to the user's choice; the script will also print a cleanup reminder in the success output.
Script usage
The script is located in this skill directory:submit.mjs(pure Node, Node ≥ 18, no additional dependencies required).
# 1) 沙箱部署:提交沙箱域名 URL(milestone=beginner)
node submit.mjs --milestone beginner \
--work-link https://abcd1234-3000.devbridge-s2.hwtunnel.com \
--summary "2048 单文件小游戏"
# 2) ECS 持久化部署:提交公网访问地址(milestone=intermediate;链接需含 index.html;带 ECS 的 Project ID / region)
node submit.mjs --milestone intermediate \
--api-link http://<ECS_EIP>/hc-activity/index.html \
--project-id <PROJECT_ID> --region cn-north-4
Credentials can be provided via command-line arguments or environment variables:
# PowerShell
$env:HW_ACCESS_KEY = "<AK>"
$env:HW_SECRET_KEY = "<SK>"
$env:HW_SECURITY_TOKEN = "<使用 STS 临时凭证时填写>" # 可选
# 或直接:node submit.mjs --ak <AK> --sk <SK> [--security-token <token>]
Example success output (actually multi-line JSON):
{
"ok": true,
"milestone": "intermediate",
"label": "ECS 持久化部署",
"points": 2000,
"message": "...",
"allCompleted": true
}
提交成功,已获得ECS 持久化部署对应积分 2000 分。
Publishing to the developer works exhibition hall's challenge activity display (user optional)
When to ask:
beginner(sandbox deployment) after successful submission,always askwhether the user wants to publish to the works exhibition hall (the script at this point setsgalleryPublishedto false);- If the sandbox stagehas been published(has run
node submit.mjs --gallery-published, i.e.galleryPublished=true)→intermediate(ECS persistent deployment) stage,do not ask again; - If the sandbox stagewas not published(still false) →
intermediate(ECS) after successful submission,ask once more。
Whether to publish is decided by the user— publish only if they agree; if they decline, skip it and do not push. After successful publishing,run node submit.mjs --gallery-published to record the status。
Submit directly to this activity by default: works are by default submitted to the works exhibition hall's "challenge activity」,skip training camp selection, and no longer let the user choose a camp.
- Activity name:
闯关活动trainingCampId:47d6ba99-fca0-4797-947d-a8776f506df1
- Ask the user(using the
questiontool): whether to submit the work to thedeveloper works exhibition hall's challenge activitydisplay? (user optional, continue only with explicit consent; if they do not agree, end and do not push) - After the user agrees, execute:
npx skills add https://gitcode.com/Lingxi-HandsOn/gallery.git --skill publish-work-to-gallery -y 2>&1 - This command will install the
publish-work-to-galleryskill; thenfollow that skill's instructionsto collect and push the code produced by the user's local challenge task work (the actual directories of frontend, backend, and other projects) to the developer works exhibition hall's challenge activity. When publishing,usetrainingCampId=47d6ba99-fca0-4797-947d-a8776f506df1(challenge activity) by default。the code directory name is not fixed, so go by the directory the user actually generated/used this time; do not assume a fixed repository name. - If the user does not agree, skip this step and end directly.
Notes:
- When to ask:
beginner(sandbox deployment) after successful submission,always ask; if the userdid not publish, thenintermediate(ECS persistent deployment) after successful submissionAsk again; sandbox stagealready published(galleryPublished=true) then the ECS stagewill not ask again(consistent with step 6 of the procedure and the "asking timing" above). - Whether to submit to the exhibition hallis entirely up to the user; if the user refuses, skip it, and do not decide on the user's behalf.
- Before executing, confirm with the user or identify the actual code directories produced by the challenge tasks (frontend and backend projects;directory names are not fixed); push only the relevant code to avoid including unrelated files. This can be specified by the user, or determined by scanning the project directories generated in the current workspace.
- If
npx skills addrequires network access/installation, report the error truthfully on failure and let the user decide whether to retry.
Prerequisites
- Node.js ≥ 18: the submission script of this skill
submit.mjsuses nativefetch(), requiring Node 18 or later. - Huawei Cloud AK/SK: requires a valid Access Key and Secret Key for API authentication request headers. The SecurityToken of STS temporary credentials is optional.
- Credential source priority: command-line parameters > environment variables (
HW_ACCESS_KEY/HW_SECRET_KEY/HW_SECURITY_TOKEN, compatible withHUAWEICLOUD_SDK_AK/HUAWEICLOUD_SDK_SK/HW_AK/HW_SK)。
- Credential source priority: command-line parameters > environment variables (
- Additional parameters for the ECS stage:
intermediate(ECS persistent deployment) submission requires--project-idand--region(or the environment variableHW_PROJECT_ID/HW_REGION, or the hcloud configuration). - Network access: must be able to access the submission API base address (
https://open-dataset.huaweicloud.com)。 - Work link:
- Sandbox deployment stage (
beginner): requires a deployed sandbox domain (https://xxx.devbridge-s2.hwtunnel.comformat). - ECS persistent deployment stage (
intermediate): requires the ECS public network access address (includingindex.html, e.g.http://<EIP>/hc-activity/index.html)。
- Sandbox deployment stage (
- Does not use KooCLI: this skill directly calls the activity API with HTTP request header authentication and does not depend on the hcloud CLI, so the
--cli-regionparameter is not needed.
Notes
- Only call APIs, no page operations: do not drive a browser, do not simulate clicking page forms.
- Fixed environment, no switching: this skill always usesthe production environment; passing in
--env/--baseand other environment parameters will beignored(no error, no effect), and will not switch to another environment (for the test environment, please usehuawei-activity-submit-test)。 - Sequential submission: the stages must be submitted in the order
beginner(sandbox) →intermediate(ECS), and the API validates the order. - Additional request headers for the ECS stage:
intermediate(ECS persistent deployment) submission requiresX-HW-PROJECT-ID(the ECS Project ID) andX-HW-REGION(the ECS region); the script obtains the values through--project-id/--region(or the environment variableHW_PROJECT_ID/HW_REGION, or the hcloud configuration), and an error is reported if they are missing. - Strict sandbox domain validation:
beginner: the link for thehttps://xxx.devbridge-s2.hwtunnel.comstage must be a sandbox domain in the formintermediate; the public address submitted for thehttp(s)://stage must start withhttp://<EIP>/hc-activity/index.html(e.g.index.html); when - Credential security: AK/SK (and the SecurityToken for temporary credentials) are used only for this session; do not write them into a repository or commit them to version control; prefer passing them via environment variables to avoid plaintext appearing in command-line history.
- SK plaintext transmission note:
X-HW-SKTransmitting it in plaintext via request headers isthe active API's own design(/agent/*(the interface requires AK/SK headers), and relies on HTTPS transport encryption; do not write the SK into repositories or logs, or share it externally. - Submissions cannot be reused: once an address is submitted, it is bound to that account; do not submit the same link again.
Reference Documents
- references/iam-policies.md — IAM permission note (this skill uses AK/SK request-header authentication and does not depend on IAM policies)
- references/verification-method.md — Verification method (how to verify the submission feature end to end)
- references/acceptance-criteria.md — Acceptance criteria (objective acceptance conditions for production readiness)