TopRank Skills

Home / Claw Skills / Git / GitHub / opencode
Official OpenClaw rules 36%

opencode

OpenCode AI - AI-driven code editor/IDE (CLI/TUI version of Cursor/Windsurf). Use when: (1) AI-assisted coding tasks, (2) Code refactoring with AI, (3) GitHub PR review/fixes, (4) Multi-file edits requiring context, (5) Running AI agents on codebases. NOT for: simple one-line edits (use edit tool), reading files (use read tool).

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 opencode 技能。 若已安装,则直接安装 opencode 技能。

Overview

Skill Key
csuwl/opencode
Author
csuwl
Source Repo
openclaw/skills
Version
-
Source Path
skills/csuwl/opencode
Latest Commit SHA
f1d99aac9e9e964ff6b3aec061681d0a1b5c6f60

Extracted Content

SKILL.md excerpt

# OpenCode AI - AI Code Editor

OpenCode is an **AI-native code editor** that runs in your terminal. Think of it as Cursor or Windsurf, but as a CLI/TUI tool.

**Version**: 1.2.10 (Homebrew)
**Platform**: macOS Darwin x64

## Prerequisites

**CRITICAL**: OpenCode requires `sysctl` to detect system architecture. Ensure `/usr/sbin` is in your PATH:

```bash
export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
```

If missing, OpenCode will fail with:
```
Executable not found in $PATH: "sysctl"
```

Add this to `~/.zshrc` permanently:
```bash
echo 'export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```

---

## When to Use OpenCode

✅ **Use for:**
- Complex refactoring across multiple files
- AI-assisted feature implementation
- GitHub PR review and automated fixes
- Exploring and understanding unfamiliar codebases
- Running multi-step coding tasks with context
- Session-based coding (continue previous work)

❌ **Don't use for:**
- Simple one-line edits (use `edit` tool)
- Reading file contents (use `read` tool)
- Non-coding tasks

---

## Core Operations (TUI Slash Commands)

When running OpenCode in **TUI mode** (`opencode`), you can use these slash commands to control the AI workflow:

### /sessions - Session Management
```
/sessions
```
- Opens session selector
- Choose to continue an existing session
- Create a new session (with user approval)
- Recommended: Select existing session for current project

### /agents - Agent (Mode) Control
```
/agents
```
Available agents:
- **plan** - Planning mode (analyze and design)
- **build** - Build mode (implement and code)
- **explore** - Exploration mode (understand codebase)
- **general** - General assistance

**Best Practice**: Always select **plan** first, then switch to **build** after approval.

### /models - Model Selection
```
/models
```
- Opens model selector
- Filter by provider (OpenAI, Anthropic, Google, Z.AI, etc.)
- Select preferred model for the task
- If authentication required, fo...

README excerpt

# OpenCode Skill for OpenClaw

这个 skill 让 OpenClaw 能够使用 **OpenCode AI** - 一个 AI 驱动的代码编辑器(类似 Cursor/Windsurf 的 CLI 版本)。

## 📦 安装

OpenCode 通过 Homebrew 安装:
```bash
brew install opencode
```

## ⚙️ 前置条件

**重要**:OpenCode 需要 `sysctl` 命令来检测系统架构。确保 `/usr/sbin` 在 PATH 中:

```bash
export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"
```

永久添加到 `~/.zshrc`:
```bash
echo 'export PATH="/usr/sbin:/usr/bin:/sbin:/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```

## 🚀 快速开始

### 1. 测试安装
```bash
./examples.sh
```

### 2. 简单任务
```bash
opencode run "Add error handling to my code"
```

### 3. 交互模式
```bash
opencode
```

## 📚 主要功能

- ✅ AI 辅助编码和重构
- ✅ GitHub PR 自动修复
- ✅ 会话管理(继续之前的工作)
- ✅ 多模型支持(OpenAI、Anthropic、Google 等)
- ✅ MCP 协议支持
- ✅ Web 界面模式

## 🔧 常用命令

| 命令 | 说明 |
|------|------|
| `opencode run "prompt"` | 运行单条 AI 指令 |
| `opencode --continue` | 继续上次会话 |
| `opencode models` | 列出可用模型 |
| `opencode session list` | 列出所有会话 |
| `opencode pr 123` | 处理 GitHub PR |
| `opencode web` | 启动 Web 界面 |
| `opencode stats` | 查看使用统计 |

## 📖 完整文档

详见 [SKILL.md](./SKILL.md)

## 🔍 测试示例

运行示例脚本测试所有功能:
```bash
bash examples.sh
```

## 💡 提示

1. **具体化提示**:清晰的提示产生更好的结果
2. **附加文件**:使用 `-f` 参数为 AI 提供上下文
3. **利用会话**:使用 `--continue` 在之前的基础上继续工作
4. **尝试分支**:使用 `--fork` 安全地尝试变体

---

*Created: 2026-02-25*

Related Claw Skills

heyixuan2

bambu-studio-ai

★ 41

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pipeline: search → generate → analyze → colorize → preview → open BS → user slice → print → monitor. Supports all 9 Bambu Lab printers (A1 Mini, A1, P1S, P2S, X1C, X1E, H2C, H2S, H2D).

capt-marbles

geo-optimization

★ 1

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discoverability and citation.

carlulsoe

parakeet-stt

★ 0

Local speech-to-text with NVIDIA Parakeet TDT 0.6B v3 (ONNX on CPU). 30x faster than Whisper, 25 languages, auto-detection, OpenAI-compatible API. Use when transcribing audio files, converting speech to text, or processing voice recordings locally without cloud APIs.

carlzhao007

feishu-process-feedback

★ 0

飞书消息自动处理与进度反馈技能。安装后后台运行,监听飞书任务消息并自动创建独立进程处理。 在处理前后发送实时进度反馈(任务确认、进度百分比、完成通知)。 支持任务类型识别、智能解析、错误重试、并发控制、状态持久化。 使用场景:飞书自动化工作流、任务进度追踪、批量任务处理、需要实时反馈的场景。

cartoonitunes

bottyfans

★ 0

BottyFans agent skill for autonomous creator monetization. Lets AI agents register, build a profile, publish posts (public, subscriber-only, or pay-to-unlock), upload media, accept USDC subscriptions and tips on Base, send and receive DMs, track earnings, and appear on the creator leaderboard. Use this skill when an agent needs to monetize content, interact with fans, manage a creator profile, handle payments in USDC, or operate as an autonomous creator on the BottyFans platform.

camopel

arxivkb

★ 0

Local arXiv paper manager with semantic search. Crawls arXiv categories, downloads PDFs, chunks content, and indexes with FAISS + Ollama embeddings. No cloud API keys required — everything runs locally.