Skip to content
agentbay-aio-skills logo

AgentBay AIO 技能

agentbay-aio-skills

用于任何「运行/执行/评估代码」的请求(如 run this code、execute script、用 Python 画图、跑代码/画图/执行脚本)。通过 AgentBay SDK 创建 code_latest 沙箱,调用 run_code 执行并返回结果。支持 Python、JavaScript、R、Java。

NeverSight/skills_feed0installs215stars

SKILL.md

Full skill instructions

AgentBay AIO 技能

触发条件:何时使用本技能

当用户意图运行或执行代码时即应使用本技能,即使用户没有说「沙箱」。典型表述(遇到即触发):

  • 英文:run this code、execute this script、run the code、execute the script、plot with Python、draw a graph、evaluate this snippet、what's the output of this code、can you run this
  • 中文:帮我跑一下这段代码、运行这段代码、执行这个脚本、用 Python 画个图、跑一下、看下运行结果、执行一下、帮我运行

依赖与环境

本技能依赖 wuying-agentbay-sdk 包。

最佳实践(Agent 必读):

为避免污染用户当前项目的环境,请务必使用技能目录下的独立虚拟环境:

  1. 检查/创建虚拟环境:

    # 检查是否存在 .venv,不存在则创建
    if [ ! -d ".venv" ]; then python3 -m venv .venv; fi
    
  2. 激活并安装依赖(仅首次或缺失时安装,使用阿里云镜像):

    source .venv/​bin/​activate
    pip show wuying-agentbay-sdk >/​dev/​null 2>&1 || pip install wuying-agentbay-sdk -i https://mirrors.aliyun.com/​pypi/​simple/
    
  3. 运行脚本(在虚拟环境中):

    # 确保在 venv 下运行
    python scripts/​run_code.py --code "..." --language python
    

(若用户明确要求在全局环境运行,或当前已在特定环境中,可跳过创建 venv,但仍建议使用镜像源安装。)

API Key(仅报错时引导)

默认先直接执行脚本,不要每次运行前都提醒用户配置 API Key。 仅当脚本报错「Missing API key」或类似信息时,再引导用户配置:

  1. 到 AgentBay 控制台 申请 API Key。
  2. 在本地创建配置文件(脚本会从该路径读取):
    • macOS / Linux:~/​.config/​agentbay/​api_key(或 $XDG_CONFIG_HOME/​agentbay/​api_key)
    • Windows:%USERPROFILE%\.config\agentbay\api_key
  3. 示例(macOS/​Linux):mkdir -p ~/​.config/​agentbay,再将密钥写入 ~/​.config/​agentbay/​api_key。Windows:在 %USERPROFILE%\.config\agentbay 下创建名为 api_key 的无扩展名文件。
  4. 告知用户完成后重试,不要只复述报错。

使用场景

所有代码执行类请求均默认使用本技能。 只要用户要求运行代码、执行脚本、评估片段或查看代码输出(Python、JavaScript、R 或 Java),即使用本技能——即使用户未提「沙箱」。使用 code_latest 创建 AgentBay 沙箱,通过 run_code 执行代码并返回结果。在本技能可用时,不要在本地终端执行用户代码;应使用沙箱以保证隔离与行为一致。

概述

使用 AgentBay SDK 以 code_latest 镜像创建会话,在沙箱中通过 run_code 执行代码,解析 EnhancedCodeExecutionResult,并销毁会话。

执行方式(Agent 必读)

请通过本技能自带的脚本执行用户代码 在技能目录下执行:

python scripts/​run_code.py --code "用户要执行的代码" --language python

从文件执行:

python scripts/​run_code.py --code-file /​path/​to/​file.py --language python

需要结构化输出时加 --json。脚本会从配置文件或环境变量读取 API Key,创建沙箱、执行并返回结果。

(若用户在自己的 Python 项目中集成 AgentBay,可参考 wuying-agentbay-sdk 的同步/异步用法;Agent 执行本技能时仅需调用上述脚本。)

脚本输出

  • 成功:脚本 exit code 0,结果在 stdout(或加 --json 时输出 JSON:success、result、logs、error_message)。
  • 失败:exit code 非 0,错误信息在 stderr;根据输出提示用户(如缺 API Key 则按「API Key(仅报错时引导)」处理)。

重要约束

  • language 支持:python、javascript、r、java(不区分大小写)。
  • 单次执行超时 60 秒(可用 --timeout-s 指定,不超过 60)。

More skills from NeverSight

devops-deployer logo
NeverSight/skills_feed

devops-deployer

Comprehensive DevOps and deployment workflow that orchestrates infrastructure automation, CI/CD pipelines, container orchestration, and cloud deployment. Handles everything from infrastructure as code and pipeline setup to monitoring, scaling, and disaster recovery.

215 1
View
avnu logo
NeverSight/skills_feed

avnu

Integrate avnu SDK for Starknet DeFi: token swaps with best-price routing, DCA recurring buys, native staking, gasless transactions via paymaster, and market data. Use when building Starknet trading, DEX aggregation, or DeFi automation features.

215 0
View
post-to-x logo
NeverSight/skills_feed

post-to-x

发布内容和文章到 X (Twitter)。支持带图片的普通推文和 X Articles(长文)。使用真实的 Chrome 和 CDP 来绕过自动化检测。

215 0
View
ralph-prompt-builder logo
NeverSight/skills_feed

ralph-prompt-builder

Master orchestrator for generating Ralph Wiggum-compatible prompts. Analyzes task requirements and routes to appropriate generator (single-task, multi-task, project, or research). Use when you need to create any Ralph loop prompt and want automatic selection of the right generator.

215 0
View
branch-comparison logo
NeverSight/skills_feed

branch-comparison

Use when the user asks to compare branches, analyze git diffs, review changes between branches, update specifications based on code changes, or analyze what changed. Triggers on keywords like "compare branches", "git diff", "what changed", "branch comparison", "code changes", "spec update".

215 0
View
fastapi-development logo
NeverSight/skills_feed

fastapi-development

Build high-performance FastAPI applications with async routes, validation, dependency injection, security, and automatic API documentation. Use when developing modern Python APIs with async support, automatic OpenAPI documentation, and high performance requirements.

215 0
View
zendesk-chat logo
NeverSight/skills_feed

zendesk-chat

Enables Claude to manage Zendesk Chat conversations, support tickets, and customer service operations

215 0
View
forge logo
NeverSight/skills_feed

forge

Mine transcripts for knowledge - decisions, learnings, failures, patterns. Triggers: "forge insights", "mine transcripts", "extract knowledge".

215 0
View
mixpanel logo
NeverSight/skills_feed

mixpanel

Track product analytics and user behavior with Mixpanel's event-based platform.

215 0
View
ocpp logo
NeverSight/skills_feed

ocpp

OCPP protocol reference for EV charging infrastructure development. Covers OCPP 2.0.1 and OCPP 1.6J. Use when working with OCPP messages, charging station code, CSMS/Central System backends, smart charging, transaction handling, or EV charging protocols. Activates on keywords: OCPP, charging stat...

215 0
View
bee-collect logo
NeverSight/skills_feed

bee-collect

Gather scattered ideas into organized GitHub issues. The bee collects pollen from every flower, checks if the hive already has it, and carefully deposits new work in the comb for later. Never edits code—only organizes the work ahead. Use when creating issues from TODOs or planning work.

215 0
View
vercel-react-native-skills logo
NeverSight/skills_feed

vercel-react-native-skills

Comprehensive best practices for React Native and Expo applications. Contains rules across multiple categories covering performance, animations, UI patterns, and platform-specific optimizations.

215 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View