submit-branch
GitHub将当前分支推送至 mermaid-js/zenuml-core 仓库并创建或复用 PR。处理工作区状态检查、提交、推送及 PR 创建,并自动调用 babysit-pr 监控 CI。
Trigger Scenarios
Install
npx skills add mermaid-js/zenuml-core --skill submit-branch -g -y
SKILL.md
Frontmatter
{
"name": "submit-branch",
"description": "Push the current branch and create or reuse a PR on mermaid-js\/zenuml-core. Use when the user says \"submit\", \"create PR\", \"push and PR\", \"open a pull request\", \"submit branch\", or wants to publish their work as a PR without merging. Does not fix CI or merge — those are separate skills."
}
Submit Branch
Publish the current branch as a pull request on mermaid-js/zenuml-core. Reuses an existing PR if one already exists for this branch.
Preconditions
The worktree must be in a committable state:
- Clean worktree — nothing to commit, just push. This is the ideal case.
- Scoped changes — all modified files relate to the current work. Stage and commit them.
- Mixed/unrelated changes — modified files include unrelated work. Stop and ask the user which files to include. Never auto-commit a mixed worktree.
To check: git status and review the file list. If in doubt, ask.
Steps
1. Check worktree state
git status
If dirty, evaluate whether changes are scoped (all related to the branch's purpose) or mixed. If mixed, stop and ask.
If scoped, stage the relevant files and commit with a descriptive message. Follow the repo's commit conventions (one-line message, Co-Authored-By trailer).
2. Push
git push -u origin <branch-name>
Use regular push — never force-push. If push fails due to upstream changes, report the conflict and stop.
3. Create or reuse PR
Check if a PR already exists:
gh pr view --json number,title,url 2>/dev/null
If a PR exists, report its URL and stop — nothing more to do.
If no PR exists, create one:
gh pr create --title "<concise title>" --body "$(cat <<'EOF'
## Summary
<bullet points>
## Test plan
<what was tested>
EOF
)"
The PR targets main on mermaid-js/zenuml-core.
4. Hand off to babysit-pr — always
A push starts a CI run. Invoke /babysit-pr with the PR number immediately, in
the same turn, without asking first. Reporting the PR URL and stopping is not
finishing this skill: it leaves a run nobody is watching, and the user then has to
type "babysit pr" to get what the push already implied.
This applies to every push, including one that only adds a commit to an existing PR.
The one exception is /ship-branch, which invokes babysit-pr itself as its next
step — do not run it twice.
Output
Report:
- SUBMITTED — PR number, URL, and branch name, then the babysit-pr result
- FAILED — what went wrong (dirty worktree, push conflict, gh error)
Does NOT
- Run tests or lint (use
/validate-branchfor that) - Merge the PR (use
/land-prfor that)
Version History
-
8c049b0
Current 2026-09-23 06:16
新增逻辑:在每次推送后自动调用 /babysit-pr 技能以监控 CI 运行,无需用户再次手动触发。
- 377f600 2026-08-20 15:11


