From ghflow
This skill should be used when the user asks to "create pr", "make pr", "open pull request", "PR 올려줘", "PR 만들어줘", "풀리퀘 생성", or invokes /create-pr. It creates a GitHub Pull Request using the PR template fetched at session start by the ghflow SessionStart hook (from the current repo and the org's .github repo). Usage: /create-pr [base-branch] [--draft] [--assignee <login>] [message]
npx claudepluginhub hbs9312/hbs9312-plugins --plugin ghflowThis skill uses the workspace's default tool permissions.
Create a GitHub Pull Request using a PR template that was fetched at session start by the
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Create a GitHub Pull Request using a PR template that was fetched at session start by the ghflow SessionStart hook. This skill does not fetch or cache templates itself — it reads the hook output directly.
Arguments can appear in any order. Parsing rules:
--draft: Optional flag. Create the PR as a draft. Can appear anywhere.--assignee {login}: Optional. GitHub username to assign to the PR. If omitted, defaults to @me (the authenticated user). Use --assignee "" to explicitly create with no assignee.[base-branch]: Optional. The target branch to merge into. Identified as the first non-flag, non-quoted token. If omitted, defaults to the repo's default branch."[message]": Optional. Free-text instructions or context, enclosed in double quotes. For example, review focus areas, additional context for reviewers, or specific instructions on how to fill the template. This message is used when generating the PR title and body.Examples:
/create-pr/create-pr develop/create-pr --draft/create-pr develop --draft "DB 마이그레이션 부분 집중 리뷰 부탁"/create-pr --draft "인증 로직 변경 중심으로 봐주세요" develop/create-pr --assignee octocat/create-pr develop --assignee octocat --draft-u flag after confirming with the user.Before gathering PR context, ensure the current branch is up to date with the base branch to avoid merge conflicts after PR creation.
Determine base branch: Use the argument if provided, otherwise detect the repo's default branch:
gh repo view --json defaultBranchRef -q '.defaultBranchRef.name'
Fetch latest remote changes:
git fetch origin {base}
Rebase onto the updated base branch:
git rebase origin/{base}
If rebase conflicts occur:
git diff --name-only --diff-filter=Ugit add {file}git rebase --continuegit rebase --abort and inform the userForce-push the rebased branch (since rebase rewrites history):
git push --force-with-lease
Use --force-with-lease instead of --force for safety — it will fail if someone else pushed to the branch in the meantime.
Collect information needed to fill in the PR:
git log --oneline {base}..HEAD
git diff {base}...HEAD
git diff --name-status {base}...HEAD
The ghflow SessionStart hook has already fetched PR templates from both the current repo and
the org's .github repo, and written them to a JSON file. This skill does not fetch or cache
templates — it reads the hook output directly.
Read path:
REPO_ID=$(gh repo view --json nameWithOwner --jq '.nameWithOwner')
SLUG=$(echo "$REPO_ID" | sed 's|/|__|')
TEMPLATES_FILE="/tmp/ghflow/${SLUG}/templates.json"
File structure (relevant subset):
{
"repo": "org/repo",
"fetched_at": "...",
"pr_templates": [
{ "source": "org/repo", "path": ".github/pull_request_template.md", "body": "..." },
{ "source": "org/.github","path": "workflow-templates/PULL_REQUEST_TEMPLATE.md", "body": "..." }
]
}
Selection rules:
.github — you will only ever see entries from one source in pr_templates..github/PULL_REQUEST_TEMPLATE.md): use it directly..github/PULL_REQUEST_TEMPLATE/*.md): infer the best match from the user's [message] / branch name / commits, then confirm the choice in Step 7's preview. If inference is ambiguous, present the list (template name derived from path filename, e.g. feature.md → "Feature") and let the user pick before filling in.pr_templates is empty or the templates file does not exist:
Analyze the commits and diff gathered in Step 3, then fill in the selected template's body intelligently:
## Summary, ## Changes, ## Description) with actual content
derived from the commits and code changes.[message], incorporate it — use it as additional context for the summary, as reviewer guidance (e.g., "focus on the DB migration"), or to emphasize specific aspects of the changes.- [ ] Tests added), leave them as-is for the user to check manually.Create a concise PR title (under 70 characters) based on the changes:
feat:, fix:, chore:)gh pr list --state merged --limit 5 --json title -q '.[].title'
Present the following to the user for review using the AskUserQuestion tool:
.github)@me or the specified username)Options:
gh pr create --base {base_branch} --title "{title}" --body "$(cat <<'EOF'
{filled_template_body}
EOF
)" --assignee {assignee} [--draft]
--draft flag if the user passed --draft argument.{assignee} is @me by default, or the value from --assignee if explicitly provided. If the user passed --assignee "", omit the --assignee flag entirely.After successful creation, display the PR URL to the user.
/tmp/ghflow/<slug>/templates.json produced by the SessionStart hook.