| name | rai-bugfix-close |
| description | Push branch, create MR, verify artifacts complete. Phase 7 of bugfix pipeline. |
| allowed-tools | ["Read","Bash(git:*)","Bash(glab:*)"] |
| license | MIT |
| metadata | {"raise.adaptable":"true","raise.fase":"7","raise.frequency":"per-bug","raise.gate":"","raise.next":"","raise.prerequisites":"bugfix-review","raise.skillset":"raise-maintainability","raise.version":"2.4.0","raise.visibility":"public","raise.work_cycle":"bugfix","raise.inputs":"- bug_id: string, required, argument\n- dev_branch: string, required, config\n","raise.outputs":"- mr_url: string, terminal\n"} |
Bugfix Close
Purpose
Push the bug branch, create a merge request targeting the development branch, and clean up the local branch. All artifacts must exist before closing.
Mastery Levels (ShuHaRi)
- Shu: Follow all steps, verify all 4 artifacts, create MR
- Ha: Streamline for batch closures
- Ri: Automated close with CI/CD integration
Context
When to use: After /rai-bugfix-review has produced the retrospective artifact.
When to skip: Never — closing is how bug work becomes visible to the team.
Inputs: Bug ID, {dev_branch} from .raise/manifest.yaml.
Expected state: On bug branch. All artifacts exist (scope.md, analysis.md, plan.md, retro.md). Gates passed in fix phase.
Steps
Step 1: Verify Completeness & Clean Tree
Check all required artifacts exist and working tree is clean:
for f in scope.md analysis.md plan.md retro.md; do
[ -f "work/bugs/RAISE-{N}/$f" ] && echo "✓ $f" || echo "ERROR: Missing $f"
done
git status --short
| Condition | Action |
|---|
| All 4 artifacts + clean tree | Continue |
| Any artifact missing | STOP — run the missing phase skill first |
| Uncommitted changes | Commit them before push |
All 4 artifacts verified. Working tree clean.
Step 2: Push & Create MR
Never merge locally to {dev_branch}.
git push origin bug/raise-{N}/{slug} -u
glab mr create \
--source-branch bug/raise-{N}/{slug} \
--target-branch {dev_branch} \
--title "fix(RAISE-{N}): {summary}" \
--description "Root cause: {one line}
Co-Authored-By: Rai <rai@humansys.ai>" \
--no-editor
If glab is not available, provide the GitLab URL from git push output for manual MR creation.
MR created in GitLab targeting `{dev_branch}`.
`glab` not available → provide push URL for manual MR creation.
Step 3: Cleanup
git checkout {dev_branch}
git branch -D bug/raise-{N}/{slug}
Local branch deleted.
Scope Constraints (CRITICAL)
Close is a merge-request-only operation:
- NEVER edit source code, skill files, config, or governance docs
- NEVER create "fix" or "refactor" commits
- NEVER delete directories or files outside the bug branch
- NEVER revert or modify commits on
{dev_branch}
If something looks wrong, return it as a finding — do not act on it.
Output
| Item | Destination |
|---|
| Merge request | GitLab MR: bug branch → {dev_branch} |
| Next | — (pipeline complete) |
Quality Checklist
References
- Previous:
/rai-bugfix-review
- Complement:
/rai-bugfix-start
- Branch model:
CLAUDE.md § Branch Model