feat(skills): add `glab skills install` to install bundled agent skill (experimental)
Description
Add a new glab skills install command that installs glab's bundled SKILL.md file into the environment so AI coding agents can discover how to use glab.
Experimental: This command is marked as experimental and may change or be removed in a future release.
Why
In ai-assist !4848, the developer_unstable agent was moved to use glab via run_command. A glab "skill" prompt was hardcoded into the Jinja system prompt as a stopgap. This is static, not discoverable by other agents, and couples ai-assist to glab internals.
This command makes glab self-describing: it carries its own skill file (embedded via go:embed) and writes it to the standard .agents/skills/ directory, following the Agent Skills specification. Any compatible agent (GitLab Duo, Claude Code, Codex, Gemini CLI, etc.) can then discover how to use glab via progressive disclosure.
Aligned implementation proposal
Based on discussion in this MR (see note_3298187886), this MR implements an incremental first step:
glab skills install— writesSKILL.mdto.agents/skills/glab/at the repo root (project scope, default)glab skills install --global— writes to~/.agents/skills/glab/(user scope)glab skills install --path <dir>— writes to a custom directory--force— overwrites existing skill files- Single skill file for now — no domain-specific sub-skills yet
- No
--agentflag in this iteration — agent-specific installation paths are deferred to a follow-up - Follows the general agentskills.io convention for directory layout
The --agent <agent> flag and agent auto-detection (e.g. writing to ~/.claude/skills/) are explicitly deferred to a follow-up MR, as is glab skills list and glab skills get.
Skill content approach
The bundled SKILL.md is intentionally concise (~78 lines). It focuses on what agents would not know from glab --help: the $(cat file) pattern for long descriptions, common gotchas (no --body, no --jq, no --state on mr list), and behavioral guidelines (read context first, use project templates). Command flag documentation is left to --help to avoid duplication and drift.
This is a starting point — the content can be expanded and the skill can later be split into domain-specific skills (glab-mr, glab-ci, etc.) using progressive disclosure.
Closes gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#2108 (closed) Part of #8252 (closed)
How has this been tested?
- Unit tests for all flags, error cases, overwrite behavior, and embedded content validation (7 tests)
- Full test suite passes (3048 tests, 0 failures)
- Lint clean
- Manual local testing: installed from source, verified all three scopes and the error case outside a git repo
Tested whether pi sees them:

