Use skills to install the glab skill instead of embedded prompt
## Summary
Add a command to `glab` that installs its own bundled agent skill file (`SKILL.md`) into the local environment, so AI coding agents can discover how to use `glab` effectively.
## Motivation
In [ai-assist !4848](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/merge_requests/4848), we moved the `developer_unstable` agent to rely on `glab` and native `git` via `run_command` instead of dedicated GitLab API tools. To make this work, a glab "skill" prompt was **hardcoded into the agent's system prompt** as a Jinja snippet — teaching the LLM how to use `glab` commands.
This works, but it's the wrong place for that knowledge to live:
- **It's static and can drift.** The prompt in ai-assist is decoupled from the glab binary version. When glab adds or changes commands, the embedded prompt doesn't update.
- **It's not discoverable.** Other agents (Claude Code, Codex, Gemini CLI, etc.) can't benefit from it — it only exists inside our developer agent flow.
- **It couples ai-assist to glab internals.** The agent platform shouldn't need to maintain documentation about CLI tools.
The fix is to make **glab self-describing**: glab carries its own skill file and can install it into any agent's skills directory on demand. This follows the [Agent Skills open standard](https://agentskills.io) (`SKILL.md` with YAML frontmatter), which is supported by all major AI coding agents.
### The intended workflow
1. An agent environment (CI job, local dev setup, etc.) has `glab` installed and authenticated.
2. As a bootstrap step, glab installs its own skill: `glab skills install` (or `glab skills install --global`).
3. The skill file lands in `.agents/skills/glab/` (project scope) or `~/.agents/skills/glab/` (user scope).
4. Any agent that scans for skills now knows how to use glab — no hardcoded prompts needed.
5. The embedded glab prompt in ai-assist can be removed.
## Proposal
### What the command does
- Writes glab's **bundled `SKILL.md` file** (embedded in the binary via `go:embed`) into the target directory.
- The skill describes glab's core workflows and common gotchas that agents consistently get wrong without guidance.
- No network calls, no registry — the skill ships with the binary and is always in sync with the installed version.
### Aligned implementation (incremental, from [cli!3177](https://gitlab.com/gitlab-org/cli/-/merge_requests/3177))
Based on discussion and alignment in [cli!3177#note_3298187886](https://gitlab.com/gitlab-org/cli/-/merge_requests/3177#note_3298187886), the command is `glab skills install` under the `skills` namespace:
| Flag | Target directory | Use case |
|---|---|---|
| _(default, project scope)_ | `.agents/skills/glab/` in the current repo | Per-project setup, checked into the repo or gitignored |
| `--global` | `~/.agents/skills/glab/` | User-wide, available to all agent sessions |
| `--path <dir>` | Custom directory | Explicit override for non-standard setups |
| `--force` | — | Overwrite existing skill files |
The `--agent <name>` flag (for agent-specific paths like `~/.claude/skills/`) is deferred to a follow-up.
The command is marked **experimental** — it may change or be removed as we learn more.
### Naming decision
The command uses the `glab skills` namespace (not `glab agent`), as aligned with reviewers in [cli!3177](https://gitlab.com/gitlab-org/cli/-/merge_requests/3177). This avoids confusion with `glab duo` (agent behavior) and aligns with the broader `glab skills` vision in [cli#8252](https://gitlab.com/gitlab-org/cli/-/work_items/8252).
### Complementary subcommands (future, tracked in [cli#8252](https://gitlab.com/gitlab-org/cli/-/work_items/8252))
- `glab skills list` — list all bundled skills
- `glab skills get <name>` — print skill content to stdout (agent-native, no filesystem write)
- `glab skills install --agent <name>` — install to agent-specific directory with auto-detection
### Out of scope (future work)
- Installing third-party skills from GitLab repositories
- Bundled skill support in the ai-assist agent framework ([discussed in !4848](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/merge_requests/4848#note_3184449245))
- Progressive disclosure / `activate_skill` tool integration
- Agent auto-detection (`--agent` flag)
## Related
- [cli!3177](https://gitlab.com/gitlab-org/cli/-/merge_requests/3177) — feat(skills): add `glab skills install` to install bundled agent skill (experimental)
- [cli#8252](https://gitlab.com/gitlab-org/cli/-/work_items/8252) — Proposal: Add `glab skills` command for bundled AI agent skills
- [ai-assist !4848](https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/merge_requests/4848) — feat: Run the developer_unstable on glab and git natively available
- [Agent Skills specification](https://agentskills.io)
issue