codex-cc-guide

如何用 ACP sessions_spawn 调用 Claude Code / Codex 写代码 — 小code 团队编码任务指南

33 stars

Best use case

codex-cc-guide is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

如何用 ACP sessions_spawn 调用 Claude Code / Codex 写代码 — 小code 团队编码任务指南

Teams using codex-cc-guide should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/codex-cc-guide/SKILL.md --create-dirs "https://raw.githubusercontent.com/aAAaqwq/AGI-Super-Team/main/skills/codex-cc-guide/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/codex-cc-guide/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How codex-cc-guide Compares

Feature / Agentcodex-cc-guideStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

如何用 ACP sessions_spawn 调用 Claude Code / Codex 写代码 — 小code 团队编码任务指南

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# ACP 调用 Claude Code / Codex 写代码指南

## 核心:sessions_spawn + runtime: "acp"

在 OpenClaw 里,agent 可以直接用 `sessions_spawn` 调起 Claude Code 或 Codex,写代码像发指令一样简单。

### 最常用:Claude Code(已装在 /usr/bin/claude)

```javascript
sessions_spawn({
  task: "用 TypeScript 重构 ~/project/src/api.ts,加入错误处理和类型定义",
  runtime: "acp",
  agentId: "claude",        // 或 "claude-code"
  label: "重构-api",
  mode: "run",              // run=一次性,session=持久会话
  cleanup: "delete"         // 完成后删除 session
})
```

### Codex(需要额外配置)

```javascript
sessions_spawn({
  task: "写一个 Python FastAPI CRUD 接口",
  runtime: "acp",
  agentId: "codex",
  model: "openai/gpt-5.4",
  label: "fastapi-crud"
})
```

## 两种模式:一次性 vs 持久会话

| 模式 | 参数 | 适用场景 |
|------|------|---------|
| **一次性** | `mode: "run"` | 单个任务,完成即删,最省资源 |
| **持久会话** | `mode: "session"` | 多步骤迭代、需要上下文累积 |

```javascript
// 一次性:适合简单任务
sessions_spawn({
  task: "在 /tmp 创建一个 React 组件 Counter.tsx",
  runtime: "acp",
  agentId: "claude",
  mode: "run"
})

// 持久会话:适合复杂项目
sessions_spawn({
  task: "继续上次的工作,修复登录页面的 bug",
  runtime: "acp",
  agentId: "claude",
  mode: "session",
  label: "react-project"
})
```

## 持久会话 + thread:绑定到 Telegram 话题

```javascript
sessions_spawn({
  task: "用 Next.js 14 App Router 重构整个电商前端",
  runtime: "acp",
  agentId: "claude",
  thread: true,              // 绑定到当前 Telegram thread
  mode: "session",
  label: "nextjs重构"
})
```

完成后 Claude Code 的输出会自动推送到 Telegram thread 里。

## 聊天指令(人类直接用)

在 Telegram 发这些指令即可:

```
/acp spawn claude 帮我写一个 Docker Compose 文件

/acp spawn codex 用 Rust 写一个 http server

/acp status   查看当前 ACP 会话状态

/acp cancel    取消当前任务

/acp close     关闭会话
```

## 小code 团队标准工作流

**场景**:Daniel 让你写一个 API

**错误做法**(慢、资源浪费):
```
自己开模型 → 写代码 → 测试 → 修 bug → 循环
```

**正确做法**(用 ACP + Claude Code):
```
1. 理解需求,确定技术栈和文件位置
2. sessions_spawn 调起 Claude Code 一次性任务
3. Claude Code 完成后你负责 review
4. 有问题再调一次 Claude Code 修
```

```javascript
// 示例:Daniel 让小code 写一个用户认证 API
sessions_spawn({
  task: `在 ~/clawd/projects/api/ 下创建用户认证模块:
  - POST /auth/login(邮箱+密码,返回 JWT)
  - POST /auth/register(邮箱+密码+昵称)
  - GET /auth/me(返回当前用户信息,需带 Bearer token)
  - 使用 Python FastAPI + SQLite
  - 密码用 bcrypt 哈希
  - JWT secret 从环境变量 AUTH_SECRET 读取
  - 代码要可以运行,有完整的错误处理`,
  runtime: "acp",
  agentId: "claude",
  label: "auth-api"
})
```

## 关键规则

1. **任务描述要具体**:包含文件路径、技术栈、具体要求
2. **清理 session**:`cleanup: "delete"` 避免垃圾积累
3. **并发控制**:最多同时跑 3 个 ACP 会话
4. **Review 是你的活**:Claude Code 写完你要检查,不是直接交付

## 错误排查

| 症状 | 检查项 |
|------|--------|
| `sessions_spawn` 没反应 | 确认 `acp.enabled: true` 在 openclaw.json |
| Claude Code 报错 "not found" | 确认 `/usr/bin/claude` 存在 |
| 会话卡住 | `/acp cancel` 然后重试 |
| 输出没推送到 Telegram | 确认 `thread: true` 且在支持 thread 的 channel |

## 配置文件参考

```json5
{
  acp: {
    enabled: true,
    defaultAgent: "claude",
    allowedAgents: ["claude", "codex", "gemini-cli"]
  }
}
```

Related Skills

web-design-guidelines

33
from aAAaqwq/AGI-Super-Team

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

tdd-guide

33
from aAAaqwq/AGI-Super-Team

Test-driven development workflow with test generation, coverage analysis, and multi-framework support

style-guide-generator

33
from aAAaqwq/AGI-Super-Team

Generate comprehensive website style guides and design systems from URLs, screenshots, and existing documentation. Use this skill when users ask to create a style guide, design system documentation, brand guidelines document, or design specification from a website, app, or existing materials. This skill produces professional PDF outputs following industry-standard style guide structure.

code-moment-codex-switch

33
from aAAaqwq/AGI-Super-Team

> Code/Codex 智能切换——在 Claude Code 和 Codex 之间自动选择最优编码 Agent

browser-profile-guide

33
from aAAaqwq/AGI-Super-Team

OpenClaw Browser 配置文件系统完全指南 — 哪个 profile 何时用、如何选

brand-guidelines

33
from aAAaqwq/AGI-Super-Team

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

wemp-operator

33
from aAAaqwq/AGI-Super-Team

> 微信公众号全功能运营——草稿/发布/评论/用户/素材/群发/统计/菜单/二维码 API 封装

Content & Documentation

zsxq-smart-publish

33
from aAAaqwq/AGI-Super-Team

Publish and manage content on 知识星球 (zsxq.com). Supports talk posts, Q&A, long articles, file sharing, digest/bookmark, homework tasks, and tag management. Use when publishing content to 知识星球, creating/editing posts, uploading files/images/audio, managing digests, batch publishing, or formatting content for 知识星球.

zoom-automation

33
from aAAaqwq/AGI-Super-Team

Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.

zoho-crm-automation

33
from aAAaqwq/AGI-Super-Team

Automate Zoho CRM tasks via Rube MCP (Composio): create/update records, search contacts, manage leads, and convert leads. Always search tools first for current schemas.

ziliu-publisher

33
from aAAaqwq/AGI-Super-Team

字流(Ziliu) - AI驱动的多平台内容分发工具。用于一次创作、智能适配排版、一键分发到16+平台(公众号/知乎/小红书/B站/抖音/微博/X等)。当用户需要多平台发布、内容排版、格式适配时使用。触发词:字流、ziliu、多平台发布、一键分发、内容分发、排版发布。

zhihu-post-skill

33
from aAAaqwq/AGI-Super-Team

> 知乎文章发布——知乎平台内容创作与发布自动化