Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计未展示

lovstudio%3agh-contributelovstudio%3agh 贡献

Agent Skill

lovstudio%3agh-contribute 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

245

周安装

10

GitHub Stars

45

下载量

79
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:lovstudio%3agh-contribute(lovstudio%3agh 贡献)
来源仓库:https://github.com/lovstudio/skills
仓库路径:skills/lovstudio%3Agh-contribute
安装命令:
npx skills add https://github.com/lovstudio/skills --skill lovstudio:gh-contribute
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lovstudio/skills --skill lovstudio:gh-contribute

简介

lovstudio%3agh-contribute 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。
  • 安装前需确认权限范围和维护状态,注意可能触发联网、命令执行或文件读写操作。
  • 建议结合原始 README 和仓库内容进一步核验具体功能和用法边界。

SKILL.md

gh-contribute — Clean PRs to Upstream Repos

Turn local changes into a clean, professional pull request against an upstream repo you don't own. Handles the full fork → branch → commit → push → PR pipeline, and splits work into multiple PRs when the changes span unrelated concerns.

When to Use

  • User wants to contribute to an open-source project they don't have write access to
  • User already has local edits and needs them shipped as a PR upstream
  • User asks to "fork this repo and send a PR"
  • User has mixed changes (e.g. docs + feature + refactor) and wants them split properly

Non-Goals

  • Does not write code changes — assumes the user (or a prior step) already has the desired modifications in the working tree or in their head
  • Does not review the project's own PRs (see gh-tidy)
  • Does not mirror to GitLab/Gitea — GitHub only

Workflow (MANDATORY)

Execute steps in order. Do not skip confirmations.

Step 1: Identify the target repo

Determine the upstream owner/repo:

  1. If the user pasted a URL or owner/repo string → use it
  2. Otherwise run git remote -v in the current directory and pick the origin (if origin is already the user's fork, find the upstream via gh repo view --json parent)

Record three facts:

  • UPSTREAM — e.g. ZenMux/zenmux-doc
  • DEFAULT_BRANCH — from gh repo view $UPSTREAM --json defaultBranchRef -q.defaultBranchRef.name
  • USER_LOGIN — from gh api user -q.login

Step 2: Read the contribution rules

Fetch CONTRIBUTING.md and CODE_OF_CONDUCT.md from upstream (if present) and skim for: commit message format, DCO/CLA requirements, branch naming, PR template. Carry these constraints into subsequent steps.

gh api repos/$UPSTREAM/contents/CONTRIBUTING.md -q .content 2>/dev/null | base64 -d

If the repo has .github/PULL_REQUEST_TEMPLATE.md, use it as the PR body skeleton.

Step 3: Survey the changes

Gather the change set that needs to become PR(s):

git status --porcelain
git diff --stat $DEFAULT_BRANCH...HEAD        # committed
git diff --stat                                # unstaged
git diff --stat --cached                       # staged

Classify files into logical groups. Typical axes:

  • By concern: docs / feature / bugfix / refactor / test / chore
  • By subsystem: unrelated top-level directories usually = separate PRs
  • By dependency: if PR B needs PR A merged first, split and note the dependency

Step 4: Propose a PR plan and confirm

Use AskUserQuestion to present the plan. Options must include at least:

  • Single PR — all changes together. Recommended when changes are cohesive.
  • Split into N PRs — show the proposed titles and file groupings.
  • Abort — something is off, let the user redirect.

Show the plan like:

PR #1 (docs): Update CLAUDE.md to reflect current scripts
  - CLAUDE.md
PR #2 (feat): Add gh-contribute skill bootstrap
  - scripts/new.ts
  - .prompts/contribute.xml

Do not proceed until the user picks an option.

Step 5: Fork (idempotent)

gh repo view $USER_LOGIN/$REPO_NAME >/dev/null 2>&1 \
  || gh repo fork $UPSTREAM --clone=false --remote=false

Ensure a fork remote exists in the local clone:

git remote get-url fork 2>/dev/null \
  || git remote add fork git@github.com:$USER_LOGIN/$REPO_NAME.git

If origin already points at the user's fork, skip the fork remote and use origin.

Step 6: Create branches and commits per PR

For each PR in the plan:

  1. Start from a clean, up-to-date base: git fetch origin $DEFAULT_BRANCH git checkout -b $BRANCH_NAME origin/$DEFAULT_BRANCH
  2. Apply only the files belonging to this PR (use git checkout <sha> -- <paths> or git stash + selective git checkout from a working branch).
  3. Commit with a conventional message. If upstream uses Conventional Commits, match: <type>(<scope>): <subject>. Otherwise mirror the style of the last 10 commits on $DEFAULT_BRANCH.
  4. Sign off if CONTRIBUTING.md requires DCO: git commit -s....

Branch naming (when upstream doesn't dictate): <type>/<short-slug>, e.g. docs/update-claude-md, feat/add-contribute-skill.

Step 7: Push to fork

git push -u fork $BRANCH_NAME

If origin is already the fork, use origin instead.

Step 8: Open the PR

gh pr create \
  --repo $UPSTREAM \
  --base $DEFAULT_BRANCH \
  --head $USER_LOGIN:$BRANCH_NAME \
  --title "$TITLE" \
  --body "$BODY"

PR body template (adapt to PR template if present):

## Summary

<1-3 bullets explaining what and why>

## Changes

- <bullet per logical change>

## Test plan

- [ ] <how to verify>

## Related

<!-- Link follow-up PRs if split, e.g. "Depends on #123" or "Part 2 of 3" -->

When opening multiple PRs, cross-link them in each body:

## Related
- PR 1/3: #<url>
- PR 2/3: (this PR)
- PR 3/3: #<url>

Step 9: Report back

Output a compact summary:

Opened 2 PRs against ZenMux/zenmux-doc:
  #201 docs: update CLAUDE.md            → https://github.com/.../pull/201
  #202 feat: add gh-contribute skill      → https://github.com/.../pull/202

Splitting Heuristics

Prefer one PR when:

  • All changes serve a single user-visible outcome
  • Total diff < ~300 lines across ≤ 5 files
  • The changes would be awkward to review in isolation

Prefer multiple PRs when:

  • Docs-only changes sit alongside code changes (docs PR lands fast)
  • Refactor + feature — land the refactor first, feature on top
  • Unrelated subsystems touched (e.g. scripts/ + docs_source/)
  • One change is trivially correct and another needs discussion

When in doubt, ask the user.

What NOT to Do

  • Never force-push to a branch that already has a PR with review comments unless the user explicitly asks
  • Never edit upstream's default branch directly — always branch first
  • Never push to upstream — always to the user's fork
  • Never bypass hooks (--no-verify) or skip signing (--no-gpg-sign) unless CONTRIBUTING.md says to or the user explicitly says so
  • Never batch unrelated concerns into one PR just to "ship faster"
  • Never fabricate a PR body — if you can't describe the change, ask the user

Dependencies

# gh CLI (https://cli.github.com/)
brew install gh      # macOS
gh auth login        # one-time

No Python dependencies. This skill is pure gh + git orchestration.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.71%
按下载量换算26

Claude

31.35%
按下载量换算25

Cursor

17.71%
按下载量换算14

Gemini CLI

10.02%
按下载量换算8

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills