Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/tomes --skill github-code-analysis명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | github-code-analysis |
| description | > Use when this capability is needed. |
提供六大能力,覆盖代码全生命周期质量管控:
| 能力 | 触发词示例 | 说明 |
|---|---|---|
| PR 审查 | "review PR"、"审查 PR #52" | 拉取 PR diff,四维度分析,写回 comment |
| 代码质量扫描 | "代码质量扫描"、"quality scan" | 扫描仓库/目录的命名、复杂度、重复、一致性 |
| 安全扫描 | "安全扫描"、"security scan" | 检测注入、硬编码 secret、不安全依赖 |
| 性能扫描 | "性能扫描"、"performance scan" | 检测 N+1、内存泄露、阻塞调用 |
| 不一致扫描 | "不一致扫描"、"consistency check" | 检测代码风格/模式/命名不一致 |
| 自动生成文档 | "生成文档"、"generate docs" | 为模块/函数/API 生成 markdown 文档 |
beyonai/ByClawIMPORTANT: Always start by executing Step 0. Do NOT ask the user for a token. Do NOT suggest creating a token. Do NOT mention GITHUB_TOKEN or environment variables.
Run this command immediately — do not ask the user anything first:
node skills/github-code-analysis/scripts/gh-pr-list.mjs --limit 1
If "ok": true → proceed based on user intent.
If "auth_required": true → the output already contains verification_uri, user_code, and message. Do these things:
message field content to the user verbatim (it has the link and code)node skills/github-code-analysis/scripts/gh-auth-login.mjs --poll
"ok": true → 授权成功,重新执行用户的原始请求"retry": true → 告诉用户"还没完成,请确认浏览器中已授权"禁止:不得提及 GITHUB_TOKEN、PAT、Personal Access Token、环境变量、手动配置。授权完全由脚本自动处理。
用户说"review PR"、"审查 PR"、"帮我看看 PR"、"代码审查"等。
Do NOT ask the user for PR number or repo. Follow this logic:
node skills/github-code-analysis/scripts/gh-pr-list.mjs --state open --limit 5
Pick the first PR from the result and proceed.
node skills/github-code-analysis/scripts/gh-pr-fetch.mjs --pr <number> --format all
Read references/review-prompts.md for detailed criteria. Analyze across four dimensions:
Post review comment:
echo '<json>' | node skills/github-code-analysis/scripts/gh-pr-comment.mjs
## 🔍 PR Review: #{number} {title}
**Reviewer**: ByClaw AI | **Dimensions**: Security, Performance, Quality, Tests
### Summary
{1-2 sentence overview}
### Findings
#### 🔒 Security
{findings or "No issues found"}
#### ⚡ Performance
{findings or "No issues found"}
#### 📐 Quality
{findings or "No issues found"}
#### 🧪 Tests
{findings or "No issues found"}
### Verdict
{approve / needs changes / comment only}
---
*Automated review by ByClaw AI*
用户说"代码质量扫描"、"quality scan"、"扫描代码质量"、"检查代码规范"等。
确定扫描范围:
byclaw-fe/srcbyclaw-be/srcClone 仓库到本地(如已 clone 则自动更新):
node skills/github-code-analysis/scripts/gh-repo-clone.mjs
脚本输出 data.path 即为本地仓库路径。后续直接用 cat/grep/find 等命令读取本地文件分析。
# 列出目标目录结构
find <repo-path>/byclaw-fe/src -name "*.ts" -o -name "*.tsx" | head -30
# 读取具体文件
cat <repo-path>/byclaw-fe/src/utils/request.ts
## 📐 代码质量报告
**扫描范围**: {repo/path/PR}
**扫描时间**: {timestamp}
### 统计
- 扫描文件数: N
- 发现问题: N (critical: X, warning: Y, suggestion: Z)
### 问题列表
| 严重度 | 文件 | 行号 | 类别 | 描述 |
|--------|------|------|------|------|
| ⚠️ | src/foo.ts | 42 | 命名 | 混用 camelCase 和 snake_case |
| ... | ... | ... | ... | ... |
### 建议
{top 3 改进建议}
用户说"安全扫描"、"security scan"、"检查安全漏洞"、"有没有安全问题"等。
node skills/github-code-analysis/scripts/gh-repo-clone.mjs
然后用 find/grep/cat 在本地仓库路径中读取文件。
对于 PR 变更可用:node skills/github-code-analysis/scripts/gh-pr-fetch.mjs --pr <number> --format files
## 🔒 安全扫描报告
**扫描范围**: {target}
**风险等级**: {高/中/低}
### 发现
#### Critical
{list or "无"}
#### Warning
{list or "无"}
### 修复建议
{prioritized fix suggestions}
用户说"性能扫描"、"performance scan"、"性能分析"、"有没有性能问题"等。
node skills/github-code-analysis/scripts/gh-repo-fetch.mjs --dir <target-path>
# 或针对 PR 变更:
node skills/github-code-analysis/scripts/gh-pr-fetch.mjs --pr <number> --format files
## ⚡ 性能扫描报告
**扫描范围**: {target}
### 发现
| 严重度 | 文件 | 问题 | 影响 | 建议 |
|--------|------|------|------|------|
| 🔴 | ... | N+1 query in loop | 线性增长延迟 | 改为批量查询 |
| ... | ... | ... | ... | ... |
### 优化优先级
1. {most impactful fix}
2. ...
用户说"不一致扫描"、"consistency check"、"检查一致性"、"风格不统一"等。
node skills/github-code-analysis/scripts/gh-repo-clone.mjs
然后用 find/grep/cat 在本地仓库路径中读取文件。
## 🔄 不一致性报告
**扫描范围**: {target}
### 发现的不一致模式
#### 1. {pattern name}
- **现状**: 文件 A 用 X 方式,文件 B 用 Y 方式
- **涉及文件**: file1.ts, file2.ts, ...
- **建议**: 统一为 {recommended pattern},原因:{why}
#### 2. ...
### 统一建议
{overall recommendation for consistency}
用户说"生成文档"、"generate docs"、"写文档"、"API 文档"、"模块文档"等。
确定文档目标:
确保仓库已 clone 到本地:
node skills/github-code-analysis/scripts/gh-repo-clone.mjs
然后用 find/cat 在本地仓库路径中读取源码。对于 PR 变更可用:
node skills/github-code-analysis/scripts/gh-pr-fetch.mjs --pr <number> --format files
生成文档内容:
输出为 markdown,可直接用于 README 或 docs/ 目录
## 📝 自动生成文档
### {Module/Function/API Name}
**路径**: `src/path/to/file.ts`
**职责**: {one-line description}
#### 导出 API
| 名称 | 类型 | 说明 |
|------|------|------|
| functionA | function | ... |
| TypeB | type | ... |
#### 使用示例
\`\`\`typescript
import { functionA } from "./path";
const result = await functionA(params);
\`\`\`
#### 注意事项
- {important notes}
| 脚本 | 用途 | 示例 |
|---|---|---|
gh-repo-clone.mjs | Clone 仓库到本地 | node skills/github-code-analysis/scripts/gh-repo-clone.mjs |
gh-pr-list.mjs | 列出 PR | node skills/github-code-analysis/scripts/gh-pr-list.mjs --state open --limit 5 |
gh-pr-fetch.mjs | 拉取 PR 数据 | node skills/github-code-analysis/scripts/gh-pr-fetch.mjs --pr 52 --format all |
gh-pr-comment.mjs | 写回 PR comment | echo '{...}' | node skills/github-code-analysis/scripts/gh-pr-comment.mjs |
gh-repo-fetch.mjs | 轻量 API 查询(单文件/目录树) | node skills/github-code-analysis/scripts/gh-repo-fetch.mjs --tree --path src |
Clone 仓库到 skills/github-code-analysis/.cache/ByClaw/:
node skills/github-code-analysis/scripts/gh-repo-clone.mjs
输出 data.path 为本地路径。后续直接用标准命令分析:
# 列出文件
find <path>/byclaw-fe/src -name "*.ts" | head -20
# 搜索模式
grep -rn "password" <path>/byclaw-be/src --include="*.java" | head -20
# 读取文件
cat <path>/byclaw-fe/src/utils/request.ts
再次运行时自动 git pull 更新,不会重复 clone。用 --force 强制重新 clone。
所有脚本默认仓库为 beyonai/ByClaw,可通过 --repo owner/repo 覆盖。
beyonai/ByClaw,不要问REQUEST_CHANGES when there are critical security or correctness issuesSource: beyonai/ByClaw — distributed by TomeVault.