AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Patch Approval

skill-jerrylalala-compound-engineering-patch-approval · by Jerrylalala

Fork Overlay:Codex Patch Approval 咨询版。当 Codex 返回 patch 时,Claude 审批后才写入文件。使用时机:Codex 以 patch/diff 格式返回代码变更时,由 Claude 作为审批层。

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add skill-jerrylalala-compound-engineering-patch-approval

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-jerrylalala-compound-engineering-patch-approval)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Patch Approval? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Patch Approval — 咨询版

> Codex 评分:4/10(完整版不可行),咨询版可行。 > > 场景:Codex 生成 patch → Claude 审批 → 用户确认 → 写入。 > 这比「直接接受 Codex 输出」多一层安全保障。


触发条件

当满足以下条件时激活 Patch Approval:

  1. 使用了 Codex 执行器(Codex-first Executor 路由到 Codex)
  2. Codex 返回的是 patch/diff 格式(不是直接文件修改)
  3. 任务不是纯分析(分析任务不需要审批)

审批流程

Step 0: 在隔离目录执行 Codex

> 注意:Codex CLI 不支持 --dry-run 参数(已验证 v0.118+)。 > 唯一安全方案是在临时隔离副本中执行,再用 git diff 捕获 patch。

# 1. 在临时目录创建仓库副本(跨平台安全路径)
ISOLATED_DIR=$(mktemp -d)
git clone . "$ISOLATED_DIR" --local --quiet

# 2. 在隔离目录执行 Codex(真实写入,不影响工作区)
(cd "$ISOLATED_DIR" && codex "$TASK_PROMPT")

# 3. 用 git diff 捕获改动作为 patch
git -C "$ISOLATED_DIR" diff HEAD > "${TMPDIR:-/tmp}/codex-patch.diff"

# 4. 清理隔离目录
rm -rf "$ISOLATED_DIR"

Step 1: Codex 生成 Patch

运行 Step 0 的隔离方案,将 patch 输出到 ${TMPDIR:-/tmp}/codex-patch.diff

Step 2: Claude 审批

Claude 读取 patch 内容,按以下维度评估:

## Patch 审批检查清单

**安全维度**(Blocking):
- [ ] 无 SQL 注入 / XSS / 命令注入
- [ ] 无硬编码密钥或敏感信息
- [ ] 无未授权的文件路径操作

**正确性维度**(Analytical):
- [ ] 改动符合原始任务意图
- [ ] 没有意外的副作用
- [ ] 变量名/函数签名合理

**范围维度**(Advisory):
- [ ] 改动范围在预期之内(没有多改)
- [ ] 没有删除不应删除的代码

Step 3: 审批决策

| 决策 | 条件 | 行动 | |------|------|------| | 通过 | 所有 Blocking 检查通过 | 应用 patch | | 修改后通过 | Analytical 有小问题 | Claude 修正 patch 后应用 | | 拒绝 | Blocking 检查失败 | 拒绝 patch,回退到 Claude 执行 |

Step 4: 用户确认(可选)

对于 gated_auto 类型的改动,展示 patch 摘要并询问确认:

📋 Codex Patch 摘要(已通过 Claude 审批):

  修改 3 个文件:
  + app/models/user.rb  (2 行新增)
  ~ app/controllers/users_controller.rb  (5 行修改)
  - app/views/users/index.html.erb  (1 行删除)

  审批结论:通过(无 Blocking 问题)
  主要改动:[改动描述]

  应用此 patch?(y/n/查看详情)

审批记录

在 state.md 中记录审批结果(如有 Task Bundle):

patch_approval:
  patch_source: "codex"
  approved_at: "2026-04-08T10:00:00+08:00"
  verdict: "pass"  # pass / modified_pass / rejected
  blocking_issues: []
  modifications: []  # Claude 修正的内容

限制说明(咨询版)

| 限制 | 说明 | |------|------| | 不支持自动应用(完整版) | 每次都需要用户确认(安全考虑) | | 不支持复杂冲突解决 | Codex patch 有冲突时回退到 Claude 执行 | | 隔离目录方案依赖 git clone | 工作区必须是 git 仓库,且本地 clone 可用 |


与 ce:work 的集成位置

Codex-first Executor 路由到 Codex
    ↓
Codex 执行(dry-run 模式)
    ↓
Patch Approval(本 skill)
    ├─ 通过 → 应用 patch → 继续 ce:work
    └─ 拒绝 → 记录原因 → 降级到 Claude 执行

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.