@gaodes/pi-gitlab 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.primecodex.json +19 -0
- package/.upstream.json +49 -0
- package/CHANGELOG.md +47 -0
- package/LICENSE +21 -0
- package/README.md +132 -0
- package/package.json +79 -0
- package/skills/gitlab-assistant/SKILL.md +28 -0
- package/skills/gitlab-issue/SKILL.md +41 -0
- package/skills/gitlab-mr/SKILL.md +49 -0
- package/skills/gitlab-pipeline/SKILL.md +36 -0
- package/skills/gitlab-release/SKILL.md +45 -0
- package/skills/gitlab-workflow/SKILL.md +39 -0
- package/src/commands/gitlab-doctor.ts +228 -0
- package/src/config/guard.ts +96 -0
- package/src/config/loader.ts +170 -0
- package/src/config/types.ts +57 -0
- package/src/events/resourcesDiscover.ts +27 -0
- package/src/index.ts +87 -0
- package/src/lib/confirm.ts +47 -0
- package/src/lib/env.ts +48 -0
- package/src/lib/errors.ts +156 -0
- package/src/lib/gitRemoteParse.ts +41 -0
- package/src/lib/glab.ts +34 -0
- package/src/lib/pagination.ts +3 -0
- package/src/lib/projectCache.ts +39 -0
- package/src/lib/projectFallback.ts +19 -0
- package/src/lib/redact.ts +24 -0
- package/src/lib/resolveProjectId.ts +37 -0
- package/src/lib/schemas.ts +16 -0
- package/src/tools/IMPLEMENTATION-NOTE-1B.md +33 -0
- package/src/tools/gitlab_api.ts +146 -0
- package/src/tools/gitlab_force_push_safe.ts +246 -0
- package/src/tools/gitlab_issue_close.ts +64 -0
- package/src/tools/gitlab_issue_create.ts +71 -0
- package/src/tools/gitlab_issue_list.ts +110 -0
- package/src/tools/gitlab_job_logs.ts +89 -0
- package/src/tools/gitlab_mr_bulk_approve.ts +109 -0
- package/src/tools/gitlab_mr_create.ts +83 -0
- package/src/tools/gitlab_mr_list.ts +108 -0
- package/src/tools/gitlab_mr_merge.ts +86 -0
- package/src/tools/gitlab_mr_view.ts +99 -0
- package/src/tools/gitlab_pipeline_run.ts +68 -0
- package/src/tools/gitlab_pipeline_status.ts +122 -0
- package/src/tools/gitlab_project_resolve.ts +59 -0
- package/src/tools/gitlab_release_create.ts +92 -0
- package/src/tools/gitlab_release_list.ts +97 -0
- package/src/tools/gitlab_release_view.ts +78 -0
package/.primecodex.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"updatedAt": "2026-06-01T08:10:00+0300",
|
|
4
|
+
"kind": "package",
|
|
5
|
+
"name": "pi-gitlab",
|
|
6
|
+
"source": "ssh://git@gitlab-ssh.elches.dev:2222/agents/primecodex/packages/pi-gitlab.git",
|
|
7
|
+
"description": "Pi extension package for GitLab workflows via glab CLI.",
|
|
8
|
+
"topic": "gitlab",
|
|
9
|
+
"requires": [
|
|
10
|
+
"glab>=1.40.0"
|
|
11
|
+
],
|
|
12
|
+
"integrationStatus": "none",
|
|
13
|
+
"npm": {
|
|
14
|
+
"name": "@gaodes/pi-gitlab",
|
|
15
|
+
"scope": "@gaodes",
|
|
16
|
+
"published": false,
|
|
17
|
+
"publishedUnderGaodes": false
|
|
18
|
+
}
|
|
19
|
+
}
|
package/.upstream.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"updatedAt": "2026-06-01T02:49:33+0300",
|
|
4
|
+
"creationMethod": "inspiration",
|
|
5
|
+
"primary": {
|
|
6
|
+
"name": "gitlab-assistant-skills",
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/grandcamel/gitlab-assistant-skills",
|
|
9
|
+
"repo": "https://github.com/grandcamel/gitlab-assistant-skills",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"relationship": "inspiration",
|
|
12
|
+
"upstreamVersion": "main@2026-06-01"
|
|
13
|
+
},
|
|
14
|
+
"inspirations": [
|
|
15
|
+
{
|
|
16
|
+
"name": "claude-glab-skill",
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/henricook/claude-glab-skill",
|
|
19
|
+
"repo": "https://github.com/henricook/claude-glab-skill",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"relationship": "inspiration"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "wenerme ai glab-cli",
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/wenerme/ai/tree/main/skills/glab-cli",
|
|
27
|
+
"repo": "https://github.com/wenerme/ai",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"relationship": "inspiration"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "wenerme ai glab-docs",
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/wenerme/ai/tree/main/skills/glab-docs",
|
|
35
|
+
"repo": "https://github.com/wenerme/ai",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"relationship": "inspiration"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "awesome-openclaw-skills glab",
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/sundial-org/awesome-openclaw-skills/tree/main/skills/glab",
|
|
43
|
+
"repo": "https://github.com/sundial-org/awesome-openclaw-skills",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"relationship": "inspiration"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"updates": []
|
|
49
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- Default token environment variable renamed from `GITLAB_TOKEN` to `PI_GITLAB_TOKEN` to avoid collisions with other tools. The `tokenEnv` setting still allows overriding to any custom env var.
|
|
12
|
+
|
|
13
|
+
## [0.3.0] - 2026-06-01
|
|
14
|
+
|
|
15
|
+
### Added (Phase 3 — Advanced tools + hardening + deprecation)
|
|
16
|
+
- **Release tools**: `gitlab_release_list`, `gitlab_release_view`, `gitlab_release_create` for full release management
|
|
17
|
+
- **Bulk operations**: `gitlab_mr_bulk_approve` — approve multiple MRs matching a label/milestone filter
|
|
18
|
+
- **Force-push safety**: `gitlab_force_push_safe` — force-push with branch protection re-enable and confirmation gate
|
|
19
|
+
- **Deprecation**: legacy `glab-gitlab` skill marked deprecated; `@gaodes/pi-gitlab` is now the canonical GitLab tool surface
|
|
20
|
+
- **README**: expanded with Phase 3 advanced tools table and deprecation section
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- All Phase 3 tools are confirm-gated following the same `requireConfirm` pattern as Phase 2
|
|
24
|
+
|
|
25
|
+
## [0.2.0] - 2026-06-01
|
|
26
|
+
|
|
27
|
+
### Added (Phase 2 — Mutating tools + confirmation UX)
|
|
28
|
+
- **Mutating tools**: `gitlab_mr_create`, `gitlab_mr_merge`, `gitlab_issue_create`, `gitlab_issue_close`, `gitlab_pipeline_run`
|
|
29
|
+
- **Confirmation utility**: `src/lib/confirm.ts` — `requireConfirm()` gates all mutating operations with `confirm:true` execution and `dryRun:true` preview
|
|
30
|
+
- **Setup guard**: all Phase 2 tools call `requireSetup(ctx.cwd)` at execute time, blocking when token or config is missing
|
|
31
|
+
- **In-package skills**: `gitlab-release` (release list/view/create patterns) and `gitlab-workflow` (cross-domain orchestration)
|
|
32
|
+
- **Guard behavior tests**: `test/tools/guard-behavior.test.ts` covers setup-required error shape and confirm gate
|
|
33
|
+
|
|
34
|
+
## [0.1.0] - 2026-06-01
|
|
35
|
+
|
|
36
|
+
### Added (Phase 1 — Read-only tools + diagnostics + wiring)
|
|
37
|
+
- Tools: `gitlab_project_resolve`, `gitlab_mr_list`, `gitlab_mr_view`, `gitlab_issue_list`, `gitlab_pipeline_status`, `gitlab_job_logs`, `gitlab_api`
|
|
38
|
+
- Lib helpers: glab runner, project cache, fallback resolution, pagination, redaction, shared schemas
|
|
39
|
+
- Config integration under `pi-gitlab` in `prime-settings.json`
|
|
40
|
+
- Setup guard to block tools until token + explicit config are valid
|
|
41
|
+
- `/gitlab-doctor` diagnostics and interactive setup wizard
|
|
42
|
+
- `resources_discover` wiring for in-package skills
|
|
43
|
+
- Package bootstrap metadata and provenance files
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
- `gitlab_api` now requires `confirm: true` for all mutating verbs (`POST`, `PUT`, `PATCH`, `DELETE`).
|
|
47
|
+
- Phase-2/3 mutating and release tool files removed from Phase-1 artifact scope.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 El Che
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# @gaodes/pi-gitlab
|
|
2
|
+
|
|
3
|
+
Pi extension package for GitLab workflows on `gitlab.elches.dev` using `glab` + in-package skills.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @gaodes/pi-gitlab
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires `glab >= 1.40.0` and a `PI_GITLAB_TOKEN` environment variable.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
1. Ensure `glab` is installed and authenticated:
|
|
16
|
+
```bash
|
|
17
|
+
glab auth status
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
2. Set `PI_GITLAB_TOKEN` and add a `pi-gitlab` configuration key to `prime-settings.json` (global or project). The extension blocks tool usage until both exist.
|
|
21
|
+
|
|
22
|
+
3. Run diagnostics:
|
|
23
|
+
```
|
|
24
|
+
/gitlab-doctor
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Tools
|
|
28
|
+
|
|
29
|
+
### Read-only (Phase 1)
|
|
30
|
+
|
|
31
|
+
| Tool | Description |
|
|
32
|
+
|------|-------------|
|
|
33
|
+
| `gitlab_project_resolve` | Resolve project path → numeric ID (with cache) |
|
|
34
|
+
| `gitlab_mr_list` | List MRs with filters and pagination |
|
|
35
|
+
| `gitlab_mr_view` | View MR details, discussions, diff |
|
|
36
|
+
| `gitlab_issue_list` | List issues with filters |
|
|
37
|
+
| `gitlab_pipeline_status` | Check pipeline status for a ref |
|
|
38
|
+
| `gitlab_job_logs` | Fetch CI job logs (redacted by default) |
|
|
39
|
+
| `gitlab_api` | Raw glab API passthrough. Mutating methods require `confirm:true`; without confirmation, returns preview-only result and does not execute |
|
|
40
|
+
|
|
41
|
+
### Mutating (Phase 2 — require `confirm:true`)
|
|
42
|
+
|
|
43
|
+
| Tool | Description |
|
|
44
|
+
|------|-------------|
|
|
45
|
+
| `gitlab_mr_create` | Create a merge request (title, description, draft, source/target branch) |
|
|
46
|
+
| `gitlab_mr_merge` | Merge an open merge request |
|
|
47
|
+
| `gitlab_issue_create` | Create an issue (title, description, labels, assignee, milestone) |
|
|
48
|
+
| `gitlab_issue_close` | Close an issue or mark it as resolved |
|
|
49
|
+
| `gitlab_pipeline_run` | Trigger a pipeline for a branch or tag |
|
|
50
|
+
|
|
51
|
+
All mutating tools require `confirm: true` to execute. Set `confirm: false, dryRun: true` to preview the operation without executing it.
|
|
52
|
+
|
|
53
|
+
### Advanced (Phase 3)
|
|
54
|
+
|
|
55
|
+
| Tool | Description |
|
|
56
|
+
|------|-------------|
|
|
57
|
+
| `gitlab_release_list` | List releases for a project |
|
|
58
|
+
| `gitlab_release_view` | View details of a single release |
|
|
59
|
+
| `gitlab_release_create` | Create a release (confirm-gated mutating operation) |
|
|
60
|
+
| `gitlab_mr_bulk_approve` | Approve multiple MRs matching a label/milestone filter (confirm-gated) |
|
|
61
|
+
| `gitlab_force_push_safe` | Force-push with branch protection re-enable and confirmation gate |
|
|
62
|
+
|
|
63
|
+
## Setup guard
|
|
64
|
+
|
|
65
|
+
On load, the extension checks for:
|
|
66
|
+
|
|
67
|
+
1. `PI_GITLAB_TOKEN` environment variable (or the env var named by `tokenEnv` in settings).
|
|
68
|
+
2. `pi-gitlab` configuration in `prime-settings.json` (global or project).
|
|
69
|
+
|
|
70
|
+
If either is missing, all tool calls are blocked. Run `/gitlab-doctor` to launch the interactive setup wizard, save the `pi-gitlab` config key, and verify readiness.
|
|
71
|
+
|
|
72
|
+
## Commands
|
|
73
|
+
|
|
74
|
+
- `/gitlab-doctor` — Run diagnostics for glab, auth, API, and config
|
|
75
|
+
|
|
76
|
+
## Skills
|
|
77
|
+
|
|
78
|
+
The package ships six in-package skills under `skills/`:
|
|
79
|
+
|
|
80
|
+
- `gitlab-assistant` — Hub router for GitLab operations
|
|
81
|
+
- `gitlab-mr` — MR lifecycle patterns (view, list, create, merge)
|
|
82
|
+
- `gitlab-issue` — Issue triage patterns (list, create, close)
|
|
83
|
+
- `gitlab-pipeline` — Pipeline diagnostics patterns (status, logs, run)
|
|
84
|
+
- `gitlab-release` — Release listing, viewing, and creation via `gitlab_api`
|
|
85
|
+
- `gitlab-workflow` — Cross-domain orchestration: release cuts, hotfixes, issue-to-MR flows
|
|
86
|
+
|
|
87
|
+
## Deprecation
|
|
88
|
+
|
|
89
|
+
This package supersedes the legacy `glab-gitlab` skill. That skill is marked deprecated in Phase 3 and remains as a read-only fallback reference. New GitLab automation should use `@gaodes/pi-gitlab` exclusively.
|
|
90
|
+
|
|
91
|
+
## Configuration
|
|
92
|
+
|
|
93
|
+
Key: `pi-gitlab` in `~/.pi/agent/prime-settings.json`
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"pi-gitlab": {
|
|
98
|
+
"hostname": "gitlab.elches.dev",
|
|
99
|
+
"sshHostname": "gitlab-ssh.elches.dev",
|
|
100
|
+
"sshPort": 2222,
|
|
101
|
+
"tokenEnv": "PI_GITLAB_TOKEN",
|
|
102
|
+
"defaultProjectPath": null,
|
|
103
|
+
"render": {
|
|
104
|
+
"tableMaxRows": 25,
|
|
105
|
+
"diffMaxLines": 400,
|
|
106
|
+
"logTailLines": 200
|
|
107
|
+
},
|
|
108
|
+
"safety": {
|
|
109
|
+
"requireConfirmForDelete": true,
|
|
110
|
+
"previewMutatingApiCalls": true,
|
|
111
|
+
"redactJobLogsByDefault": true,
|
|
112
|
+
"minGlabVersion": "1.40.0"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Project Resolution
|
|
119
|
+
|
|
120
|
+
The `project` parameter is optional on all tools. Resolution order:
|
|
121
|
+
1. Explicit parameter
|
|
122
|
+
2. Git remote `origin` in CWD
|
|
123
|
+
3. `defaultProjectPath` from settings
|
|
124
|
+
|
|
125
|
+
Resolved IDs are cached in `~/.pi/agent/cache/pi-gitlab/projects.json`.
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
[GitNexus] 1 related symbols found:
|
|
131
|
+
|
|
132
|
+
README.md (README.md)
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gaodes/pi-gitlab",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Pi extension package for GitLab workflows via glab CLI with in-package skills.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package",
|
|
7
|
+
"pi-extension",
|
|
8
|
+
"gitlab",
|
|
9
|
+
"glab"
|
|
10
|
+
],
|
|
11
|
+
"type": "module",
|
|
12
|
+
"private": false,
|
|
13
|
+
"main": "./src/index.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"src/commands",
|
|
16
|
+
"src/config",
|
|
17
|
+
"src/events",
|
|
18
|
+
"src/index.ts",
|
|
19
|
+
"src/lib",
|
|
20
|
+
"src/tools",
|
|
21
|
+
"skills",
|
|
22
|
+
"README.md",
|
|
23
|
+
"CHANGELOG.md",
|
|
24
|
+
"LICENSE",
|
|
25
|
+
".upstream.json",
|
|
26
|
+
".primecodex.json"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"lint": "biome check .",
|
|
31
|
+
"format": "biome check --write .",
|
|
32
|
+
"test": "vitest run --passWithNoTests"
|
|
33
|
+
},
|
|
34
|
+
"pi": {
|
|
35
|
+
"extensions": [
|
|
36
|
+
"./src/index.ts"
|
|
37
|
+
],
|
|
38
|
+
"skills": [
|
|
39
|
+
"./skills"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@biomejs/biome": "^2.4.3",
|
|
44
|
+
"@earendil-works/pi-coding-agent": "^0.78.0",
|
|
45
|
+
"@types/node": "^22.0.0",
|
|
46
|
+
"typebox": "^1.1.39",
|
|
47
|
+
"typescript": "^5.6.2",
|
|
48
|
+
"vitest": "^4.1.5"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@earendil-works/pi-ai": ">=0.74.0 <1",
|
|
52
|
+
"@earendil-works/pi-coding-agent": ">=0.74.0 <1",
|
|
53
|
+
"@earendil-works/pi-tui": ">=0.74.0 <1",
|
|
54
|
+
"typebox": ">=1.1.0 <2"
|
|
55
|
+
},
|
|
56
|
+
"peerDependenciesMeta": {
|
|
57
|
+
"@earendil-works/pi-ai": {
|
|
58
|
+
"optional": true
|
|
59
|
+
},
|
|
60
|
+
"@earendil-works/pi-coding-agent": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"@earendil-works/pi-tui": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
66
|
+
"typebox": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
72
|
+
},
|
|
73
|
+
"repository": {
|
|
74
|
+
"type": "git",
|
|
75
|
+
"url": "git+https://github.com/gaodes/pi-gitlab.git"
|
|
76
|
+
},
|
|
77
|
+
"license": "MIT",
|
|
78
|
+
"author": "El Che"
|
|
79
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-assistant
|
|
3
|
+
description: >
|
|
4
|
+
Hub router for all GitLab operations. Entry point when the user mentions
|
|
5
|
+
GitLab, merge requests, issues, pipelines, releases, glab, MRs, CI/CD,
|
|
6
|
+
or repositories. Routes to specialized skills based on intent.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GitLab Assistant
|
|
10
|
+
|
|
11
|
+
You are the entry point for GitLab workflows on `gitlab.elches.dev`.
|
|
12
|
+
|
|
13
|
+
## Routing
|
|
14
|
+
|
|
15
|
+
| Intent | Skill to use |
|
|
16
|
+
|--------|-------------|
|
|
17
|
+
| MR lifecycle (create, view, list, merge) | `gitlab-mr` |
|
|
18
|
+
| Issue triage (create, list, close, comment) | `gitlab-issue` |
|
|
19
|
+
| Pipeline / CI status, logs, retry | `gitlab-pipeline` |
|
|
20
|
+
| Raw API calls, complex queries | `gitlab_api` tool directly |
|
|
21
|
+
| Setup / diagnostics | `/gitlab-doctor` command |
|
|
22
|
+
|
|
23
|
+
## Rules
|
|
24
|
+
|
|
25
|
+
- Always prefer dedicated tools over raw `gitlab_api`.
|
|
26
|
+
- If a project is not specified, tools fall back to the current git remote or settings default.
|
|
27
|
+
- All mutating API calls require `confirm: true`. Without confirmation, returns a preview-only result and does not execute.
|
|
28
|
+
- Never expose tokens or credentials in output.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-issue
|
|
3
|
+
description: >
|
|
4
|
+
GitLab issue triage and workflow support. Use for creating, listing,
|
|
5
|
+
viewing, and closing issues.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# GitLab Issue Skill
|
|
9
|
+
|
|
10
|
+
## Patterns
|
|
11
|
+
|
|
12
|
+
### List open issues
|
|
13
|
+
```
|
|
14
|
+
gitlab_issue_list({ project: "namespace/project" })
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Create issue
|
|
18
|
+
```
|
|
19
|
+
gitlab_issue_create({
|
|
20
|
+
project: "namespace/project",
|
|
21
|
+
title: "Bug: ...",
|
|
22
|
+
description: "## Steps to reproduce\n...",
|
|
23
|
+
labels: ["bug", "urgent"],
|
|
24
|
+
confirm: true
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Close issue
|
|
29
|
+
```
|
|
30
|
+
gitlab_issue_close({
|
|
31
|
+
project: "namespace/project",
|
|
32
|
+
issueId: 123,
|
|
33
|
+
confirm: true
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- Always preview with `dryRun: true` before creating or closing.
|
|
40
|
+
- Require `confirm: true` for create and close.
|
|
41
|
+
- Use labels consistently with project conventions.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-mr
|
|
3
|
+
description: >
|
|
4
|
+
Merge request lifecycle support for GitLab. Use for creating, listing,
|
|
5
|
+
viewing, and merging MRs with confirmation UX.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# GitLab MR Skill
|
|
9
|
+
|
|
10
|
+
## Patterns
|
|
11
|
+
|
|
12
|
+
### List open MRs
|
|
13
|
+
```
|
|
14
|
+
gitlab_mr_list({ project: "namespace/project" })
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### View MR details
|
|
18
|
+
```
|
|
19
|
+
gitlab_mr_view({ project: "namespace/project", mrId: 42 })
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Create MR
|
|
23
|
+
```
|
|
24
|
+
gitlab_mr_create({
|
|
25
|
+
project: "namespace/project",
|
|
26
|
+
sourceBranch: "feature/x",
|
|
27
|
+
targetBranch: "main",
|
|
28
|
+
title: "Add feature X",
|
|
29
|
+
description: "## Summary\n...",
|
|
30
|
+
confirm: true
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Merge MR
|
|
35
|
+
```
|
|
36
|
+
gitlab_mr_merge({
|
|
37
|
+
project: "namespace/project",
|
|
38
|
+
mrId: 42,
|
|
39
|
+
squash: true,
|
|
40
|
+
confirm: true
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Rules
|
|
45
|
+
|
|
46
|
+
- Always preview with `dryRun: true` before mutating.
|
|
47
|
+
- Require `confirm: true` for create and merge.
|
|
48
|
+
- Check pipeline status before merging.
|
|
49
|
+
- Never merge without user confirmation.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-pipeline
|
|
3
|
+
description: >
|
|
4
|
+
Pipeline diagnostics, status checks, and CI troubleshooting for GitLab.
|
|
5
|
+
Use for checking pipeline status, fetching job logs, and triggering runs.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# GitLab Pipeline Skill
|
|
9
|
+
|
|
10
|
+
## Patterns
|
|
11
|
+
|
|
12
|
+
### Check latest pipeline status
|
|
13
|
+
```
|
|
14
|
+
gitlab_pipeline_status({ project: "namespace/project", ref: "main" })
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Fetch job logs
|
|
18
|
+
```
|
|
19
|
+
gitlab_job_logs({ project: "namespace/project", jobId: 456, tail: 100 })
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Trigger pipeline
|
|
23
|
+
```
|
|
24
|
+
gitlab_pipeline_run({
|
|
25
|
+
project: "namespace/project",
|
|
26
|
+
ref: "main",
|
|
27
|
+
confirm: true
|
|
28
|
+
})
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Rules
|
|
32
|
+
|
|
33
|
+
- Check pipeline status before merging MRs.
|
|
34
|
+
- Use `tail` to limit log output; default is 200 lines.
|
|
35
|
+
- Logs are redacted by default for secrets.
|
|
36
|
+
- Triggering pipelines requires `confirm: true`.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-release
|
|
3
|
+
description: >
|
|
4
|
+
GitLab release management. Use for listing, viewing, and creating
|
|
5
|
+
releases tied to Git tags on gitlab.elches.dev. Requires glab and
|
|
6
|
+
confirm for mutating operations.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GitLab Release Skill
|
|
10
|
+
|
|
11
|
+
## Patterns
|
|
12
|
+
|
|
13
|
+
### List releases
|
|
14
|
+
```
|
|
15
|
+
gitlab_api({ endpoint: "projects/:project/releases" })
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### View a single release
|
|
19
|
+
```
|
|
20
|
+
gitlab_api({ endpoint: "projects/:project/releases/:tag", project: "namespace/project" })
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Create a release from a tag
|
|
24
|
+
```
|
|
25
|
+
gitlab_api({
|
|
26
|
+
method: "POST",
|
|
27
|
+
endpoint: "projects/:project/releases",
|
|
28
|
+
project: "namespace/project",
|
|
29
|
+
body: {
|
|
30
|
+
tag_name: "v1.2.0",
|
|
31
|
+
name: "v1.2.0",
|
|
32
|
+
description: "## What changed\n...",
|
|
33
|
+
ref: "main"
|
|
34
|
+
},
|
|
35
|
+
confirm: true
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Rules
|
|
40
|
+
|
|
41
|
+
- Always resolve project path with `gitlab_project_resolve` before calling `gitlab_api` with `:project`.
|
|
42
|
+
- Creating releases requires `confirm: true`; list and view are read-only.
|
|
43
|
+
- Use `glab api` with numeric project IDs — path-encoded URLs break behind the local reverse proxy.
|
|
44
|
+
- Tag must exist before creating a release; create the tag first if needed.
|
|
45
|
+
- Keep release notes in Keep a Changelog format when possible.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-workflow
|
|
3
|
+
description: >
|
|
4
|
+
Cross-domain GitLab workflow orchestration on gitlab.elches.dev.
|
|
5
|
+
Combines tools into multi-step flows like release cut, hotfix, and
|
|
6
|
+
issue-to-MR pipelines. Routes to focused skills for individual steps.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GitLab Workflow Skill
|
|
10
|
+
|
|
11
|
+
## Patterns
|
|
12
|
+
|
|
13
|
+
### Release cut flow
|
|
14
|
+
1. Check pipeline status with `gitlab_pipeline_status` on the target branch.
|
|
15
|
+
2. Verify all MRs are merged with `gitlab_mr_list` (state: merged).
|
|
16
|
+
3. Create a Git tag via `git_tag` (pi-git).
|
|
17
|
+
4. Create the release with `gitlab-release` skill.
|
|
18
|
+
5. Push and verify with `gitlab_api` (GET release).
|
|
19
|
+
|
|
20
|
+
### Hotfix flow
|
|
21
|
+
1. Create a branch from the tagged release with `git_branch_create` (pi-git).
|
|
22
|
+
2. Create an MR targeting the release branch with `gitlab-mr` skill.
|
|
23
|
+
3. Monitor pipeline with `gitlab_pipeline_status`.
|
|
24
|
+
4. Merge with `gitlab_mr_merge` (confirm required).
|
|
25
|
+
5. Tag and release via `gitlab-release` skill.
|
|
26
|
+
|
|
27
|
+
### Issue-to-MR flow
|
|
28
|
+
1. List issues with `gitlab_issue_list` (labels, state).
|
|
29
|
+
2. Create a branch referencing the issue number.
|
|
30
|
+
3. Create an MR with `Closes #N` in the description via `gitlab-mr` skill.
|
|
31
|
+
4. Track pipeline and merge when green.
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
|
|
35
|
+
- Every mutating step requires explicit `confirm: true`.
|
|
36
|
+
- Prefer dedicated tools over raw `gitlab_api` for each step.
|
|
37
|
+
- Use numeric project IDs for all `glab api` calls — path-encoded URLs break behind the reverse proxy.
|
|
38
|
+
- Resolve the project once with `gitlab_project_resolve` and reuse the ID across steps.
|
|
39
|
+
- After merge, wait for pipeline to pass before tagging or releasing.
|