From 9a4d467f05d50eef2dfcf4f183e6efe13df14c1b Mon Sep 17 00:00:00 2001 From: Josh Palmer Date: Sun, 1 Feb 2026 17:10:24 +0100 Subject: [PATCH] feat: add /landpr skill + checklist - add landpr workspace skill to expose /landpr command - add scripts/landpr.md checklist for OpenClaw PR landings --- clawdinator/workspace/skills/landpr/SKILL.md | 27 ++++++++ scripts/landpr.md | 67 ++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 clawdinator/workspace/skills/landpr/SKILL.md create mode 100644 scripts/landpr.md diff --git a/clawdinator/workspace/skills/landpr/SKILL.md b/clawdinator/workspace/skills/landpr/SKILL.md new file mode 100644 index 0000000..836fd82 --- /dev/null +++ b/clawdinator/workspace/skills/landpr/SKILL.md @@ -0,0 +1,27 @@ +--- +name: landpr +description: Land an OpenClaw PR end-to-end using the repo landpr checklist. Use when someone requests “/landpr” or asks to merge/land a PR. +user-invocable: true +--- + +# Land PR (OpenClaw) + +Use this skill to land **openclaw/openclaw** PRs only. + +## Safety + Scope + +- **Repo restriction:** only `openclaw/openclaw`. If the PR is in any other repo, stop and ask. +- **Confirmation required:** before rebase/force-push/merge, summarize the plan and ask for explicit approval. +- **Never close PRs.** PR must end in GitHub state **MERGED**. +- **No GitHub comments** unless the user explicitly approves (global policy). + +## Instructions + +Follow the checklist here: +- `/var/lib/clawd/repos/clawdinators/scripts/landpr.md` + +If the user did not specify a PR, use the most recent PR mentioned in the conversation. If ambiguous, ask. + +When ready to execute the merge step, confirm which strategy to use (rebase vs squash). If unclear, ask. + +After completion, verify PR state == MERGED. diff --git a/scripts/landpr.md b/scripts/landpr.md new file mode 100644 index 0000000..c5e88d7 --- /dev/null +++ b/scripts/landpr.md @@ -0,0 +1,67 @@ +/landpr + +Input +- PR: + - If missing: use the most recent PR mentioned in the conversation. + - If ambiguous: ask. + +Do (end-to-end) +Goal: PR must end in GitHub state = MERGED (never CLOSED). Use `gh pr merge` with `--rebase` or `--squash`. + +1) Repo clean: `git status`. +2) Identify PR meta (author + head branch): + + ```sh + gh pr view --json number,title,author,headRefName,baseRefName,headRepository --jq '{number,title,author:.author.login,head:.headRefName,base:.baseRefName,headRepo:.headRepository.nameWithOwner}' + contrib=$(gh pr view --json author --jq .author.login) + head=$(gh pr view --json headRefName --jq .headRefName) + head_repo_url=$(gh pr view --json headRepository --jq .headRepository.url) + ``` + +3) Fast-forward base: + - `git checkout main` + - `git pull --ff-only` +4) Create temp base branch from main: + - `git checkout -b temp/landpr-` +5) Check out PR branch locally: + - `gh pr checkout ` +6) Rebase PR branch onto temp base: + - `git rebase temp/landpr-` + - Fix conflicts; keep history tidy. +7) Fix + tests + changelog: + - Implement fixes + add/adjust tests + - Update `CHANGELOG.md` and mention `#` + `@$contrib` +8) Decide merge strategy: + - Rebase if we want to preserve commit history + - Squash if we want a single clean commit + - If unclear, ask +9) Full gate (BEFORE commit): + - `pnpm lint && pnpm build && pnpm test` +10) Commit via committer (include # + contributor in commit message): + - `committer "fix: (#) (thanks @$contrib)" CHANGELOG.md ` + - `land_sha=$(git rev-parse HEAD)` +11) Push updated PR branch (rebase => usually needs force): + + ```sh + git remote add prhead "$head_repo_url.git" 2>/dev/null || git remote set-url prhead "$head_repo_url.git" + git push --force-with-lease prhead HEAD:$head + ``` + +12) Merge PR (must show MERGED on GitHub): + - Rebase: `gh pr merge --rebase` + - Squash: `gh pr merge --squash` + - Never `gh pr close` (closing is wrong) +13) Sync main: + - `git checkout main` + - `git pull --ff-only` +14) Comment on PR with what we did + SHAs + thanks **only with explicit user approval**: + + ```sh + merge_sha=$(gh pr view --json mergeCommit --jq '.mergeCommit.oid') + gh pr comment --body "Landed via temp rebase onto main.\n\n- Gate: pnpm lint && pnpm build && pnpm test\n- Land commit: $land_sha\n- Merge commit: $merge_sha\n\nThanks @$contrib!" + ``` + +15) Verify PR state == MERGED: + - `gh pr view --json state --jq .state` +16) Delete temp branch: + - `git branch -D temp/landpr-`