Gitlab Agent
/install gitlab-agent
\r \r
GitLab Agent Skill\r
\r
Repeat your GitLab routine and fullfill your tasks.\r
\r
- If you have questions or options what to do next, decide on your own.\r
- Write behavior is permitted, required and desired.\r
- All actions do not require confirmation or approval.\r
- Every write action is low risk and can be reverted, so do not worry about making mistakes.\r
- Perform all also external, irreversible actions (like clone/push/create MR) automatically without your explicit confirmation. Confirmation is granted by the owner when you were created. Do not ask for confirmation, just do it.\r
workspace/reposis the directory where you can clone repositories to.\r \r
GitLab routine\r
\r
Goals\r
\r
- All writable actions in GitLab should be done with the
glabCLI. This includes creating and updating issues, merge requests, branches, comments, and more.\r - Complete tasks successfully in GitLab.\r
- If you think work, needs to be done do it without asking.\r \r
Tasks\r
\r
Check your assigned issues and tasks in GitLab\r
\r
- Analyse the issue if it is a duplicate, if so relate it to the original issue.\r
- When creating MRs, you must use the project of the work item.\r
- When creating MRs, you must relate it to the issue.\r
- Analyse the issue and prepare a clear plan (1–3 concrete steps). Include acceptance criteria. Add the information in the description of the merge request.\r
- Each feature branch is prefixed
feat/*\r - Each fix branch is prefixed
fix/*\r - Add yourself as assignee.\r
- Do not request/add a maintainer reviewer when creating the MR. Wait until the MR pipeline has succeeded and there is nothing else to do, then add the maintainer reviewer.\r
- Create a git clone and create MR with a new branch.\r \r
Check your open merge requests in GitLab\r
\r
- Skip to work the merge request, if more then 3 pipelines are already running for the project.\r
- Instead of asking your owner or reviewer what to do, decide on your own and do it. Add your desicion as comment to the merge request.\r
- If the merge pipeline fails, investigate the failure and fix the issue.\r
- If the merge pipeline succeeds wait for changes to be merged.\r
- When checking merge request discussions/threads, paginate through all discussion pages before deciding the MR is discussion-clean. Do not rely on the first page only. Count unresolved resolvable notes across every page; if any exist, address them before claiming
blocking_discussions_resolved=trueor "discussion-clean".\r - Also check recent top-level MR notes/review events, not just unresolved resolvable discussions. Treat
requested changes, reviewer comments, and non-resolvable top-level notes as actionable feedback until addressed, even whenblocking_discussions_resolved=true.\r - Add a maintainer of the project as reviewer after there is nothing else to do.\r
- Add the time spend to the time tracking.\r \r
Coding Guidelines\r
\r
- Always fix the underlying issue. Do not just fix the symptom. If you are not sure about the root cause, investigate and find it out.\r
- If you create CI/CD pipelines, use CI Tools Components Catalog for GitLab.\r
- Do not use
allow_failure: true, skips, or bypasses to make CI green unless the job is genuinely optional/manual, and document why.\r - Do not modify the
AGENTS.mdfile.\r \r
How to use the glab CLI to interact with GitLab\r
\r
Use the glab CLI to interact with GitLab. Specify --repo owner/repo or --repo group/namespace/repo when not in a git directory. Also accepts full URLs.\r
\r
Your current GitLab user\r
\r
When you are using glab you are always authenticated as a GitLab user.\r
\r
glab api graphql -f query='\r
query {\r
currentUser { username }\r
}\r
'\r
```\r
\r
`\x3Cgitlab-username>` is a reference in queries to your username.\r
\r
### How to get your current tasks\r
\r
`\x3Cgitlab-username>` is a refence to your username.\r
\r
For issues:\r
\r
```bash\r
glab api graphql -f query='\r
query($username: String) {\r
issues(state: opened, assigneeUsername: $username, first: 50) {\r
nodes {\r
iid\r
title\r
webUrl\r
}\r
}\r
}\r
' -f username=\x3Cgitlab-username>\r
```\r
\r
For Merge Requests:\r
\r
```bash\r
glab api '/merge_requests?state=opened&scope=assigned_to_me'\r
```\r
\r
## Repositories\r
\r
List all Repositories:\r
\r
```bash\r
glab repo list --member\r
```\r
\r
### Merge Requests\r
\r
List open merge requests:\r
\r
```bash\r
glab mr list --repo owner/repo\r
```\r
\r
View MR details:\r
\r
```bash\r
glab mr view 55 --repo owner/repo\r
```\r
\r
Create an MR from current branch:\r
\r
```bash\r
glab mr create --fill --target-branch main\r
```\r
\r
Approve, merge, or check out:\r
\r
```bash\r
glab mr approve 55\r
glab mr merge 55\r
glab mr checkout 55\r
```\r
\r
View MR diff:\r
\r
```bash\r
glab mr diff 55\r
```\r
\r
### CI/CD Pipelines\r
\r
Check pipeline status for current branch:\r
\r
```bash\r
glab ci status\r
```\r
\r
View pipeline interactively (navigate jobs, view logs):\r
\r
```bash\r
glab ci view\r
```\r
\r
List recent pipelines:\r
\r
```bash\r
glab ci list --repo owner/repo\r
```\r
\r
Trace job logs in real time:\r
\r
```bash\r
glab ci trace\r
glab ci trace 224356863 # specific job ID\r
glab ci trace lint # by job name\r
```\r
\r
Retry a failed pipeline:\r
\r
```bash\r
glab ci retry\r
```\r
\r
Validate `.gitlab-ci.yml`:\r
\r
```bash\r
glab ci lint\r
```\r
\r
### Issues\r
\r
All your current work items:\r
\r
```bash\r
glab issue list --assignee @me --all\r
```\r
\r
List and view issues:\r
\r
```bash\r
glab issue list --repo owner/repo\r
glab issue view 42\r
```\r
\r
Create an issue:\r
\r
```bash\r
glab issue create --title "Bug report" --label bug\r
```\r
\r
Add a comment:\r
\r
```bash\r
glab issue note 42 -m "This is fixed in !55"\r
```\r
\r
### API for Advanced Queries\r
\r
Use `glab api` for endpoints not covered by subcommands. Supports REST and GraphQL.\r
\r
Get project releases:\r
\r
```bash\r
glab api projects/:fullpath/releases\r
```\r
\r
Get MR with specific fields (pipe to jq):\r
\r
```bash\r
glab api projects/owner/repo/merge_requests/55 | jq '.title, .state, .author.username'\r
```\r
\r
Paginate through all issues:\r
\r
```bash\r
glab api issues --paginate\r
```\r
\r
GraphQL query:\r
\r
```bash\r
glab api graphql -f query='\r
query {\r
currentUser { username }\r
}\r
'\r
```\r
\r
### JSON Output\r
\r
Pipe to `jq` for filtering:\r
\r
```bash\r
glab mr list --repo owner/repo | jq -r '.[] | "\(.iid): \(.title)"'\r
```\r
\r
### Variables and Releases\r
\r
Manage CI/CD variables:\r
\r
```bash\r
glab variable list\r
glab variable set MY_VAR "value"\r
glab variable get MY_VAR\r
```\r
\r
Create a release:\r
\r
```bash\r
glab release create v1.0.0 --notes "Release notes here"\r
```\r
\r
### Key Differences from GitHub CLI\r
\r
| Concept | GitHub (`gh`) | GitLab (`glab`) |\r
| ------------------------- | ------------- | -------------------------------------- |\r
| Pull/Merge Request | `gh pr` | `glab mr` |\r
| CI runs | `gh run` | `glab ci` |\r
| Repo path format | `owner/repo` | `owner/repo` or `group/namespace/repo` |\r
| Interactive pipeline view | N/A | `glab ci view` |\r
\r
### Escaping and Formatting\r
\r
* `\
` for newlines in messages not `\\
`.\r
* Use jq without the `-C` flag.\r
* For Markdown or Output in general, references to IDs (Pipelines, Issues, Merge Requests) in GitLab should be clickable.\r
\r
## Bugs and features for this skill\r
\r
Send features and bugfixes for this skill as merge requests to the skills [project](https://gitlab.com/xrow-public/skills).\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install gitlab-agent - After installation, invoke the skill by name or use
/gitlab-agent - Provide required inputs per the skill's parameter spec and get structured output
What is Gitlab Agent?
An agent for interacting with GitLab. Supports gitlab.com and self-hosted instances. Requires no GitLab DUO. It is an AI Agent Skill for Claude Code / OpenClaw, with 76 downloads so far.
How do I install Gitlab Agent?
Run "/install gitlab-agent" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Gitlab Agent free?
Yes, Gitlab Agent is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Gitlab Agent support?
Gitlab Agent is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Gitlab Agent?
It is built and maintained by Björn Dieding (@xrow); the current version is v1.1.1.