Work on an issue from GitLab
Use these deterministic scripts instead of crafting curl commands:
| Script | Purpose |
|---|---|
.claude/hooks/gitlab/scripts/get-issue.sh <iid> | Fetch issue details |
.claude/hooks/gitlab/scripts/get-epic.sh <iid> | Fetch epic details |
.claude/hooks/gitlab/scripts/create-mr.sh | Create merge request |
All scripts support --help for usage details.
The hook has already fetched issue details and calculated the branch strategy. Review the context above for:
Based on the branch strategy from the context:
For execution plans (Case A):
git fetch origin
git checkout plan/{plan-name} 2>/dev/null || git checkout -b plan/{plan-name} origin/master
git checkout phase/{plan-name}/{phase-name} 2>/dev/null || git checkout -b phase/{plan-name}/{phase-name}
git checkout -b feat/{iid}-{slug}
For epics (Case B):
git fetch origin
git checkout epic/{epic-iid}-{slug} 2>/dev/null || git checkout -b epic/{epic-iid}-{slug} origin/master
git checkout -b feat/{iid}-{slug}
For standalone issues (Case C):
git fetch origin
git checkout -b feat/{iid}-{slug} origin/master
If the issue already has an MR, check out that branch instead.
Ask clarifying questions about requirements, edge cases, or implementation choices before writing code.
Make code changes following Clean Code Best Practices and SOLID Principles.
Run tests related to the issue using a subagent.
Fix any failing tests.
Review code changes for quality and adherence to best practices.
Prepare a commit message summarizing the changes. Do NOT push without user approval.
Use the helper script:
.claude/hooks/gitlab/scripts/create-mr.sh \
--source="feat/{iid}-{slug}" \
--target="{mr-target-from-strategy}" \
--title="Resolve issue #{iid}: {title}" \
--description="Closes #{iid}
## Summary
{summary of changes}"
Do NOT merge without user approval.
Case A — Multi-phase execution plan:
master
└── plan/{plan-name}
├── phase/{plan-name}/{phase-name-1}
│ └── feat/{iid}-{slug}
└── phase/{plan-name}/{phase-name-2}
Case B — Single epic:
master
└── epic/{epic-iid}-{epic-slug}
└── feat/{iid}-{slug}
Case C — Standalone issue:
master
└── feat/{iid}-{slug}