senpi: Skill for Claude Code

.github/agent/skills/merge-upstream/SKILL.md

merge-upstream is a skill for Claude Code, Codex from code-yeongyu/senpi. It costs 52 tokens per session (1,601 once invoked), scanned A, original, MIT.

A workflow for merging changes from an upstream Git repository into a fork while preserving commit history. A fork is a separate copy of a repository, and upstream is the original repository.

In plain words
What is it for?
Checking remotes and branch state, merging an upstream branch, resolving conflicts, and preparing a safe non-destructive fork update.
Why use it?
It keeps local commit hashes intact and avoids rewriting history or force-pushing while synchronising the fork.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

This is code-yeongyu/senpi's own configuration. It tells Claude Code and Codex how to work on senpi itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything senpi configures →

Reuse

Borrowing it

Nothing to install: this file belongs to code-yeongyu/senpi. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/code-yeongyu/senpi/main/.github/agent/skills/merge-upstream/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/code-yeongyu/senpi

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for merge-upstream

README.md
[![agentmods](https://agentmods.dev/badge/skills/code-yeongyu/senpi/merge-upstream/github.svg)](https://agentmods.dev/skills/code-yeongyu/senpi/merge-upstream)
Your own site
<a href="https://agentmods.dev/skills/code-yeongyu/senpi/merge-upstream"><img src="https://agentmods.dev/badge/skills/code-yeongyu/senpi/merge-upstream/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for merge-upstream

Your own site · 80×15
<a href="https://agentmods.dev/skills/code-yeongyu/senpi/merge-upstream"><img src="https://agentmods.dev/badge/skills/code-yeongyu/senpi/merge-upstream.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,601 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 28
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.01601
Opus 5.5 $0.00021 $0.00640
Sonnet 5.5 $0.00010 $0.00320
Haiku 4.5 $0.00005 $0.00160

Measured 2mo ago against content hash 8e07c9ecdb30, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

merge-upstream scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/agent/skills/merge-upstream/SKILL.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Merge Upstream

Sync the current fork branch with upstream/<branch> using a merge commit by default. Preserve local commit hashes, keep push non-destructive, and never rewrite history.

Usage

Treat these as equivalent triggers:

/merge-upstream [--base=<branch>] [--ff-allow]
merge upstream [--base=<branch>] [--ff-allow]
sync fork with upstream

Options:

  • --base=<branch>: use that upstream branch instead of auto-detecting the upstream default branch.
  • --ff-allow: allow git merge --ff-only when the current branch has no unique local commits. Without this, use git merge --no-ff to leave an explicit sync commit.

Invariants

  • Do not run git rebase.
  • Do not run git push --force or git push --force-with-lease.
  • Do not bypass hooks or signing with --no-verify or --no-gpg-sign.
  • Ask before pushing.

Workflow

  1. Validate the repository:

    git rev-parse --is-inside-work-tree
    git branch --show-current
    git remote get-url upstream
    git remote get-url origin
    

    Abort on detached HEAD or missing upstream. If origin is missing, continue locally and skip push.

  2. Require a clean worktree:

    worktree_status=$(git status --porcelain) || exit 1
    test -z "$worktree_status"
    

    If dirty, stop and ask the user to clean or commit the changes, or use a clean task worktree.

  3. Detect the upstream target branch:

    • If --base=<branch> is provided, fetch and verify upstream/<branch>.
    • Otherwise run git remote set-head upstream -a, then read refs/remotes/upstream/HEAD.
    • If detection fails, ask the user for --base=<branch>.
  4. Fetch enough history for a reliable merge base:

    git rev-parse --is-shallow-repository
    git fetch --tags upstream "+refs/heads/${upstream_branch}:refs/remotes/upstream/${upstream_branch}"
    origin_branch_exists=false
    if git remote get-url origin >/dev/null 2>&1; then
      if ! origin_branch=$(git ls-remote --heads origin "refs/heads/${current_branch}"); then
        echo "failed to inspect origin/${current_branch}" >&2
        exit 1
      elif [ -n "$origin_branch" ]; then
        git fetch origin "+refs/heads/${current_branch}:refs/remotes/origin/${current_branch}" || exit 1
        origin_branch_exists=true
      else
        echo "origin/${current_branch} does not exist; current branch is unpublished"
      fi
    fi
    git merge-base HEAD "upstream/${upstream_branch}"
    

Read the full file on GitHub · 168 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 168 lines · 52 tokens per session scan A 8e07c9ecdb30

Subscribe to this mod's changes

merge-upstream is a skill published in the GitHub repository code-yeongyu/senpi (511 stars, last pushed yesterday), licensed MIT. It adds 52 tokens to every session and 1,601 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

merge-upstream compared with skills from other repositories

merge-upstream next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
merge-upstreamcode-yeongyu/senpiSkill511yesterdayMITA52Claude Code, Codex
transformerssynthetic-sciences/openscienceSkill4.3k2d agoApache-2.0A63Claude Code, Codex
github-explorerechoVic/blade-codeSkill18124d agoMITA35Claude Code
pypi-releasealchemiststudiosDOTai/tunacodeSkill1251mo agoMITA52Claude Code, Codex
knowledge-agent-execution-and-orchestration-subagent-runtimeechoVic/blade-codeSkill18124d agoMITA117Claude Code, Codex
knowledge-shell-process-and-worktreeechoVic/blade-codeSkill18124d agoMITA164Claude Code, Codex
segment-anything-modelsynthetic-sciences/openscienceSkill4.3k2d agoApache-2.0A45Claude Code, Codex