| name | pr |
| description | Create a pull request after self-review, verify, and test pass. Handles branch push, PR creation, plan archiving, and hand-off. Invoke automatically after /cross-review completes (or is skipped), when self-review, verify, and test reports all exist with passing verdicts. |
Create a PR to hand off completed work for human review and merge.
Pre-checks
Before creating a PR, confirm ALL of the following:
- A self-review report exists in
docs/reports/ with no CRITICAL findings.
- A verify report exists in
docs/reports/ with pass or partial-pass verdict.
- A test report exists in
docs/reports/ with pass verdict. If tests failed, do NOT create the PR.
- Raw evidence is saved in
docs/evidence/.
- Branch name passes
./scripts/branch-name.sh validate "$(git branch --show-current)".
- You are NOT on main or master.
gh CLI is available (if not, provide manual commands instead).
- If
.harness/state/standard-pipeline/active-plan.json exists, it includes worktree_path, branch, and worktree_state_id for post-PR cleanup.
If any pre-check fails, stop and explain what is missing.
Steps
- Resolve pinned plan identity (standard flow):
Read
.harness/state/standard-pipeline/active-plan.json to obtain the exact plan path and task worktree metadata persisted by /work. Use this path for archival in Step 6 instead of rescanning docs/plans/active/. If the file is absent (e.g. legacy session), fall back to the single file under docs/plans/active/ or ask the user which plan to archive.
- Check for uncommitted changes with
git status --porcelain.
- If uncommitted changes exist: Stage with
git add (prefer specific files over -A) and create a conventional commit: <type>: <description>. If a GitHub issue is linked, append Refs #<number> to the commit body.
- If working tree is clean (intermediate commits already exist): Skip staging and committing — proceed directly to push.
- Push the branch:
git push -u origin HEAD.
- Create a ready-for-review PR with
gh pr create using template.md for the body structure. PR title and body must be written in Japanese. The PR title must start with the current branch type prefix from ./scripts/branch-name.sh title-prefix "$(git branch --show-current)" (for example, feat/... -> feat: ...). Do not pass --draft unless the operator explicitly requests a draft.
- Do not identify an assistant tool as PR provenance in the title or body. Avoid markers like
[codex] ..., [claude] ..., [cursor] ..., chore(codex): ..., chore(claude): ..., chore(cursor): ..., Generated by Codex, Generated by Claude, Generated by Cursor, Created by ..., Co-authored-by: ..., or similar labels. Mention Codex, Claude, Cursor, or another tool only when the change itself is about that tool's behavior or configuration, not as the PR author or creator.
- Linked issue handling: If the PR fully completes a linked GitHub issue (from branch name
<type>/<issue>/<slug> or the plan's Related issue: field), include Closes #<number> in the PR body so GitHub auto-closes the issue on merge. For partial work or related follow-up that should keep the issue open, use Refs #<number> instead. For multiple issues, repeat the keyword for each issue, such as Closes #123, closes #456. The closing keyword must appear in normal PR body text, not inside HTML comments, code blocks, or block quotes.
- After PR creation, run
./scripts/ensure-pr-title-prefix.sh <pr-url-or-current-branch> and ./scripts/ensure-pr-ready.sh <pr-url-or-current-branch>. If either fails, stop and do NOT report the PR as complete.
- For large diffs (>500 changed lines), create a walkthrough in
docs/reports/walkthrough-<date>-<slug>.md.
- Archive the plan using the path resolved in Step 1:
./scripts/archive-plan.sh <absolute-plan-path>.
- Clear standard-pipeline state (on successful PR creation):
rm -f .harness/state/standard-pipeline/active-plan.json .harness/state/standard-pipeline/cycle-count.json.
If PR creation fails, leave the state files in place so the user can resume.
- Cleanup task worktree and local branch (standard flow only):
- Only run cleanup after the PR URL exists, title/ready checks pass, and the branch has been pushed to
origin.
- Resolve
worktree_state_id from the Step-1 active-plan.json.
- Run
./scripts/ralph-worktree.sh cleanup --id <worktree_state_id> --force-branch.
--force-branch is allowed here because the remote PR branch is already the durable hand-off. Do not delete the remote branch while the PR is open.
- If cleanup fails, leave the git-common-dir state file in place and report the exact recovery command (
./scripts/ralph-worktree.sh gc or cleanup --id <id>) instead of hiding the failure.
Completion gate
Do NOT present the PR as complete unless ALL of the following are true:
CLI execution modes
This skill runs under both Claude Code and Codex. The execution mode follows
the conventions in AGENTS.md and .codex/AGENTS.override.md.
| Aspect | Claude Code | Codex |
|---|
| Skill invocation | /skill-name slash command | $skill-name mention or the /skills menu (avoid the /skill-name form — it collides with built-ins) |
| Skill body path | .claude/skills/<name>/SKILL.md | .agents/skills/<name>/SKILL.md |
| Subagent mechanism | Task(subagent_type=...) when a policy delegates | .codex/agents/ custom agents when a policy delegates |
| Structured prompts | AskUserQuestion | Numbered options printed to stdout, awaiting a digit reply |
| Artifacts | docs/reports/, docs/plans/, docs/specs/ (shared) | Same (CLI-agnostic) |
The drift check (./scripts/check-skill-sync.sh) cross-checks both bodies and
invocation metadata — editing only one side will fail CI.