一键导入
create-pr
Create or update a GitHub pull request using the project's PR template. Use when the user wants to open a PR for the current branch.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create or update a GitHub pull request using the project's PR template. Use when the user wants to open a PR for the current branch.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Create a GitHub proposal issue with spec-level brainstorming. Use when the user wants to file a new proposal (enhancement) issue.
Use when starting work on a GitHub Issue to fetch issue content and begin brainstorming. Triggers on issue URL or number input.
Review documentation quality and consistency. Use when user wants to review docs/website documentation, or after documentation changes.
Sync API documentation with implementation. Use when files in crates/homunculus_http_server/src/** or sdk/typescript/src/** have changed, or when user requests documentation updates.
基于 SOC 职业分类
| name | create-pr |
| description | Create or update a GitHub pull request using the project's PR template. Use when the user wants to open a PR for the current branch. |
Create or update a GitHub PR using the project's PR template. Validates that the diff is consistent with the stated problem, generates a full English PR draft, and executes gh pr create (or gh pr edit) upon approval.
Step 1: Preflight (checks 1-2) ──→ failure → abort (show reason)
│
pass ↓
Step 1.5: Base branch selection ──→ no release branch → use main
│
selected ↓
Step 1 continued: Preflight (checks 4-8) ──→ failure → abort
│
pass ↓
Step 2: Problem input
│
↓
Step 3: Diff retrieval + plausibility check ──→ mismatch → revise or abort
│
pass ↓
Step 4: Full PR draft generation + approval
│
approved ↓
Step 4.5: Documentation status (if unchecked)
│
↓
Step 4.6: Label selection (AskUserQuestion multiSelect)
│
↓
Step 5: push + gh pr create/edit → report URL
Run these checks in order. Abort with a clear message on first failure:
git rev-parse --git-dir).git symbolic-ref HEAD must succeed.After checks 1-2 pass, select the base branch:
git branch -r --list 'origin/v[0-9]*' --sort=-version:refname and take the first result (the single most recent release branch).AskUserQuestion with main and the detected release branch (e.g., v0.1.0-alpha.6).main automatically.Then continue with the remaining preflight checks using the selected base branch:
git branch --show-current must differ from the selected base branch.git rev-list --count origin/<base>...HEAD must be > 0.git status --porcelain must produce no output. Abort if uncommitted changes exist.gh authenticated: gh auth status must succeed. On failure, tell the user to run gh auth login.gh pr view --json url 2>/dev/null.
Ask the user:
What problem does this PR solve? (Any language is fine — the final PR will be in English.) Optionally include related issue numbers (e.g., #123).
Accept free-form input in any language. Extract and store issue references (e.g., #123) separately from the problem description.
Run git diff origin/<base>...HEAD. If the diff is too large for context, use git diff origin/<base>...HEAD --stat for an overview and selectively read key changed files. For very large branches, rely more on the commit history.
Run git log origin/<base>...HEAD --oneline for commit history.
Perform a plausibility check — assess whether the diff is consistent with the user's stated Problem:
feat/fix type changes: verify the diff touches relevant code areas.docs/refactor/chore/test/ci/build type changes: verify the diff is relevant to the stated goal.This is a plausibility check, NOT a proof of resolution.
If consistent: Proceed to Step 4.
If inconsistent: Explain the mismatch, then present options:
Read .github/pull_request_template.md to obtain the current template structure. Generate all components in English:
Title: Conventional commit format. Select the prefix (feat, fix, docs, refactor, chore, test, ci, build) based on the dominant change type. Use imperative mood. Under 70 characters.
Body: Follow the template structure:
## Problem
{User's problem, translated/refined into English. Include `Closes #N` if issue numbers were provided.}
## Solution
{What changed, why this approach, which parts of the codebase are affected (engine, packages, mods, docs).}
## Documentation
- [x] or [ ] Included in this PR
- [ ] Will be added in a follow-up PR
- [ ] Not needed
---
- [x] or [ ] If HTTP endpoints changed: I ran `make gen-open-api` and `pnpm build`
- [x] or [ ] This PR includes breaking changes
Checklist auto-detection:
engine/crates/homunculus_http_server/src/**, mark [x]. Otherwise [ ].[x] and add a ### Breaking Changes subsection in Solution. Otherwise [ ].docs/website/ or the PR title has a docs: prefix, mark [x] Included in this PR. Otherwise, leave all documentation checkboxes unchecked.mods/*/ui/** or packages/ui/**, remind the user to consider adding screenshots.Present the complete PR draft (title + body) and ask the user to approve or request edits. If edits are requested, apply them and re-present. Repeat until approved.
After the user approves the PR draft, if all documentation checkboxes are unchecked:
AskUserQuestion: Show 3 options: "Included in this PR", "Will be added in a follow-up PR", "Not needed".If any documentation checkbox was already checked (via auto-detection or user edit), skip this step.
After the user approves the PR draft, present available labels for selection:
Fetch available labels: Run gh label list --json name,description --limit 100 to get all repo labels dynamically. If the command fails or returns no labels, skip this step entirely and proceed to Step 5.
Split into groups of up to 4: Partition the labels into groups of 4. Each group becomes one question in the AskUserQuestion call.
Present via AskUserQuestion: Use multiSelect: true on each question. Format each question title as "Labels (N/M)" to indicate pagination (e.g., "Labels (1/3)", "Labels (2/3)"). Use the label name as the option label and the label description as the option description (if description is empty, omit it).
AskUserQuestion call with up to 4 questions.AskUserQuestion calls sequentially.Collect results: Merge all selected labels. If the user selects nothing, proceed without labels.
git push -u origin <current-branch>. If push fails, report the error and abort. Do NOT use --force unless the user explicitly requests it.gh pr create --base <base-branch> --title "<title>" --body "<body>" — append -l <label> for each selected label (e.g., gh pr create ... -l bug -l enhancement).gh pr edit --base <base-branch> --title "<title>" --body "<body>" — append --add-label <label> for each selected label (e.g., gh pr edit ... --add-label bug --add-label enhancement)..github/pull_request_template.md is missing, abort with a message.