docs: update glab SKILL.md with comments section and API content-type guidance

Description

Updates the bundled glab skill (internal/commands/skills/bundled/assets/glab/SKILL.md) with documentation that was missing and caused agents to waste tool calls when posting comments and using glab api.

Changes

a) New "Comments and discussions" section

  • Documents glab issue/mr/incident note with the required -m flag
  • Documents stdin / heredoc patterns for long or Markdown comment bodies on glab mr note create (preferred for non-interactive use)
  • Documents the $(cat << 'EOF' ... EOF) heredoc-in--m fallback for glab issue note and glab incident note (which do not read stdin)
  • Documents glab mr note create --reply for threaded MR replies (full ID or 8+ char prefix)
  • Documents glab mr note create --file/--line diff comments and glab mr note resolve / reopen for thread state management
  • Documents glab api .../discussions/<id>/notes fallback for threaded replies on issues/incidents

b) Quick reference additions

  • glab mr note create <iid> -m "comment text" under Merge requests
  • glab ci status --output json and glab ci get --merge-request <iid> --with-job-details / --pipeline-id <id> --output json for non-streaming pipeline inspection
  • glab api projects/:id/jobs/<job-id>/trace for fetching a finished job log without streaming
  • Corrected glab ci retry <job-id> (was <pipeline-id>)

c) New "Content-type guidance" subsection under API calls

  • Explains the difference between -f (raw string), -F (file/type-inferred), and --input (raw bytes requiring explicit Content-Type header)
  • Prevents HTTP 415 errors from --input without Content-Type

d) Expanded "Common mistakes" section

  • -m requirement for glab issue note / glab incident note (open $EDITOR without it)
  • Deprecation of root glab mr note flags in favor of create / resolve / reopen subcommands
  • Editor-opening flags (--description "-") are unsafe in agent environments
  • Threaded reply limitations for issues/incidents
  • --input Content-Type pitfall
  • glab ci retry takes a job ID, not a pipeline ID
  • glab ci trace streams (blocks until job finishes) — use glab ci get or the trace API instead
  • glab ci view is an interactive terminal UI — use glab ci status or glab ci get instead

Resolves #8316 (closed)

How has this been tested?

This is a documentation-only change to a skill Markdown file.

  1. The validate-skills pre-commit hook ran successfully, confirming the skill file parses correctly.
  2. @duo-developer-gitlab-org ran a verification session against this MR exercising every documented command. Results in this comment:
    • All quick-reference commands pass.
    • All Comments and discussions patterns (-m, stdin pipe, heredoc stdin, heredoc-in--m, --reply full ID and 8-char prefix, --repo) pass.
    • All API content-type patterns pass, including the documented HTTP 415 behavior when --input is used without Content-Type.
    • glab mr note create --file --line (diff comments) and glab mr note resolve / reopen fail with HTTP 403 in agent sessions because the agent token currently only has ai_workflows read_api scope. These commands work outside agent sessions and the broader scope work is in progress separately, so the documentation is retained.
  3. Iterated on the diff based on the verification feedback: removed duplication (a separate "Non-interactive use (agents)" section and a separate "CI/CD pipeline inspection" section) and consolidated the actionable guidance into the quick reference and Common mistakes.
Edited by Thomas Schmidt

Merge request reports

Loading