push-to-forked-pr
Skill1k starsChanged 4 months agoMITView on GitHub
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 #N", "push to the forked PR", "update PR from fork", "push these changes to #N directly", "commit and push to the PR" — *especially* when they emphasise not creating a new branch or not pushing into the upstream repo. Use this **instead of** plain `git push origin` whenever the PR head repo differs from the local `origin` repo.
- Commits and pushes
Trending
Quiet since October.thin dataabout the whole repository
Who's talking about hoangsonww/Claude-Code-Agent-Monitor
- @github-trending-js.bsky.social“📦 hoangsonww / Claude-Code-Agent-Monitor ⭐ 618 (+51) 🗒 TypeScript 🚀 A real-time monitoring dashboard for …”Bluesky · Jun 25, 2026 · 2 likes
- @yug1224.com“Claude Codeのセッションやエージェントの活動をリアルタイムで可視化する監視ダッシュボードらしい 開発中のエージェントの動きやツール利用状況を詳しく分析したいときに使えそう yug1224 starred…”Bluesky · Jun 27, 2026 · 1 likes
- sudosubin/agents.nix“agent-skills.github.hoangsonww.claude-code-agent-monitor: 2.2.5 → 2.2.6”GitHub · Oct 5, 2026
- sudosubin/agents.nix“codex-plugins.github.hoangsonww.claude-code-agent-monitor: init at 2.2.5”GitHub · Oct 4, 2026
- sudosubin/agents.nix“codex-marketplaces.github.hoangsonww.claude-code-agent-monitor: init at 2.2.5”GitHub · Oct 4, 2026
The biggest 5 of 12 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 12
Talked about on GitHub and Bluesky (12 times).
On GitHub · 10
- Oct 5, 2026agent-skills.github.hoangsonww.claude-code-agent-monitor: 2.2.5 → 2.2.6 — sudosubin/agents.nix0 reactions
- Oct 4, 2026codex-plugins.github.hoangsonww.claude-code-agent-monitor: init at 2.2.5 — sudosubin/agents.nix0 reactions
- Oct 4, 2026codex-marketplaces.github.hoangsonww.claude-code-agent-monitor: init at 2.2.5 — sudosubin/agents.nix0 reactions
- Oct 4, 2026agent-skills.github.hoangsonww.claude-code-agent-monitor: 2.2.4 → 2.2.5 — sudosubin/agents.nix0 reactions
- Oct 3, 2026agent-skills.github.hoangsonww.claude-code-agent-monitor: 2.2.2 → 2.2.4 — sudosubin/agents.nix0 reactions
5 more on GitHub
- Sep 28, 2026agent-skills.github.hoangsonww.claude-code-agent-monitor: init at 2.2.2 — sudosubin/agents.nix0 reactions
- Aug 5, 2026Audit candidate: hoangsonww/Claude-Code-Agent-Monitor — xiaolai/nlpm0 reactions · 7 comments
- Jul 21, 2026Extract dark-elevation ramp + animation tokens from Claude-Code-Agent-Monitor — deanjstone/design-system0 reactions · 2 comments
- Jul 6, 2026サブエージェント実行中の「動作中」が UI で分からない(観測性の欠落) — siro33950/releash0 reactions
- May 18, 2026Claude-Code-Agent-Monitor 적용 평가 — dadadamarine/Agent-Quest0 reactions · 2 comments
On Bluesky · 2
- Jun 25, 2026📦 hoangsonww / Claude-Code-Agent-Monitor ⭐ 618 (+51) 🗒 TypeScript 🚀 A real-time monitoring dashboard for Claude Code, built with… — @github-trending-js.bsky.social2 likes and reposts
- Jun 27, 2026Claude Codeのセッションやエージェントの活動をリアルタイムで可視化する監視ダッシュボードらしい 開発中のエージェントの動きやツール利用状況を詳しく分析したいときに使えそう yug1224 starred… — @yug1224.com1 likes and repost
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- i18n-paritySkill
- mcp-maintainerSkill
- release-guardSkill
- repo-onboardingSkill
- version-releaseSkill
- debug-live-issueSkill
- file-headersSkill
- i18n-paritySkill
- mcp-operationsSkill
- push-to-forked-prSkill
- repo-onboardingSkill
- ship-featureSkill
- update-project-docsSkill
- version-releaseSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 15
If neither holds, abort and tell the user only the fork owner can push.
- Very specific: line 37
If headRepository.nameWithOwner matches the upstream's nameWithOwner, this PR is internal:
- Very specific: line 73
If headRefName differs from the current local branch, that's fine — you'll push with an explicit refspec local:headRefName in step 6.
- Very specific: line 74
If local HEAD is not a descendant of headRefOid, stop.
- Very specific: line 82
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 …
- Distinctive: line 94
Prefer the user's documented identity (e.g.
- Distinctive: line 117
Stop on the first red. Report which check failed and do not push.
- Very specific: line 129
Commit with a real body (use -F for multi-paragraph messages), ending with the Co-Authored-By trailer your harness requires — copy it …
- Very specific: line 175
Never push to
origin: when origin is the upstream and the PR head is a fork.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
- You are the fork owner — straightforward, you own that branch.
- 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
PR_NUMBER=<N>
gh pr view "$PR_NUMBER" --json state,headRefName,headRefOid,headRepository,headRepositoryOwner,maintainerCanModify,urlCapture:
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 betrueif you are not the fork owner.
If headRepository.nameWithOwner matches the upstream's nameWithOwner, this PR is internal:
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
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 configuredFor 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
git branch --show-current
git rev-parse HEAD
git merge-base --is-ancestor <headRefOid> HEAD && echo ok || echo NOT-DESCENDANT- If
headRefNamediffers from the current local branch, that's fine — you'll push with an explicit refspeclocal:headRefNamein 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
git config user.emailIf 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:
git -c user.name="<Name>" -c user.email="<email>" commit -F /tmp/commit-msg.txtTo correct an already-made commit before push:
git -c user.name="..." -c user.email="..." commit --amend --reset-author -C HEAD --no-editPrefer 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):
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.shPer-package extras when those areas are touched:
npm --prefix desktop run build && npm --prefix desktop test
node scripts/validate-agent-extensions.jsStop 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:
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 committingCommit 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:
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 differsgh configures git's credential helper, so HTTPS pushes pick up the right token automatically. Don't rewrite to SSH unless asked.
7. Verify the push landed on the PR
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
| Symptom | Cause | Fix |
Permission denied on push | Authenticated as the wrong user, or maintainerCanModify: false and you are not the fork owner | Abort. Only the fork owner can push to the branch. |
! [rejected] non-fast-forward | Someone else pushed to the PR since you started | git 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 update | You pushed to a branch with a different name on the fork | Re-check headRefName and use explicit refspec LOCAL:HEAD_BRANCH. |
| Commit shows "unverified" on the PR | Author email isn't tied to a verified GitHub account | Amend with the user's real identity (step 4) and push again (fast-forward, not force). |
Could not resolve host | Network or proxy issue | Surface the error. Don't blanket-retry. |
Hard rules
- Never push to
originwhen origin is the upstream and the PR head is a fork. Always verify withgit remote -vandgh 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.jsonunless 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

