JamesChan21

GitHub Knowledge Base

開發程式設計v1.0.1
作者:JamesChan21更新於 2026-05-17共 2 個版本 · 最新版本釋出於 2026-01-27github-kb@clawhub_jameschan21/github-kb
Git 輔助#GitHub#Knowledge Base

據 AlphaMoat 統計,截至 2026-09,GitHub Knowledge Base 累計下載 4,025 次、獲 3 個星標,在全部 5,078 個 AI 技能中排名第 2,538 位,在「開發程式設計」分類(577 個)中排名第 333 位。

累計安裝
123
累計下載
4025
星標
3
全站排名
#2,538
全站前 50% · 「開發程式設計」前 58%
平台累計安裝累計下載星標評論
ClawHub ↗12336932-
SkillHub ↗12240253—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

主文要求先配置 GITHUB_KB_PATH,可選透過 GITHUB_TOKEN 訪問私有倉庫;克隆專案後可更新本地 GITHUB_KB.md 目錄。令牌可能擁有較廣倉庫許可權,本地知識庫也可能累積私有或不可信倉庫,因此應使用最小許可權憑證、限定儲存路徑並審查持久化內容。

資料釋出於 2026-10-29

可以用來做什麼

  • 搜尋 GitHub 倉庫、Issue 或 Pull Request
  • 規劃將指定倉庫克隆到本地知識庫
  • 維護本地專案目錄條目

什麼時候用

  • 使用者明確授權查詢或克隆相應 GitHub 倉庫,並確認本地知識庫目錄與訪問許可權時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

只列出可用於搜尋公開倉庫的 gh CLI 命令,不訪問 GitHub 或克隆倉庫。
克隆私有倉庫前,列出需要確認的令牌許可權、儲存路徑和審查要求。

月度資料趨勢

累計下載4025
3053357540972026-05 · 累計下載 31252026-06 · 累計下載 32732026-07 · 累計下載 34882026-08 · 累計下載 36422026-09 · 累計下載 402526-0526-09
星標3
2332026-05 · 星標 22026-06 · 星標 32026-07 · 星標 32026-08 · 星標 32026-09 · 星標 326-0526-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094025—3
2026-083642+4.4%3
2026-073488+6.6%3
2026-063273+4.7%3
2026-053125—2

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

4.7 KB · ClawHub v1.0.1
---
name: github-kb
description: Manage a local GitHub knowledge base and provide GitHub search capabilities via gh CLI. Use when users ask about repos, PRs, issues, request to clone GitHub repositories, explore codebases, or need information about GitHub projects. Supports searching GitHub via gh CLI and managing local KB with GITHUB_KB.md catalog. Configure via GITHUB_TOKEN and GITHUB_KB_PATH environment variables.
---

# GitHub Knowledge Base

Manage a local GitHub knowledge base and provide GitHub search capabilities via gh CLI. Key file: GITHUB_KB.md at the root of the KB directory catalogs all projects with brief descriptions.

## Configuration
展開全部(共 156 行)

Set environment variables before use:
- `GITHUB_TOKEN` - GitHub Personal Access Token (optional, for private repos)
- `GITHUB_KB_PATH` - Path to local KB directory (default: `/home/node/clawd/github-kb`)

Example:
```bash
export GITHUB_TOKEN="ghp_xxxx..."
export GITHUB_KB_PATH="/your/path/github-kb"
```

**Token Privacy:** Never hardcode tokens. Inject via environment variables or container secrets.

## GitHub CLI (gh)

**Requirement:** GitHub CLI must be installed and authenticated.

**Installation:**
- **macOS:** `brew install gh`
- **Linux:** `apt install gh` or see [official install guide](https://github.com/cli/cli/blob/trunk/docs/install_linux.md)
- **Windows:** `winget install GitHub.cli`

**Authentication:**
```bash
# Interactive login
gh auth login

# Or use token from GITHUB_TOKEN env var
gh auth login --with-token <(echo "$GITHUB_TOKEN")
```

**Verify:** `gh auth status`

If `gh` is not installed or not authenticated, skip search operations and use only local KB features.

### Searching Repos

```bash
# Search repos by keyword
gh search repos <query> [--limit <n>]

# Examples:
gh search repos "typescript cli" --limit 10
gh search repos "language:python stars:>1000" --limit 20
gh search repos "topic:mcp" --limit 15
```

**Search qualifiers:**
- `language:<lang>` - Filter by programming language
- `stars:<n>` or `stars:><n>` - Filter by star count
- `topic:<name>` - Filter by topic
- `user:<owner>` - Search within a user's repos
- `org:<org>` - Search within an organization

### Searching Issues

```bash
gh search issues "react hooks bug" --limit 20
gh search issues "repo:facebook/react state:open" --limit 30
gh search issues "language:typescript label:bug" --limit 15
```

**Search qualifiers:**
- `repo:<owner/repo>` - Search in specific repository
- `state:open|closed` - Filter by issue state
- `author:<username>` - Filter by author
- `label:<name>` - Filter by label
- `language:<lang>` - Filter by repo language
- `comments:<n>` or `comments:><n>` - Filter by comment count

### Searching Pull Requests

```bash
# Search PRs
gh search prs <query> [--limit <n>]

# Examples:
gh search prs "repo:vercel/next.js state:open" --limit 30
gh search prs "language:go is:merged" --limit 15
```

**Search qualifiers:**
- `repo:<owner/repo>` - Search in specific repository
- `state:open|closed|merged` - Filter by PR state
- `author:<username>` - Filter by author
- `label:<name>` - Filter by label
- `language:<lang>` - Filter by repo language
- `is:merged|unmerged` - Filter by merge status

### Viewing PR/Issue Details

```bash
# View issue/PR details
gh issue view <number> --repo <owner/repo>
gh pr view <number> --repo <owner/repo>

# View with comments
gh issue view <number> --repo <owner/repo> --comments
gh pr view <number> --repo <owner/repo> --comments
```

## Local Knowledge Base Workflow

### Querying About a Repo in KB

1. Read GITHUB_KB.md to understand what projects exist
2. Locate the project directory under ${GITHUB_KB_PATH:-/home/node/clawd/github-kb}/

### Cloning a New Repo to KB

1. Search GitHub if the full repo name is not known
2. Clone to KB directory:
   ```bash
   git clone https://github.com/<owner>/<name>.git ${GITHUB_KB_PATH:-/home/node/clawd/github-kb}/<name>
   ```
3. Generate project description: Read README or key files to understand the project
4. Update GITHUB_KB.md: Add entry for the new repo following the existing format:
   ```markdown
   ### [<name>](/<name>)
   Brief one-line description of what the project does. Additional context if useful (key features, tech stack, etc.).
   ```
5. Confirm completion: Tell user the repo was cloned and where to find it

### Default Clone Location

If user says "clone X" without specifying a directory, default to ${GITHUB_KB_PATH:-/home/node/clawd/github-kb}/.

## GITHUB_KB.md Format

The catalog file follows this structure:

```markdown
# GitHub Knowledge Base

This directory contains X GitHub projects covering various domains.

---

## Category Name

### [project-name](/project-name)
Brief description of the project.
```

Maintain categorization and consistent formatting when updating.

「開發程式設計」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。