1---2name: mark-mr-ready3description: Mark a draft MR as ready for review. Removes draft status, runs linting/docs check, posts to Slack, updates Jira to In Review. Use when user says "mark MR ready", "remove draft", "undraft".4---56# Mark MR Ready for Review78## Inputs910| Input | Type | Default | Purpose |11|-------|------|---------|---------|12| `mr_id` | string | required | MR ID (e.g., "1459" or "!1459") |13| `project` | string | automation-analytics/automation-analytics-backend | GitLab project |14| `issue_key` | string | - | Jira key to update (auto-extracted from MR if empty) |15| `update_jira` | bool | true | Update Jira to In Review |16| `run_linting` | bool | true | Run black/flake8 before marking ready |17| `repo` | string | "" | Repo path for linting (auto-detected) |18| `check_docs` | bool | true | Run update_docs check |1920## Workflow2122### 1. Bootstrap23- `persona_load("developer")`24- `knowledge_query(project="automation-analytics-backend", section="gotchas")` — MR readiness patterns25- `check_known_issues("gitlab_mr_update")`26- Clean mr_id: strip "!" and whitespace2728### 2. Get MR29- `gitlab_mr_view(project, mr_id)` — get details30- Parse: title, jira_key (from title or inputs), web_url via `extract_mr_url`3132### 3. Linting (if run_linting)33- Resolve repo from config (match project to gitlab) or inputs.repo34- `git_format(repo, tool="black", check_only=true)` or run black --check35- `git_lint(repo, tool="flake8", max_line_length=100, ignore="E501,W503,E203")`36- Block if lint fails — show errors, suggest `black . && flake8`3738### 4. Docs (if check_docs)39- `skill_run("update_docs", '{"repo": "...", "check_only": true}')` — warn only40- `persona_load("developer")` — restore after update_docs4142### 5. Mark Ready43- `gitlab_mr_update(project, mr_id, draft=false)`44- Success if "Updated" or "success" in result4546### 6. Notify & Jira47- `skill_run("notify_mr", '{"mr_id": X, "project": "...", "issue_key": "..."}')` — posts to team Slack48- `persona_load("developer")` — restore after notify_mr49- If `update_jira` and `mr_info.jira_key`: `jira_set_status(issue_key, "In Review")`5051### 7. Memory52- `memory_session_log("Marked MR !X ready for review", web_url)`53- `memory_update("state/current_work", "last_updated", timestamp)`54- Update `open_mrs`: set `is_draft=false`, `marked_ready`, `needs_review=true`55- Record in `learned/patterns.mr_ready_actions`5657### 8. Failure Learning58- "no such host" → `learn_tool_fix("gitlab_mr_update", "no such host", "VPN", "vpn_connect()")`59- "merge request not found" → check mr_id and project60- "not_in_channel" (Slack) → invite bot to team channel6162## Key MCP Tools6364- `persona_load`, `gitlab_mr_view`, `gitlab_mr_update`65- `git_format`, `git_lint` (or `lint_python` if available)66- `jira_set_status`67- `knowledge_query`, `check_known_issues`, `learn_tool_fix`68- `memory_session_log`, `memory_update`, `skill_run`