Generates comprehensive merge request documentation in PT-BR compliance, analyzing commits and changes to create professional MR descriptions.
Generates comprehensive merge request documentation in Brazilian Portuguese, analyzing commits and changes to create professional MR descriptions.
/plugin marketplace add rafaelkamimura/claude-tools/plugin install rafaelkamimura-claude-tools@rafaelkamimura/claude-toolsGenerates comprehensive merge request documentation in PT-BR compliance, analyzing commits and changes to create professional MR descriptions.
Use Bash tool to get current branch:
git branch --show-currentIf not on a branch, output: "Not on a branch. Please checkout your feature branch first." and exit.
Use Bash tool to identify base branch:
for base in main master develop development staging; do git rev-parse --verify $base >/dev/null 2>&1 && echo $base && break; doneIf no base found: Output: "What is the target branch for this MR? (main/master/develop):" WAIT for user's response.
Use Bash tool to find task history:
ls -t .claude/task-history/*.md 2>/dev/null | head -1If task file exists, use Read tool to read it and parse for objective and context.
Use Bash tool to get commit list:
git log --oneline [base_branch]..HEADUse Bash tool to get detailed commit info:
git log --format="%H|%s|%b|%an|%ad" --date=short [base_branch]..HEADParse output to extract:
Use Bash tool to get commit statistics:
git show --stat --format="" [commit_hash]Use Bash tool to get overall statistics:
git diff --stat [base_branch]..HEADUse Bash tool to get detailed file changes:
git diff --name-status [base_branch]..HEADCategorize changes:
Output: "Run comprehensive review with specialized agents? This includes architecture, code quality, test coverage, database, and security analysis. (y/n):" WAIT for user's response.
If user says yes or y:
Use Task tool to launch 5 agents IN PARALLEL (single message with 5 Task tool invocations):
Task tool call:
Task tool call:
Task tool call:
Task tool call:
Task tool call:
Wait for all 5 agents to complete.
If user says no or n: Skip specialized agent reviews and proceed with basic git analysis only.
Generate PT-BR Content Structure
# Merge Request #[number]: [Título Descritivo]
## Objetivo
[Descrição clara do objetivo da MR]
## Resumo das Alterações
- **[N] arquivos modificados/criados**
- **[N] inserções (+)**
- **[N] deleções (-)**
- **[N] commits totais**
- **[Principais funcionalidades/correções]**
## Commits Incluídos
[Lista numerada de commits com hash e mensagem]
## Funcionalidades Implementadas
### 1. [Funcionalidade Principal]
[Descrição detalhada]
#### Características Técnicas
[Detalhes técnicos]
### 2. [Segunda Funcionalidade]
[Descrição]
## Arquitetura Implementada
[Se aplicável, diagramas ou descrições de arquitetura]
## Arquivos Criados/Modificados
### [Categoria 1]
1. **path/to/file.ext** ([N] linhas)
- [Descrição da mudança]
## Validações e Testes
### Testes Implementados
- [Lista de testes adicionados]
### Cobertura
- [Informações sobre cobertura de testes]
## Como Testar
```bash
# Comandos para testar a funcionalidade
[Lista de melhorias ou trabalhos futuros]
[Resumo final do que a MR adiciona ao projeto]
PT-BR Terminology Mapping
Technical Analysis Sections Based on changes detected, include relevant sections:
For API Changes:
For Database Changes:
For Infrastructure:
Clean content by removing any references to:
Present draft to user:
Output: "## Merge Request Draft Generated
File will be saved to: .claude/mr-drafts/[timestamp]-[branch].md
Preview: [First 50 lines of MR content]"
Output: "Review MR draft. Options: (edit/save/copy/discard):" WAIT for user's choice.
If user chooses 'edit': Offer to make specific changes If user chooses 'save' or default:
Use Bash tool to create directory:
mkdir -p .claude/mr-draftsUse Write tool to save MR draft to .claude/mr-drafts/[timestamp]-[branch].md
Use Bash tool to update gitignore:
grep -q "^.claude/mr-drafts/" .gitignore || echo ".claude/mr-drafts/" >> .gitignoreIf user chooses 'discard': Exit without saving
Output: "Create the Merge Request / Pull Request now? (y/n):" WAIT for user's response.
If user says no, exit command.
If user says yes:
Output: "Choose your Git hosting platform:
Choose platform (1 or 2):" WAIT for user's choice.
If user chooses GitHub (1):
Use Bash tool to check if gh CLI is installed:
which ghIf not installed, output: "gh CLI not installed. Install with: brew install gh" and exit.
Use Bash tool to create PR:
gh pr create --title "[MR title]" --body-file .claude/mr-drafts/[timestamp]-[branch].mdIf user chooses GitLab (2):
Use Bash tool to check if glab CLI is installed:
which glabIf not installed, output: "glab CLI not installed. Install with: brew install glab" and exit.
Use Bash tool to check if glapi function exists in zsh:
zsh -c "source ~/.zshrc 2>/dev/null; type glapi" 2>/dev/nullIf glapi function is available:
Use Bash tool to create MR using glapi:
zsh -c "source ~/.zshrc 2>/dev/null; glapi /merge_requests --method POST --field source_branch=[branch] --field target_branch=[base_branch] --field title='[MR title]' --field description=\"\$(cat .claude/mr-drafts/[timestamp]-[branch].md)\" --field remove_source_branch=true --field squash=true"If glapi function is NOT available:
Use Bash tool to create MR using glab CLI:
glab mr create --title "[MR title]" --description "$(cat .claude/mr-drafts/[timestamp]-[branch].md)"Output the MR/PR URL returned by the CLI tool or API.
Automatically identifies:
Calculates impact based on:
Identifies risks from:
/task-init → development → /commit → /mr-draft → push → create MR
.claude/task-history//commit commandTechnical Terms: Keep English where standard
Translate Common Terms:
Section Headers in Portuguese:
Check for project-specific template:
if [ -f .claude/mr-template.md ]; then
# Use custom template
fi
Default: .claude/mr-drafts/[timestamp]-[branch].md
Option to copy directly for pasting into GitLab/GitHub
Future: Direct MR creation via API:
One Feature Per MR
Clear Objectives
Comprehensive Testing
Risk Assessment
Review Readiness