跳到正文
FunCoding

搜索

搜索文档、Skill 和 MCP

yao-job

Background job management — start, monitor, wait, stop long-running commands. ALWAYS invoke this skill when the user asks to run background tasks, check job status, read job output, or manage long-running commands.

AI 与智能体8.1ktools/skills/yao-job/SKILL.md

安装

把这段话发给 Claude Code、Codex 或 Cursor。智能体会先检查安全性,你确认后才安装。

读取 https://funcoding.ai/skills/yaoapp/yao/yao-job/install.md ,按里面的步骤帮我安装这个 Skill。

SKILL.md

Background Jobs

Tools

  • yao_job_start — Start a command. background false (default) blocks until done and returns output_tail; background true returns job_id immediately.
  • yao_job_list — List jobs. Supports --status filter and --limit/--offset pagination.
  • yao_job_get — Get full details for a job (or daemon by ID).
  • yao_job_output — Read process output (works for both job and daemon IDs).
  • yao_job_wait — Block until a background job finishes or timeout expires. Jobs only, not daemons.
  • yao_job_stop — Kill a running job.

Parameters

yao_job_start

ParamRequiredDefaultDescription
commandyes—Shell command to execute
descriptionyes—Concise 5–10 word summary
backgroundnofalsetrue returns immediately; false blocks until done
argsno—Additional arguments (rarely needed; prefer inline in command)
working_dirnoworkspaceWorking directory
max_duration_msno—Kill the job after this many milliseconds

yao_job_list

ParamDefaultDescription
statusallFilter: running, stopping, completed, failed, cancelled, all
limit20Max items per page
offset0Skip first N items

yao_job_output

ParamRequiredDescription
job_idyesJob or daemon ID
offsetnoByte offset to read from (0 = beginning)

Output read behavior:

  • Returns all available content from offset in a single read (no limit parameter).
  • Ring buffer caps at 10 MB; older content beyond this is discarded.
  • When content has been discarded, lossy=true in the response.
  • size = total bytes the process has produced; offset = earliest readable byte position.
  • Example: a 20 MB output has size=20000000, offset≈10000000, lossy=true — the first ~10 MB was discarded.

yao_job_wait

ParamRequiredDefaultDescription
job_idyes—Job ID
timeout_msno60000Timeout in milliseconds

Response Fields

All responses are JSON. Job objects contain:

id, kind, session_id, status, description, background,
command, command_argv, command_line, pid, pgid, user,
started_at, finished_at, duration_ms, exit_code, signal, detail, seq

Foreground start (background=false)

Returns the job object plus output_tail (≤4KB tail of stdout+stderr):

{ "id": "job_...", "status": "completed", "exit_code": 0, ..., "output_tail": "hello world\n" }

List (paginated)

{ "jobs": [...], "total": 130, "offset": 0, "limit": 20, "has_more": true }

Wait

{ "job": { ... }, "timed_out": false }

Stop (already terminal)

{ "job": { ... }, "detail": "already in terminal state (failed); no action taken" }

Errors

Structured JSON with code and message:

{ "error": { "code": "invalid_argument", "message": "job_id is required" } }

Codes: invalid_argument, not_found, internal.

Usage Rules

  1. Use background true (not bare --background) for commands expected to run longer than 30 seconds.
  2. Always provide a description.
  3. Foreground is default — the result and output come back in one call.
  4. Monitor background output with yao_job_output to check progress.
  5. Use yao_job_wait to block until a background job completes rather than polling.

BackgroundJobReceipt

When a background job finishes, the system delivers a <BackgroundJobReceipt> XML message. Upon receiving it:

  1. Review the status, exit_code, cause, and output_tail.
  2. If status=failed, investigate and take corrective action.
  3. If status=completed, acknowledge and continue the task.

相似的 Skill

algorithmic-art
anthropics/skills180k

algorithmic-art

Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.

AI 与智能体

academy-guide
anthropics/skills180k

academy-guide

Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials, and use cases from Claude Academy (academy.claude.com), Anthropic's learning hub. Trigger on: "how do I", "how can I", "getting started with", "what can Claude do", "teach me", "learn to use"; questions about artifacts, projects, skills, plugins, connectors, MCP; requests about rolling Claude out to a team, class, or organization; and any ask for training materials, onboarding content, or learning resources. Use it when the user is learning how to use a feature or product — not when they are mid-task and just want the task done. This skill composes with other skills: after consulting product documentation to answer how a Claude feature works, also check here for a matching course or tutorial — a docs-grounded answer and an Academy recommendation belong together. Only recommend on a strong match; never invent Academy content.

AI 与智能体

mcp-builder
anthropics/skills180k

mcp-builder

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

AI 与智能体

template-skill
anthropics/skills180k

template-skill

Replace with description of the skill and when Claude should use it.

AI 与智能体

internal-comms
anthropics/skills180k

internal-comms

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

AI 与智能体

brand-guidelines
anthropics/skills180k

brand-guidelines

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

AI 与智能体