Index of every page on this site: llms.txt
All skills
surgepix avatar

/surgepix-query-task

@eb31c56
Run it yourself

Query or poll SurgePix async task status and get task results (download URL). Use when the user says "check task", "poll task", "query task status", "任务进度", "查任务", has a taskId from remove-background, image-translate, generate-illustrations, generate-xhs or other async API, or needs to wait for a task to finish. Output rule: taskResult has only ONE download field. When download is a ZIP or resultType is zip, show ONLY that ZIP URL; NEVER fabricate individual image links.

Use this Skill: https://skilld.dev/gh/surgepix/agent-skills/surgepix-query-task

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈128 tokens for metadata: the name and description. ≈924 when used: this file.

Description uses 6.2% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈497 characters, or 6.2%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

SurgePix Query Task

Query task progress via GET /tasks/{taskId} once and print the current status. This skill does not poll — it returns the task's current state in a single call; re-run it later to check again.

Language consistency

This skill does not generate content. Reply to the user in the same language they used in their request. When presenting a ZIP download URL from upstream skills, do not fabricate per-image links.

When to use

  • User has a taskId from an async SurgePix API (e.g. remove-background / generate-poster / generate-presentation / image-translate 在 --nowait true 时返回的 taskId)
  • User says "check task status", "poll task", "查任务进度", "任务完成了吗"
  • After submitting an async task, need to check whether the download URL is ready
  • 上游技能以 --nowait true(异步)方式运行,返回 {"async":true,"taskId":...} 后,用本技能在合适时机查询该任务(单次查询;未完成则稍后再查)

Prerequisites

  • Node.js >= 18
  • SURGEPIX_API_KEY configured (see Step 0)

Workflow

Step 0: Check environment (required)

node "<skills-dir>/surgepix-setup/scripts/check_env.mjs"
  • Exit 0 → proceed
  • Exit 1 → follow surgepix-setup skill first

Step 1: Get taskId

The user should provide a task ID returned by an async API, e.g.:

{"taskId":"task_a1b2c3d4e5f6","progress":"processing"}

If the user just submitted remove-background / generate-poster / generate-presentation / image-translate 以 --nowait true(异步)模式运行,use the taskId from that response(响应中 async:true)。

Step 2: Query (single call, no polling)

Check the current status once and print the result:

node "<skills-dir>/surgepix-query-task/scripts/query_task.mjs" "<taskId>"
Argument Description
<taskId> Task ID from an async API (e.g. task_abc123)

This skill performs a single query and prints the current status — it does not poll/wait. If the task is still processing, simply run the command again later to check.

Step 3: Parse output

Success (stdout):

{"ok":true,"taskId":"task_xxx","sessionId":123,"progress":"succeeded","download":"<DOWNLOAD_URL>","taskResult":{"download":"<DOWNLOAD_URL>"}}

Still processing:

{"ok":true,"taskId":"task_xxx","sessionId":123,"progress":"processing","download":null,"taskResult":null}

→ Wait a bit and run the same command again to re-check.

Failure (stderr):

{"ok":false,"error":"Task not found: task_xxx"}

Step 4: Present result

progress Meaning Action
processing Still running Re-run the query later to check again
succeeded Done Show download URL
failed Failed Tell user, no download available

Typical flow with async skills

适用于 remove-background / generate-poster / generate-presentation / image-translate 以 --nowait true 运行:

1. <skill> --nowait true → returns {"async":true,"taskId":...}
2. query_task.mjs <taskId> → prints current status (download URL once succeeded)
3. 若仍为 processing,稍后重复第 2 步再查,直到 succeeded / failed

若上游技能以 --nowait false(默认,同步)运行,脚本内部已轮询并直接返回 download,无需再调用本技能。

Rules

  • ALWAYS run check_env before first use
  • NEVER invent taskId — only use IDs from API responses
  • NEVER invent download URLs — only use download from script output
  • Task status is retained for 24 hours; expired tasks return 404

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    This skill is a standard API client for the SurgePix platform. It allows the agent to check the progress of background tasks by making authenticated requests to the SurgePix API using a user-provided API key and base URL. No malicious behavior or security risks were identified.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at eb31c56. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 weeks ago.

Activeupdated 3 months ago

README badge

README badge for surgepix/agent-skills/surgepix-query-task