Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计提醒

gitcode-prgitcode 公关

Agent Skill

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

总安装

941

周安装

40

GitHub Stars

18

下载量

330
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/openharmonyinsight/openharmony-skills --skill gitcode-pr

简介

用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。
  • 通过 npx skills add 命令从指定仓库安装使用。
  • 建议确认权限范围和维护状态,注意可能触发联网或命令执行。
  • 可结合原始 README 进一步了解具体功能和使用方法。

SKILL.md

GitCode PR Workflow for OpenHarmony

Handles complete GitCode PR submission for OpenHarmony repositories with intelligent remote detection and issue-PR linking. Use the gitcode mcp. If gitcode mcp is not present, warn the user and terminate the skill immediately.

Intelligent Remote Detection

Identification Algorithm

Never assume remote names. Use this algorithm to identify upstream and fork:

# Step 1: List all remotes
git remote -v

# Step 2: Parse each remote
for remote in $(git remote); do
  url=$(git remote get-url $remote)

  # Parse owner from URL
  # Format: https://gitcode.com/<owner>/<repo> or https://gitcode.com/<owner>/<repo>.git
  if [[ "$url" =~ https://gitcode\.com/([^/]+)/(.+) ]]; then
    owner="${BASH_REMATCH[1]}"
    repo=$(echo "${BASH_REMATCH[2]}" | sed 's/\.git$//')

    # Determine type
    if [ "$owner" = "openharmony" ]; then
      echo "$remote: UPSTREAM ($owner/$repo)"
    else
      echo "$remote: FORK ($owner/$repo)"
    fi
  fi
done

Remote Classification

OwnerTypeUsage
openharmonyUPSTREAMSource for PR template, target for PR base, issue creation
Other usernamesFORKPush target, PR head source

Decision Matrix

Upstream RemotesFork RemotesAction
FoundFoundUse both: create issue/PR on upstream, push to fork
FoundNoneAsk user: "Found upstream but no fork. Need to fork first?"
NoneFoundUse fork as both push target and PR target (uncommon)
NoneMultiple (no openharmony)Ask user to select: "Which remote to use?"
NoneSingle (no openharmony)Use as fork, warn: "No upstream (openharmony) remote found"

User Prompting

When remote is ambiguous, prompt user:

I found these GitCode remotes:

- **remote_name**: owner/repo (UPSTREAM/FORK)

Which remote should I use for:
- Pushing changes?
- Creating the PR?

Please specify the remote name, or press Enter to use [default].

Workflow

Follow this workflow when user requests PR submission:

1. Check Current State

Check git status and branch:

git status
git branch --show-current
git remote -v

Determine:

  • What is the current branch name?
  • Identify upstream and fork remotes using algorithm above

2. Check if PR Exists

Use gitcode_list_pull_requests to check for existing PRs:

# Get upstream owner/repo (parse from upstream remote URL)
UPSTREAM_REMOTE=$(detect_upstream_remote)
UPSTREAM_URL=$(git remote get-url $UPSTREAM_REMOTE)
# Parse: openharmony/security_code_signature from URL

# List PRs for upstream repo
gitcode_list_pull_requests --owner $UPSTREAM_OWNER --repo $UPSTREAM_REPO

# Search for PR with matching branch name and owner name

If PR exists: Only push to fork and inform user.

git push -u $FORK_REMOTE <branch-name>

If PR does not exist: Continue to steps 4-6 to create issue and PR.

3. Create Issue

Load issue template and create issue:

  1. Read issue template: references/issue_template.md
  2. Fill in template fields based on context (commit messages, changed files, etc.)
  3. Use gitcode_create_issue with upstream owner/repo

Note: Use commit message and git diff to generate issue description automatically.

4. Push to Fork

Push to your fork (the detected fork remote):

git push -u $FORK_REMOTE <branch-name>

5. Create PR from Fork to Upstream

Load PR template from upstream repository and create PR linking to issue:

  1. Get upstream PR template: # Try local copy first if [-f.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md]; then cat.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md else # Fetch from upstream git fetch $UPSTREAM_REMOTE master git show $UPSTREAM_REMOTE/master:.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md fi
  2. Fill template: Follow the direction in the template.
  3. Create PR using gitcode_create_pull_request: IMPORTANT: For cross-repo PRs, the head parameter format is CRITICAL. Parameters:

- Must be exactly: <fork-owner>:<branch-name> (no extra prefixes) - GitCode API strictly validates this format for cross-fork PRs - owner: Upstream owner (e.g., openharmony) - repo: Upstream repo (e.g., security_code_signature) - title: Follow commit message format - head: <fork-owner>:<branch-name> (from fork remote parsing) - base: Target branch on upstream (typically master or main) - body: Template content with issue reference

Example:

# After detection
UPSTREAM_OWNER="openharmony"
UPSTREAM_REPO="security_code_signature"
FORK_OWNER="someone"
FORK_REMOTE="fork"

gitcode_create_pull_request \
  --owner $UPSTREAM_OWNER \
  --repo $UPSTREAM_REPO \
  --title "fix(code_signature): add null check for buffer pointer" \
  --head "$FORK_OWNER:$BRANCH_NAME" \
  --base "master" \
  --body "$(cat .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md | \
    sed 's/^### 关联的issue:$/### 关联的issue:\n#$ISSUE_NUMBER/')"

Templates

Upstream PR Template

Located at .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md in the upstream repository.

Local Issue Template

See references/issue_template.md for standard issue format.

Key sections:

  • 问题描述: What is the problem or feature request?
  • 复现步骤: For bug reports (if applicable)
  • 预期行为: What should happen?
  • 实际行为: What actually happens?
  • 环境信息: Any relevant environment details

Remote URL Parsing

Parse owner and repo from remote URLs:

# Function to parse GitCode URL
parse_gitcode_url() {
  local url="$1"

  # Remove .git suffix if present
  url=$(echo "$url" | sed 's/\.git$//')

  # Extract owner and repo
  if [[ "$url" =~ https://gitcode\.com/([^/]+)/(.+) ]]; then
    echo "${BASH_REMATCH[1]}|${BASH_REMATCH[2]}"
  fi
}

# Usage
result=$(parse_gitcode_url "https://gitcode.com/openharmony/security_code_signature")
owner="${result%%|*}"
repo="${result##*|}"
# owner=openharmony, repo=security_code_signature

Issue Reference in PR Template

In .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md, fill in issue reference:

### 关联的issue:
#123

The PR will auto-close issue #123 when merged.

GitCode MCP Tools

Use these tools for GitCode operations:

  • gitcode_list_pull_requests - Check existing PRs (use upstream owner/repo)
  • gitcode_get_pull_request - Get PR details
  • gitcode_create_pull_request - Create new PR (head points to fork)
  • gitcode_update_pull_request - Update existing PR
  • gitcode_create_issue - Create new issue (use upstream owner/repo)
  • gitcode_get_issue - Get issue details

Error Handling

  • Authentication failure: Check if GitCode token is configured
  • Branch not found on fork: Push to fork first before creating PR
  • PR already exists: Inform user and provide link, don't create duplicate
  • No upstream remote: Ask user to configure upstream remote (owner=openharmony)
  • No fork remote: Ask user which remote to push to, or if they need to fork first
  • Multiple non-openharmony remotes: Ask user to select which is their fork
  • PR template not found: Check if .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md exists upstream
  • Owner/repo parsing error: Validate remote URL format

Decision Tree

User requests PR
  ↓
Check git status
  ↓
Changes uncommitted? → Yes → Commit changes
  ↓ No
List and parse remotes
  ↓
Detect upstream (owner=openharmony) and fork
  ↓
┌─────────────────────────────────────┐
│ Remote detection result:        │
│ - Upstream found?             │
│ - Fork found?                 │
└─────────────────────────────────────┘
  ↓
┌─────────────────────────────────────┐
│ Need user input?               │
│ - No fork?                   │
│ - Ambiguous remotes?           │
└─────────────────────────────────────┘
  ↓ Yes → Ask user
  ↓ No
Push to fork
  ↓
List PRs (upstream repo)
  ↓
PR exists for branch? → Yes → Inform user (PR already exists)
  ↓ No
Create issue (upstream repo)
  ↓
Get PR template from upstream (.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md)
  ↓
Create PR (head: fork-owner:branch, base: upstream-branch)
  ↓
Done

Context Gathering

When creating issue or PR, gather from:

  • git log -1 - Last commit message
  • git diff HEAD~1 - Changed files and diff
  • Branch name - For feature context
  • User input - Additional description if provided
  • git remote -v - All remotes and their URLs
  • Remote parsing - Upstream owner/repo and fork owner/repo

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

展示第三方安全扫描或审计结果

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

平台分布

Codex

36.06%
按下载量换算119

Claude

32.1%
按下载量换算106

Cursor

17.8%
按下载量换算59

Gemini CLI

9.54%
按下载量换算31

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

来源信息

继续浏览同类 Skills