Skip to content
Agentmart
Submit a tool

scan-repo

GitHub 開源專案安全掃描工具。當使用者貼上 GitHub URL、詢問某個套件或專案是否安全可信、想在安裝前評估風險,或提到「幫我看一下這個 repo」、「這個專案安不安全」、「我想用這個開源套件」、「這個工具可以信任嗎」時,務必使用此 skill。輸出專案概覽、靜態弱點分析、供應鏈風險、Issues…

Skill by ycs77

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ycs77-scan-repo

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

GitHub 開源專案安全掃描工具。當使用者貼上 GitHub URL、詢問某個套件或專案是否安全可信、想在安裝前評估風險,或提到「幫我看一下這個 repo」、「這個專案安不安全」、「我想用這個開源套件」、「這個工具可以信任嗎」時,務必使用此 skill。輸出專案概覽、靜態弱點分析、供應鏈風險、Issues 安全回報、維護者評估與風險總結。

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/scan-repo

Tools it pre-approves 10

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash(git
  • log
  • *)
  • ls-files
  • Bash(gh
  • repo
  • view
  • issue
  • list
  • Bash(ls

What's inside

Skill name
scan-repo
Description
GitHub 開源專案安全掃描工具。當使用者貼上 GitHub URL、詢問某個套件或專案是否安全可信、想在安裝前評估風險,或提到「幫我看一下這個 repo」、「這個專案安不安全」、「我想用這個開源套件」、「這個工具可以信任嗎」時,務必使用此 skill。輸出專案概覽、靜態弱點分析、供應鏈風險、Issues 安全回報、維護者評估與風險總結。
License
MIT
Allowed tools
Bash(git, log, *), Bash(git, ls-files, *), Bash(gh, repo, view, *), Bash(gh, issue, list, *), Bash(gh, issue, view, *), Bash(ls, *)
Metadata
version: 2026.04.12
Instructions
302 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands
  • Instructions call the network

Files (3)

  • LICENSE
  • README.md
  • SKILL.md

SKILL.md (first lines)

# Scan Repo — GitHub 開源專案安全掃描

## 使用方式

```
/scan-repo https://github.com/owner/repo
```

參數:
- **GitHub repo URL**(必要)— 支援含 query string 的 URL(自動清除 `?fbclid=` 等追蹤參數)

---

## 執行規則

1. **GitHub repo URL** 為必要參數。如果使用者沒有提供,直接詢問,不要猜測。
2. URL 清理:移除 `?fbclid=`、`?ref=` 等追蹤參數,保留 `https://github.com/owner/repo` 格式。
3. 前置檢查通過後才開始掃描流程。
4. 掃描完成後清理:無論掃描是否成功,都必須刪除 clone 的 repo(見下方路徑說明)。

---

## 前置檢查

掃描前依序確認:

```bash
# 1. git 是否可用
git --version

# 2. gh 是否可用且已登入
gh auth status
```

- `git` 不可用 → 停止,提示安裝
- `gh` 不可用或未登入 → 警告,跳過 Phase 5(Issues 掃描),其餘照跑

---

## 掃描流程

### Phase 1:專案概覽

依作業系統決定 clone 路徑:

- **Linux / macOS**:`/tmp/scan-repo-{repo_name}`
- **Windows**:`$env:TEMP\scan-repo-{repo_name}`(PowerShell)或 `%TEMP%\scan-repo-{repo_name}`(CMD)

```bash
# Linux/macOS
git clone --depth 50 {repo_url} /tmp/scan-repo-{repo_name}

# Windows (PowerShell)
git clone --depth 50 {repo_url} "$env:TEMP\scan-repo-{repo_name}"
```

> **注意**:`--depth 50` 適合大多數情況。若 Phase 6 需要評估更長期的 commit 活動,可改為 `--depth 200`。若 repo 歷史特別短,shallow clone 不影響結果。

分析並整理:

| 項目 | 內容 |
|------|------|
| 專案名稱 | |
| 用途說明 | 一句話描述這個專案做什麼 |
| 主要語言 | |
| 關鍵檔案 | 列出核心檔案及其功能 |
| 執行方式 | 如何安裝/使用(從 README 或程式碼判斷)|
| Stars / Forks | |
| License | |
| 最後 commit | 日期 + 內容摘要 |

**重點:用最少的字讓人搞懂這個 repo 在幹嘛。**

---

### Phase 2:依賴分析

掃描以下檔案(存在才掃):

- `package.json` / `package-lock.json`(Node.js)
- `requirements.txt` / `setup.py` / `pyproject.toml`(Python)
- `go.mod`(Go)
- `Cargo.toml`(Rust)
- `Gemfile`(Ruby)
- `pom.xml` / `build.gradle`(Java)
- `composer.json`(PHP)

檢查項目:
- [ ] 是否有已知高風險套件(如 `event-stream`、`ua-parser-js` 等曾被投毒的套件)
- [ ] 依賴數量是否合理(一個小工具拉了 200 個套件?)
- [ ] 是否有 `postinstall`、`preinstall` hook(package.json scripts)
- [ ] 是否鎖定版本(有無 lock file)
- [ ] 依賴是否仍在維護(看最後更新時間)
- [ ] 是否有 native binary 依賴(如 `sharp`、`node-gyp` 等,增加攻擊面)

---

### Phase 3:靜態弱點掃描

優先掃描以下目錄(按風險高低排序):`src/`、`lib/`、`bin/`、`scripts/`、根目錄的 `.js`/`.py`/`.sh`/`.ts` 檔案。

排除以下目錄與檔案(不掃描):`node_modules/`、`.git/`、`dist/`、`build/`、`vendor/`、`__pycache__/`,以及大於 1MB 的單一檔案。

對每個符合條件的原始碼檔案,檢查以下類別:

#### 3.1 命令注入(Command Injection)
- `exec()`、`execSync()`、`spawn()` 使用未過濾的外部輸入
- `os.system()`、`subprocess.call()` 拼接字串
- `` `backtick` `` 或 `$()` 內含變數
- `eval()` 動態執行

#### 3.2 路徑穿越(Path Traversal)
- 使用者輸入直接拼接檔案路徑(無 `path.resolve` 或 sanitize)
- `../` 未被過濾

#### 3.3 硬編碼機密(Hardcoded Secrets)
- API key、token、password 寫死在程式碼中
- `.env` 檔案被追蹤到 git

From ycs77/skills, MIT.

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 8, 2026 (22 days ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
2026.04.12
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from ycs77

Cite this page

scan-repo skill. Agent Mart. https://agentmart.dev/skills/ycs77-scan-repo (last updated 2026-10-24)