create-draft-mr
1
总安装量
1
周安装量
#52861
全站排名
安装命令
npx skills add https://github.com/bartdbont/create-draft-mr --skill create-draft-mr
Agent 安装分布
amp
1
opencode
1
cursor
1
kimi-cli
1
codex
1
github-copilot
1
Skill 文档
Create Draft MR (GitLab)
Create a commit from all current changes, push the current branch, and open a Draft MR via glab with a concise, intent-focused description.
Preconditions
- Verify
glabis installed and authenticated:glab auth status(useglab auth loginif needed). - Work on a non-default branch (create one if needed):
git switch -c <branch>.
Workflow
-
Inspect changes and avoid committing secrets
- Run
git status. - Run
git diff(andgit diff --stagedif anything is already staged). - If anything looks like secrets or local-only config (e.g.
.env, credentials files), stop and ask what to do.
- Run
-
Infer repo conventions for commit + MR
- Run
git log -10 --onelineto match message style. - Capture current branch:
git branch --show-current. - If base branch is unclear, ask exactly one question:
- Recommended default: target
main. - What changes:
glab mr create --target-branch <base>.
- Recommended default: target
- Run
-
Stage and commit everything
- Stage all:
git add -A. - Commit with a concise message (1 line; focus on intent).
- Stage all:
-
Push branch
- Push and set upstream:
git push -u origin HEAD.
- Push and set upstream:
-
Create Draft MR (use HEREDOC body)
- Title rules: succinct; no “feat:” prefix; “fix:” is ok for bug fixes.
- Description rules: intent + approach only; no file/change list; no checkbox test plan; no AI footer.
glab mr create --draft \
--title "<MR title>" \
--description "$(cat <<'EOF'
## Problem / Intent
<Why this change exists>
## Approach
<High-level concept of the solution>
EOF
)"
Notes
- If the repo uses a non-
originremote, detect viagit remote -vand push accordingly. - If
glab mr createrequires explicit targeting, add--target-branch <base>. - Reference: https://docs.gitlab.com/cli/mr/create/