📦 coding-agent-common — 技能工具

v1.0.0

通用的编码代理技能,封装 Codex、Claude Code、OpenCode 等工具。 使用场景:(1) 构建/创建新功能或应用 (2) 重构大型代码库 (3) Bug 修复 (4) 代码审查 (5) 迭代式编码。 不适用于:简单的单行修改(直接用 edit),读取代码(用 read 工具)。

0· 444·0 当前·0 累计
whiskeyforsun 头像by @whiskeyforsun (whisky)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/27
0
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
安全
medium confidence
The skill's declared purpose, required binaries, and runtime instructions are internally consistent for a wrapper around coding CLIs, but it recommends powerful flags (bypass/auto/no-sandbox) and background execution—so use caution and isolate runs.
评估建议
This skill appears to do what it says: drive CLI-based coding agents against a codebase. Before installing, be sure you trust the underlying CLIs (codex/claude/opencode/pi) and their sources; run the agent in an isolated worktree or temporary repo to limit blast radius; avoid using --yolo and prefer review workflows rather than --full-auto where possible; ensure you understand which credentials (git/GitHub) are available on the system because the skill expects to call git/gh and push PRs; and mo...
详细分析 ▾
用途与能力
The name/description claim to wrap Codex/Claude/OpenCode and the skill's metadata lists those CLIs as allowable binaries (anyBins). The instructions focus on running those CLI agents in a git workdir, creating worktrees, and pushing PRs—behaviors consistent with a coding-agent wrapper.
指令范围
SKILL.md instructs the agent to run CLI commands, manage background sessions, create git worktrees, run package installs, and push/create PRs. This is within the stated purpose (automated coding tasks), but the doc explicitly encourages use of flags that bypass permission checks (--permission-mode bypassPermissions, --full-auto, --yolo). Those flags grant the agent broad ability to change the workspace and could produce unwanted changes or data exposure if misused. The file also suggests using openclaw system event to send completion notifications, which will send a text event outside the repository context.
安装机制
Instruction-only skill with no install spec and no code files; nothing is written to disk by the skill itself. This is the lowest-risk install posture.
凭证需求
The skill declares no required environment variables or credentials. It does assume existing developer tools (git, gh, appropriate CLI auth) are present in the environment; that reliance is reasonable but the skill does not request or require new secrets. No unexpected env access is declared in SKILL.md.
持久化与权限
always:false (no forced inclusion). The skill does not request persistent system-wide privileges or modify other skills' configs. It instructs running commands that can change repositories (git push/gh pr create) but does so within the user's workspace context.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.02026/3/27

Initial release of coding-agent. - Provides a general coding agent skill wrapping Codex, Claude Code, OpenCode, and similar tools. - Supports scenarios including feature creation, large-scale refactoring, bug fixing, code review, and iterative development. - Includes comprehensive usage guide, command templates, and configuration examples for different agent backends. - Documents best practices, safety rules, background task monitoring, and multi-agent workflows. - Lists troubleshooting tips and frequently asked questions for common issues.

可疑

安装命令

点击复制
官方npx clawhub@latest install coding-agent-common
镜像加速npx clawhub@latest install coding-agent-common --registry https://cn.longxiaskill.com

技能文档

通过后台进程将编码任务委托给 Codex、Claude Code 或 OpenCode 等代理。

🎯 快速选择指南

代理特点推荐场景
CodexOpenAI 模型,速度快快速原型、功能开发、Bug 修复
Claude CodeClaude 模型,理解力强复杂重构、架构设计、代码审查
OpenCode开源方案轻量级任务

⚙️ 执行模式配置

Codex / OpenCode / Pi - 需要 PTY

# ✅ 正确用法(需要 pty:true)
exec pty:true command:"codex exec '你的任务描述'"

Claude Code - 不需要 PTY

# ✅ 正确用法(使用 --print 模式)
exec command:"claude --permission-mode bypassPermissions --print '你的任务描述'"

# 后台执行 exec background:true command:"claude --permission-mode bypassPermissions --print '你的任务描述'"

🚀 常用命令模板

1. 快速一次性任务

# Codex(需要 git 目录)
exec pty:true workdir:/path/to/project command:"codex exec --full-auto '添加错误处理到 API 调用'"

# Claude Code exec workdir:/path/to/project command:"claude --permission-mode bypassPermissions --print '添加错误处理到 API 调用'"

2. 后台长时间任务

# 启动后台任务
exec pty:true workdir:/path/to/project background:true command:"codex exec --full-auto '重构认证模块'"

# 返回 sessionId,可用于监控

3. 代码审查

# 审查当前分支变更
exec pty:true workdir:/path/to/project command:"codex review --base main"

# 审查 PR exec pty:true workdir:/path/to/project command:"codex exec '审查 PR #130'"

4. 多任务并行

# 同时启动多个代理处理不同任务
exec pty:true workdir:/path/to/project background:true command:"codex exec '修复 issue #78'"
exec pty:true workdir:/path/to/project background:true command:"codex exec '修复 issue #99'"

📋 任务监控

查看后台进程

process action:list

查看输出日志

process action:log sessionId:

检查是否完成

process action:poll sessionId:

发送输入

# 发送文本 + 回车
process action:submit sessionId: data:"yes"

# 发送原始数据(无回车) process action:write sessionId: data:"some input"

终止进程

process action:kill sessionId:

🔧 Codex CLI 参数

参数效果
exec "prompt"一次性执行,完成后退出
--full-auto沙箱模式但自动批准工作区内的更改
--yolo无沙箱,无批准(最快但最危险)

🏗️ 工作目录规则

重要: 始终指定 workdir,让代理专注于特定目录:

# ✅ 正确 - 指定工作目录
exec pty:true workdir:/path/to/project command:"codex exec '任务'"

# ❌ 错误 - 无工作目录,代理可能读取不相关文件 exec pty:true command:"codex exec '任务'"

📝 任务提示词最佳实践

好的任务描述

构建一个 REST API 端点用于管理待办事项:
  • GET /todos - 获取所有待办
  • POST /todos - 创建待办
  • PUT /todos/:id - 更新待办
  • DELETE /todos/:id - 删除待办

要求:

  • 使用 Express.js
  • 添加输入验证
  • 添加错误处理
  • 完成后运行测试

不好的任务描述

写个 todo api

添加完成通知

对于长时间运行的后台任务,在提示词末尾添加通知命令:

...你的任务描述...

完成后运行此命令通知我: openclaw system event --text "完成: [简要描述]" --mode now

🛡️ 安全规则

  • 不要在 ~/.openclaw/ 目录启动代理 - 可能读取敏感文件
  • 不要在 Live OpenClaw 实例目录切换分支
  • 审查 PR 时使用临时目录或 git worktree
  • 敏感项目使用 --full-auto 而非 --yolo

🔄 Git Worktree 并行工作流

# 1. 为每个 issue 创建 worktree
exec command:"git worktree add -b fix/issue-78 /tmp/issue-78 main"
exec command:"git worktree add -b fix/issue-99 /tmp/issue-99 main"

# 2. 在每个 worktree 中启动代理 exec pty:true workdir:/tmp/issue-78 background:true command:"pnpm install && codex exec --full-auto '修复 issue #78'" exec pty:true workdir:/tmp/issue-99 background:true command:"pnpm install && codex exec --full-auto '修复 issue #99'"

# 3. 监控进度 process action:list

# 4. 完成后创建 PR exec workdir:/tmp/issue-78 command:"git push -u origin fix/issue-78 && gh pr create --title 'fix: ...' --body '...'"

# 5. 清理 exec command:"git worktree remove /tmp/issue-78"

📊 进度更新规则

启动后台代理时,保持用户知情:

  • 启动时 - 发送简短消息说明正在运行什么 + 在哪里
  • 更新时 - 只在有变化时更新:
- 里程碑完成(构建完成、测试通过) - 代理提问/需要输入 - 遇到错误或需要用户操作 - 代理完成(说明改变了什么 + 在哪里)
  • 终止时 - 如果杀掉会话,立即说明原因

🧪 临时工作区(无 git 目录)

Codex 需要 git 目录。对于快速实验:

# 创建临时 git 目录
$SCRATCH = New-TempDir
exec workdir:$SCRATCH command:"git init"
exec pty:true workdir:$SCRATCH command:"codex exec '你的实验任务'"

⚠️ 常见问题

代理卡住无输出

检查是否忘记 pty:true(Codex/OpenCode/Pi 需要)

Claude Code 过早退出

检查是否使用了 --dangerously-skip-permissions,改用 --permission-mode bypassPermissions --print

找不到文件

检查 workdir 是否正确设置

权限被拒绝

检查是否在正确的目录,或使用 --full-auto 模式

🎓 学习笔记(2026年1月)

  • PTY 至关重要 - 编码代理是交互式终端应用
  • 需要 git 目录 - Codex 不在 git 目录外运行
  • exec 是好朋友 - codex exec "prompt" 运行后干净退出
  • submit vs write - submit 发送输入 + 回车,write 发送原始数据

让编码代理为你工作 🤖✨

数据来源ClawHub ↗ · 中文优化:龙虾技能库