create-draft-mr

📁 bartdbont/create-draft-mr 📅 2 days ago
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 glab is installed and authenticated: glab auth status (use glab auth login if needed).
  • Work on a non-default branch (create one if needed): git switch -c <branch>.

Workflow

  1. Inspect changes and avoid committing secrets

    • Run git status.
    • Run git diff (and git diff --staged if anything is already staged).
    • If anything looks like secrets or local-only config (e.g. .env, credentials files), stop and ask what to do.
  2. Infer repo conventions for commit + MR

    • Run git log -10 --oneline to 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>.
  3. Stage and commit everything

    • Stage all: git add -A.
    • Commit with a concise message (1 line; focus on intent).
  4. Push branch

    • Push and set upstream: git push -u origin HEAD.
  5. 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-origin remote, detect via git remote -v and push accordingly.
  • If glab mr create requires explicit targeting, add --target-branch <base>.
  • Reference: https://docs.gitlab.com/cli/mr/create/