← 返回 Skills 市场
chat2dev

Github Forker

作者 chat2dev · GitHub ↗ · v0.1.1 · MIT-0
cross-platform ⚠ suspicious
256
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install github-forker
功能描述
Use this skill when the user wants to fork a GitHub repository — creating their own copy of a repo under their GitHub account. Trigger on any fork or copy-to...
使用说明 (SKILL.md)

GitHub Forker

Fork GitHub repositories extracted from text or images. You need GITHUB_TOKEN set in the environment with repo permissions.

What you do

  1. Extract all GitHub repository URLs from the input (text, image, or both)
  2. Fork each repository via the GitHub API
  3. Star the original repository after a successful fork
  4. Report results clearly

Step 1: Extract GitHub URLs

From text

Scan the input for patterns matching:

  • https://github.com/{owner}/{repo} (with or without trailing slash, path, or fragment)
  • github.com/{owner}/{repo} (without scheme)
  • {owner}/{repo} only when context makes it clearly a GitHub repo

Normalize each match to the canonical form: https://github.com/{owner}/{repo} Strip any extra path segments — you only need owner and repo name.

From images

When the user provides an image (screenshot, photo, diagram), use your vision capabilities to read the image and identify any GitHub URLs or repo references visible in it. Apply the same extraction rules as above to whatever text you find.

Truncated URLs

URLs are often cut off in screenshots or social media previews, like:

  • github.com/openchamber/op...
  • github.com/some-owner/proj…

When you detect a truncated URL (ends with ... or , or the repo name is clearly incomplete):

  1. Search GitHub for matching repos:

    curl -s -L \
      -H "Authorization: Bearer $GITHUB_TOKEN" \
      -H "Accept: application/vnd.github+json" \
      "https://api.github.com/search/repositories?q={owner}/{partial}+in:full_name&per_page=5"
    

    Use whatever partial info you have — owner + partial repo name is ideal; owner alone works too.

  2. Use context to pick the best match. Look at surrounding text, tweet content, project name mentioned, description keywords, and star count. If one result stands out clearly:

    • The repo name starts with the visible partial (e.g. op...openchamber matches)
    • The description aligns with what the user said (e.g. "UI真好" → pick the UI-focused one)
    • It has significantly more stars than the others

    If you're confident, proceed directly and tell the user your reasoning:

    "github.com/openchamber/op..." → inferred openchamber/openchamber ⭐1.5k (Desktop UI for OpenCode, matches context "UI真好")
    
  3. Ask the user only when genuinely uncertain — when multiple results are plausible and context doesn't help distinguish them:

    Found truncated URL "github.com/foo/bar..." — which repo did you mean?
    1. foo/barista ⭐420 — Coffee shop POS system
    2. foo/baroque ⭐38 — Baroque music generator
    Enter number (or 0 to skip):
    

    Never fork a truncated URL without either a confident inference or explicit user confirmation.

Step 2: Fork via GitHub API

For each unique {owner}/{repo} pair, call the fork endpoint:

curl -s -L -X POST \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/{owner}/{repo}/forks

The -L flag is required — GitHub's API returns a 307 redirect that must be followed.

  • If GITHUB_TOKEN is not set, tell the user to set it and stop:
    export GITHUB_TOKEN="ghp_..."   # classic PAT (recommended)
    # To persist across sessions, add to ~/.zshrc or ~/.bash_profile
    
  • Fork requests are async on GitHub's side — a 202 response means "accepted", not "done".
  • If a repo is already forked, GitHub returns the existing fork (not an error) — that's fine.
  • Handle HTTP errors:
    • 401: bad or expired token
    • 403: token lacks fork permission. For classic PATs, need repo or public_repo scope. For fine-grained PATs, need "Administration: Read and write" permission (not just contents).
    • 404: repo not found or private (token has no access)

Step 3: Star the original repository

After a successful fork, star the original repo:

curl -s -L -X PUT \
  -H "Authorization: Bearer $GITHUB_TOKEN" \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/user/starred/{owner}/{repo}

A 204 response means success. Star failures are non-fatal — if starring fails, note it in the report but don't treat the overall operation as failed.

Step 4: Report results

After all forks are attempted, show a clear summary:

Found X repositories:
✓ owner/repo — forked → https://github.com/YOUR_USERNAME/repo  ⭐ starred
✓ owner/repo — forked → https://github.com/YOUR_USERNAME/repo  (star failed: \x3Creason>)
✗ owner/repo — failed: \x3Creason>

If the token's authenticated username isn't obvious, extract it from the fork response (full_name field gives your-username/repo-name).

Edge cases

  • No URLs found: Tell the user clearly — "No GitHub repository URLs found in the input."
  • Private repos: Fork will fail with 404 if the token doesn't have access; report the error.
  • Duplicate URLs: Deduplicate before forking — fork each unique repo once.
  • Non-repo URLs: Ignore github.com/ paths that aren't owner/repo format (e.g., github.com/features, github.com/login).
安全使用建议
Do not install or enable this skill until the metadata and provenance are clarified. Specific things to check before using it: - Ask the publisher to update the registry metadata to declare GITHUB_TOKEN as a required credential (and provide a verifiable homepage/source). The current mismatch is a packaging/metadata red flag. - Only provide a token with the minimum scope you need (for public repos, prefer public_repo; for limited actions, use a fine-grained token scoped to just the required repos or permissions). Test with a throwaway account/token first. - Avoid putting a PAT directly into ~/.zshrc/.bashrc; prefer an ephemeral token, an environment variable injected only into the agent process, or a secrets manager. If you must export a token temporarily, remove it from shell config files afterward. - Confirm that the agent/platform will prompt before performing fork/star actions and will only call api.github.com. Because the skill is instruction-only, there is no bundled code to inspect — you should verify network activity during a controlled test to ensure no unexpected endpoints are contacted. - Because the skill will read images via the agent's vision capability, be cautious about sending screenshots that contain other sensitive info. If in doubt, use explicit textual repository references rather than images. If the publisher corrects the metadata and you follow least-privilege token practices, the skill's behavior appears coherent with its stated purpose; until then, treat it with caution.
功能分析
Type: OpenClaw Skill Name: github-forker Version: 0.1.1 The github-forker skill is designed to automate forking and starring GitHub repositories using the GitHub API via curl. It includes logic for extracting URLs from text and images and resolving truncated URLs through GitHub search. While it requires a sensitive GITHUB_TOKEN, its actions are transparent, documented, and restricted to the official GitHub API (api.github.com), with no evidence of data exfiltration, unauthorized execution, or malicious intent.
能力评估
Purpose & Capability
The SKILL.md clearly requires a GITHUB_TOKEN with repo permissions to call GitHub APIs for forking and starring; however, the registry metadata lists no required environment variables or primary credential. That is an internal inconsistency: forking GitHub repos legitimately needs a GitHub token, so the metadata should declare it. The absence of that declaration suggests sloppy or incomplete packaging and increases risk.
Instruction Scope
Instructions are narrowly scoped to extracting GitHub repo references from text/images, resolving truncated names via GitHub search, calling GitHub REST endpoints to fork and star repos, and reporting results. The skill uses vision to read images (consistent with its stated purpose). It explicitly says to ask the user before forking ambiguous/truncated repos. The SKILL.md does not instruct the agent to read unrelated files or send data to endpoints other than api.github.com.
Install Mechanism
This is instruction-only with no install spec or bundled code — lowest install risk. No remote downloads or package installs are present.
Credentials
The runtime text requires a GITHUB_TOKEN (and gives guidance on scopes), but the declared requirements list zero env vars/credentials. Requesting a GitHub personal access token is proportionate to forking, but the metadata omission is a significant discrepancy. Additionally, the README suggests persisting the token in shell rc files (e.g., ~/.zshrc), which is poor security advice and increases credential exposure.
Persistence & Privilege
The skill does not request permanent 'always' inclusion, does not modify other skills, and is instruction-only. Autonomous model invocation is enabled by default platform behavior but is not combined here with other strong red flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install github-forker
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /github-forker 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.1
- Added a README.md file with detailed usage and instructions. - No changes to code or main logic; documentation only.
v0.1.0
Initial release: Fork GitHub repositories from text or images, including handling truncated URLs - Automatically extracts GitHub repository URLs from user input (text or images). - Handles truncated or incomplete repo URLs by searching GitHub and using context to infer the correct repository, or asks the user if unsure. - Forks each unique repository using the GitHub API, and stars the original repo after forking. - Provides a clear summary of results, including errors and whether starring was successful. - Ignores irrelevant URLs and ensures `GITHUB_TOKEN` is set before proceeding.
元数据
Slug github-forker
版本 0.1.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Github Forker 是什么?

Use this skill when the user wants to fork a GitHub repository — creating their own copy of a repo under their GitHub account. Trigger on any fork or copy-to... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 256 次。

如何安装 Github Forker?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install github-forker」即可一键安装,无需额外配置。

Github Forker 是免费的吗?

是的,Github Forker 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Github Forker 支持哪些平台?

Github Forker 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Github Forker?

由 chat2dev(@chat2dev)开发并维护,当前版本 v0.1.1。

💬 留言讨论