Skip to content

Gram-ax/gramax / .claude/skills/merge-request

merge-request

Verified

Use when creating, rewriting, OR reviewing a GitLab Merge Request in the Gramax product repo (`gramax/` → `gitlab.ics-it.ru/ics/doc-reader`). Triggers on "mr", "напиши описание MR", "опиши MR", "создай MR", "мерж реквест", "ревью MR", "проверь MR", "посмотри MR", "review MR", "review merge request", "code review for MR", "write MR description", "draft MR", "create merge request". Also pre-empts generic `/requesting-code-review`, `/code-review`, `/review` flows when target is a Gramax GitLab MR — team-convention checks (description, board link, `## Notes`) must run BEFORE code review.

FileKindSize
REFERENCE.mdmarkdown3.1 KB
SKILL.mdskill md19.2 KB

REFERENCE.md

View on GitHub
# merge-request — GitLab command reference

Concrete commands for the `merge-request` skill. Project `ics/doc-reader` (id `155`), host `gitlab.ics-it.ru`, API base `$GITLAB_API_URL` (`https://gitlab.ics-it.ru/api/v4`). Writes use whatever token the environment provides (`$GITLAB_TOKEN` — set by `glab`'s login / the CI env). No token prescription — **except replies to comments, which always use the bot token** `GITLAB_CLAUDE_ACCESS_TOKEN` (prefix those calls: `GITLAB_TOKEN=$GITLAB_CLAUDE_ACCESS_TOKEN` / `PRIVATE-TOKEN: $GITLAB_CLAUDE_ACCESS_TOKEN`).

## Create / update MR

Create it ready — a `Draft:` title skips the MR pipeline (only the manual stand jobs remain). Hand over when green (see *Hand over for review*):

```sh
glab mr create -s <branch> -b develop -y --title "<title>" --description "$(cat <file>)"
glab mr update <iid> --description "$(cat <file>)"
```

`<title>` is the branch name plus what the MR does — shape and examples in [SKILL.md](SKILL.md) → *Title*.

The installed `glab` has no `--description-from-file` flag (neither on `create` nor `update`) — only `-d`/`--description`. Feed the file through command substitution.

## Hand over for review

Ready + assignee `stanislav` in one call:

```sh
glab mr update <iid> --ready --assignee stanislav
```

The API has no `draft` field (`PUT` with `draft=false` is a 400): the `Draft:` title prefix *is* the flag, and `--ready` edits the title. Over curl that is `-d "title=<title without prefix>" -d "assignee_ids[]=81"`.

Pipeline first — status, then the jobs that are not green:

```sh
glab api "projects/155/merge_requests/<iid>" | jq '.head_pipeline | {id, status, web_url}'
glab api "projects/155/pipelines/<pipeline-id>/jobs?per_page=100" | jq -r '.[] | select(.status != "success") | "\(.id)\t\(.name)\t\(.status)"'
```

## Regular (non-inline) comment

For the *Missing description comment* — one MR-level note, not tied to a line:

```sh
glab mr note <iid> -m "$(cat <file>)"
# or via API:
curl -s -H "PRIVATE-TOKEN: $GITLAB_TOKEN" \
  --data-urlencode "body@<file>" \
  "$GITLAB_API_URL/projects/155/merge_requests/<iid>/notes"
```

## Inline comments (code findings)

One thread = one finding, on a specific line. Needs the diff `base_sha`/`start_sha`/`head_sha` from the MR versions endpoint:

```sh
curl -s -H "PRIVATE-TOKEN: $GITLAB_TOKEN" \
  "$GITLAB_API_URL/projects/155/merge_requests/<iid>/versions" | jq '.[0]'

curl -s -X POST -H "PRIVATE-TOKEN: $GITLAB_TOKEN" \
  --data-urlencode "body=<finding text>" \
  --data "position[position_type]=text" \
  --data "position[base_sha]=<base>" \
  --data "position[start_sha]=<start>" \
  --data "position[head_sha]=<head>" \
  --data "position[new_path]=<file>" \
  --data "position[new_line]=<line>" \
  "$GITLAB_API_URL/projects/155/merge_requests/<iid>/discussions"
```

For the GitHub mirror use `gh pr comment` / `gh api` instead.

## Diverged commits (source behind target — minor remark)

```sh
glab api "projects/155/merge_requests/<iid>?include_diverged_commits_count=true" | jq '.diverged_commits_count'
```

## Read an MR

```sh
glab mr view <iid>
glab api "projects/155/merge_requests/<iid>" | jq
```
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall