agent-canvas-environment
БесплатноБез исполняемых скриптовНе проверенWork effectively inside a local Agent Canvas environment, including local agent-server auth, frontend/backend port discovery, safe workspace hygiene, and…
от OpenHands★ 190 звёзд на GitHubОб этом скилле
Agent Canvas Environment
Use this skill when running inside or alongside a local Agent Canvas stack, especially when the user asks to inspect the local backend, create or monitor local conversations, or delegate work to another local conversation.
Core rules
- Treat the local Agent Canvas backend as an agent-server API, usually
http://localhost:8001. - Treat the local UI as a separate frontend, usually
http://localhost:8000. - Do not print session API keys. Pass them directly in
X-Session-API-Key. - Trust any runtime-services block or explicit user-provided host over default ports.
- Before mutating a repository, check
git status -sb. If a worktree has unrelated changes, use a separate worktree or clone. - When delegating, write a self-contained prompt. The new conversation does not inherit the current chat context.
Find the session key
Use the first available value, without echoing it:
KEY="${SESSION_API_KEY:-${OH_SESSION_API_KEYS_0:-${LOCAL_BACKEND_API_KEY:-}}}"
if [ -z "$KEY" ] && [ -f "$HOME/.openhands/agent-canvas/api-key.txt" ]; then
KEY="$(tr -d '\n' < "$HOME/.openhands/agent-canvas/api-key.txt")"
fi
test -n "$KEY" || { echo "No Agent Canvas session API key found" >&2; exit 1; }
Validate backend access:
curl -sS -o /tmp/agent-canvas-conversations.json -w '%{http_code}\n' \
-H "X-Session-API-Key: $KEY" \
http://localhost:8001/api/conversations/search
HTTP 200 means the backend and key work.
Delegate to a local conversation
Use POST /api/conversations with:
- the encrypted
agent_settingsfromGET /api/settings(withX-Expose-Secrets: encrypted), which carries the real Fernet-encryptedllm.api_key, the existingagent_context, and the agent kind — so you never handle plaintext credentials and you don't drop the caller's skill/context config secrets_encrypted: trueso the agent-server decrypts thatapi_keyserver-side- the exec tool set merged into
agent_settings.tools(andtask_tool_setwhen you enable sub-agents) tool_module_qualnamesfor any non-SDK tools (e.g.canvas_ui)agent_context.load_public_skills/load_user_skills/load_project_skillsset totrueif the delegated agent should inherit bundled/user/project skills- a fresh absolute workspace directory
initial_message.run: trueworktree: falsewhen the workspace is already isolated
Credential handling — important
GET /api/settings (default) masks every credential — llm.api_key comes back as the literal string "**********". If you forward that verbatim, the new conversation authenticates with the placeholder and fails immediately with LLMAuthenticationError (You must provide an API key).
The supported way to obtain forwardable credentials is the X-Expose-Secrets: encrypted request header. With it, /api/settings returns the real llm.api_key as a Fernet-encrypted token (starts with gAAAAA) intended to be sent back to the server with secrets_encrypted: true; the agent-server's decrypt_incoming_llm_secrets decrypts it server-side. Do not read ~/.openhands/profiles/*.json directly — that is brittle (the caller may not share the backend's home directory, active_profile may be null, the profile store may live elsewhere).
Two working approaches:
agent_profile_id(simplest, but no tools) — send onlyagent_profile_id: "<uuid>"(fromGET /api/agent-profiles→ the profile whoseidequalsactive_agent_profile_idfrom/api/settings). The server resolves the LLM key + agent kind from the profile. Mutually exclusive withagent/agent_settings, and theopenhandsagent-profile schema forbidstools/include_default_tools, so the conversation gets zero exec tools this way. Use only when the task needs no tools.Encrypted
agent_settings(full tools, preserves context) — start from the encrypted/api/settingsagent_settingspayload, dropschema_versionandmcp_config(to avoid MCP-connection failures at creation time), merge in the exec tool set andload_*_skillsflags, and send withsecrets_encrypted: true. This is the pattern for real delegated work.
Template (full tools, preserves context):
set -euo pipefail
BASE="${AGENT_CANVAS_BACKEND:-http://localhost:8001}"
KEY="${SESSION_API_KEY:-${OH_SESSION_API_KEYS_0:-${LOCAL_BACKEND_API_KEY:-}}}"
if [ -z "$KEY" ] && [ -f "$HOME/.openhands/agent-canvas/api-key.txt" ]; then
KEY="$(tr -d '\n' < "$HOME/.openhands/agent-canvas/api-key.txt")"
fi
test -n "$KEY" || { echo "No Agent Canvas session API key found" >&2; exit 1; }
WORKDIR="${WORKDIR:-$HOME/workspace/delegated/$(date +%Y%m%d-%H%M%S)}"
mkdir -p "$WORKDIR"
# Fetch the agent_settings with ENCRYPTED secrets exposed. This returns the
# real llm.api_key as a Fernet token (gAAAAA...) plus the existing
# agent_context/agent kind, so we preserve the caller's config and never
# handle plaintext credentials.
SETTINGS_JSON="$(curl -sS -H "X-Session-API-Key:
Установить agent-canvas-environment в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл agent-canvas-environment?
Work effectively inside a local Agent Canvas environment, including local agent-server auth, frontend/backend port discovery, safe workspace hygiene, and delegating work to a new local conversation through POST /api/conversations.
Как установить скилл agent-canvas-environment?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agent-canvas-environment запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic