Token导航 LogoToken导航

Agent Skill · 研究检索

opencode-acp-control-v2(opencode acp 控件 v2)

opencode-acp-control-v2 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

opencode-acp-control-v2 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为执行命令;许可证为 MIT-0,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 11,337。

总安装 11,393周安装 470GitHub Stars 公开资料未说明下载 3,722核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
2.2.1

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:opencode-acp-control-v2(opencode acp 控件 v2)
来源仓库:https://github.com/studio-hakke/opencode-acp-control-v2
安装命令:
openclaw skills install opencode-acp-control-v2
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install opencode-acp-control-v2

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

opencode-acp-control-v2 通过代理客户端协议 (ACP) 直接控制 OpenCode 实例。适用于启动会话、发送提示与管理更新等远程操作场景。支持对话恢复与子代理调度。opencode-acp-control-v2 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

使用前需建立 ACP 连接并验证身份凭证有效性。建议核对原始文档中的协议版本与兼容性说明。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install opencode-acp-control-v2;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

opencode-acp-control-v2 怎么安装?

在终端执行 openclaw skills install opencode-acp-control-v2。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

opencode-acp-control-v2 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

opencode-acp-control-v2 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 openclaw skills install opencode-acp-control-v2 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

opencode-acp-control-v2 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

opencode-acp-control-v2 用的人多吗?

公开数据是累计安装 11,393 次,近一周安装 470 次,下载 3,722 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

opencode-acp-control-v2 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
opencode-acp-control-v2

opencode acp 控件 v2 · 本页

11,393—执行命令MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
opencode-acp-control
description
Control OpenCode directly via the Agent Client Protocol (ACP). Start sessions, send prompts, resume conversations, and manage OpenCode updates. Includes automatic recovery, stuck detection, and session management.
metadata
{"version": "2.0.0", "author": "Bastian Berrios <bastianberrios.a@gmail.com>", "license": "MIT", "github_url": "https://github.com/berriosb/Opencode-Acp-Control"}

OpenCode ACP Skill v2.0

Control OpenCode directly via the Agent Client Protocol (ACP) with automatic recovery and stuck detection.

🆕 What's New in v2.0

FeatureDescription
Auto-retryAutomatically retries on failure (max 3 attempts)
Stuck detectionDetects when OpenCode is not responding
Lock cleanupAutomatically removes stale lock files
Adaptive pollingPolls faster at start, slower when stable
Health checksPeriodic checks that OpenCode is alive
Configurable timeoutsShorter timeouts with escalation
Session recoveryCan recover from crashes mid-task

Quick Reference

ActionHow
Start OpenCodeexec(command: "opencode acp --cwd /path", background: true)
Send message`process.write(sessionId, data: "<json-rpc>\
")`
Read responseprocess.poll(sessionId) - adaptive polling
Health checkprocess.poll(sessionId, timeout: 5000) - only when no output >60s
Stop OpenCodeprocess.kill(sessionId) + cleanup locks
Clean locksexec(command: "rm -f ~/.openclaw/agents/*/sessions/*.lock")
List sessionsexec(command: "opencode session list", workdir: "...")
Resume sessionList sessions → session/load

🚀 Quick Start (Simple)

For most use cases, use this simple workflow:

1. exec(command: "opencode acp --cwd /path/to/project", background: true)
   -> sessionId: "bg_42"

2. process.write(sessionId: "bg_42", data: initialize_json + "\
")
   process.poll(sessionId: "bg_42", timeout: 10000)

3. process.write(sessionId: "bg_42", data: session_new_json + "\
")
   process.poll(sessionId: "bg_42", timeout: 10000)
   -> opencodeSessionId: "sess_xyz"

4. process.write(sessionId: "bg_42", data: prompt_json + "\
")
   adaptivePoll(sessionId: "bg_42", maxWaitMs: 120000)

5. When done: process.kill(sessionId: "bg_42")
   cleanupLocks()

📁 Skill Files

FilePurpose
SKILL.mdThis file - main documentation
config.default.jsonDefault configuration (copy to config.json to customize)
templates.mdPrompt templates for common tasks

⚙️ Configuration

Option 1: Use defaults

All defaults are built-in. No config file needed.

Option 2: Customize

Copy config.default.json to config.json in the same folder and modify:

cp config.default.json config.json
# Edit config.json with your preferences

Config structure:

{
  "timeouts": { "initialize": 10000, "prompt": {...} },
  "retry": { "maxAttempts": 3, "initialDelay": 2000 },
  "polling": { "initial": 1000, "active": 2000 },
  "healthCheck": { "noOutputThreshold": 60000 },
  "recovery": { "autoRecover": true },
  "mcpServers": { "default": [], "supabase": ["supabase"] }
}

Timeouts (Configurable)

OperationDefaultMaxWhen to increase
Initialize10s30sSlow machine
Session new10s30sLarge project
Prompt (simple)60s120sComplex query
Prompt (complex)120s300sRefactor, code gen
Health check5s10sNetwork issues

Retry Configuration

SettingDefaultDescription
Max retries3How many times to retry on failure
Retry delay2sInitial delay between retries
Backoff multiplier2Delay doubles each retry
Max retry delay10sMaximum delay between retries

Adaptive Polling

PhaseIntervalDuration
Initial1sFirst 10s
Active2s10s - 60s
Stable3s60s - 120s
Slow5s120s+

🔄 Automatic Recovery

Stuck Detection

OpenCode is considered "stuck" when:

  • No response after 2x expected timeout
  • Health check fails 3 times in a row
  • Process is still running but not responding to polls

Recovery Steps

When stuck is detected:

1. Cancel current operation: session/cancel
2. Wait 2 seconds
3. If still stuck: process.kill
4. Clean up locks
5. Restart OpenCode
6. Resume from last known session (if available)

Lock Cleanup

Lock files can become stale when OpenCode crashes. Always clean up:

# Before starting a new session
exec(command: "find ~/.openclaw/agents -name '*.lock' -mmin +30 -delete")

# After killing a stuck process
exec(command: "rm -f ~/.openclaw/agents/*/sessions/*.lock")

📋 Step-by-Step Workflow

Step 1: Pre-flight Check

Before starting, verify environment:

# Check OpenCode is installed
exec(command: "opencode --version")

# Clean stale locks (older than 30 minutes)
exec(command: "find ~/.openclaw/agents -name '*.lock' -mmin +30 -delete")

Step 2: Start OpenCode

exec(
  command: "opencode acp --cwd /path/to/project",
  background: true,
  workdir: "/path/to/project"
)
# Save sessionId for all subsequent operations

Step 3: Initialize (with retry)

// Send initialize
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":true,"writeTextFile":true},"terminal":true},"clientInfo":{"name":"clawdbot","title":"Clawdbot","version":"2.0.0"}}}

Retry logic:

for attempt in 1..3:
    process.write(sessionId, initialize_json + "\
")
    response = process.poll(sessionId, timeout: 10000)
    
    if response contains protocolVersion:
        break  # Success
    
    if attempt < 3:
        sleep(2 * attempt)  # Backoff: 2s, 4s
    else:
        # Recovery mode
        process.kill(sessionId)
        cleanupLocks()
        restart from Step 2

Step 4: Create Session (with retry)

{"jsonrpc":"2.0","id":1,"method":"session/new","params":{"cwd":"/path/to/project","mcpServers":[]}}

Same retry logic as initialize.

Step 5: Send Prompts (with adaptive polling)

{"jsonrpc":"2.0","id":2,"method":"session/prompt","params":{"sessionId":"sess_xyz","prompt":[{"type":"text","text":"Your question here"}]}}

Adaptive polling:

elapsed = 0
interval = 1000  # Start at 1s
maxWait = 120000  # 2 minutes for complex tasks

while elapsed < maxWait:
    response = process.poll(sessionId, timeout: interval)
    
    if response contains stopReason:
        return response  # Done
    
    if response contains error:
        handle_error(response)
        break
    
    # Adaptive interval
    elapsed += interval
    if elapsed < 10000:
        interval = 1000      # First 10s: poll every 1s
    elif elapsed < 60000:
        interval = 2000      # 10-60s: poll every 2s
    elif elapsed < 120000:
        interval = 3000      # 60-120s: poll every 3s
    else:
        interval = 5000      # 120s+: poll every 5s

# Timeout reached - check if stuck
if is_stuck(sessionId):
    recover(sessionId)

Step 6: Health Check (Smart - No Token Waste)

⚠️ Don't poll constantly - wastes tokens!

Only do health checks when:

  1. No output for >60s (possible stuck)
  2. Approaching timeout (verify before declaring stuck)
  3. Something looks wrong (partial errors, etc.)

DO NOT health check when:

  • OpenCode is actively generating output
  • <60s since last output
# Smart health check - only when needed
if time_since_last_output > 60000:  # 60s
    response = process.poll(sessionId, timeout: 5000)
    
    if response contains new data:
        last_output_time = now()
        continue  # Not stuck, just slow
    
    if response is "Process still running" with no data:
        # Still alive, just thinking - wait more
        continue
    
    if response is "No active session":
        # Process died - recover
        recover(sessionId)

Step 7: Cleanup

When done, always clean up:

process.kill(sessionId)
exec(command: "rm -f ~/.openclaw/agents/*/sessions/*.lock")

🛠️ Error Handling

Common Errors and Solutions

ErrorDetectionSolution
Process diedprocess.poll returns "No active session"Restart OpenCode, resume session
Stuck (no response)No response after 2x timeoutCancel, kill, clean locks, restart
Lock file exists.lock file from previous runRemove stale locks (>30min old)
JSON parse errorMalformed responseSkip line, continue polling
Timeoutelapsed >= maxWaitCheck if stuck, retry or escalate
Rate limitedHTTP 429 from OpenCodeExponential backoff, max 10s

Recovery Function

function recover(sessionId, opencodeSessionId):
    # Step 1: Try to cancel gracefully
    process.write(sessionId, cancel_json + "\
")
    sleep(2000)
    
    # Step 2: Check if recovered
    response = process.poll(sessionId, timeout: 5000)
    if response is valid:
        return  # Recovered!
    
    # Step 3: Force kill
    process.kill(sessionId)
    
    # Step 4: Clean up
    exec("rm -f ~/.openclaw/agents/*/sessions/*.lock")
    
    # Step 5: Restart
    newSessionId = startOpenCode()
    initialize(newSessionId)
    
    # Step 6: Resume if we had a session
    if opencodeSessionId:
        session_load(newSessionId, opencodeSessionId)
    
    return newSessionId

🔌 Session Management

Multiple Sessions

OpenCode supports multiple concurrent sessions. Track them:

{
  "sessions": {
    "process_42": {
      "processSessionId": "bg_42",
      "opencodeSessionId": "sess_abc",
      "project": "/path/to/project1",
      "lastActivity": "2026-03-05T10:00:00Z",
      "status": "active"
    },
    "process_43": {
      "processSessionId": "bg_43",
      "opencodeSessionId": "sess_def",
      "project": "/path/to/project2",
      "lastActivity": "2026-03-05T09:30:00Z",
      "status": "idle"
    }
  }
}

Session Recovery

If OpenCode crashes mid-task:

1. Find the last opencodeSessionId
2. Start new OpenCode process
3. Initialize
4. session/load with the old sessionId
5. Continue from where it left off

📊 Monitoring

Health Metrics

Track these to detect problems early:

MetricHealthyWarningCritical
Response time<5s5-15s>15s
Polls without data<1010-30>30
Lock file age<5min5-30min>30min
Consecutive errors01-2≥3

Logging

Log important events for debugging:

[2026-03-05 10:00:00] Started OpenCode, sessionId=bg_42
[2026-03-05 10:00:02] Initialized successfully
[2026-03-05 10:00:03] Created session sess_abc
[2026-03-05 10:00:05] Sent prompt: "Refactor auth module"
[2026-03-05 10:00:15] Received update (thinking)
[2026-03-05 10:00:45] Received update (tool use)
[2026-03-05 10:01:30] Completed, stopReason=end_turn

🎯 Best Practices

DO:

  • ✅ Always clean up locks before starting
  • ✅ Use adaptive polling (saves tokens)
  • ✅ Implement retry logic (makes it robust)
  • ✅ Track session state (enables recovery)
  • ✅ Set appropriate timeouts per task type
  • ✅ Kill and restart if stuck >2x timeout

DON'T:

  • ❌ Poll every 2s for 5 minutes (wastes tokens)
  • ❌ Health check every 30s when output is active (wastes tokens)
  • ❌ Ignore stuck processes (blocks future work)
  • ❌ Leave lock files after crashes
  • ❌ Use same timeout for all operations
  • ❌ Skip health checks when no output for >60s (misses stuck detection)

📝 Example: Robust Implementation

# State tracking
state = {
  processSessionId: null,
  opencodeSessionId: null,
  messageId: 0,
  retries: 0,
  lastActivity: null
}

# Start with cleanup
cleanupStaleLocks()

# Start OpenCode
state.processSessionId = exec("opencode acp --cwd /path", background: true)

# Initialize with retry
for attempt in 1..3:
  process.write(state.processSessionId, initialize())
  response = process.poll(state.processSessionId, timeout: 10000)
  
  if is_valid(response):
    break
  
  if attempt == 3:
    throw Error("Failed to initialize after 3 attempts")

# Create session with retry
for attempt in 1..3:
  process.write(state.processSessionId, session_new())
  response = process.poll(state.processSessionId, timeout: 10000)
  
  if is_valid(response):
    state.opencodeSessionId = response.result.sessionId
    break
  
  if attempt == 3:
    throw Error("Failed to create session after 3 attempts")

# Send prompt with adaptive polling
process.write(state.processSessionId, prompt(state.messageId, "Your task"))

elapsed = 0
interval = 1000
maxWait = 120000

while elapsed < maxWait:
  response = process.poll(state.processSessionId, timeout: interval)
  state.lastActivity = now()
  
  if contains_stop_reason(response):
    return parse_response(response)
  
  elapsed += interval
  interval = get_adaptive_interval(elapsed)
  
  # Smart health check - only if no output for >60s
  if elapsed > 60000 && no_recent_output:
    if is_stuck(state.processSessionId):
      state = recover(state)
      # Re-send prompt
      process.write(state.processSessionId, prompt(state.messageId, "Your task"))
      elapsed = 0

# Timeout
throw Error("Operation timed out after ${maxWait}ms")

🔧 Utility Functions

cleanupStaleLocks()

# Remove locks older than 30 minutes
find ~/.openclaw/agents -name '*.lock' -mmin +30 -delete

isStuck(sessionId)

# Check if process is alive but not responding
response = process.poll(sessionId, timeout: 5000)
return response == "Process still running" && no_data_for_60s

getAdaptiveInterval(elapsedMs)

if elapsedMs < 10000: return 1000
if elapsedMs < 60000: return 2000
if elapsedMs < 120000: return 3000
return 5000

📝 Prompt Templates


📝 Prompt Templates

See templates.md for pre-built prompts for common tasks:

CategoryTemplates
RefactoringExtract function, convert to TS, improve readability
FeaturesAdd endpoint, add component, implement feature
Bug fixesDebug and fix, TypeScript errors
TestingUnit tests, integration tests
DocumentationJSDoc/TSDoc, README updates
DatabaseMigrations, RLS policies
PerformanceQuery optimization, bundle size
SecuritySecurity audit

Usage:

1. Read templates.md
2. Find appropriate template
3. Replace placeholders with your specifics
4. Send as prompt

📊 Metrics & Monitoring

Track these for health monitoring:

MetricHow to trackHealthyWarningCritical
Avg response timeLog timestamps<30s30-60s>60s
Polls per requestCounter<2020-50>50
Retry rateRetries/requests<5%5-15%>15%
Stuck rateStucks/sessions<1%1-5%>5%
Success rateCompleted/started>95%85-95%<85%

Logging format:

[2026-03-05 10:00:00] INFO: Started OpenCode, sessionId=bg_42
[2026-03-05 10:00:02] INFO: Initialized successfully
[2026-03-05 10:00:03] INFO: Created session sess_abc
[2026-03-05 10:00:05] INFO: Sent prompt (refactor)
[2026-03-05 10:00:15] DEBUG: Received update (thinking)
[2026-03-05 10:00:45] DEBUG: Received update (tool use)
[2026-03-05 10:01:30] INFO: Completed, stopReason=end_turn
[2026-03-05 10:01:31] INFO: Metrics: duration=91s, polls=15, retries=0

Log levels:

  • ERROR - Failures, exceptions, stuck detected
  • WARN - Retries, slow responses, near-timeout
  • INFO - Start, complete, cleanup
  • DEBUG - Detailed output, updates received

📦 Skill Files

opencode-acp-control-3/
├── SKILL.md              # This file
├── opencode-session.sh   # Helper script (executable)
├── config.default.json   # Default configuration
├── templates.md          # Prompt templates
├── _meta.json            # Skill metadata
└── .clawhub/             # ClawHub metadata

🚀 Helper Script (Recommended)

Use opencode-session.sh for automatic workflow:

# Simple usage
~/.openclaw/workspace/skills/opencode-acp-control-3/opencode-session.sh \
  --project /path/to/project \
  --prompt "Add error handling to the API"

# With template
opencode-session.sh \
  --project ~/myapp \
  --template "Add API endpoint" \
  --prompt "POST /api/users with validation"

# Complex task
opencode-session.sh \
  --project ~/myapp \
  --timeout complex \
  --mcp '["supabase"]' \
  --prompt "Create migration for users table"

Script options:

OptionDescription
--project PATHProject directory (required)
--prompt "TEXT"Prompt to send (required if no template)
--template NAMEUse template from templates.md
--timeout TYPEsimple (60s) \medium (120s) \complex (300s)
--mcp SERVERSMCP servers as JSON array
--verboseEnable debug logging
--dry-runShow JSON-RPC without executing
--helpShow help

What the script provides:

The script outputs a complete workflow with:

  • ✅ Pre-flight cleanup
  • ✅ Exact JSON-RPC messages to send
  • ✅ Retry logic hints
  • ✅ Adaptive polling intervals
  • ✅ Health check thresholds
  • ✅ Cleanup commands

CYPHER should:

  1. Execute the script with options
  2. Parse the output
  3. Execute the steps in order
  4. Log metrics at the end

*Version 2.2.0 - Released 2026-03-05* *Changes: Added opencode-session.sh helper script*

平台分布

OpenClaw

87.28%
按下载量换算3,249

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install opencode-acp-control-v2 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills