據 AlphaMoat 統計,截至 2026-10,Opencode Acp Control 累計下載 7,200 次、獲 9 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 3,905 位,在「AI 智慧體」分類(1,632 個)中排名第 527 位。
列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。
| 平台 | 累計下載 | 星標 | 評論 |
|---|---|---|---|
| ClawHub ↗ | 5490 | 9 | - |
| SkillHub ↗ | 7200 | 9 | — |
各平台的計數口徑不同,統計時間不一致。
可啟動會話、傳送提示詞、恢復已有對話,也能檢查並觸發 OpenCode 的更新。恢復會話時 session/load 需要 cwd 與 mcpServers 兩個引數,缺一不可。此技能可控制專案中的 OpenCode 工作階段,更新流程可能終止正在執行的程序。結束程序前確認受影響的執行個體;使用經驗證的套件管理員或簽章固定版本,不要直接執行遠端安裝命令。
資料釋出於 2026-10-27
以下是根據技能文件生成的示例,不代表實際執行結果。
2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。
| 月份 | 累計下載 | 環比 | 星標 |
|---|---|---|---|
| 2026-10 | 7200 | — | 9 |
| 2026-09 | 5622 | — | 9 |
| 2026-08 | 5271 | +2.2% | 9 |
| 2026-07 | 5160 | +4.5% | 9 |
| 2026-06 | 4936 | +2.5% | 9 |
| 2026-05 | 4814 | — | 9 |
| 2026-03 | 4513 | — | 9 |
以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。
---
name: opencode-acp-control
description: Control OpenCode directly via the Agent Client Protocol (ACP). Start sessions, send prompts, resume conversations, and manage OpenCode updates.
metadata: {"version": "1.0.2", "author": "Benjamin Jesuiter <[email protected]>", "license": "MIT", "github_url": "https://github.com/bjesuiter/opencode-acp-skill"}
---
# OpenCode ACP Skill
Control OpenCode directly via the Agent Client Protocol (ACP).
## Metadata
- For ACP Protocol Docs (for Agents/LLMs): https://agentclientprotocol.com/llms.txt
- GitHub Repo: https://github.com/bjesuiter/opencode-acp-skill
- If you have issues with this skill, please open an issue ticket here: https://github.com/bjesuiter/opencode-acp-skill/issues
## Quick Reference
| Action | How |
|--------|-----|
| Start OpenCode | `bash(command: "opencode acp", background: true)` |
| Send message | `process.write(sessionId, data: "<json-rpc>\n")` |
| Read response | `process.poll(sessionId)` - repeat every 2 seconds |
| Stop OpenCode | `process.kill(sessionId)` |
| List sessions | `bash(command: "opencode session list", workdir: "...")` |
| Resume session | List sessions → ask user → `session/load` |
| Check version | `bash(command: "opencode --version")` |
## Starting OpenCode
```
bash(
command: "opencode acp",
background: true,
workdir: "/path/to/your/project"
)
```
Save the returned `sessionId` - you'll need it for all subsequent commands.
## Protocol Basics
- All messages are **JSON-RPC 2.0** format
- Messages are **newline-delimited** (end each with `\n`)
- Maintain a **message ID counter** starting at 0
## Step-by-Step Workflow
### Step 1: Initialize Connection
Send immediately after starting OpenCode:
```json
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":true,"writeTextFile":true},"terminal":true},"clientInfo":{"name":"clawdbot","title":"Clawdbot","version":"1.0.0"}}}
```
Poll for response. Expect `result.protocolVersion: 1`.
### Step 2: Create Session
```json
{"jsonrpc":"2.0","id":1,"method":"session/new","params":{"cwd":"/path/to/project","mcpServers":[]}}
```
Poll for response. Save `result.sessionId` (e.g., `"sess_abc123"`).
### Step 3: Send Prompts
```json
{"jsonrpc":"2.0","id":2,"method":"session/prompt","params":{"sessionId":"sess_abc123","prompt":[{"type":"text","text":"Your question here"}]}}
```
Poll every 2 seconds. You'll receive:
- `session/update` notifications (streaming content)
- Final response with `result.stopReason`
### Step 4: Read Responses
Each poll may return multiple lines. Parse each line as JSON:
- **Notifications**: `method: "session/update"` - collect these for the response
- **Response**: Has `id` matching your request - stop polling when `stopReason` appears
### Step 5: Cancel (if needed)
```json
{"jsonrpc":"2.0","method":"session/cancel","params":{"sessionId":"sess_abc123"}}
```
No response expected - this is a notification.
## State to Track
Per OpenCode instance, track:
- `processSessionId` - from bash tool (clawdbot's process ID)
- `opencodeSessionId` - from session/new response (OpenCode's session ID)
- `messageId` - increment for each request you send
## Polling Strategy
- Poll every **2 seconds**
- Continue until you receive a response with `stopReason`
- Max wait: **5 minutes** (150 polls)
- If no response, consider the operation timed out
## Common Stop Reasons
| stopReason | Meaning |
|------------|---------|
| `end_turn` | Agent finished responding |
| `cancelled` | You cancelled the prompt |
| `max_tokens` | Token limit reached |
## Error Handling
| Issue | Solution |
|-------|----------|
| Empty poll response | Keep polling - agent is thinking |
| Parse error | Skip malformed line, continue |
| Process exited | Restart OpenCode |
| No response after 5min | Kill process, start fresh |
## Example: Complete Interaction
```
1. bash(command: "opencode acp", background: true, workdir: "/home/user/myproject")
-> processSessionId: "bg_42"
2. process.write(sessionId: "bg_42", data: '{"jsonrpc":"2.0","id":0,"method":"initialize",...}\n')
process.poll(sessionId: "bg_42") -> initialize response
3. process.write(sessionId: "bg_42", data: '{"jsonrpc":"2.0","id":1,"method":"session/new","params":{"cwd":"/home/user/myproject","mcpServers":[]}}\n')
process.poll(sessionId: "bg_42") -> opencodeSessionId: "sess_xyz789"
4. process.write(sessionId: "bg_42", data: '{"jsonrpc":"2.0","id":2,"method":"session/prompt","params":{"sessionId":"sess_xyz789","prompt":[{"type":"text","text":"List all TypeScript files"}]}}\n')
5. process.poll(sessionId: "bg_42") every 2 sec until stopReason
-> Collect all session/update content
-> Final response: stopReason: "end_turn"
6. When done: process.kill(sessionId: "bg_42")
```
---
## Resume Session
Resume a previous OpenCode session by letting the user choose from available sessions.
### Step 1: List Available Sessions
```
bash(command: "opencode session list", workdir: "/path/to/project")
```
Example output:
```
ID Updated Messages
ses_451cd8ae0ffegNQsh59nuM3VVy 2026-01-11 15:30 12
ses_451a89e63ffea2TQIpnDGtJBkS 2026-01-10 09:15 5
ses_4518e90d0ffeJIpOFI3t3Jd23Q 2026-01-09 14:22 8
```
### Step 2: Ask User to Choose
Present the list to the user and ask which session to resume:
```
"Which session would you like to resume?
1. ses_451cd8ae... (12 messages, updated 2026-01-11)
2. ses_451a89e6... (5 messages, updated 2026-01-10)
3. ses_4518e90d... (8 messages, updated 2026-01-09)
Enter session number or ID:"
```
### Step 3: Load Selected Session
Once user responds (e.g., "1", "the first one", or "ses_451cd8ae..."):
1. **Start OpenCode ACP**:
```
bash(command: "opencode acp", background: true, workdir: "/path/to/project")
```
2. **Initialize**:
```json
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{...}}
```
3. **Load the session**:
```json
{"jsonrpc":"2.0","id":1,"method":"session/load","params":{"sessionId":"ses_451cd8ae0ffegNQsh59nuM3VVy","cwd":"/path/to/project","mcpServers":[]}}
```
**Note**: `session/load` requires `cwd` and `mcpServers` parameters.
On load, OpenCode streams the full conversation history back to you.
### Resume Workflow Summary
```
function resumeSession(workdir):
# List available sessions
output = bash("opencode session list", workdir: workdir)
sessions = parseSessionList(output)
if sessions.empty:
notify("No previous sessions found. Starting fresh.")
return createNewSession(workdir)
# Ask user to choose
choice = askUser("Which session to resume?", sessions)
selectedId = matchUserChoice(choice, sessions)
# Start OpenCode and load session
process = bash("opencode acp", background: true, workdir: workdir)
initialize(process)
session_load(process, selectedId, workdir, mcpServers: [])
notify("Session resumed. Conversation history loaded.")
return process
```
### Important Notes
- **History replay**: On load, all previous messages stream back
- **Memory preserved**: Agent remembers the full conversation
- **Process independent**: Sessions survive OpenCode restarts
---
## Updating OpenCode
OpenCode auto-updates when restarted. Use this workflow to check and trigger updates.
### Step 1: Check Current Version
```
bash(command: "opencode --version")
```
Returns something like: `opencode version 1.1.13`
Extract the version number (e.g., `1.1.13`).
### Step 2: Check Latest Version
```
webfetch(url: "https://github.com/anomalyco/opencode/releases/latest", format: "text")
```
The redirect URL contains the latest version tag:
- Redirects to: `https://github.com/anomalyco/opencode/releases/tag/v1.2.0`
- Extract version from the URL path (e.g., `1.2.0`)
### Step 3: Compare and Update
If latest version > current version:
1. **Stop all running OpenCode processes**:
```
process.list() # Find all "opencode acp" processes
process.kill(sessionId) # For each running instance
```
2. **Restart instances** (OpenCode auto-downloads new binary on start):
```
bash(command: "opencode acp", background: true, workdir: "/path/to/project")
```
3. **Re-initialize** each instance (initialize + session/load for existing sessions)
### Step 4: Verify Update
```
bash(command: "opencode --version")
```
If version still doesn't match latest:
- Inform user: "OpenCode auto-update may have failed. Current: X.X.X, Latest: Y.Y.Y"
- Suggest manual update: `curl -fsSL https://opencode.dev/install | bash`
### Update Workflow Summary
```
function updateOpenCode():
current = bash("opencode --version") # e.g., "1.1.13"
latestPage = webfetch("https://github.com/anomalyco/opencode/releases/latest")
latest = extractVersionFromRedirectUrl(latestPage) # e.g., "1.2.0"
if semverCompare(latest, current) > 0:
# Stop all instances
for process in process.list():
if process.command.includes("opencode"):
process.kill(process.sessionId)
# Wait briefly for processes to terminate
sleep(2 seconds)
# Restart triggers auto-update
bash("opencode acp", background: true)
# Verify
newVersion = bash("opencode --version")
if newVersion != latest:
notify("Auto-update may have failed. Manual update recommended.")
else:
notify("OpenCode is up to date: " + current)
```
### Important Notes
- **Sessions persist**: `opencodeSessionId` survives restarts — use `session/load` to recover
- **Auto-update**: OpenCode downloads new binary automatically on restart
- **No data loss**: Conversation history is preserved server-side
將開發過程中的經驗、錯誤與修正記錄為 Markdown 檔案,供日後重用並提升為工作區記憶。
用自然語言描述需求,在本機與遠端技能市場尋找技能並取得推薦。
給 AI agent 用的瀏覽器自動化命令列技能。
將使用者明確糾正與自我檢視整理成分層記憶,並依使用情況升級或封存。
規劃 AI 代理主動跟進、工作記憶與回顧流程的工作區設定指南。
指導如何建立與更新有效 Claude 技能的寫作指南。
在安裝第三方技能之前,按清單審查來源、許可權與危險模式的技能。
把盛唐詩人李白的詩學觀、意象系統與口吻,蒸餾成 AI 可呼叫的角色包。
資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。