用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Purushot14/user-agent-parser --skill pr命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | pr |
| description | Create or update a pull request from current branch to origin main with auto-generated title and description |
| argument-hint | [base-branch] |
/pr # Create or update PR to origin/main (default)
/pr develop # Create or update PR to specified base branch
git status
If there are uncommitted changes:
/commit skill first to commit all pending changes# This is a direct repo (not a fork) — remote is always origin
git remote -v
BRANCH=$(git branch --show-current)
BASE_BRANCH=${1:-main} # Default base is main
# Get repo from origin
REPO=$(git remote get-url origin | sed 's/.*github.com[:/]\(.*\)\.git/\1/' | sed 's/.*github.com[:/]\(.*\)/\1/')
# Fetch latest
git fetch origin
# Check for existing PR from current branch
gh pr list --repo $REPO --head $BRANCH --json number,url,title,body
If PR exists: Go to UPDATE MODE (Step 4a) If no PR: Go to CREATE MODE (Step 4b)
git push origin $BRANCH
gh pr view $PR_NUMBER --repo $REPO --json commits
git log origin/$BASE_BRANCH..HEAD --oneline
Update the PR body to:
[x]gh pr edit $PR_NUMBER --repo $REPO --body "$(cat <<'EOF'
<updated-description>
EOF
)"
✅ PR #123 updated successfully!
**URL:** https://github.com/owner/user-agent-parser/pull/123
**New commits pushed:** 2
**Description updated:** Yes
Invoke the /pr-review skill on the PR number.
git push -u origin $BRANCH
origin/main and HEADFormat: <emoji> <type>(<scope>): <subject> (max 70 chars)
Same format as commit messages. If multiple types, use the dominant one. If equal, prioritize: fix > feat > refactor > test > docs > style.
gh pr create --repo $REPO --base $BASE_BRANCH --head $BRANCH \
--title "<emoji> <type>(<scope>): <subject>" \
--body "$(cat <<'EOF'
## Summary
- <emoji> <change 1>
- <emoji> <change 2>
- <emoji> <change 3>
## Changes
### <Category 1>
- **Component**: Description of change
## Testing
- [ ] `poetry run pytest` — all tests pass
- [ ] `poetry run pytest -q --cov=user_agent_parser --cov-report=xml` — coverage not decreased
- [ ] `poetry run ruff check && poetry run ruff format --check` — no lint issues
## Compatibility
- [ ] Python 3.8+ syntax only (no match/case, no X|Y unions)
- [ ] `parse()` returns 7-tuple — backward compatible
- [ ] Public API signatures unchanged (or documented as breaking)
- [ ] `@lru_cache` functions return immutable types
- [ ] CI matrix passes (Python 3.8–3.15)
## Test plan
- [ ] Test item 1
- [ ] Test item 2
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Invoke the /pr-review skill on the new PR number.
| Type | Emoji | Use Case |
|---|---|---|
| feat | ✨ | New feature |
| fix | 🐛 | Bug fix |
| docs | 📝 | Documentation |
| style | 💄 | Formatting only |
| refactor | ♻️ | Code restructure |
| perf | ⚡ | Performance |
| test | ✅ | Tests |
| build | 📦 | Dependencies |
| ci | 🌐 | CI/CD |
| chore | 🔧 | Maintenance/mixed changes |
| revert | ⏪ | Revert commit |
| remove | 🔥 | Remove code/files |
| Priority | Scope | File Paths |
|---|---|---|
| 1 | parser | user_agent_parser/parser.py |
| 2 | engine | user_agent_parser/advanced_engine.py |
| 3 | analytics | user_agent_parser/analytics.py |
| 4 | devices | user_agent_parser/modern_devices.py, constants device entries |
| 5 | constants | user_agent_parser/constants.py |
| 6 | api | user_agent_parser/__init__.py |
| 7 | tests | tests/* |
| 8 | ci | .github/workflows/* |
| 9 | deps | pyproject.toml, poetry.lock |
| Rule | Details |
|---|---|
| Uncommitted Changes | Run /commit skill first |
| Existing PR | Detect and switch to UPDATE mode |
| Remote | Always origin (direct repo, not a fork) |
| Base Branch | Default main |
| Push | Push to origin before creating/updating PR |
| Title Format | <emoji> <type>(<scope>): <subject> |
| Title Length | Max 70 chars |
| TODO Updates | Mark completed items with [x] in update mode |
| Review | Invoke /pr-review skill after create/update |
| Error | Action |
|---|---|
| Uncommitted changes | Run /commit skill first |
| On main branch | Ask user to create a feature branch first |
| No commits ahead of origin/main | Report "Nothing to create PR for" |
| Push fails | Report error and stop |
| gh CLI not authenticated | Run gh auth login |
CREATE MODE:
✅ PR created successfully!
**Title:** ✨ feat(parser): add Brave browser detection
**URL:** https://github.com/owner/user-agent-parser/pull/42
**Base:** origin/main
**Head:** feature-branch
**Commits:** 3 commits
**Files changed:** 4 files
Running /pr-review to check PR...
UPDATE MODE:
✅ PR #42 updated successfully!
**URL:** https://github.com/owner/user-agent-parser/pull/42
**New commits pushed:** 2
**Description updated:** Yes
Updates made:
- ✨ Added: "Add parametrized test cases for Brave"
- ✅ Completed: "poetry run pytest passes"
Running /pr-review to check PR...