[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71FT8WBYD5T32RVHA4S29AR":3,"skill-same:01M71FT8WBYD5T32RVHA4S29AR":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":14,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":51,"ownerDescription":52,"updatedAt":53,"install":54,"resources":67},"01M71FT8WBYD5T32RVHA4S29AR","open-upstream-pr",null,"ALWAYS invoke this skill when opening a pull request against a repository the operator does not control — a fork's upstream, or any base whose permission is READ, TRIAGE, or NONE. NEVER open a pull request against such a repository without this skill.","outcomeeng\u002Fplugins","outcomeeng","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F257335685?v=4","01M71FRVRF36XYR3HRSCGFHK2R","Outcome Engineering","01M71FRVS4BZG17DWANFJ7EPNY",1,"MIT","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Fcontribute\u002Fskills\u002Fopen-upstream-pr\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"pr","open upstream pr","upstream","open","commit","Bash","when","parse","invoke","mktemp","URL","remote","get","show","never","fetch","ask","branch","pick","gh pr","2026-11-10 10:12:30",false,"---\nname: open-upstream-pr\ndescription: >-\n  ALWAYS invoke this skill when opening a pull request against a repository the operator does not control — a fork's upstream, or any base whose permission is READ, TRIAGE, or NONE.\n  NEVER open a pull request against such a repository without this skill.\nargument-hint: \"[what the change does, or empty to describe it from the branch]\"\nallowed-tools: Read, Write, Glob, {{! tool('use_skill') !}},{!% if target == 'claude' %!} Agent,{!% else %!} {{! tool('spawn_agent') !}}, {{! tool('wait_agent') !}},{!% endif %!} {{! tool('ask_user') !}}, Bash(git remote get-url origin), Bash(gh repo view:*), Bash(gh api users\u002F*), Bash(gh pr create:*), Bash(git fetch:*), Bash(git rev-parse:*), Bash(git switch:*), Bash(git cherry-pick:*), Bash(git diff:*), Bash(git status --porcelain), Bash(git add:*), Bash(git commit:*), Bash(git branch --show-current), Bash(git log:*), Bash(git push -u origin HEAD:refs\u002Fheads\u002F*), Bash(mktemp -d)\n---\n\n\u003Cobjective>\nOne pull request open against a repository the operator does not control, carrying a change verified against every one of that repository's own checks that could run locally, with any that could not named in the body as unverified.\n\u003C\u002Fobjective>\n\n\u003Cworkflow>\n\n**Step 1 — Load the standards and read the invocation input.** {!% require_skill 'contribute:contribution-standards' %!} Its `\u003Cinvariants>` govern every step below; this workflow adds ordering and the pull-request specifics.\n\n`$ARGUMENTS`, when non-empty, is the one-sentence description of the change used in Step 3's authorization and in the Step 9 body. When it is empty, derive that sentence from the checkout's current branch at invocation — the branch the change was written on, distinct from the `\u003Cbranch>` Step 4 cuts — and its own commit subjects (`git log --format=%s origin\u002FHEAD..HEAD`), which needs nothing a later step resolves.\n\n**Step 2 — GATE: Establish the target.** Read the live `\u003CUPSTREAM_TARGET>` marker; invoke `\u002Fupstream` when none is live. Report `base`, `head`, and `permission` verbatim.\n\nOnly `upstream-contribution` continues — a pull request needs a head to push from. `controlled` belongs to a controlled-repository pull-request flow. `head-ambiguous` and `fork-absent` each stop per `\u002Fcontribution-standards` `\u003Cresolution>`, and `blocked` stops with the resolver's `detail` verbatim.\n\n**Step 3 — GATE: Obtain authorization.** Present, through the runtime's structured-question tool, the resolved `base`, the resolved `head`, the change in one sentence, and the choice to authorize the pull request against that base or to stop and inspect. Create nothing in the base repository until the operator authorizes it in this turn.\n\nThe authorization covers this pull request and its later revisions. It does not carry to a second pull request, an issue, or a comment on an unrelated thread.\n\n**Step 4 — Cut the branch from the base default branch.** Fetch it by URL so the step never depends on a remote name the checkout may not carry:\n\n```bash\ngh repo view \"\u003Cbase>\" --json defaultBranchRef --jq '.defaultBranchRef.name'\n```\n\nDerive `\u003Cbranch>` from the one-sentence description Step 1 resolved: lowercase it, drop every word that names neither the action nor its subject, join what remains with hyphens, and stop at five words. \"Fix the flaky retry timeout in the webhook handler\" keeps six words and stops at five, giving `fix-flaky-retry-timeout-webhook`. The branch names the change and nothing else — never the operator, the fork, or Claude. Resolve it here, because Step 9 reads it back from the checkout and a branch that does not exist yet answers nothing.\n\nRead the default-branch name, then fetch and branch in a second block:\n\n```bash\ngit fetch \"https:\u002F\u002Fgithub.com\u002F\u003Cbase>.git\" \"\u003Cbase-default-branch>\"\ngit rev-parse FETCH_HEAD\n```\n\nRecord what `git rev-parse` printed as `\u003Cbase-tip>` and use that SHA in every later comparison, starting with the next command. `FETCH_HEAD` is overwritten by the next fetch from any source — one inside a check Step 6 runs, or inside a commit hook — so a later `FETCH_HEAD...HEAD` diff can silently compare against an unrelated commit and report a real contribution as empty.\n\nRead whether this branch already exists before creating it:\n\n```bash\ngit rev-parse --verify --quiet \"refs\u002Fheads\u002F\u003Cbranch>\"\n```\n\nIt prints a SHA when an earlier pass already cut the branch — the name derives from the description, so a retry after a failed replay, an aborted cherry-pick, or a failed creation lands on the same one. `git switch -c` refuses an existing branch, so decide here rather than stopping on its error with no instruction:\n\n- **Nothing printed.** The branch is new; cut it below.\n- **The printed SHA equals `\u003Cbase-tip>`.** The earlier pass cut the branch and got no further. Take it with plain `git switch \"\u003Cbranch>\"`, then continue at the replay below.\n- **Any other SHA.** The branch carries commits from an earlier attempt. Report the branch, that SHA, and `git log --format='%h %s' \u003Cbase-tip>..\u003Cbranch>`, then stop. Whether those commits are the contribution to keep or the wreckage of an aborted replay is a decision about the contribution; discarding them or building on them silently makes it for the operator.\n\n```bash\ngit switch -c \"\u003Cbranch>\" FETCH_HEAD\n```\n\nBranch from `FETCH_HEAD`, never from the head repository's default branch, which is behind by however long since the last sync.\n\n**When the contribution already exists as commits on the invocation branch**, cutting at `FETCH_HEAD` alone abandons them and pushes the base tip. Replay them onto the new branch before continuing, and confirm the diff against `\u003Cbase-tip>` carries the intended change:\n\n```bash\ngit cherry-pick \u003Cfirst-commit>^..\u003Clast-commit>\ngit diff --stat \u003Cbase-tip>...HEAD\n```\n\nThe `^` is required. `A..B` means every commit reachable from `B` but not from `A`, so naming the first contribution commit as `A` excludes it: a multi-commit contribution silently loses its earliest commit, and a single-commit contribution replays nothing at all while the empty result still looks like a completed replay. `\u003Cfirst-commit>^` names that commit's parent, which is the range's exclusive end.\n\nAn empty diff **from that replay** means the cherry-pick range named no commit and the contribution was left behind; stop rather than carrying an empty branch forward. This gate belongs to the replay and runs only when one ran. A contribution that exists as uncommitted edits enters no replay at all — `git switch -c` carries those edits onto the new branch — so it reaches Step 8, where the commit gate stages them and the same diff is read against a tree that now holds a commit.\n\nA conflict stops the replay mid-pick and leaves the checkout in that state. Run `git cherry-pick --abort` to return it to the branch tip, then report the conflicting commit and stop. The replay conflicts because the base moved under the change, and reconciling it is a decision about the contribution rather than a step of cutting the branch.\n\n**Step 5 — Conform to the base repository's conventions.** Before writing code, read what that repository declares: its contributing guide, the READMEs governing any fixture or test-data directory the change touches, metadata schemas, the documents a change of this kind updates, and the commit-message style of recent history. Locate them by pattern rather than by guessing at paths — `**\u002FCONTRIBUTING*`, `**\u002FREADME*`, and the directories the change touches — then read each one. Shape the change to those conventions.\n\n**Step 6 — GATE: Run the base repository's own verification.** Locate its declared checks — the commands its contributing guide names, its workflow files, and its build and test targets — and run them locally. They must report success. Those commands belong to that repository and cannot be enumerated here, so they run per `\u002Fcontribution-standards` `\u003Ccapability_scope>` rather than from this skill's grants; the same applies to editing the files Step 5 shapes.\n\nCapture verbose output in a directory from `mktemp -d`, inspect the exit status and failing sections, and leave the directory in place. Fix failures and re-run until green. A check that cannot run locally is recorded for Step 9's body with the reason it could not run; never report it as passed and never drop it silently.\n\n**Step 7 — GATE: Review the outward text.** Draft the title and body per `\u003Ctitle_and_body>`, then review them per `\u002Fcontribution-standards` `\u003Cinvariants>` \"Outward-facing text is permanent\". Where the prose plugin is installed, dispatch its `{{! subagent_name('prose', 'prose-auditor') !}}` thin agent through the runtime's agent-dispatch surface and apply its findings. Where it is not, review against `\u002Fcontribution-standards` `\u003Coutward_text>` and state in the report that the review ran unassisted.\n\n**Step 8 — GATE: Commit what the push will carry.** A push transfers commits. Everything above — the branch cut, the conventions, the base repository's own checks, the outward-text review — can run against edits sitting in the working tree, and none of them reach the pull request. Read the tree before pushing:\n\n```bash\ngit status --porcelain\n```\n\nEmpty output means every verified change is already committed. Any output is the contribution, or part of it, still uncommitted: commit it in the base repository's commit style and re-run Step 6, because the checks passed against a tree that is now the commit.\n\n```bash\ngit add \u003Ccontribution-paths>\ngit commit -m \"\u003Cmessage in the base repository's commit style>\"\n```\n\nConfirm the branch carries a change before continuing. `git diff --stat \u003Cbase-tip>...HEAD` empty here means the pull request would be empty; stop rather than opening it.\n\n**Step 9 — Push, then open.** Confirm `origin` resolves to the resolved head per `\u002Fcontribution-standards` `\u003Cresolution>` \"Verify `origin` before pushing or fetching through it\" — a remote name is a local label, and pushing through the wrong one publishes the contribution to a repository nobody named:\n\n```bash\ngh repo view \"$(git remote get-url origin)\" --json nameWithOwner --jq '.nameWithOwner'\n```\n\n**STOP when that does not equal the resolved `head`.** Then push the branch with the explicit destination ref and open the pull request naming the base repository.\n\nDerive `\u003Chead-owner>` from the resolved `head`, which the resolver reports as `owner\u002Fname`: take the portion before the `\u002F`. `gh pr create --head` reads `owner:branch`, so passing the whole `owner\u002Fname` there names no head at all.\n\n```bash\nbranch=$(git branch --show-current)\ngit push -u origin HEAD:refs\u002Fheads\u002F\"${branch}\"\n```\n\n`gh pr create --head \u003Cowner>:\u003Cbranch>` resolves a user-owned head; `gh` does not support an organization as that owner. Read which one this head has, because the resolver reports fork candidates only when no fork exists — the classification this flow never continues on — so its candidate list is empty here and answers nothing:\n\n```bash\ngh api users\u002F\"\u003Chead-owner>\" --jq '.type'\n```\n\n`User` takes `--head \u003Chead-owner>:\u003Cbranch>`. `Organization` cannot be selected that way at all: run the creation from a checkout whose `origin` is that head repository and pass `--head \u003Cbranch>` alone. Stop with the resolved head named when neither form selects it — never fall back to a head `gh` picks.\n\nThe body is a payload. Write it with the file-write tool to a file in the scratch directory the harness names for this session, under a file name unique to the agent and this pull request, then hand that file to `gh`. Where the harness names no scratch directory, use the one the environment designates, such as `$RUNNER_TEMP` on a hosted runner. Never remove it; the harness clears its scratch directory. The file holds:\n\n```text\n## Summary\n\n- \u003Cbullet>\n\n## Verification\n\n- \u003Cbase repository check> — passed\n- \u003Ccheck that could not run> — unverified, \u003Creason>\n\n## Refs\n\n- \u003Cissue or discussion this answers>\n```\n\n```bash\nGIT_TERMINAL_PROMPT=0 gh pr create \\\n  --repo \"\u003Cbase>\" \\\n  --base \"\u003Cbase-default-branch>\" \\\n  --head \"\u003Chead-owner>:\u003Cbranch>\" \\\n  --title \"\u003Csubject under 70 chars>\" \\\n  --body-file \"\u003Cbody-file>\"\n```\n\nPass `--draft` when the contribution is unsolicited or its conformance to the base repository's conventions remains uncertain.\n\nFlag rationale:\n\n- `--repo` — the resolved base. Without it `gh` opens against whatever it resolves from the checkout, which for a fork is the parent, reached by inference rather than by decision.\n- `--head \u003Chead-owner>:\u003Cbranch>` — the head repository's owner and the branch, both resolved above, stated explicitly so the head never depends on inference and no fork-selection prompt appears. An organization-owned head drops the owner and passes `--head \u003Cbranch>` from a checkout whose `origin` is that repository, per the account-type read above.\n- `--base` — the base repository's default branch, resolved in Step 4.\n- `--body-file \"\u003Cbody-file>\"` — the body arrives from the scratch file with real newlines, whatever code spans, quotes, or shell text it carries. `--body` does not expand escape sequences, and a heredoc, pipe, or inline argument is refused by the dangerous-command guard on such text.\n\n**Step 10 — Hand off.** Surface the pull-request URL, then invoke `\u002Fmanage-upstream-pr` on it.\n\n\u003C\u002Fworkflow>\n\n\u003Ctitle_and_body>\n\nThe title is one subject line under 70 characters, in the commit-message style of the base repository's recent history — not the operator's own convention.\n\nThe body states what the change does, what verification ran, and what it answers. Sections:\n\n- **Summary** — one or two bullets a maintainer can read before the diff.\n- **Verification** — each of the base repository's declared checks with its result, and each check that could not run locally marked unverified with its reason.\n- **Refs** — the issue or discussion the change answers.\n\nA defect fix adds a **Root cause** paragraph and carries the evidence `\u002Fcontribution-standards` requires: tool versions, the base commit observed against, the command that produced the observation, and a negative control.\n\nThe body explains why; the diff already shows what.\n\n\u003C\u002Ftitle_and_body>\n\n\u003Cconstraints>\n\n- MUST establish the target through `\u002Fupstream` before the first write — reading `isFork`, `parent`, and `viewerPermission` by eye is the failure that gate exists to prevent.\n- MUST obtain authorization naming the resolved base in the same turn before creating the pull request.\n- MUST name the base repository with `--repo` on `gh pr create`, and name the head explicitly rather than letting `gh` resolve one: `--head \u003Chead-owner>:\u003Cbranch>` for a user-owned head, `--head \u003Cbranch>` from a checkout whose `origin` is the head repository when that head is organization-owned. `gh` documents the qualified form as `\u003Cuser>:\u003Cbranch>`, so requiring it unconditionally steers an organization-owned head back into the form that cannot select it.\n- MUST cut the contribution branch from the base repository's default branch, under a name derived in Step 4 before the first command that uses it.\n- NEVER discard or build on commits an earlier pass left on the derived branch. Read whether the branch exists before `git switch -c`, take it only when its tip is `\u003Cbase-tip>`, and otherwise report its commits and stop.\n- NEVER force-push. The `Bash(git push -u origin HEAD:refs\u002Fheads\u002F*)` grant matches by prefix, so it admits `--force` and `--force-with-lease` too; this constraint is the whole containment for those flags.\n- NEVER pass `--force` or `--discard-changes` to `git switch` — the `Bash(git switch:*)` grant matches by prefix and admits both, and either one drops uncommitted work in the invocation checkout. Cutting the contribution branch never needs them.\n- NEVER write through `gh api users`. The `Bash(gh api users\u002F*)` grant matches by prefix, so it admits `-X PATCH` and `-X DELETE` after the owner segment; this constraint is the whole containment for those verbs. It reads the head owner's account type and nothing else.\n- NEVER stage by wildcard. The `Bash(git add:*)` grant matches by prefix, so it admits `-A` and `.`, either of which sweeps unrelated work in the invocation checkout into a commit bound for someone else's repository. Name the contribution's paths.\n- NEVER pass `--no-verify` to `git commit`. The `Bash(git commit:*)` grant matches by prefix and admits it. Hooks run from this checkout's own configuration, which conforming to the base repository's conventions is what installs, so skipping them drops part of the verification Step 6 requires.\n- NEVER cherry-pick a commit outside the invocation branch's own range. The `Bash(git cherry-pick:*)` grant matches by prefix, so it admits any revision the checkout can name; Step 4 replays that branch's commits and nothing else.\n- NEVER open a pull request whose diff against `\u003Cbase-tip>` is empty at the Step 8 commit gate — the pull request would carry nothing. Step 4's identical check belongs to the replay and applies only to a pass that ran one; an uncommitted contribution is empty there by construction and is committed in Step 8.\n- NEVER open against a base whose classification is `controlled`, `fork-absent`, or `blocked`.\n- NEVER create the fork — report the destination candidates and stop.\n- NEVER report an unrunnable check as passed, or omit it from the body.\n- NEVER pass the pull-request body through a heredoc, a pipe, or an inline argument, and NEVER remove the body file.\n\n\u003C\u002Fconstraints>\n\n\u003Cfailure_modes>\n\n**A resolved default stood in for a named target.** Claude ran `gh pr create` from a fork checkout without `--repo`, and `gh` resolved the base to the parent. The command would have published to an organization nobody named, and nothing in its output said so. Resolve first, pass `--repo`, and report the resolved values verbatim.\n\n**The branch was cut from the fork's default.** Claude branched from the head repository's default branch, which was thirty-one commits behind the base. The resulting diff carried unrelated divergence, and the maintainer's first comment was about the noise rather than the change. Fetch the base repository's default branch and cut from that ref.\n\n\u003C\u002Ffailure_modes>\n\n\u003Csuccess_criteria>\n\n- The `\u003CUPSTREAM_TARGET>` marker read for this pass carries `classification=\"upstream-contribution\"`, and its `base`, `head`, and `permission` values appear verbatim in the report.\n- The operator authorized this pull request against the resolved base in the turn it was created.\n- The contribution branch was cut from the base repository's default branch, and a branch an earlier pass had already cut was taken only at `\u003Cbase-tip>`; one carrying commits stopped the flow with those commits named.\n- The branch's diff against `\u003Cbase-tip>` carried the change before the push; an empty diff at either gate stopped the flow with nothing opened, and every criterion below covers a pass that opened.\n- The base repository's declared checks ran locally and reported success; any check that could not run is named in the body as unverified with its reason.\n- The title and body passed a prose review, and a review that ran unassisted is reported as such.\n- The head owner's account type was read before the head form was chosen, and `gh pr create` named the base with `--repo` and named the head explicitly — `\u003Chead-owner>:\u003Cbranch>` for a user, `\u003Cbranch>` alone for an organization — with the body arriving from a scratch file through `--body-file`.\n- The pull-request URL is surfaced and `\u002Fmanage-upstream-pr` has taken over.\n\n\u003C\u002Fsuccess_criteria>\n","\u003Cobjective>\nOne pull request open against a repository the operator does not control, carrying a change verified against every one of that repository's own checks that could run locally, with any that could not named in the body as unverified.\n\u003C\u002Fobjective>\n\n\u003Cworkflow>\n\n**Step 1 — Load the standards and read the invocation input.** {!% require_skill 'contribute:contribution-standards' %!} Its `\u003Cinvariants>` govern every step below; this workflow adds ordering and the pull-request specifics.\n\n`$ARGUMENTS`, when non-empty, is the one-sentence description of the change used in Step 3's authorization and in the Step 9 body. When it is empty, derive that sentence from the checkout's current branch at invocation — the branch the change was written on, distinct from the `\u003Cbranch>` Step 4 cuts — and its own commit subjects (`git log --format=%s origin\u002FHEAD..HEAD`), which needs nothing a later step resolves.\n\n**Step 2 — GATE: Establish the target.** Read the live `\u003CUPSTREAM_TARGET>` marker; invoke `\u002Fupstream` when none is live. Report `base`, `head`, and `permission` verbatim.\n\nOnly `upstream-contribution` continues — a pull request needs a head to push from. `controlled` belongs to a controlled-repository pull-request flow. `head-ambiguous` and `fork-absent` each stop per `\u002Fcontribution-standards` `\u003Cresolution>`, and `blocked` stops with the resolver's `detail` verbatim.\n\n**Step 3 — GATE: Obtain authorization.** Present, through the runtime's structured-question tool, the resolved `base`, the resolved `head`, the change in one sentence, and the choice to authorize the pull request against that base or to stop and inspect. Create nothing in the base repository until the operator authorizes it in this turn.\n\nThe authorization covers this pull request and its later revisions. It does not carry to a second pull request, an issue, or a comment on an unrelated thread.\n\n**Step 4 — Cut the branch from the base default branch.** Fetch it by URL so the step never depends on a remote name the checkout may not carry:\n\n```bash\ngh repo view \"\u003Cbase>\" --json defaultBranchRef --jq '.defaultBranchRef.name'\n```\n\nDerive `\u003Cbranch>` from the one-sentence description Step 1 resolved: lowercase it, drop every word that names neither the action nor its subject, join what remains with hyphens, and stop at five words. \"Fix the flaky retry timeout in the webhook handler\" keeps six words and stops at five, giving `fix-flaky-retry-timeout-webhook`. The branch names the change and nothing else — never the operator, the fork, or Claude. Resolve it here, because Step 9 reads it back from the checkout and a branch that does not exist yet answers nothing.\n\nRead the default-branch name, then fetch and branch in a second block:\n\n```bash\ngit fetch \"https:\u002F\u002Fgithub.com\u002F\u003Cbase>.git\" \"\u003Cbase-default-branch>\"\ngit rev-parse FETCH_HEAD\n```\n\nRecord what `git rev-parse` printed as `\u003Cbase-tip>` and use that SHA in every later comparison, starting with the next command. `FETCH_HEAD` is overwritten by the next fetch from any source — one inside a check Step 6 runs, or inside a commit hook — so a later `FETCH_HEAD...HEAD` diff can silently compare against an unrelated commit and report a real contribution as empty.\n\nRead whether this branch already exists before creating it:\n\n```bash\ngit rev-parse --verify --quiet \"refs\u002Fheads\u002F\u003Cbranch>\"\n```\n\nIt prints a SHA when an earlier pass already cut the branch — the name derives from the description, so a retry after a failed replay, an aborted cherry-pick, or a failed creation lands on the same one. `git switch -c` refuses an existing branch, so decide here rather than stopping on its error with no instruction:\n\n- **Nothing printed.** The branch is new; cut it below.\n- **The printed SHA equals `\u003Cbase-tip>`.** The earlier pass cut the branch and got no further. Take it with plain `git switch \"\u003Cbranch>\"`, then continue at the replay below.\n- **Any other SHA.** The branch carries commits from an earlier attempt. Report the branch, that SHA, and `git log --format='%h %s' \u003Cbase-tip>..\u003Cbranch>`, then stop. Whether those commits are the contribution to keep or the wreckage of an aborted replay is a decision about the contribution; discarding them or building on them silently makes it for the operator.\n\n```bash\ngit switch -c \"\u003Cbranch>\" FETCH_HEAD\n```\n\nBranch from `FETCH_HEAD`, never from the head repository's default branch, which is behind by however long since the last sync.\n\n**When the contribution already exists as commits on the invocation branch**, cutting at `FETCH_HEAD` alone abandons them and pushes the base tip. Replay them onto the new branch before continuing, and confirm the diff against `\u003Cbase-tip>` carries the intended change:\n\n```bash\ngit cherry-pick \u003Cfirst-commit>^..\u003Clast-commit>\ngit diff --stat \u003Cbase-tip>...HEAD\n```\n\nThe `^` is required. `A..B` means every commit reachable from `B` but not from `A`, so naming the first contribution commit as `A` excludes it: a multi-commit contribution silently loses its earliest commit, and a single-commit contribution replays nothing at all while the empty result still looks like a completed replay. `\u003Cfirst-commit>^` names that commit's parent, which is the range's exclusive end.\n\nAn empty diff **from that replay** means the cherry-pick range named no commit and the contribution was left behind; stop rather than carrying an empty branch forward. This gate belongs to the replay and runs only when one ran. A contribution that exists as uncommitted edits enters no replay at all — `git switch -c` carries those edits onto the new branch — so it reaches Step 8, where the commit gate stages them and the same diff is read against a tree that now holds a commit.\n\nA conflict stops the replay mid-pick and leaves the checkout in that state. Run `git cherry-pick --abort` to return it to the branch tip, then report the conflicting commit and stop. The replay conflicts because the base moved under the change, and reconciling it is a decision about the contribution rather than a step of cutting the branch.\n\n**Step 5 — Conform to the base repository's conventions.** Before writing code, read what that repository declares: its contributing guide, the READMEs governing any fixture or test-data directory the change touches, metadata schemas, the documents a change of this kind updates, and the commit-message style of recent history. Locate them by pattern rather than by guessing at paths — `**\u002FCONTRIBUTING*`, `**\u002FREADME*`, and the directories the change touches — then read each one. Shape the change to those conventions.\n\n**Step 6 — GATE: Run the base repository's own verification.** Locate its declared checks — the commands its contributing guide names, its workflow files, and its build and test targets — and run them locally. They must report success. Those commands belong to that repository and cannot be enumerated here, so they run per `\u002Fcontribution-standards` `\u003Ccapability_scope>` rather than from this skill's grants; the same applies to editing the files Step 5 shapes.\n\nCapture verbose output in a directory from `mktemp -d`, inspect the exit status and failing sections, and leave the directory in place. Fix failures and re-run until green. A check that cannot run locally is recorded for Step 9's body with the reason it could not run; never report it as passed and never drop it silently.\n\n**Step 7 — GATE: Review the outward text.** Draft the title and body per `\u003Ctitle_and_body>`, then review them per `\u002Fcontribution-standards` `\u003Cinvariants>` \"Outward-facing text is permanent\". Where the prose plugin is installed, dispatch its `{{! subagent_name('prose', 'prose-auditor') !}}` thin agent through the runtime's agent-dispatch surface and apply its findings. Where it is not, review against `\u002Fcontribution-standards` `\u003Coutward_text>` and state in the report that the review ran unassisted.\n\n**Step 8 — GATE: Commit what the push will carry.** A push transfers commits. Everything above — the branch cut, the conventions, the base repository's own checks, the outward-text review — can run against edits sitting in the working tree, and none of them reach the pull request. Read the tree before pushing:\n\n```bash\ngit status --porcelain\n```\n\nEmpty output means every verified change is already committed. Any output is the contribution, or part of it, still uncommitted: commit it in the base repository's commit style and re-run Step 6, because the checks passed against a tree that is now the commit.\n\n```bash\ngit add \u003Ccontribution-paths>\ngit commit -m \"\u003Cmessage in the base repository's commit style>\"\n```\n\nConfirm the branch carries a change before continuing. `git diff --stat \u003Cbase-tip>...HEAD` empty here means the pull request would be empty; stop rather than opening it.\n\n**Step 9 — Push, then open.** Confirm `origin` resolves to the resolved head per `\u002Fcontribution-standards` `\u003Cresolution>` \"Verify `origin` before pushing or fetching through it\" — a remote name is a local label, and pushing through the wrong one publishes the contribution to a repository nobody named:\n\n```bash\ngh repo view \"$(git remote get-url origin)\" --json nameWithOwner --jq '.nameWithOwner'\n```\n\n**STOP when that does not equal the resolved `head`.** Then push the branch with the explicit destination ref and open the pull request naming the base repository.\n\nDerive `\u003Chead-owner>` from the resolved `head`, which the resolver reports as `owner\u002Fname`: take the portion before the `\u002F`. `gh pr create --head` reads `owner:branch`, so passing the whole `owner\u002Fname` there names no head at all.\n\n```bash\nbranch=$(git branch --show-current)\ngit push -u origin HEAD:refs\u002Fheads\u002F\"${branch}\"\n```\n\n`gh pr create --head \u003Cowner>:\u003Cbranch>` resolves a user-owned head; `gh` does not support an organization as that owner. Read which one this head has, because the resolver reports fork candidates only when no fork exists — the classification this flow never continues on — so its candidate list is empty here and answers nothing:\n\n```bash\ngh api users\u002F\"\u003Chead-owner>\" --jq '.type'\n```\n\n`User` takes `--head \u003Chead-owner>:\u003Cbranch>`. `Organization` cannot be selected that way at all: run the creation from a checkout whose `origin` is that head repository and pass `--head \u003Cbranch>` alone. Stop with the resolved head named when neither form selects it — never fall back to a head `gh` picks.\n\nThe body is a payload. Write it with the file-write tool to a file in the scratch directory the harness names for this session, under a file name unique to the agent and this pull request, then hand that file to `gh`. Where the harness names no scratch directory, use the one the environment designates, such as `$RUNNER_TEMP` on a hosted runner. Never remove it; the harness clears its scratch directory. The file holds:\n\n```text\n## Summary\n\n- \u003Cbullet>\n\n## Verification\n\n- \u003Cbase repository check> — passed\n- \u003Ccheck that could not run> — unverified, \u003Creason>\n\n## Refs\n\n- \u003Cissue or discussion this answers>\n```\n\n```bash\nGIT_TERMINAL_PROMPT=0 gh pr create \\\n  --repo \"\u003Cbase>\" \\\n  --base \"\u003Cbase-default-branch>\" \\\n  --head \"\u003Chead-owner>:\u003Cbranch>\" \\\n  --title \"\u003Csubject under 70 chars>\" \\\n  --body-file \"\u003Cbody-file>\"\n```\n\nPass `--draft` when the contribution is unsolicited or its conformance to the base repository's conventions remains uncertain.\n\nFlag rationale:\n\n- `--repo` — the resolved base. Without it `gh` opens against whatever it resolves from the checkout, which for a fork is the parent, reached by inference rather than by decision.\n- `--head \u003Chead-owner>:\u003Cbranch>` — the head repository's owner and the branch, both resolved above, stated explicitly so the head never depends on inference and no fork-selection prompt appears. An organization-owned head drops the owner and passes `--head \u003Cbranch>` from a checkout whose `origin` is that repository, per the account-type read above.\n- `--base` — the base repository's default branch, resolved in Step 4.\n- `--body-file \"\u003Cbody-file>\"` — the body arrives from the scratch file with real newlines, whatever code spans, quotes, or shell text it carries. `--body` does not expand escape sequences, and a heredoc, pipe, or inline argument is refused by the dangerous-command guard on such text.\n\n**Step 10 — Hand off.** Surface the pull-request URL, then invoke `\u002Fmanage-upstream-pr` on it.\n\n\u003C\u002Fworkflow>\n\n\u003Ctitle_and_body>\n\nThe title is one subject line under 70 characters, in the commit-message style of the base repository's recent history — not the operator's own convention.\n\nThe body states what the change does, what verification ran, and what it answers. Sections:\n\n- **Summary** — one or two bullets a maintainer can read before the diff.\n- **Verification** — each of the base repository's declared checks with its result, and each check that could not run locally marked unverified with its reason.\n- **Refs** — the issue or discussion the change answers.\n\nA defect fix adds a **Root cause** paragraph and carries the evidence `\u002Fcontribution-standards` requires: tool versions, the base commit observed against, the command that produced the observation, and a negative control.\n\nThe body explains why; the diff already shows what.\n\n\u003C\u002Ftitle_and_body>\n\n\u003Cconstraints>\n\n- MUST establish the target through `\u002Fupstream` before the first write — reading `isFork`, `parent`, and `viewerPermission` by eye is the failure that gate exists to prevent.\n- MUST obtain authorization naming the resolved base in the same turn before creating the pull request.\n- MUST name the base repository with `--repo` on `gh pr create`, and name the head explicitly rather than letting `gh` resolve one: `--head \u003Chead-owner>:\u003Cbranch>` for a user-owned head, `--head \u003Cbranch>` from a checkout whose `origin` is the head repository when that head is organization-owned. `gh` documents the qualified form as `\u003Cuser>:\u003Cbranch>`, so requiring it unconditionally steers an organization-owned head back into the form that cannot select it.\n- MUST cut the contribution branch from the base repository's default branch, under a name derived in Step 4 before the first command that uses it.\n- NEVER discard or build on commits an earlier pass left on the derived branch. Read whether the branch exists before `git switch -c`, take it only when its tip is `\u003Cbase-tip>`, and otherwise report its commits and stop.\n- NEVER force-push. The `Bash(git push -u origin HEAD:refs\u002Fheads\u002F*)` grant matches by prefix, so it admits `--force` and `--force-with-lease` too; this constraint is the whole containment for those flags.\n- NEVER pass `--force` or `--discard-changes` to `git switch` — the `Bash(git switch:*)` grant matches by prefix and admits both, and either one drops uncommitted work in the invocation checkout. Cutting the contribution branch never needs them.\n- NEVER write through `gh api users`. The `Bash(gh api users\u002F*)` grant matches by prefix, so it admits `-X PATCH` and `-X DELETE` after the owner segment; this constraint is the whole containment for those verbs. It reads the head owner's account type and nothing else.\n- NEVER stage by wildcard. The `Bash(git add:*)` grant matches by prefix, so it admits `-A` and `.`, either of which sweeps unrelated work in the invocation checkout into a commit bound for someone else's repository. Name the contribution's paths.\n- NEVER pass `--no-verify` to `git commit`. The `Bash(git commit:*)` grant matches by prefix and admits it. Hooks run from this checkout's own configuration, which conforming to the base repository's conventions is what installs, so skipping them drops part of the verification Step 6 requires.\n- NEVER cherry-pick a commit outside the invocation branch's own range. The `Bash(git cherry-pick:*)` grant matches by prefix, so it admits any revision the checkout can name; Step 4 replays that branch's commits and nothing else.\n- NEVER open a pull request whose diff against `\u003Cbase-tip>` is empty at the Step 8 commit gate — the pull request would carry nothing. Step 4's identical check belongs to the replay and applies only to a pass that ran one; an uncommitted contribution is empty there by construction and is committed in Step 8.\n- NEVER open against a base whose classification is `controlled`, `fork-absent`, or `blocked`.\n- NEVER create the fork — report the destination candidates and stop.\n- NEVER report an unrunnable check as passed, or omit it from the body.\n- NEVER pass the pull-request body through a heredoc, a pipe, or an inline argument, and NEVER remove the body file.\n\n\u003C\u002Fconstraints>\n\n\u003Cfailure_modes>\n\n**A resolved default stood in for a named target.** Claude ran `gh pr create` from a fork checkout without `--repo`, and `gh` resolved the base to the parent. The command would have published to an organization nobody named, and nothing in its output said so. Resolve first, pass `--repo`, and report the resolved values verbatim.\n\n**The branch was cut from the fork's default.** Claude branched from the head repository's default branch, which was thirty-one commits behind the base. The resulting diff carried unrelated divergence, and the maintainer's first comment was about the noise rather than the change. Fetch the base repository's default branch and cut from that ref.\n\n\u003C\u002Ffailure_modes>\n\n\u003Csuccess_criteria>\n\n- The `\u003CUPSTREAM_TARGET>` marker read for this pass carries `classification=\"upstream-contribution\"`, and its `base`, `head`, and `permission` values appear verbatim in the report.\n- The operator authorized this pull request against the resolved base in the turn it was created.\n- The contribution branch was cut from the base repository's default branch, and a branch an earlier pass had already cut was taken only at `\u003Cbase-tip>`; one carrying commits stopped the flow with those commits named.\n- The branch's diff against `\u003Cbase-tip>` carried the change before the push; an empty diff at either gate stopped the flow with nothing opened, and every criterion below covers a pass that opened.\n- The base repository's declared checks ran locally and reported success; any check that could not run is named in the body as unverified with its reason.\n- The title and body passed a prose review, and a review that ran unassisted is reported as such.\n- The head owner's account type was read before the head form was chosen, and `gh pr create` named the base with `--repo` and named the head explicitly — `\u003Chead-owner>:\u003Cbranch>` for a user, `\u003Cbranch>` alone for an organization — with the body arriving from a scratch file through `--body-file`.\n- The pull-request URL is surfaced and `\u002Fmanage-upstream-pr` has taken over.\n\n\u003C\u002Fsuccess_criteria>\n",{"name":5,"description":7,"allowed-tools":44,"argument-hint":45},"Read, Write, Glob, {{! tool('use_skill') !}},{!% if target == 'claude' %!} Agent,{!% else %!} {{! tool('spawn_agent') !}}, {{! tool('wait_agent') !}},{!% endif %!} {{! tool('ask_user') !}}, Bash(git remote get-url origin), Bash(gh repo view:*), Bash(gh api users\u002F*), Bash(gh pr create:*), Bash(git fetch:*), Bash(git rev-parse:*), Bash(git switch:*), Bash(git cherry-pick:*), Bash(git diff:*), Bash(git status --porcelain), Bash(git add:*), Bash(git commit:*), Bash(git branch --show-current), Bash(git log:*), Bash(git push -u origin HEAD:refs\u002Fheads\u002F*), Bash(mktemp -d)","[what the change does, or empty to describe it from the branch]","main","978d51c51d68c99cffb2ba48f7cad9d2f07e5738","src\u002Fplugins\u002Fcontribute\u002Fskills\u002Fopen-upstream-pr","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins","https:\u002F\u002Fgithub.com\u002Foutcomeeng","https:\u002F\u002Foutcome.engineering","Spec-driven development for AI-assisted engineering","2026-11-14 20:33:56",{"source":8,"skillName":5,"commands":55,"prompt":65,"zipAvailable":66},[56,59,62],{"tool":57,"command":58},"npx","npx skills add outcomeeng\u002Fplugins --skill open-upstream-pr",{"tool":60,"command":61},"bunx","bunx skills add outcomeeng\u002Fplugins --skill open-upstream-pr",{"tool":63,"command":64},"pnpm","pnpm dlx skills add outcomeeng\u002Fplugins --skill open-upstream-pr","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Fcontribute\u002Fskills\u002Fopen-upstream-pr\u002FSKILL.md",true,[],[69,75,99,115,129,139],{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":39},"01M71G25RZTPQG9KJ00JCHC1F7","plugin","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Ftemplates\u002Fplugin\u002FSKILL.md",[],[71],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":39},"01M71G23DCX3SV60H63HBBKQ6J","sanitize-powerpoint","ALWAYS invoke this skill when sanitizing, cleaning up, auditing, or aligning a PowerPoint (.pptx) deck — slide-master and layout structure, layout type attributes, stray fonts, non-theme colors, or layout naming. NEVER hand-edit pptx XML without this skill.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Fwork\u002Fskills\u002Fsanitize-powerpoint\u002FSKILL.md",[],[82,83,84,85,86,87,88,33,89,90,91,92,93,94,95,96,97,98,27,25],"sanitize powerpoint","powerpoint","sanitize","fonts","type","cleaning","structure","attributes","theme","pptx","naming","layout","deck","up","edit","xml","master",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":39},"01M71G21PQKBCDECHGVYSKPJW5","draw-excalidraw","ALWAYS invoke this skill when creating Excalidraw diagrams, visualizing workflows, architectures, or concepts. NEVER generate Excalidraw JSON without this skill.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Fwork\u002Fskills\u002Fdraw-excalidraw\u002FSKILL.md",[],[106,107,108,109,110,33,27,111,112,25,113,114],"draw excalidraw","excalidraw","draw","diagrams","architectures","generate","workflows","concepts","json",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":39},"01M71G1ZMNGFD37RZYM620XM2C","typescript-test-standards","TypeScript test standards enforced across all skills. Loaded by other skills, not invoked directly.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-test-standards\u002FSKILL.md",[],[122,123,124,125,126,127,128],"typescript","typescript test standards","test","standards","false","read","across",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":39},"01M71G1XBH0X1VCTR7269MDGSY","typescript-code-standards","TypeScript code standards enforced across all skills. Loaded by other skills, not invoked directly.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-code-standards\u002FSKILL.md",[],[122,136,137,138,125,126,127,128],"code","typescript code standards","code standards",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":39},"01M71G1TQ3VN45SJ75DFMJDB9W","typescript-architecture-standards","TypeScript ADR conventions enforced across architect and auditor skills. Loaded by other skills, not invoked directly.","https:\u002F\u002Fgithub.com\u002Foutcomeeng\u002Fplugins\u002Fblob\u002Fmain\u002Fsrc\u002Fplugins\u002Ftypescript\u002Fskills\u002Ftypescript-architecture-standards\u002FSKILL.md",[],[146,125,147,148,122,149,150,128,127,151,126,152],"architecture standards","typescript architecture standards","architecture","adr","architect","auditor","conventions"]