[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CEAHWTTATH3J7QKJGJJ945":3,"skill-same:01M6CEAHWTTATH3J7QKJGJJ945":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":28,"linkOnly":29,"markdownContent":30,"markdownBody":31,"frontMatter":32,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":6,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":39,"install":40,"resources":53},"01M6CEAHWTTATH3J7QKJGJJ945","prepare-pr",null,"Prepare a GitHub PR for merge by rebasing onto main, fixing review findings, running gates, committing fixes, and pushing to the PR head branch. Use after \u002Freview-pr. Never merge or push to main.","LongIV999\u002FOpenclawd","LongIV999","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F92411512?v=4","01M6CEACAHRWWFRVKBQPSQ2WBM","01M6CEACEJDYKGDKD1P6A7J7VV",0,"MIT","https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002F.agents\u002Farchive\u002Fprepare-pr-v1\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27],"prepare","pr","prepare pr","review","github","merge","push","branch","use","never","2026-11-10 10:12:30",false,"---\nname: prepare-pr\ndescription: Prepare a GitHub PR for merge by rebasing onto main, fixing review findings, running gates, committing fixes, and pushing to the PR head branch. Use after \u002Freview-pr. Never merge or push to main.\n---\n\n# Prepare PR\n\n## Overview\n\nPrepare a PR head branch for merge with review fixes, green gates, and deterministic merge handoff artifacts.\n\n## Inputs\n\n- Ask for PR number or URL.\n- If missing, use `.local\u002Fpr-meta.env` from the PR worktree if present.\n- If ambiguous, ask.\n\n## Safety\n\n- Never push to `main` or `origin\u002Fmain`. Push only to the PR head branch.\n- Never run `git push` without explicit remote and branch. Do not run bare `git push`.\n- Do not run gateway stop commands. Do not kill processes. Do not touch port 18792.\n- Do not run `git clean -fdx`.\n- Do not run `git add -A` or `git add .`.\n\n## Execution Rule\n\n- Execute the workflow. Do not stop after printing the TODO checklist.\n- If delegating, require the delegate to run commands and capture outputs.\n\n## Completion Criteria\n\n- Rebase PR commits onto `origin\u002Fmain`.\n- Fix all BLOCKER and IMPORTANT items from `.local\u002Freview.md`.\n- Commit prep changes with required subject format.\n- Run required gates and pass (`pnpm test` may be skipped only for high-confidence docs-only changes).\n- Push the updated HEAD back to the PR head branch.\n- Write `.local\u002Fprep.md` and `.local\u002Fprep.env`.\n- Output exactly: `PR is ready for \u002Fmergepr`.\n\n## First: Create a TODO Checklist\n\nCreate a checklist of all prep steps, print it, then continue and execute the commands.\n\n## Setup: Use a Worktree\n\nUse an isolated worktree for all prep work.\n\n```sh\nrepo_root=$(git rev-parse --show-toplevel)\ncd \"$repo_root\"\ngh auth status\n\nWORKTREE_DIR=\".worktrees\u002Fpr-\u003CPR>\"\nif [ ! -d \"$WORKTREE_DIR\" ]; then\n  git fetch origin main\n  git worktree add \"$WORKTREE_DIR\" -b temp\u002Fpr-\u003CPR> origin\u002Fmain\nfi\ncd \"$WORKTREE_DIR\"\nmkdir -p .local\n```\n\nRun all commands inside the worktree directory.\n\n## Load Review Artifacts (Mandatory)\n\n```sh\nif [ ! -f .local\u002Freview.md ]; then\n  echo \"Missing .local\u002Freview.md. Run \u002Freview-pr first and save findings.\"\n  exit 1\nfi\n\nif [ ! -f .local\u002Fpr-meta.env ]; then\n  echo \"Missing .local\u002Fpr-meta.env. Run \u002Freview-pr first and save metadata.\"\n  exit 1\nfi\n\nsed -n '1,220p' .local\u002Freview.md\nsource .local\u002Fpr-meta.env\n```\n\n## Steps\n\n1. Identify PR meta with one API call\n\n```sh\npr_meta_json=$(gh pr view \u003CPR> --json number,title,author,headRefName,headRefOid,baseRefName,headRepository,headRepositoryOwner,body)\nprintf '%s\\n' \"$pr_meta_json\" | jq '{number,title,author:.author.login,head:.headRefName,headSha:.headRefOid,base:.baseRefName,headRepo:.headRepository.nameWithOwner,headRepoOwner:.headRepositoryOwner.login,headRepoName:.headRepository.name,body}'\n\npr_number=$(printf '%s\\n' \"$pr_meta_json\" | jq -r .number)\ncontrib=$(printf '%s\\n' \"$pr_meta_json\" | jq -r .author.login)\nhead=$(printf '%s\\n' \"$pr_meta_json\" | jq -r .headRefName)\npr_head_sha_before=$(printf '%s\\n' \"$pr_meta_json\" | jq -r .headRefOid)\nhead_owner=$(printf '%s\\n' \"$pr_meta_json\" | jq -r '.headRepositoryOwner.login \u002F\u002F empty')\nhead_repo_name=$(printf '%s\\n' \"$pr_meta_json\" | jq -r '.headRepository.name \u002F\u002F empty')\nhead_repo_url=$(printf '%s\\n' \"$pr_meta_json\" | jq -r '.headRepository.url \u002F\u002F empty')\n\nif [ -n \"${PR_HEAD:-}\" ] && [ \"$head\" != \"$PR_HEAD\" ]; then\n  echo \"ERROR: PR head branch changed from $PR_HEAD to $head. Re-run \u002Freview-pr.\"\n  exit 1\nfi\n```\n\n2. Fetch PR head and rebase on latest `origin\u002Fmain`\n\n```sh\ngit fetch origin pull\u002F\u003CPR>\u002Fhead:pr-\u003CPR> --force\ngit checkout -B pr-\u003CPR>-prep pr-\u003CPR>\ngit fetch origin main\ngit rebase origin\u002Fmain\n```\n\nIf conflicts happen:\n\n- Resolve each conflicted file.\n- Run `git add \u003Cresolved_file>` for each file.\n- Run `git rebase --continue`.\n\nIf the rebase gets confusing or you resolve conflicts 3 or more times, stop and report.\n\n3. Fix issues from `.local\u002Freview.md`\n\n- Fix all BLOCKER and IMPORTANT items.\n- NITs are optional.\n- Keep scope tight.\n\nKeep a running log in `.local\u002Fprep.md`:\n\n- List which review items you fixed.\n- List which files you touched.\n- Note behavior changes.\n\n4. Optional quick feedback tests before full gates\n\nTargeted tests are optional quick feedback, not a substitute for full gates.\n\nIf running targeted tests in a fresh worktree:\n\n```sh\nif [ ! -x node_modules\u002F.bin\u002Fvitest ]; then\n  pnpm install --frozen-lockfile\nfi\n```\n\n5. Commit prep fixes with required subject format\n\nUse `scripts\u002Fcommitter` with explicit file paths.\n\nRequired subject format:\n\n- `fix: \u003Csummary> (openclaw#\u003CPR>) thanks @\u003Cauthor>`\n\n```sh\ncommit_msg=\"fix: \u003Csummary> (openclaw#$pr_number) thanks @$contrib\"\nscripts\u002Fcommitter \"$commit_msg\" \u003Cchanged file 1> \u003Cchanged file 2> ...\n```\n\nIf there are no local changes, do not create a no-op commit.\n\nPost-commit validation (mandatory):\n\n```sh\nsubject=$(git log -1 --pretty=%s)\necho \"$subject\" | rg -q \"openclaw#$pr_number\" || { echo \"ERROR: commit subject missing openclaw#$pr_number\"; exit 1; }\necho \"$subject\" | rg -q \"thanks @$contrib\" || { echo \"ERROR: commit subject missing thanks @$contrib\"; exit 1; }\n```\n\n6. Decide verification mode and run required gates before pushing\n\nIf you are highly confident the change is docs-only, you may skip `pnpm test`.\n\nHigh-confidence docs-only criteria (all must be true):\n\n- Every changed file is documentation-only (`docs\u002F**`, `README*.md`, `CHANGELOG.md`, `*.md`, `*.mdx`, `mintlify.json`, `docs.json`).\n- No code, runtime, test, dependency, or build config files changed (`src\u002F**`, `extensions\u002F**`, `apps\u002F**`, `package.json`, lockfiles, TS\u002FJS config, test files, scripts).\n- `.local\u002Freview.md` does not call for non-doc behavior fixes.\n\nSuggested check:\n\n```sh\nchanged_files=$(git diff --name-only origin\u002Fmain...HEAD)\nnon_docs=$(printf \"%s\\n\" \"$changed_files\" | grep -Ev '^(docs\u002F|README.*\\.md$|CHANGELOG\\.md$|.*\\.md$|.*\\.mdx$|mintlify\\.json$|docs\\.json$)' || true)\n\ndocs_only=false\nif [ -n \"$changed_files\" ] && [ -z \"$non_docs\" ]; then\n  docs_only=true\nfi\n\necho \"docs_only=$docs_only\"\n```\n\nBootstrap dependencies in a fresh worktree before gates:\n\n```sh\nif [ ! -d node_modules ]; then\n  pnpm install --frozen-lockfile\nfi\n```\n\nRun required gates:\n\n```sh\npnpm build\npnpm check\n\nif [ \"$docs_only\" = \"true\" ]; then\n  echo \"Docs-only change detected with high confidence; skipping pnpm test.\" | tee -a .local\u002Fprep.md\nelse\n  pnpm test\nfi\n```\n\nRequire all required gates to pass. If something fails, fix, commit, and rerun. Allow at most 3 fix-and-rerun cycles.\n\n7. Push safely to the PR head branch\n\nBuild `prhead` from owner\u002Fname first, then validate remote branch SHA before push.\n\n```sh\nif [ -n \"$head_owner\" ] && [ -n \"$head_repo_name\" ]; then\n  head_repo_push_url=\"https:\u002F\u002Fgithub.com\u002F$head_owner\u002F$head_repo_name.git\"\nelif [ -n \"$head_repo_url\" ] && [ \"$head_repo_url\" != \"null\" ]; then\n  case \"$head_repo_url\" in\n    *.git) head_repo_push_url=\"$head_repo_url\" ;;\n    *) head_repo_push_url=\"$head_repo_url.git\" ;;\n  esac\nelse\n  echo \"ERROR: unable to determine PR head repo push URL\"\n  exit 1\nfi\n\ngit remote add prhead \"$head_repo_push_url\" 2>\u002Fdev\u002Fnull || git remote set-url prhead \"$head_repo_push_url\"\n\necho \"Pushing to branch: $head\"\nif [ \"$head\" = \"main\" ] || [ \"$head\" = \"master\" ]; then\n  echo \"ERROR: head branch is main\u002Fmaster. This is wrong. Stopping.\"\n  exit 1\nfi\n\nremote_sha=$(git ls-remote prhead \"refs\u002Fheads\u002F$head\" | awk '{print $1}')\nif [ -z \"$remote_sha\" ]; then\n  echo \"ERROR: remote branch refs\u002Fheads\u002F$head not found on prhead\"\n  exit 1\nfi\nif [ \"$remote_sha\" != \"$pr_head_sha_before\" ]; then\n  echo \"ERROR: expected remote SHA $pr_head_sha_before, got $remote_sha. Re-fetch metadata and rebase first.\"\n  exit 1\nfi\n\ngit push --force-with-lease=refs\u002Fheads\u002F$head:$pr_head_sha_before prhead HEAD:$head || push_failed=1\n```\n\nIf lease push fails because head moved, perform one automatic retry:\n\n```sh\nif [ \"${push_failed:-0}\" = \"1\" ]; then\n  echo \"Lease push failed, retrying once with fresh PR head...\"\n\n  pr_head_sha_before=$(gh pr view \u003CPR> --json headRefOid --jq .headRefOid)\n  git fetch origin pull\u002F\u003CPR>\u002Fhead:pr-\u003CPR>-latest --force\n  git rebase pr-\u003CPR>-latest\n\n  pnpm build\n  pnpm check\n  if [ \"$docs_only\" != \"true\" ]; then\n    pnpm test\n  fi\n\n  git push --force-with-lease=refs\u002Fheads\u002F$head:$pr_head_sha_before prhead HEAD:$head\nfi\n```\n\n8. Verify PR head and base relation (Mandatory)\n\n```sh\nprep_head_sha=$(git rev-parse HEAD)\npr_head_sha_after=$(gh pr view \u003CPR> --json headRefOid --jq .headRefOid)\n\nif [ \"$prep_head_sha\" != \"$pr_head_sha_after\" ]; then\n  echo \"ERROR: pushed head SHA does not match PR head SHA.\"\n  exit 1\nfi\n\ngit fetch origin main\ngit fetch origin pull\u002F\u003CPR>\u002Fhead:pr-\u003CPR>-verify --force\ngit merge-base --is-ancestor origin\u002Fmain pr-\u003CPR>-verify && echo \"PR is up to date with main\" || (echo \"ERROR: PR is still behind main, rebase again\" && exit 1)\ngit branch -D pr-\u003CPR>-verify 2>\u002Fdev\u002Fnull || true\n```\n\n9. Write prep summary artifacts (Mandatory)\n\nWrite `.local\u002Fprep.md` and `.local\u002Fprep.env` for merge handoff.\n\n```sh\ncontrib_id=$(gh api users\u002F$contrib --jq .id)\ncoauthor_email=\"${contrib_id}+${contrib}@users.noreply.github.com\"\n\ncat > .local\u002Fprep.env \u003C\u003CEOF_ENV\nPR_NUMBER=$pr_number\nPR_AUTHOR=$contrib\nPR_HEAD=$head\nPR_HEAD_SHA_BEFORE=$pr_head_sha_before\nPREP_HEAD_SHA=$prep_head_sha\nCOAUTHOR_EMAIL=$coauthor_email\nEOF_ENV\n\nls -la .local\u002Fprep.md .local\u002Fprep.env\nwc -l .local\u002Fprep.md .local\u002Fprep.env\n```\n\n10. Output\n\nInclude a diff stat summary:\n\n```sh\ngit diff --stat origin\u002Fmain..HEAD\ngit diff --shortstat origin\u002Fmain..HEAD\n```\n\nReport totals: X files changed, Y insertions(+), Z deletions(-).\n\nIf gates passed and push succeeded, print exactly:\n\n```\nPR is ready for \u002Fmergepr\n```\n\nOtherwise, list remaining failures and stop.\n\n## Guardrails\n\n- Worktree only.\n- Do not delete the worktree on success. `\u002Fmergepr` may reuse it.\n- Do not run `gh pr merge`.\n- Never push to main. Only push to the PR head branch.\n- Run and pass all required gates before pushing. `pnpm test` may be skipped only for high-confidence docs-only changes, and the skip must be explicitly recorded in `.local\u002Fprep.md`.\n","# Prepare PR\n\n## Overview\n\nPrepare a PR head branch for merge with review fixes, green gates, and deterministic merge handoff artifacts.\n\n## Inputs\n\n- Ask for PR number or URL.\n- If missing, use `.local\u002Fpr-meta.env` from the PR worktree if present.\n- If ambiguous, ask.\n\n## Safety\n\n- Never push to `main` or `origin\u002Fmain`. Push only to the PR head branch.\n- Never run `git push` without explicit remote and branch. Do not run bare `git push`.\n- Do not run gateway stop commands. Do not kill processes. Do not touch port 18792.\n- Do not run `git clean -fdx`.\n- Do not run `git add -A` or `git add .`.\n\n## Execution Rule\n\n- Execute the workflow. Do not stop after printing the TODO checklist.\n- If delegating, require the delegate to run commands and capture outputs.\n\n## Completion Criteria\n\n- Rebase PR commits onto `origin\u002Fmain`.\n- Fix all BLOCKER and IMPORTANT items from `.local\u002Freview.md`.\n- Commit prep changes with required subject format.\n- Run required gates and pass (`pnpm test` may be skipped only for high-confidence docs-only changes).\n- Push the updated HEAD back to the PR head branch.\n- Write `.local\u002Fprep.md` and `.local\u002Fprep.env`.\n- Output exactly: `PR is ready for \u002Fmergepr`.\n\n## First: Create a TODO Checklist\n\nCreate a checklist of all prep steps, print it, then continue and execute the commands.\n\n## Setup: Use a Worktree\n\nUse an isolated worktree for all prep work.\n\n```sh\nrepo_root=$(git rev-parse --show-toplevel)\ncd \"$repo_root\"\ngh auth status\n\nWORKTREE_DIR=\".worktrees\u002Fpr-\u003CPR>\"\nif [ ! -d \"$WORKTREE_DIR\" ]; then\n  git fetch origin main\n  git worktree add \"$WORKTREE_DIR\" -b temp\u002Fpr-\u003CPR> origin\u002Fmain\nfi\ncd \"$WORKTREE_DIR\"\nmkdir -p .local\n```\n\nRun all commands inside the worktree directory.\n\n## Load Review Artifacts (Mandatory)\n\n```sh\nif [ ! -f .local\u002Freview.md ]; then\n  echo \"Missing .local\u002Freview.md. Run \u002Freview-pr first and save findings.\"\n  exit 1\nfi\n\nif [ ! -f .local\u002Fpr-meta.env ]; then\n  echo \"Missing .local\u002Fpr-meta.env. Run \u002Freview-pr first and save metadata.\"\n  exit 1\nfi\n\nsed -n '1,220p' .local\u002Freview.md\nsource .local\u002Fpr-meta.env\n```\n\n## Steps\n\n1. Identify PR meta with one API call\n\n```sh\npr_meta_json=$(gh pr view \u003CPR> --json number,title,author,headRefName,headRefOid,baseRefName,headRepository,headRepositoryOwner,body)\nprintf '%s\\n' \"$pr_meta_json\" | jq '{number,title,author:.author.login,head:.headRefName,headSha:.headRefOid,base:.baseRefName,headRepo:.headRepository.nameWithOwner,headRepoOwner:.headRepositoryOwner.login,headRepoName:.headRepository.name,body}'\n\npr_number=$(printf '%s\\n' \"$pr_meta_json\" | jq -r .number)\ncontrib=$(printf '%s\\n' \"$pr_meta_json\" | jq -r .author.login)\nhead=$(printf '%s\\n' \"$pr_meta_json\" | jq -r .headRefName)\npr_head_sha_before=$(printf '%s\\n' \"$pr_meta_json\" | jq -r .headRefOid)\nhead_owner=$(printf '%s\\n' \"$pr_meta_json\" | jq -r '.headRepositoryOwner.login \u002F\u002F empty')\nhead_repo_name=$(printf '%s\\n' \"$pr_meta_json\" | jq -r '.headRepository.name \u002F\u002F empty')\nhead_repo_url=$(printf '%s\\n' \"$pr_meta_json\" | jq -r '.headRepository.url \u002F\u002F empty')\n\nif [ -n \"${PR_HEAD:-}\" ] && [ \"$head\" != \"$PR_HEAD\" ]; then\n  echo \"ERROR: PR head branch changed from $PR_HEAD to $head. Re-run \u002Freview-pr.\"\n  exit 1\nfi\n```\n\n2. Fetch PR head and rebase on latest `origin\u002Fmain`\n\n```sh\ngit fetch origin pull\u002F\u003CPR>\u002Fhead:pr-\u003CPR> --force\ngit checkout -B pr-\u003CPR>-prep pr-\u003CPR>\ngit fetch origin main\ngit rebase origin\u002Fmain\n```\n\nIf conflicts happen:\n\n- Resolve each conflicted file.\n- Run `git add \u003Cresolved_file>` for each file.\n- Run `git rebase --continue`.\n\nIf the rebase gets confusing or you resolve conflicts 3 or more times, stop and report.\n\n3. Fix issues from `.local\u002Freview.md`\n\n- Fix all BLOCKER and IMPORTANT items.\n- NITs are optional.\n- Keep scope tight.\n\nKeep a running log in `.local\u002Fprep.md`:\n\n- List which review items you fixed.\n- List which files you touched.\n- Note behavior changes.\n\n4. Optional quick feedback tests before full gates\n\nTargeted tests are optional quick feedback, not a substitute for full gates.\n\nIf running targeted tests in a fresh worktree:\n\n```sh\nif [ ! -x node_modules\u002F.bin\u002Fvitest ]; then\n  pnpm install --frozen-lockfile\nfi\n```\n\n5. Commit prep fixes with required subject format\n\nUse `scripts\u002Fcommitter` with explicit file paths.\n\nRequired subject format:\n\n- `fix: \u003Csummary> (openclaw#\u003CPR>) thanks @\u003Cauthor>`\n\n```sh\ncommit_msg=\"fix: \u003Csummary> (openclaw#$pr_number) thanks @$contrib\"\nscripts\u002Fcommitter \"$commit_msg\" \u003Cchanged file 1> \u003Cchanged file 2> ...\n```\n\nIf there are no local changes, do not create a no-op commit.\n\nPost-commit validation (mandatory):\n\n```sh\nsubject=$(git log -1 --pretty=%s)\necho \"$subject\" | rg -q \"openclaw#$pr_number\" || { echo \"ERROR: commit subject missing openclaw#$pr_number\"; exit 1; }\necho \"$subject\" | rg -q \"thanks @$contrib\" || { echo \"ERROR: commit subject missing thanks @$contrib\"; exit 1; }\n```\n\n6. Decide verification mode and run required gates before pushing\n\nIf you are highly confident the change is docs-only, you may skip `pnpm test`.\n\nHigh-confidence docs-only criteria (all must be true):\n\n- Every changed file is documentation-only (`docs\u002F**`, `README*.md`, `CHANGELOG.md`, `*.md`, `*.mdx`, `mintlify.json`, `docs.json`).\n- No code, runtime, test, dependency, or build config files changed (`src\u002F**`, `extensions\u002F**`, `apps\u002F**`, `package.json`, lockfiles, TS\u002FJS config, test files, scripts).\n- `.local\u002Freview.md` does not call for non-doc behavior fixes.\n\nSuggested check:\n\n```sh\nchanged_files=$(git diff --name-only origin\u002Fmain...HEAD)\nnon_docs=$(printf \"%s\\n\" \"$changed_files\" | grep -Ev '^(docs\u002F|README.*\\.md$|CHANGELOG\\.md$|.*\\.md$|.*\\.mdx$|mintlify\\.json$|docs\\.json$)' || true)\n\ndocs_only=false\nif [ -n \"$changed_files\" ] && [ -z \"$non_docs\" ]; then\n  docs_only=true\nfi\n\necho \"docs_only=$docs_only\"\n```\n\nBootstrap dependencies in a fresh worktree before gates:\n\n```sh\nif [ ! -d node_modules ]; then\n  pnpm install --frozen-lockfile\nfi\n```\n\nRun required gates:\n\n```sh\npnpm build\npnpm check\n\nif [ \"$docs_only\" = \"true\" ]; then\n  echo \"Docs-only change detected with high confidence; skipping pnpm test.\" | tee -a .local\u002Fprep.md\nelse\n  pnpm test\nfi\n```\n\nRequire all required gates to pass. If something fails, fix, commit, and rerun. Allow at most 3 fix-and-rerun cycles.\n\n7. Push safely to the PR head branch\n\nBuild `prhead` from owner\u002Fname first, then validate remote branch SHA before push.\n\n```sh\nif [ -n \"$head_owner\" ] && [ -n \"$head_repo_name\" ]; then\n  head_repo_push_url=\"https:\u002F\u002Fgithub.com\u002F$head_owner\u002F$head_repo_name.git\"\nelif [ -n \"$head_repo_url\" ] && [ \"$head_repo_url\" != \"null\" ]; then\n  case \"$head_repo_url\" in\n    *.git) head_repo_push_url=\"$head_repo_url\" ;;\n    *) head_repo_push_url=\"$head_repo_url.git\" ;;\n  esac\nelse\n  echo \"ERROR: unable to determine PR head repo push URL\"\n  exit 1\nfi\n\ngit remote add prhead \"$head_repo_push_url\" 2>\u002Fdev\u002Fnull || git remote set-url prhead \"$head_repo_push_url\"\n\necho \"Pushing to branch: $head\"\nif [ \"$head\" = \"main\" ] || [ \"$head\" = \"master\" ]; then\n  echo \"ERROR: head branch is main\u002Fmaster. This is wrong. Stopping.\"\n  exit 1\nfi\n\nremote_sha=$(git ls-remote prhead \"refs\u002Fheads\u002F$head\" | awk '{print $1}')\nif [ -z \"$remote_sha\" ]; then\n  echo \"ERROR: remote branch refs\u002Fheads\u002F$head not found on prhead\"\n  exit 1\nfi\nif [ \"$remote_sha\" != \"$pr_head_sha_before\" ]; then\n  echo \"ERROR: expected remote SHA $pr_head_sha_before, got $remote_sha. Re-fetch metadata and rebase first.\"\n  exit 1\nfi\n\ngit push --force-with-lease=refs\u002Fheads\u002F$head:$pr_head_sha_before prhead HEAD:$head || push_failed=1\n```\n\nIf lease push fails because head moved, perform one automatic retry:\n\n```sh\nif [ \"${push_failed:-0}\" = \"1\" ]; then\n  echo \"Lease push failed, retrying once with fresh PR head...\"\n\n  pr_head_sha_before=$(gh pr view \u003CPR> --json headRefOid --jq .headRefOid)\n  git fetch origin pull\u002F\u003CPR>\u002Fhead:pr-\u003CPR>-latest --force\n  git rebase pr-\u003CPR>-latest\n\n  pnpm build\n  pnpm check\n  if [ \"$docs_only\" != \"true\" ]; then\n    pnpm test\n  fi\n\n  git push --force-with-lease=refs\u002Fheads\u002F$head:$pr_head_sha_before prhead HEAD:$head\nfi\n```\n\n8. Verify PR head and base relation (Mandatory)\n\n```sh\nprep_head_sha=$(git rev-parse HEAD)\npr_head_sha_after=$(gh pr view \u003CPR> --json headRefOid --jq .headRefOid)\n\nif [ \"$prep_head_sha\" != \"$pr_head_sha_after\" ]; then\n  echo \"ERROR: pushed head SHA does not match PR head SHA.\"\n  exit 1\nfi\n\ngit fetch origin main\ngit fetch origin pull\u002F\u003CPR>\u002Fhead:pr-\u003CPR>-verify --force\ngit merge-base --is-ancestor origin\u002Fmain pr-\u003CPR>-verify && echo \"PR is up to date with main\" || (echo \"ERROR: PR is still behind main, rebase again\" && exit 1)\ngit branch -D pr-\u003CPR>-verify 2>\u002Fdev\u002Fnull || true\n```\n\n9. Write prep summary artifacts (Mandatory)\n\nWrite `.local\u002Fprep.md` and `.local\u002Fprep.env` for merge handoff.\n\n```sh\ncontrib_id=$(gh api users\u002F$contrib --jq .id)\ncoauthor_email=\"${contrib_id}+${contrib}@users.noreply.github.com\"\n\ncat > .local\u002Fprep.env \u003C\u003CEOF_ENV\nPR_NUMBER=$pr_number\nPR_AUTHOR=$contrib\nPR_HEAD=$head\nPR_HEAD_SHA_BEFORE=$pr_head_sha_before\nPREP_HEAD_SHA=$prep_head_sha\nCOAUTHOR_EMAIL=$coauthor_email\nEOF_ENV\n\nls -la .local\u002Fprep.md .local\u002Fprep.env\nwc -l .local\u002Fprep.md .local\u002Fprep.env\n```\n\n10. Output\n\nInclude a diff stat summary:\n\n```sh\ngit diff --stat origin\u002Fmain..HEAD\ngit diff --shortstat origin\u002Fmain..HEAD\n```\n\nReport totals: X files changed, Y insertions(+), Z deletions(-).\n\nIf gates passed and push succeeded, print exactly:\n\n```\nPR is ready for \u002Fmergepr\n```\n\nOtherwise, list remaining failures and stop.\n\n## Guardrails\n\n- Worktree only.\n- Do not delete the worktree on success. `\u002Fmergepr` may reuse it.\n- Do not run `gh pr merge`.\n- Never push to main. Only push to the PR head branch.\n- Run and pass all required gates before pushing. `pnpm test` may be skipped only for high-confidence docs-only changes, and the skip must be explicitly recorded in `.local\u002Fprep.md`.\n",{"name":5,"description":7},"main","56e72bb5549c5fa0a0470501619427b4f104aa92",".agents\u002Farchive\u002Fprepare-pr-v1",1,"https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd","https:\u002F\u002Fgithub.com\u002FLongIV999","2026-02-15 08:26:56",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add LongIV999\u002FOpenclawd --skill prepare-pr",{"tool":46,"command":47},"bunx","bunx skills add LongIV999\u002FOpenclawd --skill prepare-pr",{"tool":49,"command":50},"pnpm","pnpm dlx skills add LongIV999\u002FOpenclawd --skill prepare-pr","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002F.agents\u002Farchive\u002Fprepare-pr-v1\u002FSKILL.md",true,[54],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"agents\u002Fopenai.yaml","REFERENCE","参考文档",175,"https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002F.agents\u002Farchive\u002Fprepare-pr-v1\u002Fagents\u002Fopenai.yaml",[61,70,81,100,113,129],{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":28},"01M6CEFMR22ANX8BMWBY9J8VW3","youtube-to-obsidian","https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-to-obsidian\u002FSKILL.md",[],[67,68,69],"youtube to obsidian","youtube","obsidian",{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":28},"01M6CEFJW8HMZ7EY2C7FXDN8HG","weather","Get current weather and forecasts (no API key required).","https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002Fskills\u002Fweather\u002FSKILL.md",[],[72,77,78,79,80],"help","https","api","curl",{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":28},"01M6CEFGENXXNDQTCWVC82VBFT","wacli","Send WhatsApp messages to other people or search\u002Fsync WhatsApp history via the wacli CLI (not for normal user chats).","https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002Fskills\u002Fwacli\u002FSKILL.md",[],[83,22,88,89,90,78,91,92,93,94,95,96,97,98,99],"cli","sync","search","messages","history","cmd","brew","user","install","tap","whatsapp","go",{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":28},"01M6CEFERBY58R1VW8Z8ZCYEMY","voice-call","Start voice calls via the OpenClaw voice-call plugin.","https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002Fskills\u002Fvoice-call\u002FSKILL.md",[],[107,108,109,110,111,112],"voice","voice call","openclaw","plugin","plugins","start",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":124,"publishedAt":28},"01M6CEFD0C501CWXD9E4BMV2B2","video-frames","Extract frames or short clips from videos using ffmpeg.","https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002Fskills\u002Fvideo-frames\u002FSKILL.md",[119],{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},"01JBSEEDCAT000000000000016","图像与多媒体","SCENARIO","使用场景",[125,126,94,78,127,128,96],"Video","video frames","short","extract",{"skillNo":130,"name":131,"nameZh":6,"description":132,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":143,"publishedAt":28},"01M6CEFAJ48939CYW40VTBYGVP","trello","Manage Trello boards, lists, and cards via the Trello REST API.","https:\u002F\u002Fgithub.com\u002FLongIV999\u002FOpenclawd\u002Fblob\u002Fmain\u002Fskills\u002Ftrello\u002FSKILL.md",[135,138],{"categoryNo":136,"categoryName":137,"taxonomyType":122,"taxonomyTypeDesc":123},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":139,"categoryName":140,"taxonomyType":141,"taxonomyTypeDesc":142},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[131,78,144,145,146,79,147,148,149],"cloud","developer","REST","jq","atlassian","manage"]