跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 coding-agent

Coding Agent

将编码工作委托给 Codex, Claude Code, 或 OpenCode 作为背景工作者; 不简单的编辑或只读代码搜索 .

3773 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

将编码工作委托给 Codex, Claude Code, 或 OpenCode 作为背景工作者; 不简单的编辑或只读代码搜索 .

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Coding Agent、Hard rules、Mandatory Git preparation、Notification block、Launch forms、Long issue-to-PR work。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 description(原文)

Delegate coding work to Codex, Claude Code, or OpenCode as background workers; not simple edits or read-only code lookup.

Coding AgentHard rulesMandatory Git preparationNotification blockLaunch formsLong issue-to-PR workScratch CodexProcess actionsStatus to user

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
coding-agent
description
Delegate coding work to Codex, Claude Code, or OpenCode as background workers; not simple edits or read-only code lookup.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「coding-agent」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-067e74dce6f99340-Coding-Agent.html
请存为 .cursor/skills/coding-agent/SKILL.md 或 .claude/skills/coding-agent/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/openclaw/openclaw' --list

npx skills add 'https://github.com/openclaw/openclaw' --skill 'coding-agent'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: coding-agent description: "Delegate coding work to Codex, Claude Code, or OpenCode as background workers; not simple edits or read-only code lookup." metadata: { "openclaw": { "emoji": "🧩", "requires": { "anyBins": ["claude", "codex", "opencode"], "config": ["skills.entries.coding-agent.enabled"], }, "install": [ { "id": "node-claude", "kind": "node", "package": "@anthropic-ai/claude-code", "bins": ["claude"], "label": "Install Claude Code CLI (npm)", }, { "id": "node-codex", "kind": "node", "package": "@openai/codex", "bins": ["codex"], "label": "Install Codex CLI (npm)", }, ], }, } --- # Coding Agent Use for background feature builds, PR reviews, large refactors, and issue-to-PR loops. Do not use for simple edits, read-only lookup, ACP thread-bound work, or any run inside `~/.openclaw`, `$OPENCLAW_STATE_DIR`, or active OpenClaw state dirs. ## Hard rules - Always launch with `background:true`. - Codex and OpenCode: use `pty:true`. - Codex: never inherit ambient `CODEX_HOME` or the default `~/.codex`. Use a separately authenticated coding-agent home and scope it to each Codex command. - Claude Code: no PTY; use `claude --permission-mode bypassPermissions --print`. - Capture a real notification route before spawning. - Worker must send completion/failure via `openclaw message send`. - Do not rely on heartbeat, system events, or notify-on-exit. - Monitor with `process`; do not kill slow workers without cause. - If user asked for a specific agent, use that agent. - If worker fails/hangs, respawn or ask; do not silently hand-code instead. - Never checkout branches or run background coding agents in `~/Projects/openclaw`; use an isolated checkout. - Classify the source ref as trusted or untrusted before any checkout or worktree creation. Never materialize a contributor-controlled ref outside the repository's approved untrusted-PR sandbox/review workflow, and never launch a permission-bypassed worker in it. - For tasks that modify a Git-backed project, prepare and verify the Git worktree before launch, then include the exact Git preparation block below in the worker prompt. ## Mandatory Git preparation Before launching Codex, Claude Code, or OpenCode for work that modifies a Git-backed project: 1. Establish the intended target repository, then select its canonical remote. Prefer `upstream` when it exists and matches that target; otherwise verify `origin`. Resolve the selected remote's default branch dynamically. Determine the target base from an explicit task branch or authoritative existing-PR metadata; for other shared branches, prove the configured/tracked base or ask. Use the canonical default only for new work with no other specified base. Stop if the repository, remote, or target base cannot be proven. 2. Classify the source ref as trusted or untrusted before any checkout or worktree creation. For contributor-controlled refs, use the repository's approved untrusted-PR sandbox/review workflow, which must own ref materialization inside the sandbox, or stop. The remaining steps and launch forms are for trusted refs only. 3. For trusted new work, run `git fetch --prune ` immediately before creating a new isolated worktree and branch from `/`. 4. For trusted new work, verify the worktree's initial `HEAD` equals the fetched target-base SHA. Record the canonical remote, canonical default branch, target base branch, base SHA, worktree path, and branch. 5. For a trusted existing PR or shared branch, fetch the canonical target base and source branch immediately before creating an isolated worktree from the fetched source branch. Record that source ref and starting SHA, report its divergence from the refreshed target base, and do not automatically rebase, merge, reset, force-push, or otherwise rewrite shared history. 6. Launch the worker in the isolated worktree, never the primary checkout. For OpenClaw, the primary checkout under `~/Projects/openclaw` remains forbidden. For tasks that modify a Git-backed project, append this block to the worker prompt with real values: ```text Git preparation (mandatory before edits): - canonical remote: - canonical default branch: - target base branch: - fetched target base SHA: - preparation mode: - checkout trust: trusted - prepared source ref: - prepared start SHA: - isolated worktree: - working branch: - preparation receipt: ` ran immediately before creation from `/` | existing branch: the canonical target base and trusted source ref were fetched immediately before the worktree was created from `` at ``> Before editing, verify the current directory is the isolated worktree and its initial HEAD equals . For new work, that SHA must equal . Never edit the primary checkout. For existing PR/shared-branch work, report divergence and do not rebase, merge, reset, force-push, or otherwise rewrite shared history unless explicitly asked. Immediately before the final push or PR for newly authored work, run `git fetch --prune ` and `git merge-base --is-ancestor / HEAD`. If the ancestry check fails, update the new branch onto the latest target base, rerun the relevant proof, and only then push without force. For existing PR/shared-branch work, report a failed ancestry check and follow the repository workflow without rewriting the branch. ``` For trusted refs, the launcher must create and verify the worktree before starting the editing worker; do not delegate worktree creation to that worker. The approved untrusted-PR workflow must instead own checkout and worktree materialization inside its sandbox. Never start a worker in `~/Projects/openclaw`. Read-only tasks and non-project scratch work do not require the Git preparation block. ## Notification block Append this shape to every worker prompt with real values: ```text Notification route: - channel: - target: - account: - reply_to: - thread_id: When finished, send exactly one completion or failure message using: openclaw message send --channel --target '' --message '' Add --account, --reply-to, or --thread-id only when present above. Do not use openclaw system event or heartbeat. ``` If no trustworthy route exists, say completion auto-notify is unavailable. ## Launch forms Write the worker prompt to a temp file first. This avoids shell quoting bugs when the required notification block contains quotes or newlines. ```bash PROMPT=$(mktemp -t openclaw-worker-prompt.XXXXXX) cat >"$PROMPT" <<'EOF' Task. EOF printf 'prompt file: %s\n' "$PROMPT" ``` Use `$PROMPT` when launching from the same shell/session. If using a separate tool call, substitute the printed path. The launch forms below are for trusted checkouts only; untrusted contributor refs require the repository's approved sandbox/review workflow. Before the first Codex worker on a host, prepare a dedicated auth home in the foreground. Do not copy `auth.json` or other credentials from ambient `~/.codex`; authorize this home separately. Codex scopes both file and keyring credentials by `CODEX_HOME`. ```bash CODEX_WORKER_HOME="$HOME/.codex-coding-agent" mkdir -p "$CODEX_WORKER_HOME" if ! env -u CODEX_API_KEY -u CODEX_ACCESS_TOKEN -u OPENAI_API_KEY \ CODEX_HOME="$CODEX_WORKER_HOME" codex login status >/dev/null 2>&1; then printf 'Codex coding-agent login required for %s\n' "$CODEX_WORKER_HOME" env -u CODEX_API_KEY -u CODEX_ACCESS_TOKEN -u OPENAI_API_KEY \ CODEX_HOME="$CODEX_WORKER_HOME" codex login --device-auth fi printf 'Codex worker home: %s\n' "$CODEX_WORKER_HOME" ``` The login is an interactive foreground setup step, not a background worker. The launch command repeats the fixed, quoted home and removes ambient Codex and OpenAI auth overrides. Never export the worker home into the OpenClaw Gateway environment. Codex: ```bash bash pty:true background:true workdir:/path/isolated-worktree command:"env -u CODEX_API_KEY -u CODEX_ACCESS_TOKEN -u OPENAI_API_KEY CODEX_HOME=\"$HOME/.codex-coding-agent\" codex exec - < \"$PROMPT\"" ``` Claude Code: ```bash bash background:true workdir:/path/isolated-worktree command:"claude --permission-mode bypassPermissions --print < \"$PROMPT\"" ``` OpenCode: ```bash bash pty:true background:true workdir:/path/isolated-worktree command:"opencode run < \"$PROMPT\"" ``` ## Long issue-to-PR work 1. Create/reuse a GitHub issue as durable spec. 2. Include issue URL, repo, canonical remote/default branch, target base branch/SHA, isolated worktree, working branch, expected PR, proof, and notification route. 3. Include the mandatory Git preparation block, then tell the worker to implement, test, run review until no accepted actionable findings, and open the PR. 4. Return issue URL and `sessionId` immediately. 5. Monitor with `process`; cancel through Task Registry if mirrored there. ## Scratch Codex Codex needs a trusted git repo. This throwaway scaffold is not project work and has no canonical remote, so the Git preparation block does not apply: ```bash SCRATCH=$(mktemp -d) git -C "$SCRATCH" init PROMPT=$(mktemp -t openclaw-worker-prompt.XXXXXX) cat >"$PROMPT" <<'EOF' Build X. EOF printf 'prompt file: %s\n' "$PROMPT" bash pty:true background:true workdir:$SCRATCH command:"env -u CODEX_API_KEY -u CODEX_ACCESS_TOKEN -u OPENAI_API_KEY CODEX_HOME=\"$HOME/.codex-coding-agent\" codex exec - < \"$PROMPT\"" ``` ## Process actions - `list`: running/recent sessions. - `poll`: status. - `log`: output. - `submit`: send input + Enter. - `write`: raw stdin. - `paste`: paste text. - `kill`: terminate. ## Status to user - Say what started, where, and `sessionId`. - Update only on milestone, worker question, error, user action needed, or finish. - If killed, say why.

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…