Huo15 Openclaw Code Review

v1.0.0

对 GitHub / cnb.cool PR 做综合代码评审(设计 / 实现 / 测试 / 安全 / 可维护五维),借 gh CLI 拉 diff,产出可粘贴到 PR 的评论 markdown。触发词:评审 PR、code review、审一下这个 PR、帮我 review、看看这个合并请求。

0· 79·0 current·0 all-time
byJob Zhao@zhaobod1

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for zhaobod1/huo15-openclaw-code-review.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Huo15 Openclaw Code Review" (zhaobod1/huo15-openclaw-code-review) from ClawHub.
Skill page: https://clawhub.ai/zhaobod1/huo15-openclaw-code-review
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install huo15-openclaw-code-review

ClawHub CLI

Package manager switcher

npx clawhub@latest install huo15-openclaw-code-review
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The skill claims to use the gh CLI / repo diffs to produce reviews, and its workflow and outputs match that purpose. Minor incongruity: SKILL.md repeatedly references the gh CLI and git diff, yet the registry metadata declares no required binaries — this is explainable because the skill explicitly says it will not exec commands and instead returns commands for the user to run or uses provided context.
Instruction Scope
Instructions focus on fetching PR metadata/diff, scanning files, producing five-dimensional findings, inline comments, and a summary. It does not instruct the agent to perform merges, post comments, run tests/builds, or read unrelated system files. It does direct checks for secret-like patterns (expected for security review) and delegates deeper scanning to a dedicated security-review skill.
Install Mechanism
Instruction-only skill with no install spec and no code files — lowest risk. Nothing is written to disk or fetched at install time.
Credentials
The skill declares no required environment variables or credentials and its actions do not require secrets. The instructions ask users to provide PR URLs or paste command output; they do not request tokens or credentials.
Persistence & Privilege
always is false and the skill does not request persistent system presence or modify other skills/config. It explicitly forbids autonomous actions like approving/merging/commenting unless the user explicitly asks.
Assessment
This skill is a read-only, instruction-only code-review assistant that returns text you can paste into a PR. It will not autonomously run gh/git commands, post comments, or merge — you must run any returned CLI commands or explicitly ask it to act. Before using, be careful what you paste: if you paste full diffs or outputs that contain secrets, those secrets could appear in the skill's output. If you expect the skill to run commands locally, note it won't execute them unless the platform/context you use supplies the command outputs. If you need the skill to perform automated posting or merges, require a different skill and only allow that after verifying its permissions.

Like a lobster shell, security has layers — review code before you run it.

latestvk977apqxr9fs9aztzfh1q9qerh85e1bh
79downloads
0stars
1versions
Updated 3d ago
v1.0.0
MIT-0

火一五代码评审技能 v1.0

五维 PR 评审 + 可粘贴评论 — 青岛火一五信息科技有限公司


一、触发场景

  • "帮我 review PR #123"
  • "审一下这个合并请求"
  • "code review 一下我的 PR"
  • 用户贴 PR URL:https://github.com/xxx/yyy/pull/123https://cnb.cool/.../merge_requests/45

产出:五维清单 + 行内评论建议 + 总评(批准/请改/阻断)+ 一段可直接粘贴到 PR 的 markdown。


二、评审五维

维度关注点不关注
1. 设计(Design)方案是否对问题对症 / 抽象是否合适 / 与现有架构一致风格偏好
2. 实现(Implementation)逻辑正确 / 边界处理 / 错误处理 / 资源回收次要优化
3. 测试(Tests)关键路径有单测 / 边界 case / 回归100% 覆盖率
4. 安全(Security)代理 huo15-openclaw-security-review 做六类扫描
5. 可维护(Maintainability)命名 / 文档 / 可读性 / 变更局部性代码风格(交给 linter)

三、工作流(严格按序)

Step 1:拉取 PR 元信息

# GitHub
gh pr view <number> --json title,body,author,baseRefName,headRefName,files,commits,additions,deletions

# cnb.cool(如有 API / CLI)
curl .../merge_requests/<id>

不 exec — 返回命令让用户粘贴结果,或若上下文里已有就用。

Step 2:拉取 diff

gh pr diff <number>
# 或
git diff <base>...<head>

Step 3:分段阅读 + Grep 关键字

  • 每个文件至少过一遍
  • Grep 高危模式(密钥 / SQL 拼接 / dangerouslySetInnerHTML)转交 security-review 思路
  • 对新增函数:检查命名、参数、返回值、错误处理

Step 4:五维评分

对 5 维每个给:

  • ✅ Pass
  • ⚠️ Minor(可合但建议改)
  • ❌ Blocker(必须改)

Step 5:生成行内评论

每条评论格式:

`path/to/file.ts:line` — <简短标题>

<问题描述>
<建议>

Step 6:总评

  • Approve — 全 ✅ 或只有 🟢 minor
  • Request changes — 有任何 ⚠️ 影响核心
  • Block — 有 ❌ 安全 / 数据丢失 / 不兼容风险

四、报告模板

## 📋 Code Review — PR #123 "<title>"

**作者**:@xxx · **变更**:12 文件 +340 -120 · **评审耗时**:5 min

### 五维评分
- Design:✅
- Implementation:⚠️ 2 处
- Tests:⚠️ 缺边界测试
- Security:✅(无新增攻击面)
- Maintainability:✅

### 总评:🟡 Request Changes

必改后合并:1 处 Implementation blocker + 1 处测试缺失。

---

### 行内评论

**`src/api/user.ts:45`** — 边界未处理
当 `userId` 为 `undefined` 时 `db.user.findById(userId)` 会返回所有用户。
建议:函数入口加 `if (!userId) throw new Error(...)`。

**`src/api/user.ts:88`** — 错误吞掉
`catch(e) { return null }` 掩盖了数据库连接错误。
建议:区分「找不到」和「出错」,至少记日志。

**`tests/user.test.ts`** — 缺边界用例
新增的 `mergeProfile` 没测 `null` / `undefined` / `{}` 空对象三种输入。
建议:补 3 条测试用例。

### 其他观察(不阻塞合并)
- 命名 `data` → `userProfile` 可读性更好(src/utils.ts:12)
- 可用 `Pick<User, 'id'|'name'>` 替代手写接口(types.ts:33)

---

🤖 Reviewed by huo15-openclaw-code-review

五、硬红线(绝不触碰)

  1. gh pr review --approve / --request-changes — 评审意见由人提交(避免 AI 自己批自己的 PR)
  2. gh pr merge — 合并决策权归人
  3. 不自动 gh pr comment — 除非用户明确说"直接发到 PR 上"
  4. 不跑测试 / build — 除非用户要求
  5. 禁 child_processgh 命令走 return-cliCmd

六、与相邻技能的边界

场景用哪个
PR 综合评审本技能
只看安全huo15-openclaw-security-review
只看代码质量huo15-openclaw-simplify
只看设计稿 / UIhuo15-openclaw-design-critique

Comments

Loading comments...