원클릭으로
create-pr
Create a GitHub PR with verification and Codex review. Runs verify.sh and code/doc review before PR creation.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Create a GitHub PR with verification and Codex review. Runs verify.sh and code/doc review before PR creation.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Generate EXECUTION_PLAN.md and scoped AGENTS.md files for a feature. Use after /feature-technical-spec to create the task breakdown.
Generate the greenfield execution plan plus root and scoped AGENTS.md files. Use after /technical-spec to create the phased task breakdown.
Guide discovery and discussion to determine how an AI coding agent can autonomously run and verify a specific user flow end to end. Use when the user asks what would be needed to test a flow, prove an app works, create an E2E/self-test harness, make agent verification repeatable, or evaluate whether an existing test setup lets the agent verify behavior. This skill is for shaping the verification approach before implementation: read the repo's product docs and existing verification contracts, identify the real user flow and channel under test, uncover missing controllable state or external dependencies, ask focused questions, and produce a concrete agent-runnable verification plan only after the flow is understood.
Exploratory conversation before /product-spec. Asks one question at a time, runs background research for open-source/off-the-shelf alternatives, and writes DISCOVERY_NOTES.md. Use when the user has an idea but hasn't scoped it yet.
Define feature requirements (problem, users, scope, acceptance criteria) through guided Q&A and write FEATURE_SPEC.md. Use when starting a new feature.
Define technical approach (architecture, integration points, data model) for a feature through guided Q&A and write FEATURE_TECHNICAL_SPEC.md. Use after /feature-spec.
| name | create-pr |
| description | Create a GitHub PR with verification and Codex review. Runs verify.sh and code/doc review before PR creation. |
| argument-hint | [focus] [--skip-verify] [--skip-review] [--base BRANCH] [--title TITLE] [--draft] |
| allowed-tools | Bash, Read, Glob, Grep |
Create a GitHub pull request with verification and Codex review. Runs .workstream/verify.sh (if available), auto-generates title and body from commits, runs Codex review (code or doc), and includes findings in the PR description.
gh CLI installed and authenticated (gh auth status works)| Argument | Example | Description |
|---|---|---|
focus | security | Focus Codex review on specific area |
--skip-verify | Skip verification (.workstream/verify.sh) | |
--skip-review | Skip Codex review entirely | |
--base BRANCH | --base develop | Base branch for PR (default: repo default) |
--title TITLE | --title "Add auth" | Override auto-generated title |
--draft | Create as draft PR |
Additional gh pr create flags are passed through.
Copy this checklist and track progress:
Create PR Progress:
- [ ] Step 1: Pre-flight checks
- [ ] Step 2: Run verification
- [ ] Step 3: Gather branch context
- [ ] Step 4: Auto-generate title and body
- [ ] Step 5: Run Codex review
- [ ] Step 6: Show preview and confirm
- [ ] Step 7: Create PR
gh auth status
If not authenticated:
gh CLI is not authenticated.
Run: gh auth login
CURRENT_BRANCH=$(git branch --show-current)
If on main or master:
CREATE PR: ABORTED
===================
You are on the main branch. Create a feature branch first.
git status --porcelain
If dirty:
CREATE PR: WARNING
==================
You have uncommitted changes. Commit or stash them first.
Uncommitted files:
{list of files}
Use AskUserQuestion:
Question: "You have uncommitted changes. How would you like to proceed?"
Header: "Dirty tree"
Options:
- Label: "Commit all changes"
Description: "Stage and commit everything before creating PR **(Default)**"
- Label: "Continue anyway"
Description: "Create PR with current commits only"
- Label: "Cancel"
Description: "Stop and handle changes manually"
If "Commit all changes": stage all, commit with auto-generated message, then verify with git status that the commit succeeded and the working tree is clean before continuing.
If "Cancel": stop.
# Detect base branch
BASE_BRANCH="${BASE:-$(gh repo view --json defaultBranchRef -q '.defaultBranchRef.name' 2>/dev/null || echo 'main')}"
# Count commits ahead
COMMITS_AHEAD=$(git rev-list --count $BASE_BRANCH..HEAD 2>/dev/null || echo "0")
If 0 commits ahead:
CREATE PR: ABORTED
===================
No commits ahead of {base_branch}. Nothing to create a PR for.
# Check if remote tracking branch exists and is up to date
git rev-parse --abbrev-ref @{upstream} 2>/dev/null
UNPUSHED=$(git rev-list --count @{upstream}..HEAD 2>/dev/null || echo "all")
If unpushed commits (or no upstream):
git push -u origin $CURRENT_BRANCH
Verify with git status that the branch is tracking the remote. If the push failed, report the error and stop.
If --skip-verify is set: Skip this step entirely, continue to Step 3.
[[ -f .workstream/verify.sh ]]
If .workstream/verify.sh does not exist:
bash .workstream/verify.sh
This runs the project's verification gate (typically: typecheck → lint → test → build).
If verification passes (exit code 0):
VERIFICATION: PASSED
====================
All checks passed (typecheck, lint, test, build).
Continue to Step 3.
If verification fails (non-zero exit code):
VERIFICATION: FAILED
====================
{verification output showing failures}
Fix the issues above before creating a PR.
Use AskUserQuestion:
Question: "Verification failed. How would you like to proceed?"
Header: "Verify failed"
Options:
- Label: "Fix issues first"
Description: "Stop PR creation, address the failures **(Default)**"
- Label: "Create PR anyway"
Description: "Proceed despite verification failures"
- Label: "Cancel"
Description: "Abort PR creation"
If "Fix issues first": stop and show what needs fixing. If "Create PR anyway": continue to Step 3 (note failure in PR body). If "Cancel": stop.
# Commits on this branch
git log --oneline $BASE_BRANCH..HEAD
# Full diff stat
git diff $BASE_BRANCH...HEAD --stat
# Changed files list (for review type detection)
git diff $BASE_BRANCH...HEAD --name-only
Check changed files to determine whether to use /codex-review (code) or /codex-consult (docs):
# Get list of changed file extensions
git diff $BASE_BRANCH...HEAD --name-only
Code file extensions: .ts, .tsx, .js, .jsx, .py, .go, .rs, .java, .rb, .php, .swift, .kt, .c, .cpp, .h, .cs, .sh, .bash, .zsh, .sql, .graphql, .vue, .svelte
Doc file extensions: .md, .txt, .json, .yaml, .yml, .toml, .xml, .csv, .env, .conf, .cfg, .ini
Rules:
/codex-review/codex-consult/codex-review if unsureIf --title not provided, generate from branch name and commit log:
feature/add-auth -> Add authfix-123), use the first commit subjectGenerate PR body from commit log:
# Get commit subjects and bodies
git log --format="- %s%n%n%b" $BASE_BRANCH..HEAD
Structure the body:
## Summary
{2-4 bullet points summarizing the changes from commit messages}
## Changes
{For each commit:}
- {commit subject}
## Test plan
- [ ] {Inferred testing steps based on changes}
If --skip-review is set:
**Codex Review:** SKIPPED (--skip-review)If running inside Codex (CODEX_SANDBOX set):
**Codex Review:** SKIPPED (running inside Codex)codex --version 2>/dev/null
If Codex not available:
**Codex Review:** SKIPPED (Codex CLI not available)Based on review type detected in Step 2:
For code changes: Invoke /codex-review with the optional focus area.
The review runs against the current branch vs base branch.
For doc-only changes: Invoke /codex-consult on the diff content.
Parse the Codex output for severity levels (see EVALUATION_PRACTICES.md):
If critical issues found:
CODEX REVIEW: CRITICAL ISSUES
==============================
{List of critical issues}
Critical issues must be addressed before creating the PR.
Use AskUserQuestion:
Question: "Codex found critical issues. How would you like to proceed?"
Header: "Critical"
Options:
- Label: "Fix issues first"
Description: "Stop PR creation, address the issues **(Default)**"
- Label: "Create PR anyway"
Description: "Proceed with critical issues noted in PR body"
- Label: "Cancel"
Description: "Abort PR creation"
If "Fix issues first": stop and list what needs fixing. If "Create PR anyway": continue with issues in body.
If no critical issues (pass or pass_with_notes): Continue with findings in body.
Append a Codex Review section to the PR body:
## Codex Review
**Status:** {PASS | PASS WITH NOTES | NEEDS ATTENTION}
**Model:** {model used}
{If recommendations:}
### Recommendations
{numbered list of recommendations}
{If positive findings:}
### Positive Findings
{bulleted list}
Display the complete PR before creating:
PR PREVIEW
==========
Title: {title}
Base: {base_branch} <- {current_branch}
Type: {regular | draft}
Body:
---
{full PR body}
---
Use AskUserQuestion:
Question: "Create this PR?"
Header: "Confirm PR"
Options:
- Label: "Yes, create PR"
Description: "Create the pull request as shown (Recommended)"
- Label: "Edit title"
Description: "Change the PR title before creating"
- Label: "Cancel"
Description: "Abort PR creation"
If "Edit title": ask for new title via AskUserQuestion, then re-preview. If "Cancel": stop.
gh pr create --title "$TITLE" --body "$(cat <<'EOF'
{full PR body}
---
Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Add flags as needed:
--base $BASE_BRANCH if non-default base--draft if draft mode requestedVerify the PR URL was returned successfully in the gh pr create output. If the command failed, report the full error output and stop.
PR CREATED
==========
{PR URL from gh output}
Title: {title}
Base: {base_branch} <- {current_branch}
Review: {PASS | PASS WITH NOTES | NEEDS ATTENTION | SKIPPED}
| Failure | Action |
|---|---|
gh not installed | Report and stop |
gh not authenticated | Suggest gh auth login |
| Not on a feature branch | Report and stop |
| No commits ahead | Report and stop |
| Push fails | Report error and stop |
| Verification unavailable | Skip verification silently |
| Verification fails | Ask user (fix, continue, or cancel) |
| Codex unavailable | Skip review, note in PR body |
| Codex times out | Skip review, note in PR body |
| Codex critical issues | Ask user (fix, continue, or cancel) |
gh pr create fails | Report error with full output |
Codex review uses existing configuration from .claude/settings.local.json:
{
"codexReview": {
"enabled": true,
"codeModel": "gpt-5.3-codex"
},
"codexConsult": {
"enabled": true,
"researchModel": "gpt-5.2"
}
}
If both codexReview.enabled and codexConsult.enabled are false, Codex review is skipped entirely.
Basic PR:
/create-pr
Skip verification (e.g., for doc-only changes):
/create-pr --skip-verify
Skip Codex review:
/create-pr --skip-review
Skip both verification and review (fastest):
/create-pr --skip-verify --skip-review
Security-focused review with custom base:
/create-pr security --base develop
Draft PR with custom title:
/create-pr --draft --title "WIP: Add authentication"
REMINDER: Working tree must be clean before PR creation. Commit or stash all changes first.