Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhance GitLab skill with CLI documentation#63

Open
jpshackelford wants to merge 2 commits intomain from
feature/enhance-gitlab-skill
Open

Enhance GitLab skill with CLI documentation #63
jpshackelford wants to merge 2 commits intomain from
feature/enhance-gitlab-skill

Conversation

@jpshackelford
Copy link

@jpshackelford jpshackelford commented Feb 19, 2026

Summary

This PR enhances the GitLab skill to have equivalent detail to the GitHub skill, particularly around CLI usage and URL recognition.

Changes

URL Recognition

  • Added https://gitlab.com as a trigger so the skill activates when GitLab URLs are mentioned
  • Added explicit note in the <IMPORTANT> section that any URL starting with https://gitlab.com refers to a GitLab artifact

CLI Documentation

Added comprehensive glab CLI command reference:

  • Merge Request commands: list, view (with comments), create, checkout, approve, merge
  • Issue commands: list, view (with comments), create, close, add comments
  • Pipeline/CI commands: status, view, list pipelines, retry failed, trace job logs
  • API access: direct API calls via glab

Review Comment Handling

  • Added section on handling review comments (matching GitHub skill guidance)
  • Added section on resolving discussion threads via GitLab API

Other Improvements

  • Added note about not marking MRs ready to merge unless explicitly asked
  • Fixed terminology (PR → MR where appropriate)

Motivation

The GitHub skill had significantly more detail about CLI usage, especially around:

  • Using gh for workflow monitoring
  • GraphQL API for resolving review threads
  • Best practices for handling review comments

This update brings the GitLab skill to parity, ensuring agents have the same level of guidance when working with GitLab repositories.

Testing

The glab CLI commands were tested against a live GitLab repository to verify accuracy.

@jpshackelford can click here to continue refining the PR

- Add trigger for https://gitlab.com URLs to identify GitLab artifacts
- Add IMPORTANT note about recognizing GitLab URLs
- Add glab CLI examples for checking pipeline status, viewing MRs/issues
- Add section on handling review comments (matching GitHub skill)
- Add comprehensive glab CLI command reference:
 - Merge request commands (list, view, create, checkout, approve, merge)
 - Issue commands (list, view, create, close, comment)
 - Pipeline/CI commands (status, view, list, retry, trace)
 - API access commands
- Add section on resolving discussion threads via API
- Add note about not marking MRs ready unless explicitly asked
This brings the GitLab skill to parity with the GitHub skill in terms of
CLI usage documentation and best practices.
Co-authored-by: openhands <openhands@all-hands.dev>
Removed the verbose 'Common GitLab CLI Commands' reference section.
Key examples are already in the IMPORTANT block, and the discussion
thread resolution section provides the equivalent of GitHub's GraphQL
examples.
Co-authored-by: openhands <openhands@all-hands.dev>
Copy link
Author

A customer indicated that the agent was attempting to use the web-browser to access GitLab issues and MRs. I have updated the GitLab skill to use the gitlab command-line so as to give equivalent instructions as the GitHub skill. I have tested with my own GitLab instance.

@jpshackelford jpshackelford changed the title (削除) Enhance GitLab skill with comprehensive CLI documentation (削除ここまで) (追記) Enhance GitLab skill with CLI documentation (追記ここまで) Feb 19, 2026
Copy link

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Acceptable - Brings GitLab skill to parity with GitHub, but command syntax and consistency need fixes.

---
name: gitlab
description: Interact with GitLab repositories, merge requests, and APIs using the GITLAB_TOKEN environment variable. Use when working with code hosted on GitLab or managing GitLab resources.
description: Interact with GitLab repositories, merge requests, issues, and pipelines using the GITLAB_TOKEN environment variable and GitLab CLI (glab). Use when working with code hosted on GitLab or managing GitLab resources. Any URL starting with https://gitlab.com is a GitLab artifact.
Copy link

@all-hands-bot all-hands-bot Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 Important: Description is 180+ characters. The GitHub skill keeps it concise (~100 chars). Long descriptions break UI displays and catalog views. Consider:

Suggested change
description: Interact with GitLab repositories, merge requests, issues, and pipelines using the GITLAB_TOKEN environment variable and GitLab CLI (glab). Use when working with code hosted on GitLab or managing GitLab resources. Any URL starting with https://gitlab.com is a GitLab artifact.
description: Interact with GitLab repositories, merge requests, issues, and pipelines using the GITLAB_TOKEN environment variable and GitLab CLI (glab). Use when working with code hosted on GitLab.


1. Get the discussion IDs for a merge request:
```bash
glab api projects/:id/merge_requests/:mr_iid/discussions
Copy link

@all-hands-bot all-hands-bot Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Placeholders :id and :mr_iid are not explained. Make it concrete:

Suggested change
glab api projects/:id/merge_requests/:mr_iid/discussions
1. Get the discussion IDs for a merge request (replace PROJECT_ID with numeric ID or URL-encoded path, MR_IID with merge request number):
```bash
glab api projects/12345/merge_requests/42/discussions
# Or with URL-encoded path:
glab api projects/mygroup%2Fmyrepo/merge_requests/42/discussions

Comment on lines +68 to +77
curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
"https://gitlab.com/api/v4/projects/:id/merge_requests/:mr_iid/discussions/:discussion_id/notes" \
--data "body=Fixed in <COMMIT_SHA>"
```

3. Resolve a discussion thread:
```bash
curl --request PUT --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
"https://gitlab.com/api/v4/projects/:id/merge_requests/:mr_iid/discussions/:discussion_id" \
--data "resolved=true"
Copy link

@all-hands-bot all-hands-bot Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Suggestion: Inconsistent tooling. Line 62 uses glab api, then suddenly switches to curl. Pick one approach or explain why you switch. For consistency with the skill's preference for glab:

Suggested change
curl --request POST --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
"https://gitlab.com/api/v4/projects/:id/merge_requests/:mr_iid/discussions/:discussion_id/notes" \
--data "body=Fixed in <COMMIT_SHA>"
```
3. Resolve a discussion thread:
```bash
curl --request PUT --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
"https://gitlab.com/api/v4/projects/:id/merge_requests/:mr_iid/discussions/:discussion_id" \
--data "resolved=true"
2. Reply to a discussion thread:
```bash
glab api --method POST projects/:id/merge_requests/:mr_iid/discussions/:discussion_id/notes \
-f body="Fixed in <COMMIT_SHA>"
  1. Resolve a discussion thread:
glab api --method PUT projects/:id/merge_requests/:mr_iid/discussions/:discussion_id \
 -f resolved=true

Comment on lines +82 to +86
# List recent pipelines to find the ID
glab pipeline list

# Retry the failed pipeline
glab ci retry <pipeline-id>
Copy link

@all-hands-bot all-hands-bot Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Critical: Command syntax is wrong. glab ci retry does NOT take a pipeline ID argument - it retries the last pipeline for the current branch. For a specific pipeline:

Suggested change
# List recent pipelines to find the ID
glab pipeline list
# Retry the failed pipeline
glab ci retry <pipeline-id>
4. Retry a failed pipeline:
```bash
# List recent pipelines to find the ID
glab ci list
# Retry a specific pipeline (use glab API)
glab api --method POST projects/:id/pipelines/:pipeline_id/retry
# Or retry the latest pipeline for current branch
glab ci retry

glab pipeline list

# Retry the failed pipeline
glab ci retry <pipeline-id>
Copy link

@all-hands-bot all-hands-bot Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Nit: File should end with a newline (POSIX standard). Git will flag this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@juanmichelini juanmichelini Awaiting requested review from juanmichelini

1 more reviewer

@all-hands-bot all-hands-bot all-hands-bot left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Comments

AltStyle によって変換されたページ (->オリジナル) /