Agent skill

Push To Forked PR

by hoangsonww in hoangsonww/Claude-Code-Agent-Monitor

Push the current working tree directly to a GitHub PR whose head lives on a fork, without creating a new branch and without pushing to origin (which is usually the upstream).

MITAuto-check passed

Install Push To Forked PR

skills CLI
$ npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill push-to-forked-pr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hoangsonww/Claude-Code-Agent-Monitor push-to-forked-pr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hoangsonww/Claude-Code-Agent-Monitor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/push-to-forked-pr .claude/skills/push-to-forked-pr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
push-to-forked-pr
GitHub stars
1.1k
Token cost
~2.3k tokens
SKILL.md length
847 words
Files
2
Skills in repo
78
Repo updated
First seen
Licence
MIT

At a glance

Push the current working tree directly to a GitHub PR whose head lives on a fork, without creating a new branch and without pushing to origin (which is usually the upstream).

  • Works in 7 steps: Read the PR's head metadata → Confirm you can actually push → Sanity-check the local branch → …
  • Says things like push straight to PR
  • SKILL.md covers Procedure, Common failure modes and Hard rules
  • Calls git, npm and gh; reaches github.com

What it does

Push To Forked PR is an agent skill from hoangsonww/Claude-Code-Agent-Monitor. Push the current working tree directly to a GitHub PR whose head lives on a fork, without creating a new branch and without pushing to origin (which is usually the upstream). Invoke when the user says things like "push straight to PR

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `agents/openai.yaml`).

It works with GitHub. The repository describes itself as: 🚀 A real-time monitoring dashboard for Claude Code & Codex, built with SQLite3, Node.js, Express, React, Vite, TailwindCSS, & WebSockets. It tracks sessions, agent activity… The licence is MIT.

When your agent uses it

  • Says things like push straight to PR

Example prompts

  • “/push-to-forked-pr”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Read the PR's head metadata
  2. Confirm you can actually push
  3. Sanity-check the local branch
  4. Verify commit author identity before committing
  5. Run the repo's full verification suite — before pushing
  6. Stage, commit, push to the fork (not origin)
  7. Verify the push landed on the PR

What it can do on your machine

Read from SKILL.md and the folder at commit a06db03. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • npm
    • gh
    • bash
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Push To Forked PR loads about 2.3k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 847 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hoangsonww/Claude-Code-Agent-Monitor at commit a06db03, republished under its MIT licence (© hoangsonww). 847 words, ~2,269 tokens.

Download SKILL.mdSave it as .claude/skills/push-to-forked-pr/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
push-to-forked-pr
description
Push the current working tree directly to a GitHub PR whose head lives on a **fork**, without creating a new branch and without pushing to `origin` (which is usually the upstream). Invoke when the user says things like "push straight to PR

push-to-forked-pr

The whole point of this skill: origin is usually the upstream, but the PR's head is on someone else's fork. Pushing to origin updates the upstream's branch, not the PR. You have to push to the fork.

GitHub allows this in two situations:

  1. You are the fork owner — straightforward, you own that branch.
  2. You are an upstream maintainer and the PR has maintainerCanModify: true (the "Allow edits from maintainers" checkbox the PR author leaves on by default). GitHub then lets the upstream's auth push to the fork branch.

If neither holds, abort and tell the user only the fork owner can push.


Procedure

1. Read the PR's head metadata
bash
PR_NUMBER=<N>
gh pr view "$PR_NUMBER" --json state,headRefName,headRefOid,headRepository,headRepositoryOwner,maintainerCanModify,url

Capture:

  • state — bail if not "OPEN".
  • headRepository.nameWithOwner → the fork (e.g. someone/Repo).
  • headRepositoryOwner.login → the fork owner.
  • headRefName → the branch on the fork (usually matches local).
  • headRefOid → the PR's current head SHA. Your local HEAD must be a descendant.
  • maintainerCanModify → must be true if you are not the fork owner.

If headRepository.nameWithOwner matches the upstream's nameWithOwner, this PR is internal:

bash
HEAD_BRANCH=$(gh pr view "$PR_NUMBER" --json headRefName --jq .headRefName)
HEAD_REF_OID=$(gh pr view "$PR_NUMBER" --json headRefOid --jq .headRefOid)
git merge-base --is-ancestor "$HEAD_REF_OID" HEAD && echo ok || echo NOT-DESCENDANT   # abort if NOT-DESCENDANT
git push origin "HEAD:${HEAD_BRANCH}"

Exit the skill once this push lands — do not continue to the fork-push steps below.

2. Confirm you can actually push
bash
gh auth status                        # who am I?
git remote get-url origin             # fetch URL — confirm origin is the UPSTREAM, not the fork
git remote get-url --push origin      # push URL — can differ from the fetch URL if `pushurl` is configured

For the internal-PR path above, compare the push URL (not just the fetch URL) against the expected upstream nameWithOwner before relying on git push origin — a configured pushurl can silently redirect the push to a different destination than the fetch URL suggests.

You may push to the fork branch iff the active gh user is:

  • the fork owner, or
  • a writer on the upstream and maintainerCanModify == true.

Otherwise stop. Tell the user the PR doesn't allow maintainer edits.

3. Sanity-check the local branch
bash
git branch --show-current
git rev-parse HEAD
git merge-base --is-ancestor <headRefOid> HEAD && echo ok || echo NOT-DESCENDANT
  • If headRefName differs from the current local branch, that's fine — you'll push with an explicit refspec local:headRefName in step 6.
  • If local HEAD is not a descendant of headRefOid, stop. Either you're on the wrong branch, or someone else has pushed to the PR since you forked from it. Do not force-push without explicit user permission.
4. Verify commit author identity before committing
bash
git config user.email

If it is empty, hostname-shaped (user@host.local, *@*.tail*.ts.net, etc.), or otherwise not a real email tied to a GitHub account, the commit will appear "unverified" on GitHub and won't link to a profile. Override per-commit:

bash
git -c user.name="<Name>"  -c user.email="<email>"  commit -F /tmp/commit-msg.txt

To correct an already-made commit before push:

bash
git -c user.name="..." -c user.email="..." commit --amend --reset-author -C HEAD --no-edit

Prefer the user's documented identity (e.g. from CLAUDE.md or earlier in the session) over the local git config when the local config is clearly machine-generated.

5. Run the repo's full verification suite — before pushing

The user almost always asks for this explicitly. In this repo (see CLAUDE.md for the authoritative list):

bash
npm run format:check                        # tracked files only; local .worktrees/ noise is not yours to fix
npm run test:server                         # backend touched
npm run test:client                         # frontend, wiki i18n, screen snapshots
npm run mcp:typecheck && npm run mcp:build  # mcp/ touched
npm --prefix mcp test                       # mcp unit suite
npm run build                               # production client build
bash .claude/skills/file-headers/scripts/check-headers.sh

Per-package extras when those areas are touched:

bash
npm --prefix desktop run build && npm --prefix desktop test
node scripts/validate-agent-extensions.js

Stop on the first red. Report which check failed and do not push.

6. Stage, commit, push to the fork (not origin)

Exclude session-local noise (.claude/settings.local.json is harness state, not work) and never stage blindly:

bash
git status                          # review exactly what changed
git add <path1> <path2> ...         # stage only the files for this PR's change — never `git add -A`
git status                          # confirm the staged diff matches intent (and excludes .claude/settings.local.json) before committing

Commit with a real body (use -F for multi-paragraph messages), ending with the Co-Authored-By trailer your harness requires — copy it verbatim from the harness instructions rather than from this file, so the model name never goes stale.

Then push to the fork. Add a one-off remote so it's clear in git remote -v and the destination URL doesn't end up in the user's shell history:

bash
FORK_REPO=$(gh pr view "$PR_NUMBER" --json headRepository --jq '.headRepository.nameWithOwner')
HEAD_BRANCH=$(gh pr view "$PR_NUMBER" --json headRefName   --jq .headRefName)
LOCAL_BRANCH=$(git branch --show-current)

if [ -z "$LOCAL_BRANCH" ]; then
  echo "Detached HEAD — refusing to push (source ref would be empty and delete ${HEAD_BRANCH} on the fork)." >&2
  exit 1
fi

git remote add "pr${PR_NUMBER}-fork" "https://github.com/${FORK_REPO}.git"
git push "pr${PR_NUMBER}-fork" "HEAD:${HEAD_BRANCH}"    # push HEAD itself, not "$LOCAL_BRANCH" — safe even if the local branch name differs

gh configures git's credential helper, so HTTPS pushes pick up the right token automatically. Don't rewrite to SSH unless asked.

Show full SKILL.md (291 more words)Show less
7. Verify the push landed on the PR
bash
LOCAL_HEAD=$(git rev-parse HEAD)
PR_HEAD=$(gh pr view "$PR_NUMBER" --json headRefOid --jq .headRefOid)
[ "$LOCAL_HEAD" = "$PR_HEAD" ] && echo "PR updated ✓" || echo "MISMATCH — push went somewhere else"

Report the new HEAD SHA, the PR URL, and the diff stat back to the user.


Common failure modes

SymptomCauseFix
Permission denied on pushAuthenticated as the wrong user, or maintainerCanModify: false and you are not the fork ownerAbort. Only the fork owner can push to the branch.
! [rejected] non-fast-forwardSomeone else pushed to the PR since you startedgit fetch "pr${PR_NUMBER}-fork" "${HEAD_BRANCH}", then rebase or merge. Never force-push someone else's PR branch without explicit permission.
Push succeeds, but PR head SHA doesn't updateYou pushed to a branch with a different name on the forkRe-check headRefName and use explicit refspec LOCAL:HEAD_BRANCH.
Commit shows "unverified" on the PRAuthor email isn't tied to a verified GitHub accountAmend with the user's real identity (step 4) and push again (fast-forward, not force).
Could not resolve hostNetwork or proxy issueSurface the error. Don't blanket-retry.

Hard rules

  • Never push to origin when origin is the upstream and the PR head is a fork. Always verify with git remote -v and gh pr view.
  • Never create a new branch. The user pushed because they want this PR updated; a new branch defeats that.
  • Never force-push to a fork PR branch without explicit user permission. The fork owner will lose any commits they had locally.
  • Always run the repo's tests/builds first. A fork-PR push triggers CI on the fork and surfaces on the upstream's PR view — pushing red code is doubly visible.
  • Always exclude .claude/settings.local.json unless the user explicitly says to include it. It's harness session state, not the work.
  • Never stage with git add -A. Stage explicit paths for the requested change so unrelated files or local secrets can't ride along.

© hoangsonww, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .codex/skills/push-to-forked-pr of hoangsonww/Claude-Code-Agent-Monitor.

  • SKILL.md
  • agents/openai.yaml

Open the folder on GitHubat commit a06db03

Compare with similar skills

Push To Forked PR next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Push To Forked PR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Push To Forked PR this skillhoangsonww/Claude-Code-Agent-Monitor1.1k—~2.3kAutomated safety check: PassMIT
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Greplooponyx-dot-app/onyx32k4 repos~3.3kAutomated safety check: PassMIT
GitHub Deep Researchbytedance/deer-flow84k4 repos~1.3kAutomated safety check: PassMIT
Diagnosing Superpowers Sessionsobra/superpowers297k3 repos~1.7kAutomated safety check: PassMIT
Update V8 Versionopeninterpreter/openinterpreter69k2 repos~845Automated safety check: PassApache-2.0

Similar skills

  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed
  • GitHub Deep Research

    bytedance/deer-flow

    Researches a GitHub repository over four rounds using the GitHub API and web search, then writes a structured markdown report with timeline, metrics and Mermaid diagrams.

    84k GitHub starsUsed in 4 repos~1.3k tokens
    Research & ScienceAuto-check passed
  • Investigates a session where Superpowers went wrong, reads the transcripts on disk and produces an evidence-cited report, optionally prepared as a bug report for the maintainers.

    297k GitHub starsUsed in 3 repos~1.7k tokens
    Agent WorkflowsAuto-check passed
  • Update V8 Version

    openinterpreter/openinterpreter

    Bumps the pinned v8 and rusty_v8 versions in Codex, validates the release-candidate path with the v8-canary check, and traces failures to upstream build changes.

    69k GitHub starsUsed in 2 repos~845 tokens
    DevOps & CloudAuto-check passed
  • Last30days

    mvanhorn/last30days-skill

    Research what people actually say about any topic in the last 30 days.

    64k GitHub stars~7.9k tokensUpdated yesterday
    Research & ScienceAuto-check: notes

More from hoangsonww/Claude-Code-Agent-Monitor

All 78 skills in this repo
  • Version Release

    hoangsonww/Claude-Code-Agent-Monitor

    Choose and apply the correct semantic version bump for this repository.

    1.1k GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Budget Set

    hoangsonww/Claude-Code-Agent-Monitor

    Define a spend budget for Claude Code and, optionally, create a cost alert rule that fires when usage crosses the limit, via POST /api/alerts/rules on the Agent Monitor dashboard.

    1.1k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Cache Efficiency

    hoangsonww/Claude-Code-Agent-Monitor

    Analyze prompt-cache effectiveness for Claude Code usage from the Agent Monitor dashboard — cache hit rate (totalcacheread / (totalcacheread + totalinput)), cachewrite vs cacheread reuse, cache-read…

    1.1k GitHub stars~966 tokensUpdated today
    Auto-check passed
  • Cost Breakdown

    hoangsonww/Claude-Code-Agent-Monitor

    Break down Claude Code costs using the Agent Monitor pricing engine.

    1.1k GitHub stars~845 tokensUpdated today
    Auto-check passed
  • Dag Map

    hoangsonww/Claude-Code-Agent-Monitor

    Render the multi-agent orchestration DAG for a session — parent→child subagent edges, tree depth, and fan-out — from the Agent Monitor workflow intelligence API.

    1.1k GitHub stars~564 tokensUpdated today
    Auto-check passed
  • Dashboard Status

    hoangsonww/Claude-Code-Agent-Monitor

    Quick dashboard health and status overview — checks the Agent Monitor API (port 4820), reports session/agent/event counts from /api/stats, confirms WebSocket connectivity, reads the redacted hook…

    1.1k GitHub stars~600 tokensUpdated today
    Auto-check passed

Works with

Questions about Push To Forked PR

What does Push To Forked PR do?

Push the current working tree directly to a GitHub PR whose head lives on a fork, without creating a new branch and without pushing to origin (which is usually the upstream). Push To Forked PR is an agent skill from hoangsonww/Claude-Code-Agent-Monitor. Push the current working tree directly to a GitHub PR whose head lives on a fork, without creating a new branch and without pushing to origin (which is usually the upstream).

When should I use Push To Forked PR?

Push To Forked PR fits situations like: says things like push straight to PR.

How do I install Push To Forked PR in Claude Code?

Run `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill push-to-forked-pr -a claude-code`. Or copy the skill folder (.codex/skills/push-to-forked-pr in hoangsonww/Claude-Code-Agent-Monitor) into .claude/skills/push-to-forked-pr in your project. Claude Code loads it when a task matches its description.

How do I install Push To Forked PR in Codex?

Run `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill push-to-forked-pr -a codex`. Or copy the skill folder (.codex/skills/push-to-forked-pr in hoangsonww/Claude-Code-Agent-Monitor) into .agents/skills/push-to-forked-pr in your project. Codex loads it when a task matches its description.

Can I use Push To Forked PR in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill push-to-forked-pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/push-to-forked-pr, .gemini/skills/push-to-forked-pr, .github/skills/push-to-forked-pr and .opencode/skills/push-to-forked-pr in your project.

What does Push To Forked PR need to run?

Going by SKILL.md and its folder, Push To Forked PR needs the command-line tools its instructions call (git, npm, gh, bash and node).

Does Push To Forked PR access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Push To Forked PR safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Push To Forked PR use?

Push To Forked PR is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Push To Forked PR use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Push To Forked PR?

Skills that share tags, products or a category with Push To Forked PR: PR Babysitter (openinterpreter/openinterpreter, 69k stars), Greploop (onyx-dot-app/onyx, 32k stars), GitHub Deep Research (bytedance/deer-flow, 84k stars) and Diagnosing Superpowers Sessions (obra/superpowers, 297k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Push To Forked PR?

hoangsonww (a GitHub user) maintains it in hoangsonww/Claude-Code-Agent-Monitor, which has 1,058 GitHub stars. The repository holds 78 skills in this directory. The repository was last updated on October 10, 2026.

Source: hoangsonww/Claude-Code-Agent-Monitor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.