Create a new pull request
Creates a pull request with optional AI-generated descriptions from conversation context.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-repo@fractary"<title>" [--body "<text>"] [--prompt "<instructions>"] [--base <branch>] [--head <branch>] [--work-id <id>] [--draft]claude-haiku-4-5<CRITICAL_RULES> YOU MUST:
YOU MUST NOT:
COMMAND ISOLATION:
WHEN COMMANDS FAIL:
THIS COMMAND IS ONLY A ROUTER. </CRITICAL_RULES>
<WORKFLOW> 1. **Parse user input** - Extract title (required) - Parse optional arguments: --body, --prompt, --base, --head, --work-id, --draft - Validate required arguments are presentHandle --prompt argument (if provided)
--prompt is provided but --body is NOT provided:
--prompt and --body are provided:
--body as the base, but enhance/refine it using the prompt instructions--body is provided (no --prompt):
--body as-is (current behavior)Build structured request
ACTUALLY INVOKE the Task tool
Return response
<ARGUMENT_SYNTAX>
This command follows the space-separated argument syntax (consistent with work/repo plugin family):
--flag value (NOT --flag=value)--body "Implements CSV export functionality" ✅--body Implements CSV export functionality ❌Always use quotes for multi-word values:
✅ /fractary-repo:pr-create "Add CSV export feature" --body "Implements user data export"
✅ /fractary-repo:pr-create "Fix authentication bug" --work-id 123
❌ /fractary-repo:pr-create Add CSV export feature --body Implements export
Single-word values don't require quotes:
✅ /fractary-repo:pr-create "Title" --work-id 123
✅ /fractary-repo:pr-create "Title" --base develop
Boolean flags have no value:
✅ /fractary-repo:pr-create "WIP: Feature" --draft
❌ /fractary-repo:pr-create "WIP: Feature" --draft true
</ARGUMENT_SYNTAX>
<ARGUMENT_PARSING>
Required Arguments:
title (string): PR title, use quotes if multi-word (e.g., "Add CSV export feature")Optional Arguments:
--body (string): PR description/body text, use quotes if multi-word - exact text to use as body--prompt (string): Instructions for generating the PR description from conversation context (use quotes). When provided without --body, Claude will craft the description using the current conversation plus these instructions. Useful for summarizing implementation discussions and code changes.--base (string): Base branch to merge into (default: main/master). Examples: "main", "develop", "release/v1.0"--head (string): Head branch to merge from (default: current branch). Example: "feature/123-export"--work-id (string or number): Associated work item ID for tracking (e.g., "123", "PROJ-456")--draft (boolean flag): Create as draft PR (not ready for review). No value needed, just include the flagBody vs Prompt:
--body provides the exact text to use as the PR description--prompt provides instructions for Claude to generate the description from conversation context--body is the base and --prompt refines it--prompt is provided, Claude generates the entire description based on the conversation and instructionsMaps to: create-pr
Example:
/fractary-repo:pr-create "Add CSV export feature" --work-id 123 --body "Implements CSV export functionality"
→ Invoke agent with {"operation": "create-pr", "parameters": {"title": "Add CSV export feature", "work_id": "123", "body": "Implements CSV export functionality"}}
</ARGUMENT_PARSING>
<EXAMPLES> ## Usage Examples# Create PR
/fractary-repo:pr-create "Add CSV export feature" --work-id 123
# Create draft PR
/fractary-repo:pr-create "WIP: Refactor auth module" --draft
# Create with custom base
/fractary-repo:pr-create "Hotfix: Fix login bug" --base main --head hotfix/urgent-fix
# Create with detailed body
/fractary-repo:pr-create "Add export feature" --body "Implements CSV and JSON export" --work-id 123
# Create PR with description generated from conversation context
/fractary-repo:pr-create "Implement user authentication" --work-id 123 --prompt "Summarize the OAuth2 implementation approach and include the test coverage we discussed"
# Create PR capturing the full implementation discussion
/fractary-repo:pr-create "Fix race condition in queue processor" --prompt "Include the root cause analysis and the locking strategy we implemented"
</EXAMPLES>
<AGENT_INVOCATION>
CRITICAL: After parsing arguments, you MUST actually invoke the Task tool. Do NOT just describe what should be done.
How to invoke: Use the Task tool with these parameters:
Example Task tool invocation:
Task(
subagent_type="fractary-repo:repo-manager",
description="Create pull request",
prompt='{
"operation": "create-pr",
"parameters": {
"title": "Add CSV export feature",
"body": "Implements user data export to CSV format",
"base": "main",
"head": "feature/123-csv-export",
"work_id": "123",
"draft": false
}
}'
)
Request structure:
{
"operation": "create-pr",
"parameters": {
"title": "PR title",
"body": "PR description",
"base": "main",
"head": "feature/branch",
"work_id": "123",
"draft": false
}
}
What the agent does:
DO NOT:
<ERROR_HANDLING> Common errors to handle:
Missing title:
Error: title is required
Usage: /fractary-repo:pr-create <title>
Branch not pushed:
Error: Branch not found on remote: feature/123-export
Push the branch first: /fractary-repo:push
</ERROR_HANDLING>
<NOTES> ## Pull Request Best PracticesThis command works with:
Platform is configured via /fractary-repo:init and stored in .fractary/plugins/repo/config.json.
Related commands:
/fractary-repo:pr-comment - Add comments to PRs/fractary-repo:pr-review - Review PRs/fractary-repo:pr-merge - Merge PRs/fractary-repo:branch-create - Create branches/fractary-repo:push - Push changes/fractary-repo:init - Configure repo plugin
</NOTES>
/pr-create> 不再推荐:请优先使用 `/pr-create-smart` 生成高质量的 PR 描述草稿,然后使用 gh/GUI 创建 PR。本命令属于“端到端自动创建 PR(保留模板、自动打标签、创建 Draft)”的旧方案,仅为兼容保留。
/pr-createCreates Pull Requests automatically by analyzing your Git changes for a smoother workflow.
/pr-create> 不再推薦:請優先使用 `/pr-create-smart` 生成高質量的 PR 描述草稿,然後使用 gh/GUI 創建 PR。本命令属于“端到端自動創建 PR(保留模板、自動打標簽、創建 Draft)”的旧方案,仅為兼容保留。