# OpenCode Tool Mapping

This document maps Claude Code tool names used in MaxFrame skills to OpenCode equivalents.

## Core Tools

| Claude Code Tool | OpenCode Tool | Notes |
|------------------|---------------|-------|
| `Read` | Native file read | Use native file reading |
| `Write` | Native file write | Use native file writing |
| `Edit` | Native file edit | Use native file editing |
| `Bash` | Native shell | Use native shell execution |
| `Glob` | Native file search | Use native file discovery |
| `Grep` | Native content search | Use native search |

## Task Management

| Claude Code Tool | OpenCode Tool | Notes |
|------------------|---------------|-------|
| `TodoWrite` | `todowrite` | Manage task list |
| `TaskCreate` | `todowrite` | Create new task via todowrite |
| `TaskUpdate` | `todowrite` | Update task via todowrite |
| `TaskList` | `todowrite` | List tasks via todowrite |
| `TaskGet` | `todowrite` | Get task via todowrite |

## Agent & Skill Tools

| Claude Code Tool | OpenCode Tool | Notes |
|------------------|---------------|-------|
| `Skill` | `skill` | Native OpenCode skill tool |
| `Agent` | `@mention` | Use @mention to invoke subagents |
| `TaskOutput` | Direct response | Subagents respond directly |

## Interaction Tools

| Claude Code Tool | OpenCode Tool | Notes |
|------------------|---------------|-------|
| `AskUserQuestion` | Native interaction | Use native user interaction |
| `EnterPlanMode` | Direct conversation | Plan via direct conversation |
| `ExitPlanMode` | Direct conversation | N/A |

## Web Tools

| Claude Code Tool | OpenCode Tool | Notes |
|------------------|---------------|-------|
| `WebFetch` | Native web fetch | Use native web capabilities |
| `WebSearch` | Native web search | Use native web capabilities |

## Notebook Tools

| Claude Code Tool | OpenCode Tool | Notes |
|------------------|---------------|-------|
| `NotebookEdit` | Native notebook tools | Use native notebook support |

## Tool Availability

OpenCode has a native `skill` tool that discovers skills from symlinked skill directories. The platform auto-discovers skills at startup from `~/.config/opencode/skills/`.

## Platform-Specific Behavior

- **Skill Discovery**: OpenCode's `skill` tool lists available skills from symlinked directories
- **Skill Loading**: Use `skill` to load skill content by name (e.g., `skill load odps-maxframe/alibabacloud-maxframe-coding`)
- **Subagent Invocation**: Use `@mention` syntax instead of launching agents explicitly
- **Tool Mapping**: Most core tools are native to OpenCode and don't require substitution

## Usage Example

If a MaxFrame skill says:
```
Use the Skill tool to load alibabacloud-maxframe-coding
```

In OpenCode, use:
```
skill load odps-maxframe/alibabacloud-maxframe-coding
```

To list available skills:
```
skill list
```

## Configuration

OpenCode skills are configured via symlinks:
```bash
# Symlink skills directory
ln -s ~/.config/opencode/odps-maxframe/skills ~/.config/opencode/skills/odps-maxframe

# Symlink plugin
ln -s ~/.config/opencode/odps-maxframe/.opencode/plugins/odps-maxframe.js ~/.config/opencode/plugins/odps-maxframe.js
```

The plugin automatically injects bootstrap content at session start via system prompt transform.

## Task Management Pattern

OpenCode uses `todowrite` for all task management operations:

```javascript
// Creating tasks
todowrite({
  todos: [
    { content: "Task 1", status: "pending", activeForm: "Working on task 1" },
    { content: "Task 2", status: "pending", activeForm: "Working on task 2" }
  ]
})

// Updating task status
todowrite({
  todos: [
    { content: "Task 1", status: "completed", activeForm: "Working on task 1" }
  ]
})
```
