home / skills / onekeyhq / app-monorepo / 1k-create-pr

1k-create-pr skill

/.claude/skills/1k-create-pr

This skill automates the full pull request workflow for OneKey app-monorepo changes, including branch creation, commits, pushes, PR creation, and auto-merge.

npx playbooks add skill onekeyhq/app-monorepo --skill 1k-create-pr

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.2 KB
---
name: 1k-create-pr
description: Creates a Pull Request from current changes for OneKey app-monorepo. Use when user wants to create PR, submit changes, or merge feature branch. Handles branch creation, commit, push, and PR creation workflow.
disable-model-invocation: true
---

# Create OneKey App PR

Automates the complete PR creation workflow for OneKey app-monorepo changes.

## Quick Reference

| Step | Action | Commands |
|------|--------|----------|
| 1 | Check status | `git status`, `git branch --show-current` |
| 2 | Create branch (if on x) | `git checkout -b <branch-name>` |
| 3 | Stage & commit | `git add .`, `git commit -m "type: description"` |
| 4 | Push to remote | `git push -u origin <branch-name>` |
| 5 | Create PR | `gh pr create --base x --title "..." --body "..."` |
| 6 | Enable auto-merge | `gh pr merge <number> --auto --squash` |

## Workflow

### 1. Check Current Branch Status

```bash
git status
git branch --show-current
```

### 2. Branch Handling

**If on `x` branch:**
- Analyze current changes (staged and unstaged)
- Generate descriptive branch name based on changes:
  - `feat/` - new features
  - `fix/` - bug fixes
  - `refactor/` - refactoring
  - `chore/` - maintenance tasks
- Create and switch: `git checkout -b <branch-name>`

**If already on feature branch:** Skip branch creation

### 3. Stage and Commit Changes

```bash
git add .
git commit -m "<type>: <description>"
```

**Commit format:**
- Follow conventional commits
- Do NOT add Claude signatures or Co-Authored-By

### 4. Push to Remote

```bash
git push -u origin <branch-name>
```

### 5. Create Pull Request

```bash
gh pr create --base x --title "<title>" --body "<description>"
```

**Issue ID handling:**
- Extract `OK-{number}` from commit summary/description
- Append to PR title: `fix: description(OK-49185)`
- No space before opening parenthesis

### 6. Enable Auto-Merge

```bash
gh pr update-branch <PR_NUMBER>
gh pr merge <PR_NUMBER> --auto --squash
```

### 7. Return PR URL

Display PR URL to user and optionally open in browser:
```bash
open <PR_URL>
```

## Important Notes

- Always target `x` as base branch
- Use conventional commit format: `type: description`
- Extract and append issue IDs (OK-{number}) to PR title

Overview

This skill automates creating a Pull Request for the OneKey app-monorepo from your current local changes. It handles branch creation, staging and committing, pushing to origin, creating the PR with proper metadata, enabling auto-merge, and returning the PR URL. It follows repository conventions like conventional commits, targeting the x base branch, and appending OK-{number} issue IDs to PR titles.

How this skill works

The skill inspects the working tree and current branch, decides whether to create a new feature branch or use the existing one, and stages and commits changes using conventional commit format. It pushes the branch to origin, uses the GitHub CLI to create a PR with a structured title and body (including any OK-{number} issue IDs found), and optionally enables auto-merge and updates the branch. Finally it returns the PR URL and can open it in your browser.

When to use it

  • You have local changes in the OneKey app-monorepo ready to submit.
  • You need to create a feature or fix branch and open a PR quickly.
  • You want PR titles and commits to follow conventional-commit and OK-{number} conventions.
  • You want the PR created and set to auto-merge after checks pass.
  • You prefer an automated, repeatable workflow for staging, committing, pushing, and creating PRs.

Best practices

  • Run git status and confirm current branch before starting to avoid accidental branch creation.
  • Use conventional commit messages: type: description (e.g., feat: add feature X).
  • If changes reference an issue, include OK-{number} in the commit or description so the skill can append it to the PR title.
  • Target the x base branch for all PRs unless instructed otherwise.
  • Review the generated branch name and PR title before pushing or enabling auto-merge.

Example use cases

  • Fix a wallet UI bug: create fix/ branch, commit with fix: description, push, and open a PR that includes OK-#### if present.
  • Add a new mobile feature: create feat/ branch from current changes and generate a feature PR ready for code review.
  • Refactor shared module: create refactor/ branch, commit, and set up a PR that updates the branch and enables auto-merge when checks pass.
  • Small chore or dependency update: commit as chore:, push, and auto-merge the PR once CI is green.

FAQ

What commit format is required?

Use conventional commits like type: description. Do not add assistant signatures or Co-Authored-By lines.

How does the skill find issue IDs?

It extracts OK-{number} patterns from commit summaries or the PR description and appends them to the PR title with no extra space before the parenthesis.