Get the FREE Ultimate OpenClaw Setup Guide →

codeact

npx machina-cli add skill gradion-ai/ipybox/codeact --openclaw
Files (1)
SKILL.md
2.1 KB

Use Python tools to perform tasks.

You must use the execute_ipython_cell tool of the ipybox MCP server for executing Python code.

All operations must follow the tool usage restrictions and workflows defined below.

Tool Directories

The gentools/ and mcptools/ directories are in the working directory shown in your <env> block. All paths are relative to the working directory, NOT to this skill's base directory.

Tool Usage Restrictions

You are restricted to these tools only:

Python Tools

  • Functions in mcptools/<category>/<tool>.py (use run_parsed if defined, otherwise run)
  • Functions in gentools/<category>/<tool>/api.py

ipybox MCP Server Tools

  • execute_ipython_cell - Execute Python code
  • reset - Reset the IPython kernel

Claude Code Filesystem Tools

  • All filesystem tools for reading, writing files, and listing directories.

Workflow

1. Python Tool Selection

  1. List available categories in gentools/ and mcptools/
  2. List available tools in relevant categories
  3. Read tool files to understand interfaces and parameters.

2. Python Tool Priority

  1. Search gentools package first
  2. If not found, search mcptools package
  3. If no appropriate tool exists, generate custom code

3. Code Generation and Python Tool Chaining

  • Generate code that uses selected Python tools as argument for execute_ipython_cell.
  • Chain Python tools in the generated code if the structured output of one tool can be used as input for another tool.

4. Code Execution

  • Use the execute_ipython_cell for Python code execution
  • Print only required information, not intermediate results
  • Store intermediate results in variables

Output Parsers

When generating output parsers for Python tools in the mcptools package, see references/output-parsers.md.

Saving Code Actions

To save executed code as a reusable gentools tool, see references/saving-codeacts.md.

Source

git clone https://github.com/gradion-ai/ipybox/blob/main/plugin/skills/codeact/SKILL.mdView on GitHub

Overview

codeact enables generating and running Python code using specialized tools to act with Python capabilities. Activate it by explicitly asking to use the codeact skill. It integrates with ipybox to execute code cells and supports tool-driven automation.

How This Skill Works

codeact discovers available Python tools under gentools and mcptools, selects appropriate ones, and generates code that may chain tool outputs as inputs. The generated code is executed using execute_ipython_cell, with intermediate results stored in variables for traceability.

When to Use It

  • You want to perform a task using a Python tool (from gentools or mcptools) and get immediate results.
  • You need to chain the output of one tool as the input to another tool.
  • You require reproducible code execution in an IPython cell via the ipybox server.
  • You want to inspect tool interfaces by reading tool files before selecting a tool.
  • You explicitly request activation of the codeact skill with phrases like 'use the codeact skill'.

Quick Start

  1. Step 1: Explicitly say 'use the codeact skill' to activate.
  2. Step 2: Let the system list available gentools/mcptools and pick a tool.
  3. Step 3: Review the generated code, then codeact executes it via execute_ipython_cell and returns results.

Best Practices

  • Explicitly activate the skill with phrases such as 'use the codeact skill' before proceeding.
  • List available gentools and mcptools tools to understand interfaces and parameters.
  • Generate modular, small code blocks and store results in clearly named variables.
  • Validate tool outputs and handle errors gracefully in the code you generate.
  • Chain tools thoughtfully, ensuring outputs are compatible inputs for the next step.

Example Use Cases

  • Generate a data transformation script using a mcptools data tool and print the summary.
  • Read a file with a Python tool and compute basic statistics in the same workflow.
  • Fetch data with one tool and pass the results to another tool for analysis.
  • Experiment with a small code snippet in an IPython cell and capture the result.
  • Create and save a reusable code snippet as a gentools tool for future use.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers