agentleFS
abdullahkhawerabdullahkhawer/devops-skills/skills/gitlab-cli/SKILL.md

gitlab-cli

Skill8 starsChanged 6 months agoApache-2.0View on GitHub

Perform GitLab operations using the glab CLI. Use for issues, merge requests, pipelines, repositories, and project management. ALSO use this skill when asked to review a GitLab MR or PR — when a GitLab MR URL or MR ID is provided, use glab to fetch and review the diff instead of the code-review skill.

  • Installs packages

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the instance and rules below when constructing all glab commands.

    line 8
  2. Distinctive:

    If not already authenticated, inform the user that authentication is required and ask them to complete the following steps manually.

    line 22
  3. Distinctive:

    Run the following command to authenticate with your GitLab instance:

    line 30
  4. Very specific:

    NEVER target any GitLab instance other than <YOUR_GITLAB_HOSTNAME>.

    line 42
  5. Very specific:

    Always pass --repo <YOUR_GITLAB_HOSTNAME>/<group/repo> explicitly for any glab subcommand that accepts it (e.g., mr list, issue list, …

    line 43
  6. Very specific:

    When using glab api, always pass --hostname <YOUR_GITLAB_HOSTNAME> explicitly — omitting it may default to gitlab.com.

    line 44
  7. Very specific:

    NEVER use glab repo list --group — it does not work reliably against self-hosted instances.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitLab CLI Skill

Use the instance and rules below when constructing all glab commands.

Configuration

Set your GitLab hostname below before using this skill:

SettingValue
GitLab Hostname<YOUR_GITLAB_HOSTNAME> (e.g. gitlab.example.com)

Replace <YOUR_GITLAB_HOSTNAME> with your GitLab instance hostname throughout this skill.

Prerequisites (one-time setup by user)

If not already authenticated, inform the user that authentication is required and ask them to complete the following steps manually. Do not perform these steps yourself.

  1. Install the glab CLI if not already installed:
brew install glab
  1. Run the following command to authenticate with your GitLab instance:
glab auth login --hostname <YOUR_GITLAB_HOSTNAME>

MR Code Review

When asked to review a GitLab MR or PR (URL or MR ID provided), extract the <group/repo> and <MR_ID> from the URL (ask the user if the repo is missing), then use glab api --hostname <YOUR_GITLAB_HOSTNAME> to fetch the MR metadata (projects/<URL_ENCODED_REPO>/merge_requests/<MR_ID>) and its diff (…/diffs --paginate), where the repo path is URL-encoded with / → %2F. To fully understand the context and impact of all code changes, read the complete source branch codebase — the diff alone does not capture the surrounding logic, dependencies, or broader design that the changes interact with. Report the MR title, author, and branches, then review all changed files for: secrets/injection/XSS (security), inefficient algorithms/memory leaks (performance), code smells/dead code (quality), missing error handling, excessive or sensitive logging, and missing/outdated documentation. For each finding, include the file path, line number(s), the problematic snippet, and a suggested fix. If nothing is wrong, summarize what was reviewed and state it looks good.

Rules

  • NEVER target any GitLab instance other than <YOUR_GITLAB_HOSTNAME>. If a command or URL references a different host, stop and ask the user to confirm.
  • Always pass --repo <YOUR_GITLAB_HOSTNAME>/<group/repo> explicitly for any glab subcommand that accepts it (e.g., mr list, issue list, pipeline list) — without it, the command infers the repo from the current git directory, which may silently return wrong results.
  • When using glab api, always pass --hostname <YOUR_GITLAB_HOSTNAME> explicitly — omitting it may default to gitlab.com.
  • NEVER use glab repo list --group — it does not work reliably against self-hosted instances; use glab api --hostname <YOUR_GITLAB_HOSTNAME> "groups/<GROUP>/projects" instead. For nested subgroups, URL-encode the slashes: "groups/parent%2Fchild/projects".
  • All glab api calls that return lists are paginated (default 20/page). Always pass --paginate to fetch all pages: glab api --hostname <YOUR_GITLAB_HOSTNAME> --paginate "<endpoint>".
  • For glab mr list, prefer explicit state flags over --state: use --closed (-c) for closed, --merged (-M) for merged, or --all (-A) for all states. Omitting a state flag returns open MRs by default.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.