skills/create-draft-pr/SKILL.md
Create a GitHub draft pull request for a Jira ticket. Use when asked to "create a PR", "open a draft PR", "submit a pull request", or "create a draft pull request" after finishing implementation. Reads local ticket details, summarises changes, creates a draft PR via GitHub MCP, and assigns it to the current user. Requires setup-new-work to have been run first.
npx skillsauth add shysssthanhtri/AI-tools create-draft-prInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a well-structured GitHub draft pull request for a Jira ticket after implementation is complete.
You are a senior software engineer who writes clear, informative pull requests. You read the ticket, understand what changed, and produce a PR that gives reviewers everything they need to understand the work.
setup-new-work skillsetup-new-work skill has been run — the worktree exists at ./worktrees/<ticket-id>-<platform>/ and the branch is feature/<ticket-id>-<slug>-<platform>. A local ticket doc under docs/<ticket-id>/ is optional (another skill may create it); if missing, fetch ticket details from Jira in Step 2.mcp_io_github_git_* tools)| Parameter | Required | Description | Example |
|-------------|----------|------------------------------------|-----------|
| ticket-id | Yes | The Jira ticket key | CM-4873 |
The user must provide a Jira ticket key (e.g. CM-4873). If not provided, check the current branch name — if it matches feature/<ticket-id>-*, extract the ticket ID from it. If still not determinable, ask the user.
Detect the platform and locate the worktree:
if [ -n "$CURSOR_TRACE_DIR" ] || [ -n "$CURSOR_CHANNEL" ]; then
platform="cursor"
elif [ -n "$VSCODE_GIT_ASKPASS_NODE" ] || [[ "${TERM_PROGRAM:-}" == *vscode* ]]; then
platform="copilot"
else
platform="ai"
fi
repo_root="$(git rev-parse --show-toplevel)"
worktree="$repo_root/worktrees/<ticket-id>-$platform"
setup-new-work skill first.cd into the worktree:cd "$worktree"
Before creating a PR, the feature branch must exist on the remote. Check whether the branch has been published:
git ls-remote --heads origin $(git branch --show-current)
git push --set-upstream origin $(git branch --show-current)
Confirm the push succeeded before proceeding. If the push fails (e.g. permissions error), stop and report the error to the user.
docs/<ticket-id>/<ticket-id>.md exists in the worktree (e.g. from another skill), read it completely. Otherwise skip to fetching from Jira below.https://theiconic.atlassian.net/browse/<ticket-id>If there is no local file or it lacks detail, fetch from Jira:
mcp_com_atlassian_getAccessibleAtlassianResources → get cloudId
mcp_com_atlassian_getJiraIssue(cloudId, issueIdOrKey=<ticket-id>, responseContentFormat=markdown)
Run these git commands inside the worktree to understand what changed:
# Current branch name
git branch --show-current
# Commits ahead of master/main
git log origin/master..HEAD --oneline
# Files changed
git diff origin/master..HEAD --name-status
# Full diff (for context, do NOT include in PR body verbatim)
git diff origin/master..HEAD --stat
Use the output to:
Call mcp_io_github_git_get_me to get the current authenticated GitHub user's login.
Determine the repository owner and name from git remote -v output or from repo context:
theiconicFormat: <ticket-id>: <summary>
Rules:
Example: CM-4873: Fix internal structure exposure in user response
Use this template exactly:
## Jira Ticket
[<ticket-id>](<ticket-url>) — <one-sentence ticket summary>
---
## Context / Problem
<2–4 sentences describing the current state and why it is a problem. Derived from the ticket description.>
---
## Solution
<2–4 sentences describing what was changed and how it solves the problem. Derived from your analysis of the code diff.>
**Files changed:**
- `path/to/file` — <what changed and why>
- `path/to/file` — <what changed and why>
---
## How to Test
<Step-by-step instructions a reviewer can follow to verify the changes work correctly. Be specific — include endpoints, request payloads, expected responses, or commands to run.>
1. <step>
2. <step>
3. <step>
---
## Checklist
- [ ] Code follows project conventions
- [ ] Tests added or updated
- [ ] No unintended files included
Fill in each section using the ticket details and code change analysis from Steps 2–3.
Call mcp_io_github_git_create_pull_request with:
| Field | Value |
|-------|-------|
| owner | repository owner (e.g. theiconic) |
| repo | repository name (e.g. bridge-keeper) |
| title | PR title from Step 5 |
| body | PR description from Step 6 |
| head | current feature branch name |
| base | default branch (usually master) |
| draft | true |
After the PR is created:
mcp_io_github_git_get_me.mcp_io_github_git_update_pull_request or the appropriate assignees call to assign the PR to yourself.If the MCP tool supports assignees directly in create_pull_request, pass it during creation to avoid an extra call.
After the PR is created and assigned, report back to the user:
Draft PR created:
Title: <PR title>
URL: <PR URL from response>
Branch: <feature branch>
Base: master
Assigned: <your GitHub username>
Status: Draft
| Issue | Solution |
|-------|----------|
| Ticket ID not found | Provide it explicitly or check git branch --show-current |
| Worktree not found | Run the setup-new-work skill first |
| No commits ahead of base | Commit your changes before creating a PR |
| Branch not on remote | Step 1b will auto-push; if it fails check your remote access |
| MCP GitHub auth error | Ensure the GitHub MCP server is connected and authenticated |
| PR creation fails with 422 | A PR may already exist for this branch — check open PRs |
testing
Execute an existing Jira ticket implementation plan phase by phase. Use when asked to "work on ticket CM-1234", "implement the plan for CM-1234", "start working on the plan", or "execute the next phase". Reads the plan from docs/<ticket-id>/plan.md, captures a pre-implementation full test baseline in plan/progress docs, presents each phase for user approval before coding, updates progress after each phase, and operates inside the dedicated git worktree. After the last phase is committed, runs the full test suite, fixes regressions (skipping known pre-existing failures), then presents a full change summary for user review and creates a GitHub draft PR using the create-draft-pr skill.
tools
Generate a complete MCP server project in TypeScript with tools, resources, and proper configuration
tools
Use when starting work on a Jira ticket. Fetches ticket details via Atlassian MCP (for branch naming and a local story snapshot), creates an isolated git worktree with branch feature/<ticket-id>-<slug>-<platform>, and writes docs/<ticket-id>/<ticket-id>.md in the worktree.
documentation
Create a work plan for a Jira ticket. Use when asked to plan work, create a plan for a ticket, break down a Jira issue, or prepare implementation steps for a Jira ticket ID like CM-1234. Reads local ticket details, deeply analyzes requirements and root causes, proposes up to three optimized solutions (not workarounds) with pros and cons, asks the user to choose, then finalizes the plan with that choice under docs/<ticket-id>/.