メインコンテンツまでスキップ

Worker Agent Skill

The Tianji Worker Skill teaches coding agents how to write Worker code and carry out common operations using the dashboard, CLI, and supported management APIs.

Download the Tianji Worker Skill (.tar.gz)

The archive contains an installable tianji-worker folder with SKILL.md, a common-operations guide, and the Worker Agent Reference. It includes no credentials and requires no MCP server.

Install

Download and extract the archive into your agent's skills directory. For Codex:

curl --fail --location https://tianji.dev/skills/tianji-worker.tar.gz \
--output tianji-worker.tar.gz
mkdir -p ~/.codex/skills
tar -xzf tianji-worker.tar.gz -C ~/.codex/skills

For Claude Code, use ~/.claude/skills; for Cursor, use ~/.cursor/skills. If you already installed this skill, review local customizations before replacing its files. Restart or reload the agent session after installation.

What the agent learns

OperationGuidance included
Create and updateRuntime contract, payload validation, local project setup, deployment, preserving existing settings
Test and invokeDraft tests, saved-code manual runs, public HTTP requests, and their different effects
DebugExecution history, logs, errors, and common configuration problems
ConfigureText/Secret variables, shared-module bindings, cron expressions, and workspace timezone
MaintainRevision comparison and rollback, pause/resume, and deletion

The skill explains the limits of each interface. For example, CLI deployment activates a Worker and can disable its existing schedule; a draft test isolates KV but can still call real external services. It directs the agent to supported dashboard actions where no public API or CLI command exists.

Example requests

Use tianji-worker to create a Worker that validates an incoming webhook and
forwards its message using a Secret named API_TOKEN. Give me valid and invalid
test payloads. Save the code locally for review.
Update Worker <worker-id> in workspace <workspace-id> on <server-url>.
Keep its active state, cron schedule, and environment variables unchanged.
Test the new code before deploying it, then check the execution logs.
Inspect the recent failures for Worker <worker-id>, compare its revisions,
and explain which revision could restore the previous behavior.
Pause Worker <worker-id> without deleting its code or cron configuration.

Provide the target server and workspace through your existing configuration. Keep API keys and Secret values in secure configuration rather than pasting them into prompts. The skill supplies instructions; it does not grant access to your Tianji instance.

Source and maintenance

The source lives in skills/tianji-worker. The website build refreshes the bundled runtime reference from the Worker documentation and rebuilds the download. To rebuild it locally:

pnpm --dir website build:worker-skill

For a walkthrough in the dashboard, see Worker Getting Started. For read-only queries across Tianji services, see the separate Tianji Data Query Skill.