Logo de Gitlab Mr

Gitlab Mr

Organização
addxai
gitlab-mr

Create and manage GitLab Merge Requests on gitlab.example.com repositories, driving them to a truly mergeable state. Automatically generates User Story documentation, constructs MR descriptions (with blob links), pushes and creates MRs, polls CI pipeline status via API and fixes failures, resolves merge conflicts, and loops until all MR checks pass with no conflicts. Triggers when the user says "submit MR", "create MR", "push and create MR", "merge to main", or needs to submit the current branch for review.

Visão geral

Publicado poraddxai
Repositórioenterprise-harness-engineering
Nome da habilidadegitlab-mr
Estrelas
47
Forks
8
Arquivos incluídos
Somente instruções
LicençaApache-2.0
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    Habilidades de IA são Markdown simples, não código específico de um provedor, por isso funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Completa em si mesma

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por addxai no GitHub. Leia o conteúdo-fonte antes de instalar.

Instalação

Instale a habilidade de IA Gitlab Mr no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL da pasta da habilidade exibida abaixo e confirme.
    https://github.com/addxai/enterprise-harness-engineering/tree/main/skills/gitlab-mr
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Nova habilidade → Via URL GitHub, depois cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/addxai/enterprise-harness-engineering.git /tmp/enterprise-harness-engineering
mkdir -p .claude/skills
cp -r /tmp/enterprise-harness-engineering/skills/gitlab-mr .claude/skills/gitlab-mr
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Gitlab Mr em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Gitlab Mr automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Gitlab Mr não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

GitLab MR

Create an MR and drive it to a truly mergeable state (all CI green + no merge conflicts). Core principle: write documentation first, then submit the MR, verify with APIs, and loop through fixes until the MR is mergeable.

Prerequisite: The current repository's remote points to gitlab.example.com, and glab CLI is installed.


Rules

  1. Never use the skip-doc-check label — every MR must have a real documentation link
  2. User Story must be relevant to the MR changes — CI checks relevance (check:mr-us-relevance); irrelevant links will be rejected
  3. Blob links must point to pushed files — the branch name and file path in the link must exist on the remote
  4. Verify with APIs, don't guess — confirm results at every step using glab commands

Execution Flow

Step 1: Check Prerequisites

bash
# Confirm remote points to gitlab.example.com
git remote get-url origin

# Confirm current branch is not main/master
git branch --show-current

# Confirm no uncommitted changes
git status

If there are uncommitted changes, commit or stash them first.

Step 2: Ensure Documentation Exists

The MR description must contain documentation links. CI performs two checks:

  • check:mr-documentation: whether the link format is valid
  • check:mr-us-relevance: whether the linked document is relevant to the MR changes

Prefer GitLab blob links pointing to documentation files within the repository.

2a: Find or Create Documentation

Check whether related documentation already exists in the repository:

bash
# Look for potentially related documents
ls docs/plans/ docs/04-user-stories/ 2>/dev/null

If no related documentation exists, create one for this MR:

  • Place the document at docs/plans/YYYY-MM-DD-<feature-name>.md (design doc) or docs/04-user-stories/<feature-name>.md (User Story)
  • The document content must cover the core changes in this MR (otherwise the relevance check will fail)
  • The document does not need to be long, but must describe: what was done and why
2b: Commit and Push Documentation
bash
git add docs/plans/<doc-file>.md
git commit -m "docs: add <feature> design document"

Step 3: Push the Branch

bash
git push -u origin <branch-name>

Step 4: Create or Update MR

Check if an MR already exists
bash
glab mr list --source-branch <branch-name>
If no MR exists, create one

Analyze all commits in git log main..HEAD to write the MR title and description.

Blob link format: https://gitlab.example.com/<group>/<project>/-/blob/<branch>/<filepath>

  • <group>/<project> parsed from git remote get-url origin
  • <branch> is the current branch name
  • <filepath> is the in-repo path to the document
bash
glab mr create \
  --title "<concise title, <70 chars>" \
  --description "$(cat <<'EOF'
## Change Summary
<Summary based on all commits, 2-3 bullet points>

## Related Documentation
- User Story (required): https://gitlab.example.com/<group>/<project>/-/blob/<branch>/docs/plans/<doc>.md
- Tech Design: <fill if available, otherwise remove this line>

## Change Type
- [x] <corresponding type>
EOF
)" \
  --push
If an MR exists but the description lacks documentation links
bash
glab mr update <mr-id> --description "$(cat <<'EOF'
<complete description with blob links>
EOF
)"

Step 5: Wait and Check Pipeline

After creating/updating the MR, wait for the pipeline to trigger and complete.

bash
# Wait for pipeline to start (usually takes a few seconds after push)
sleep 5

# Check pipeline status
glab ci status

If the pipeline is still running, wait and check again:

bash
sleep 20
glab ci status

Step 6: Handle Failed Jobs

If the pipeline fails, check which specific job failed:

bash
# Get status of all jobs in the pipeline
glab api "projects/:id/merge_requests/<mr-iid>/pipelines" | python3 -c "
import sys,json
pipelines = json.load(sys.stdin)
if pipelines:
    pid = pipelines[0]['id']
    print(f'Latest pipeline: {pid}, status: {pipelines[0][\"status\"]}')
"
bash
# View failed job logs
glab api "projects/:id/pipelines/<pipeline-id>/jobs" | python3 -c "
import sys,json
for j in json.load(sys.stdin):
    if j['status'] == 'failed':
        print(f'FAILED: {j[\"name\"]} (id={j[\"id\"]})')
"
bash
# Get the tail of a failed job's log
glab api "projects/:id/jobs/<job-id>/trace" 2>&1 | tail -30
Common Failures and Fixes
Failed JobCauseFix
check:mr-documentationMR description missing a valid documentation linkglab mr update <id> --description "..." to add blob links
check:mr-us-relevanceDocument content is not relevant to MR changesEdit the document to cover the MR's core changes, commit and push
validate:skillsSKILL.md format is non-compliantRun uv run python scripts/validate.py --skills to fix locally
validate:securitySecurity scan detected an issueRun uv run python scripts/validate.py --security to fix locally
Merge conflictBranch conflicts with maingit fetch origin main && git rebase origin/main, resolve conflicts and force push

After fixing:

  • If the issue was in the MR description (check:mr-documentation): update the description then retry the job
  • If the issue was in code/docs: commit the fix, push, and a new pipeline will trigger automatically
bash
# Retry a failed job
glab ci retry <job-id>

# Or push a new commit to trigger a new pipeline
git push

Step 7: Confirm MR Is Mergeable

After CI passes, also confirm the MR has no merge conflicts. CI passing does not mean mergeable.

bash
glab ci status        # Confirm CI is all green
glab mr view <branch> # Confirm no merge conflict

If there are merge conflicts, resolve them (rebase onto main), force push, and wait for the new CI to pass.

Loop through Steps 5-7 until both conditions are met: CI all green + no conflicts.

Once the MR is truly mergeable, report the MR URL to the user.


Examples

Full Workflow Example

# Create MR
glab mr create --title "feat: add retry logic" --description "..." --push

# Loop until CI passes
glab ci status  # -> if failed, check logs, fix -> check again

# After CI passes, check merge status
glab mr view feat/add-retry-logic
# -> conflicts? rebase to resolve -> force push -> wait for new CI

# Final confirmation: CI all green + no conflicts -> report MR URL

Bad/Good Examples

Bad — Declaring done just because CI passed

glab ci status  # -> success
# -> "MR !42 is created, CI passed!"  <- but there's actually a merge conflict, cannot merge

Bad — Posting an irrelevant link

glab mr create --description "User Story: .../README.md"  # unrelated to changes, CI will reject

Good — Driving to a truly mergeable state

# Create MR -> poll CI and fix failures -> check merge status -> resolve conflicts -> confirm mergeable

Notes

  • Branch names containing / (e.g., feat/my-branch) are correctly handled by GitLab in blob links
  • glab ci status shows the status of all jobs in the latest pipeline
  • If the pipeline doesn't trigger for a long time, you can manually run: glab ci run
  • After updating the MR description, you need to retry the failed job or wait for a new pipeline

Perguntas frequentes

O que a habilidade de IA Gitlab Mr faz?

Create and manage GitLab Merge Requests on gitlab.example.com repositories, driving them to a truly mergeable state. Automatically generates User Story documentation, constructs MR descriptions (with blob links), pushes and creates MRs, polls CI pipeline status via API and fixes failures, resolves merge conflicts, and loops until all MR checks pass with no conflicts. Triggers when the user says "submit MR", "create MR", "push and create MR", "merge to main", or needs to submit the current branch for review.

Por que usar Gitlab Mr no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. Gitlab Mr é escrito em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. O TypingMind usa suas próprias chaves de API, então o pagamento é feito diretamente aos provedores, em vez de uma assinatura por licença de usuário, e suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Gitlab Mr no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/addxai/enterprise-harness-engineering/tree/main/skills/gitlab-mr. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Gitlab Mr?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Gitlab Mr?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Gitlab Mr com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Gitlab Mr é gratuita?

Sim. A habilidade é publicada no GitHub por addxai sob a licença Apache-2.0. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, modelos de documento ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas para chamar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA fornece conhecimento e um processo ao modelo: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇