skills/creating-issues-and-pull-requests/SKILL.md
Use when creating GitHub pull requests or issues with template compliance. Triggers: 'create a PR', 'open a pull request', 'file an issue', 'create issue'. Also invoked by finishing-a-development-branch. NOT for: deciding whether to merge or PR (use finishing-a-development-branch).
npx skillsauth add axiomantic/spellbook creating-issues-and-pull-requestsInstall 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.
Announce: "Using creating-issues-and-pull-requests skill to handle GitHub creation."
--body-file - Never rely on --template or --fill. Read the template content, populate it, write to a temp file, pass via --body-file.#N to issues/PRs (notifying all subscribers) and @username pings users. A stray #108 in a PR description pings everyone subscribed to issue 108. The sanitization gate in create-pr and create-issue commands enforces this.--draft. Only use --draft=false when the user explicitly requests a ready PR on their fork.| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| mode | No | auto-detect | "pr" or "issue" |
| branch | No | current branch | Feature branch name |
| base | No | auto-detect | Base/target branch for PRs |
| target_repo | No | auto-detect | OWNER/REPO for the target |
| jira_ticket | No | detect from branch | Jira ticket number (e.g., ODY-1234) |
| diff_summary | No | compute from merge-base diff | Pre-computed merge-base diff summary |
| draft | No | false | Create as draft PR |
| labels | No | none | Labels to apply |
| reviewers | No | none | Reviewers to request |
| Output | Type | Description |
|--------|------|-------------|
| url | string | Created PR or issue URL |
| number | int | PR or issue number |
| type | string | "pr" or "issue" |
| target_repo | string | OWNER/REPO where it was created |
finishing-a-development-branch (Option 2: Push and Create PR) - Delegates PR creation with branch context.executing-plans - Indirectly, through finishing-a-development-branch at the end of implementation./creating-issues-and-pull-requests, or the shorthand commands /create-pr and /create-issue.When invoked as a delegate from finishing-a-development-branch:
mode: "pr"
branch: <feature-branch>
base: <base-branch>
diff_summary: <pre-computed merge-base diff summary>
The skill handles everything from push confirmation through PR creation and URL reporting.
| Invocation | Behavior |
|------------|----------|
| /creating-issues-and-pull-requests | Mode detection, asks PR or issue |
| /creating-issues-and-pull-requests --pr | Dispatches directly to /create-pr |
| /creating-issues-and-pull-requests --issue | Dispatches directly to /create-issue |
| /create-pr | Invokes PR command directly (bypasses orchestrator) |
| /create-issue | Invokes issue command directly |
| Signal | Detected Mode |
|--------|---------------|
| "create a PR", "open PR", caller passes mode: "pr" | PR |
| "create an issue", "file a bug", "open issue", caller passes mode: "issue" | Issue |
| No clear signal | Ask user: "Would you like to create a PR or an issue?" |
Collect context that commands need:
git branch --show-currentgit remote -vgh repo view --json isFork,parentODY-XXXX or elijahr/ODY-XXXXPass all gathered context to the appropriate command.
Fork detection: Check if the repo has both a fork remote (origin) and an upstream remote (upstream).
workflow_stage: "direct".If fork detected: Ask the user:
"You have a fork and upstream configured. Are you staging this on your fork first, or submitting directly to upstream?"
Set workflow variables based on response:
| User Response | workflow_stage | draft_mode | Target Remote |
|---------------|-----------------|--------------|---------------|
| Staging on fork | fork_staging | true (forced) | Fork (origin) |
| Submitting to upstream | upstream_submit | User's preference | Upstream (upstream) |
| Single remote (no fork) | direct | User's preference | Default remote |
Fork staging: Force --draft by default. The user must explicitly pass --draft=false to override.
Upstream submit confirmation:
Do not proceed without a clear "yes" from the user. </CRITICAL>
workflow_stage and draft_mode to Phase 2.For PR creation: Dispatch subagent with command: /create-pr
Provide context: branch name, base branch, target repo (if known), jira ticket (if detected), diff summary (if pre-computed), draft flag, labels, reviewers, workflow_stage, draft_mode.
fork_staging → pass --draft unless user explicitly overrode it; set target to fork remote.upstream_submit → pass confirmed target repo and user's draft preference.direct → pass context with no fork-specific overrides.For issue creation: Dispatch subagent with command: /create-issue
Provide context: target repo (if known), labels, workflow_stage. Ensure issue targets the repo matching the workflow stage.
Report the created URL back to the user and to any calling skill.
Both commands implement a 4-tier template discovery cascade. If GraphQL tiers fail, fall through to Tier 4.
| Tier | Source | Method | Applies When |
|------|--------|--------|-------------|
| 1 | Local filesystem | Scan .github/, root, docs/ for pull_request_template.md and PULL_REQUEST_TEMPLATE/ directories | Same-repo PRs only |
| 2 | Remote (target repo) | GraphQL repository.pullRequestTemplates | Always (primary source for fork PRs) |
| 3 | Org-level .github repo | GraphQL against ORG/.github | Fallback when target repo has no templates |
| 4 | No template found | Use sensible default body structure | Final fallback |
| Tier | Source | Method |
|------|--------|--------|
| 1 | Local filesystem | Scan .github/ISSUE_TEMPLATE/ for .md and .yml files, parse config.yml |
| 2 | Remote (target repo) | GraphQL repository.issueTemplates |
| 3 | Org-level .github repo | GraphQL against ORG/.github |
| 4 | Legacy / No template | Check root issue_template.md; if nothing found, use blank issue (if allowed) |
When multiple templates are discovered at any tier, present a chooser listing filenames and descriptions. Let the user select.
If the target repo has ANY template of a given type (PR or issue), ALL org-level templates of that type are blocked. No merging or layering between repo-level and org-level templates.
| Condition | PR Title | Branch Name |
|-----------|----------|-------------|
| Jira ticket exists | [ODY-XXXX] <description> | elijahr/ODY-XXXX |
| No Jira ticket | <description> (plain, no prefix) | elijahr/<descriptive-slug> |
Since gh pr edit is broken (GitHub Projects Classic deprecation), use the REST API for post-creation modifications:
# Update PR title or body
gh api repos/OWNER/REPO/pulls/NUMBER --method PATCH \
-f title="New title" -f body="New body"
# Add labels
gh api repos/OWNER/REPO/issues/NUMBER/labels --method POST \
-f 'labels[]=label1'
# Request reviewers
gh api repos/OWNER/REPO/pulls/NUMBER/requested_reviewers --method POST \
-f 'reviewers[]=username'
IF ANY unchecked: STOP and fix. </reflection>
<FINAL_EMPHASIS> Every PR and issue you create is a public artifact. Template compliance is not optional. Sanitize before submission, confirm before action, and never invent ticket numbers. Your reputation as a GitHub Integration Specialist depends on getting this right every time. </FINAL_EMPHASIS>
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment. Triggers: 'write a skill', 'new skill', 'create a skill', 'skill doesn't work', 'skill isn't firing', 'edit skill', 'skill quality'. NOT for: general prompt improvement (use instruction-engineering) or command creation (use writing-commands).
development
Use when you have a spec, design doc, or requirements and need a detailed implementation plan before coding. Triggers: 'write a plan', 'create implementation plan', 'plan this out', 'break this down into steps', 'convert design to tasks', 'implementation order'. Also invoked by develop during planning. NOT for: reviewing existing plans (use reviewing-impl-plans).
testing
Use when creating new commands, editing existing commands, or reviewing command quality. Triggers: 'write command', 'new command', 'create a command', 'review command', 'fix command', 'command doesn't work', 'add a slash command'. NOT for: skill creation (use writing-skills).
development
Use when about to claim discovery during debugging. Triggers: "I found", "this is the issue", "I think I see", "looks like the problem", "that's why", "the bug is", "root cause", "culprit", "smoking gun", "aha", "got it", "here's what's happening", "the reason is", "causing the", "explains why", "mystery solved", "figured it out", "the fix is", "should fix", "this will fix". Also invoked by debugging, scientific-debugging, systematic-debugging before any root cause claim.