分享一个Codeg多智能体协同下的skill案例,在一个会话里跨Agent协同,效率拉满

分享一个Codeg多智能体协同下的skill案例,在一个会话里跨Agent协同,效率拉满
分享一个Codeg多智能体协同下的skill案例,在一个会话里跨Agent协同,效率拉满

使用 Codeg (开启多智能体协同的情况下)在claude code进行开发,在一个会话里使用skill和不使用skill的区别效果:

9e44273b9b3d28f59849afdc0637b08e

使用skill后任务完成会由codex自动review,有问题直接修复,解决了我以前手动来回倒腾的问题。这是skill内容(如果使用其它子智能体review的话,可以把skill里面的codex替换一下),可以直接在skills管理里面添加:

---
name: sub-agent-review-loop
description: Use when any task could modify code, tests, config, schemas, migrations, deps, build/deploy scripts, artifacts, or behavior before completion
---

# Sub-Agent Review Loop

## Overview

Use Codex as an independent reviewer after work that can modify artifacts or behavior. Loop until the latest result is production-ready.

**Core principle:** Work is not complete until Codex approves the latest fixed version as production-ready.

## Required Loop

1. Finish the implementation and run the relevant local checks.
2. Call Codeg MCP `delegate_to_agent` with `agent_type: "codex"`, absolute `working_dir`, and a self-contained `task` containing the request, changed files or diff/SHAs, checks run, and constraints.
3. Require this quality bar: **production-ready; do not approve while in-scope correctness, security, reliability, data, API, UX, performance, test, or maintainability issues remain.**
4. Use `receiving-code-review`: verify claims, fix valid feedback, and push back with evidence on invalid or out-of-scope feedback.
5. Run the relevant checks again after fixes.
6. Send the updated result back to Codex for re-review.
7. Repeat until Codex approves the latest version with no unresolved valid in-scope issues.

Do not use an ordinary in-session Task/general-purpose reviewer as a substitute.

If `delegate_to_agent` is missing, Codeg MCP is not injected/enabled, the call fails, or the Codex child session fails, tell the human and leave the task incomplete or blocked. Do not self-review instead.

## Codeg MCP Call

```json
{
  "agent_type": "codex",
  "working_dir": "<absolute current working directory>",
  "task": "<complete review prompt; child cannot see this conversation>"
}
```

## Codex Review Prompt

```markdown
Review these completed changes as Codex.

Quality bar: production-ready. Do not approve while in-scope correctness,
security, reliability, data, API, UX, performance, test, or maintainability
issues remain.

User request:
<request>

Changes to review:
<diff, changed files, or BASE_SHA..HEAD_SHA>

Verification already run:
<commands and results>

Return:
- Verdict: APPROVED or CHANGES_REQUESTED
- Critical / Important / Minor issues
- Required verification
```

For re-review, add:

```markdown
Re-review the latest state after fixes against the same production-ready quality
bar. Do not approve unless the current version is ready to ship.
```

## Quick Reference

| Situation | Required action |
| --- | --- |
| Artifact/behavior-changing task is done | Call `delegate_to_agent` before final response |
| Codex finds valid issues | Fix, verify, send back to Codex |
| Feedback seems wrong | Verify, push back with evidence |
| Minor issues remain | Fix valid ones unless they expand scope or risk |
| Codex approves latest version | Final response may be sent after checks pass |

## Red Flags

Rationalizations:

- "The change is tiny."
- "The user is waiting."
- "Tests already passed."
- "I reviewed my own diff."
- "Codex only found nits."
- "I fixed the issue, so another review is unnecessary."
- "I used a generic reviewer subagent instead of Codeg MCP."

## Common Mistakes

| Mistake | Fix |
| --- | --- |
| Reviewing the original diff after fixes | Ask Codex to review the latest state |
| Blindly applying feedback | Verify with codebase evidence first |
| Stopping after fixes | Re-dispatch Codex after changes |
| Treating tests as a replacement for review | Run tests and Codex review |
| Using an in-session reviewer | Use Codeg MCP `delegate_to_agent` |

## Completion Gate

Final response is allowed only after implementation and accepted fixes are done,
relevant checks pass or limitations are stated, Codex approves the latest
version, and no known valid production-readiness issue remains in scope.

欢迎佬们使用反馈,或者创作分享 :smiling_face_with_tear:

1 个帖子 - 1 位参与者

阅读完整话题

来源: LinuxDo 最新话题查看原文