Logo von Gitcode Pr

Gitcode Pr

Organisation
openharmonyinsight
gitcode-pr

Handle GitCode PR workflow for OpenHarmony - commit changes, push to fork remote, create issue, create PR from fork to upstream using repo's .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md with issue linking via

Übersicht

Herausgeberopenharmonyinsight
Repositoryopenharmony-skills
Skill-Namegitcode-pr
Sterne
36
Forks
7
Mitgelieferte Dateien
1
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 1 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von openharmonyinsight auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Gitcode Pr in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/gitcode-pr
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/openharmonyinsight/openharmony-skills.git /tmp/openharmony-skills
mkdir -p .claude/skills
cp -r /tmp/openharmony-skills/skills/gitcode-pr .claude/skills/gitcode-pr
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Gitcode Pr in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Gitcode Pr automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Gitcode Pr nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

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:

bash
# 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:

markdown
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:

bash
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:

bash
# 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.

bash
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):

bash
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:

    bash
    # 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.

    • Must be exactly: <fork-owner>:<branch-name> (no extra prefixes)
    • GitCode API strictly validates this format for cross-fork PRs

    Parameters:

    • 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:

bash
# 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:

bash
# 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:

markdown
### 关联的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

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Gitcode Pr?

Handle GitCode PR workflow for OpenHarmony - commit changes, push to fork remote, create issue, create PR from fork to upstream using repo's .gitee/PULL_REQUEST_TEMPLATE.zh-CN.md with issue linking via

Warum Gitcode Pr in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Gitcode Pr besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Gitcode Pr in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/openharmonyinsight/openharmony-skills/tree/main/skills/gitcode-pr ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Gitcode Pr nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Gitcode Pr verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Gitcode Pr damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Gitcode Pr kostenlos?

Der Skill wird von openharmonyinsight auf GitHub veröffentlicht. Die Lizenzbedingungen finden Sie im Repository. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇