Github Sync Upstream logo

Github Sync Upstream

Organization
opendatahub-io
github-sync-upstream

Sync code from an upstream GitHub repository into a target fork (e.g., opendatahub-io midstream). Detects remotes from the current repo, or clones fresh if run from outside. Fetches upstream, merges into a sync branch, restores protected files, resolves conflicts, and opens a PR to the target GitHub repo. Use when asked to sync upstream, merge upstream changes, or bring a GitHub fork up to date with its upstream source.

Overview

Publisheropendatahub-io
Repositoryai-helpers
Skill namegithub-sync-upstream
Stars
39
Forks
76
Bundled files
8
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by opendatahub-io on GitHub. Read the source before you install it.

Installation

Install the Github Sync Upstream AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-git/skills/github-sync-upstream
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/opendatahub-io/ai-helpers.git /tmp/ai-helpers
mkdir -p .claude/skills
cp -r /tmp/ai-helpers/plugins/odh-git/skills/github-sync-upstream .claude/skills/github-sync-upstream
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Github Sync Upstream in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Github Sync Upstream on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Github Sync Upstream is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Sync Upstream

Merge upstream commits into a sync branch on the user's fork and open a PR to the target repo. See references/workflow.md for exact script invocations, exit-code handling, and the summary template.

Commit SHA (optional): $ARGUMENTS

Step 1: Determine Working Context

bash
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || REPO_ROOT=""

If REPO_ROOT is non-empty, run scripts/detect-remotes.sh --repo "${REPO_ROOT}" and ask via AskUserQuestion whether this is the correct repo. If yes → Step 2A. If no or not in a repo → Step 2B.

Step 2A: In-Repo Setup

Pre-fill upstream/target from detect-remotes output. Ask via AskUserQuestion to confirm: upstream repo, target repo, branches (default main). Run scripts/setup-remotes.sh, parse UPSTREAM_REMOTE and TARGET_REMOTE. Save ORIGINAL_BRANCH from current HEAD.

Step 2B: Clone From Scratch

Ask for upstream repo, target repo, and branches. If the user has a local clone, use its path and continue as Step 2A. If not, ask if they have a GitHub fork — run scripts/clone-fork.sh then scripts/setup-remotes.sh. If no fork exists, ask them to create one and re-run. Stop.

Save ORIGINAL_BRANCH from current HEAD.

Step 3: Protected Files

Protected files keep the target version, discarding upstream changes. Ask via AskUserQuestion for glob patterns to protect (or none). Suggest common examples: /OWNERS, /OWNERS_ALIASES, .tekton/*.yaml, Dockerfile*konflux.

Anchor ownership patterns to the repo root with a leading /. A bare OWNERS* matches by basename and so also deletes nested OWNERS files that upstream owns (e.g. pkg/.../OWNERS), which is rarely intended — only the root OWNERS / OWNERS_ALIASES are usually target-specific.

Step 4: Pre-flight Check

Verify origin does not point to upstream or target. If it does, tell the user to set origin to their personal fork and stop.

Step 5: Merge

Run scripts/sync-merge.sh. Handle exit codes 0 (success), 1 (conflicts), 3 (a sync branch for this upstream tip already exists — it may be orphaned or push-only, so check whether a PR is actually open for it before telling the user one is), and 4 (nothing to sync — target already up to date; report and stop, no PR) as described in references/workflow.md.

When an agent is driving this skill, pass --co-author "Claude <noreply@anthropic.com>" so the merge commit credits the agent alongside the human author.

Step 6: Push and Open PR

Show PR summary and ask via AskUserQuestion: open a PR or just push? If confirmed, run scripts/open-pr.sh. The PR body's commit count and diffstat are derived automatically from the merge commit. If any conflicts were resolved in Step 5, pass them via --conflicts (markdown table rows, no header) so a "## Conflict Resolution" section is appended.

To put a human on the PR, pass --assignee <handle> (assignee, not reviewer — GitHub forbids requesting review from the PR author, so a --reviewer equal to the author is silently dropped). open-pr.sh is idempotent: if an open PR for this branch in the current fork already exists it returns that URL without creating a duplicate. A same-named branch in someone else's fork is not treated as reusable.

Step 7: Cleanup and Summary

Check out ORIGINAL_BRANCH. Then, only if the Step 6 operation the user chose completed successfully — the push for push-only, or the push and the PR creation when a PR was requested — delete the now-redundant local sync branch (git branch -D <sync-branch>): the PR tracks the branch pushed to the fork (origin), so the local copy is no longer needed. Never delete the remote branch — the open PR depends on it. If either the push or the PR creation failed, keep the local branch so the work can be retried.

For Path B (clone-from-scratch) the entire temp clone is discarded, so there is no local branch to clean up — just inform the user of the temp directory.

Display the summary per references/workflow.md.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Github Sync Upstream AI skill do?

Sync code from an upstream GitHub repository into a target fork (e.g., opendatahub-io midstream). Detects remotes from the current repo, or clones fresh if run from outside. Fetches upstream, merges into a sync branch, restores protected files, resolves conflicts, and opens a PR to the target GitHub repo. Use when asked to sync upstream, merge upstream changes, or bring a GitHub fork up to date with its upstream source.

Why use Github Sync Upstream on TypingMind?

Because you install it once and use it with any model. Github Sync Upstream is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Github Sync Upstream in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/opendatahub-io/ai-helpers/tree/main/plugins/odh-git/skills/github-sync-upstream. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Github Sync Upstream?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Github Sync Upstream?

As many as you like. As long as a model supports skills, you can use Github Sync Upstream with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Github Sync Upstream AI skill free?

Yes. It is published on GitHub by opendatahub-io under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇