agentleFS
Greg-KleinGreg-Klein/implementation-factory/skills/glab-gitlab-api/SKILL.md

glab-gitlab-api

Skill1 starsChanged 34 days agoMITView on GitHub

Recipes and traps for the `glab` CLI and the GitLab API - linking a ticket to an epic, passing a long description from a file, assigning an issue reliably, reading and writing a work item's native status. Use whenever a glab command fails silently or returns an unexpected error (404 on --epic, assignee_ids ignored, description filled with the literal text "@file.md", status absent from the REST API).

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. Greg-Klein/implementation-harness★ 1100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository13 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When the gitlab-tickets conventions apply, the group the epics live in is the one IMPL_GITLAB_EPIC_GROUP names, which may be a root group …

    line 29
  2. Very specific:

    Do not go through glab api projects/:id/issues -f "assignee_ids[]=<userid>" (POST or PUT): the assignment is silently ignored (assignees …

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

glab / GitLab API - recipes and traps

Linking a ticket to an epic

The --epic <iid> flag of glab issue create returns a 404 Not Found. Do not rely on it.

The workflow that works, in three steps:

# 1. Create the ticket without --epic
glab issue create -R <group/project> -t "..." -d "..." -l ... -a ... -y

# 2. Fetch the ticket's INTERNAL id (not its displayed iid)
glab api "projects/<group%2Fproject>/issues/<iid>"   # the `id` field

# 3. Link it to the epic through the internal id
glab api --method POST "groups/<group>/epics/<epic_iid>/issues/<internal_id>"

Invented example: ticket shop#412 (internal id 90001234) linked to epic acme&17: glab api --method POST "groups/acme/epics/17/issues/90001234".

Group trap: an epic's iid is scoped to its group, not global. acme&6 and acme/app&6 are two completely different epics that share the iid 6 by coincidence. Always reuse the EXACT group path written in the ticket ("Épique : acme/app&6"), never assume the root group applies. Check with glab api "groups/<url-encoded-group-path>/epics/<iid>" and compare the title before linking.

When the gitlab-tickets conventions apply, the group the epics live in is the one IMPL_GITLAB_EPIC_GROUP names, which may be a root group and not the subgroup of the project.

Passing a long description from a file

For a multi-line markdown description with glab api: --field "description=@file.md". The @ prefix is only interpreted with --field.

  • --raw-field "description=@file.md" sends the literal string @file.md (no interpretation).
  • --input file.json returns HTTP 400 (wrong Content-Type for the GitLab API).

Epic creation example: glab api "groups/<gid>/epics" -X POST --field "title=..." --field "description=@desc.md".

Trap with glab issue create (not glab api): its -d / --description flag does NOT support the @file prefix. -d "@file.md" literally fills the description with the text @file.md. The correct workflow for a long description at creation time:

glab issue create -t "..." -d "placeholder" -l ... -a ...
glab api --method PUT "projects/<path>/issues/<iid>" --field "description=@file.md"

Assigning an issue

Use glab issue update <iid> --assignee <username> -R <project>.

Do not go through glab api projects/:id/issues -f "assignee_ids[]=<userid>" (POST or PUT): the assignment is silently ignored (assignees stays empty) with no error. The dedicated glab issue update command works reliably with the username.

Work item status

For native status reads and authorized updates, read work-item-status.md. The caller chooses the transition; lifecycle names are project-specific.

Merge request delivery

For an authorized MR creation or consolidated review publication, read merge-request.md. Do not publish merely because a report or URL is supplied. The caller provides the branch, target, exact content, reviewer policy and whether delivery is ready or draft.

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.