Files
architecture/skills/pr/SKILL.md
Hugo Nijhuis 7406517cd9 refactor: migrate commands to user-invocable skills
Claude Code has unified commands into skills with the user-invocable
frontmatter field. This migration:

- Converts 20 commands to skills with user-invocable: true
- Consolidates docs into single writing-capabilities.md
- Rewrites capability-writing skill for unified model
- Updates CLAUDE.md, Makefile, and other references
- Removes commands/ directory

Skills now have two types:
- user-invocable: true - workflows users trigger with /name
- user-invocable: false - background knowledge auto-loaded

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 16:39:55 +01:00

3.4 KiB

name, description, model, user-invocable
name description model user-invocable
pr Create a PR from current branch. Auto-generates title and description from branch name and commits. Use when creating pull requests, submitting changes, or when user says /pr. haiku true

Create Pull Request

@~/.claude/skills/gitea/SKILL.md

Quick PR creation from current branch - lighter than full /work-issue flow for when you're already on a branch with commits.

Prerequisites

  • Current branch is NOT main/master
  • Branch has commits ahead of main
  • Changes have been pushed to origin (or will be pushed)

Process

1. Verify Branch State

# Check current branch
git branch --show-current

# Ensure we're not on main
# If on main, abort with message: "Cannot create PR from main branch"

# Check for commits ahead of main
git log main..HEAD --oneline

2. Push if Needed

# Check if branch is tracking remote
git status -sb

# If not pushed or behind, push with upstream
git push -u origin <branch-name>

3. Generate PR Title

Option A: Branch contains issue number (e.g., issue-42-add-feature)

Extract issue number and use format: [Issue #<number>] <issue-title>

tea issues <number>  # Get the actual issue title

Option B: No issue number

Generate from branch name or recent commit messages:

  • Convert branch name from kebab-case to title case: add-user-auth -> Add user auth
  • Or use the most recent commit subject line

4. Generate PR Description

Analyze the diff and commits to generate a description:

# Get diff against main
git diff main...HEAD --stat

# Get commit messages
git log main..HEAD --format="- %s"

Structure the description:

## Summary
[1-2 sentences describing the overall change]

## Changes
[Bullet points summarizing commits or key changes]

[If issue linked: "Closes #<number>"]

5. Create PR

Use tea CLI to create the PR:

tea pulls create --title "<generated-title>" --description "<generated-description>"

Capture the PR number from the output (e.g., "Pull Request #42 created").

6. Auto-review

Inform the user that auto-review is starting, then spawn the code-reviewer agent in background:

Task tool with:
  - subagent_type: "code-reviewer"
  - run_in_background: true
  - prompt: |
      Review PR #<PR_NUMBER> in the repository at <REPO_PATH>.

      1. Checkout the PR: tea pulls checkout <PR_NUMBER>
      2. Get the diff: git diff main...HEAD
      3. Analyze for code quality, bugs, security, style, test coverage
      4. Post structured review comment with tea comment
      5. Merge with rebase if LGTM, otherwise leave for user

7. Display Result

Show the user:

  • PR URL/number
  • Generated title and description
  • Status of auto-review (spawned in background)

Issue Linking

To detect if branch is linked to an issue:

  1. Check branch name for patterns:

    • issue-<number>-*
    • <number>-*
    • *-#<number>
  2. If issue number found:

    • Fetch issue title from Gitea
    • Use [Issue #N] <issue-title> format for PR title
    • Add Closes #N to description

Example Output

Created PR #42: [Issue #15] Add /pr command

## Summary
Adds /pr command for quick PR creation from current branch.

## Changes
- Add commands/pr.md with auto-generation logic
- Support issue linking from branch name

Closes #15

---
Auto-review started in background. Check status with: tea pulls 42 --comments