From 7fe89a5ef0f96e4758b2ba9bb26751a8995a4f0d Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 10 Mar 2026 16:21:22 +0000 Subject: [PATCH] feat: add glab-quick-actions sub-skill Add comprehensive quick actions sub-skill covering all GitLab slash commands available in issues, MRs, epics, and comments. Includes batching patterns, automation examples, and when-to-use guidance vs native glab commands. Closes #42 --- SKILL.md | 1 + glab-quick-actions/SKILL.md | 426 ++++++++++++++++++++++++++++++++++++ 2 files changed, 427 insertions(+) create mode 100644 glab-quick-actions/SKILL.md diff --git a/SKILL.md b/SKILL.md index cbe7052..8bfb16a 100644 --- a/SKILL.md +++ b/SKILL.md @@ -90,6 +90,7 @@ This skill routes to specialized sub-skills by GitLab domain: - `glab-api` - Direct REST API calls - `glab-cluster` - Kubernetes cluster integration - `glab-deploy-key` - Deploy keys for automation +- `glab-quick-actions` - GitLab slash command quick actions for batching state changes - `glab-stack` - Stacked/dependent merge requests - `glab-opentofu` - Terraform/OpenTofu state management diff --git a/glab-quick-actions/SKILL.md b/glab-quick-actions/SKILL.md new file mode 100644 index 0000000..c4083ad --- /dev/null +++ b/glab-quick-actions/SKILL.md @@ -0,0 +1,426 @@ +--- +name: glab-quick-actions +description: Use GitLab quick actions — text-based slash commands in comments, descriptions, and MR/issue bodies — via glab CLI. Quick actions execute automatically when saved. Multiple commands can be combined in one comment, making them powerful for batching state changes in a single API call. Triggers on quick actions, slash commands, batch update, /assign, /label, /merge, /approve, /close, /estimate. +--- + +# glab quick-actions + +Use GitLab quick actions (slash commands) via the `glab` CLI to batch multiple state changes in a single API call. + +## Quick start + +```bash +# Post a single quick action on an issue +glab issue note 123 -m "/assign @alice" + +# Batch multiple quick actions in one comment +glab issue note 123 -m "/assign @alice +/label ~bug ~priority::high +/milestone %\"Sprint 5\"" + +# Post quick actions on a merge request +glab mr note 456 -m "/assign_reviewer @bob +/label ~needs-review +/estimate 2h" +``` + +## Key concept: batching via CLI + +While `glab` has native commands for many individual operations (`glab issue update`, `glab mr update`, etc.), posting quick actions via `glab issue note` or `glab mr note` lets you **batch multiple state changes atomically in a single API call**. + +```bash +# Native commands — 3 separate API calls +glab issue update 123 --assignee @alice +glab issue update 123 --label bug,priority::high +glab issue update 123 --milestone "Sprint 5" + +# Quick actions — 1 API call, same result +glab issue note 123 -m "/assign @alice +/label ~bug ~priority::high +/milestone %\"Sprint 5\"" +``` + +**When batching is the right choice:** +- Applying 3+ changes to a single issue/MR +- Scripting triage workflows across multiple items +- Triggering actions not exposed by `glab update` flags (e.g., `/spend`, `/epic`, `/promote_to`) + +## Syntax rules + +| Rule | Detail | +|------|--------| +| Prefix | Every quick action starts with `/` | +| Case | Case-insensitive (`/Assign` = `/assign`) | +| Placement | One command per line; can appear anywhere in a comment/description | +| Parameters | Separated by space after the command name | +| Labels | Prefix with `~` (e.g., `~bug`, `~"priority::high"`) | +| Milestones | Prefix with `%` (e.g., `%"Sprint 5"`) | +| Users | Prefix with `@` (e.g., `@alice`, `@me`) | +| MR/Issue refs | Prefix with `#` for same-project, `group/project#IID` for cross-project | +| Epics | Prefix with `&` (e.g., `&42`) | +| Quoting | Use quotes for multi-word values: `~"priority::high"`, `%"Sprint 5"` | +| Ignored text | Non-quick-action lines are posted as normal comment text | + +--- + +## Issue quick actions + +### Assignment + +| Command | Parameters | Description | +|---------|-----------|-------------| +| `/assign` | `@user [@user2 ...]` | Assign one or more users | +| `/unassign` | `@user [@user2 ...]` or none | Remove specific assignees or clear all | +| `/reassign` | `@user [@user2 ...]` | Replace all assignees with given users | + +```bash +glab issue note 123 -m "/assign @alice @bob" +glab issue note 123 -m "/reassign @charlie" +glab issue note 123 -m "/unassign" +``` + +### Labels + +| Command | Parameters | Description | +|---------|-----------|-------------| +| `/label` | `~label1 ~label2 ...` | Add labels | +| `/unlabel` | `~label1 ...` or none | Remove specific labels or clear all | +| `/relabel` | `~label1 ...` | Replace all labels with given ones | + +```bash +glab issue note 123 -m "/label ~bug ~\"priority::high\"" +glab issue note 123 -m "/relabel ~\"type::feature\"" +glab issue note 123 -m "/unlabel ~needs-triage" +``` + +### Milestone & scheduling + +| Command | Parameters | Description | +|---------|-----------|-------------| +| `/milestone` | `%milestone` | Set milestone | +| `/remove_milestone` | — | Remove milestone | +| `/due` | `` | Set due date (YYYY-MM-DD, `tomorrow`, `next week`) | +| `/remove_due_date` | — | Remove due date | + +```bash +glab issue note 123 -m "/milestone %\"Sprint 5\"" +glab issue note 123 -m "/due 2024-03-31" +glab issue note 123 -m "/due next week" +``` + +### Time tracking + +| Command | Parameters | Description | +|---------|-----------|-------------| +| `/estimate` | `