An AI agent skill for GitLab integration — fetch issues and merge requests, generate executive summaries, perform structured code reviews, and automate issue resolution workflows.
Built as a Claude Code / Cursor skill, it works with any AI coding assistant that supports skill-based orchestration.
curl -fsSL https://raw.githubusercontent.com/ekohe/gitlab-skill/main/install.sh | bashThis clones the repo into your skills directory, installs dependencies, and creates a config file for you to fill in. Re-run to update.
Manual install:
git clone https://github.com/ekohe/gitlab-skill.git ~/.claude/skills/gitlab-skill
cd ~/.claude/skills/gitlab-skill
pip install -r requirements.txt
cp gitlab_config.json.template gitlab_config.json- Multi-instance — manage multiple GitLab servers from one config
- Project aliases — short names with automatic instance routing
- Issue summaries — executive-level summaries focused on business impact
- Code reviews — structured analysis across Security, Logic, Performance, and Quality
- Issue resolution — end-to-end: fetch issue, branch, implement, MR, comment
- Project insights — aggregate statistics and trend analysis
A Personal Access Token (PAT) is required to authenticate with the GitLab API.
- Sign in to your GitLab instance
- Go to User Settings > Access Tokens
- GitLab.com: https://gitlab.com/-/user_settings/personal_access_tokens
- Self-hosted:
https://<your-gitlab>/–/user_settings/personal_access_tokens
- Click Add new token
- Fill in the fields:
- Token name: e.g.
Gitlab Skill - Expiration date: set a reasonable expiry (max 1 year recommended)
- Scopes: select
api(full API access — required for reading issues/MRs and posting comments)
- Token name: e.g.
- Click Create personal access token
- Copy the token immediately (it won't be shown again)
| Scope | Required | Why |
|---|---|---|
api |
Yes | Read/write access to issues, MRs, comments, and diffs |
read_api |
Partial | Read-only — sufficient if you don't need to post comments or create MRs |
- Never commit tokens to version control (
gitlab_config.jsonis in.gitignore) - Set file permissions:
chmod 600 gitlab_config.json - Use short expiration dates and rotate regularly
- Create separate tokens per tool/integration
- Revoke tokens immediately if compromised
Edit gitlab_config.json (created by the installer from the template):
{
"default": "work",
"instances": {
"work": {
"url": "https://gitlab.company.com",
"token": "glpat-xxxxxxxxxxxxxxxxxxxx",
"description": "Company GitLab"
}
},
"projects": {
"webapp": {
"project_id": "acme/webapp",
"instance": "work",
"description": "Main web app"
}
}
}You can also use environment variables for a single instance:
export GITLAB_URL="https://gitlab.com"
export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"Verify your setup:
python scripts/gitlab_api.py list-instances
python scripts/gitlab_api.py list-projectsThe skill provides two CLI scripts that your AI agent orchestrates automatically:
| Script | Purpose |
|---|---|
scripts/gitlab_api.py |
Core API client — fetch issues, MRs, diffs, post comments, aggregate stats |
scripts/auto_resolve_issue.py |
Resolution workflow — create branches, push, create MRs |
When used as an AI skill, the agent reads SKILL.md for detailed workflow instructions covering:
- Summarize Issue — fetch + executive summary using
references/issue_summary_format.md - Review MR — fetch + structured code review using
references/code_review_style.md - Resolve Issue — full loop from issue to merge request
- Aggregate Insights — project health reports
- List & Filter — issues/MRs by state and labels
See SKILL.md for the complete CLI reference and workflow details.
gitlab-skill/
├── SKILL.md # Agent instructions & full CLI reference
├── install.sh # One-command installer
├── gitlab_config.json.template # Config template (safe to share)
├── requirements.txt # Python dependencies
├── scripts/
│ ├── gitlab_api.py # GitLab API client & CLI
│ └── auto_resolve_issue.py # Issue resolution automation
└── references/
├── issue_summary_format.md # Executive summary format guide
└── code_review_style.md # Code review style guide
Contributions are welcome! Fork the repo, create a feature branch, and open a Pull Request.
- Encore — creator & maintainer
Made by Ekohe — github.com/ekohe/gitlab-skill