@gaodes/pi-gitlab 0.3.0 → 0.4.2
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 +3 -3
- package/CHANGELOG.md +40 -1
- package/README.md +4 -4
- package/package.json +1 -1
- package/skills/gitlab-assistant/SKILL.md +1 -1
- package/skills/gitlab-badge/SKILL.md +77 -0
- package/skills/gitlab-ci/SKILL.md +69 -0
- package/skills/gitlab-container/SKILL.md +67 -0
- package/skills/gitlab-discussion/SKILL.md +97 -0
- package/skills/gitlab-file/SKILL.md +86 -0
- package/skills/gitlab-group/SKILL.md +92 -0
- package/skills/gitlab-label/SKILL.md +64 -0
- package/skills/gitlab-milestone/SKILL.md +68 -0
- package/skills/gitlab-protected-branch/SKILL.md +61 -0
- package/skills/gitlab-release/SKILL.md +1 -1
- package/skills/gitlab-repo/SKILL.md +72 -0
- package/skills/gitlab-search/SKILL.md +47 -0
- package/skills/gitlab-variable/SKILL.md +69 -0
- package/skills/gitlab-vulnerability/SKILL.md +74 -0
- package/skills/gitlab-webhook/SKILL.md +79 -0
- package/skills/gitlab-wiki/SKILL.md +70 -0
- package/skills/gitlab-workflow/SKILL.md +1 -1
- package/src/commands/gitlab-doctor.ts +12 -4
- package/src/config/loader.ts +13 -1
- package/src/config/types.ts +4 -4
- package/src/index.ts +14 -1
- package/src/lib/env.ts +2 -3
- package/src/lib/projectCache.ts +17 -1
- package/src/lib/schemas.ts +1 -1
- package/src/tools/gitlab_ci_lint.ts +138 -0
- package/src/tools/gitlab_force_push_safe.ts +18 -10
- package/src/tools/gitlab_issue_close.ts +16 -4
- package/src/tools/gitlab_issue_create.ts +19 -5
- package/src/tools/gitlab_issue_list.ts +5 -5
- package/src/tools/gitlab_job_logs.ts +5 -5
- package/src/tools/gitlab_mr_bulk_approve.ts +4 -2
- package/src/tools/gitlab_mr_create.ts +1 -1
- package/src/tools/gitlab_mr_list.ts +5 -5
- package/src/tools/gitlab_mr_merge.ts +2 -4
- package/src/tools/gitlab_mr_view.ts +5 -5
- package/src/tools/gitlab_pipeline_run.ts +29 -10
- package/src/tools/gitlab_pipeline_status.ts +5 -5
- package/src/tools/gitlab_project_resolve.ts +5 -5
- package/src/tools/gitlab_release_create.ts +2 -3
- package/src/tools/gitlab_release_list.ts +4 -9
- package/src/tools/gitlab_release_view.ts +8 -3
- package/src/tools/gitlab_repo_view.ts +116 -0
- package/src/tools/gitlab_search_query.ts +221 -0
package/.primecodex.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"updatedAt": "2026-06-01T08:
|
|
3
|
+
"updatedAt": "2026-06-01T08:15:00+0300",
|
|
4
4
|
"kind": "package",
|
|
5
5
|
"name": "pi-gitlab",
|
|
6
6
|
"source": "ssh://git@gitlab-ssh.elches.dev:2222/agents/primecodex/packages/pi-gitlab.git",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"npm": {
|
|
14
14
|
"name": "@gaodes/pi-gitlab",
|
|
15
15
|
"scope": "@gaodes",
|
|
16
|
-
"published":
|
|
17
|
-
"publishedUnderGaodes":
|
|
16
|
+
"published": true,
|
|
17
|
+
"publishedUnderGaodes": true
|
|
18
18
|
}
|
|
19
19
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -7,8 +7,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.2] - 2026-06-01
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Auto-derive apiBase from hostname in loadConfig and writeConfig when apiBase is not explicitly set
|
|
14
|
+
|
|
15
|
+
## [0.4.1] - 2026-06-01
|
|
16
|
+
|
|
10
17
|
### Changed
|
|
11
|
-
-
|
|
18
|
+
- Removed hardcoded personal GitLab instance hostname from `DEFAULT_CONFIG` — defaults are now empty strings, forcing users through setup wizard on first use
|
|
19
|
+
- Replaced personal instance references in skills and README with generic placeholder text
|
|
20
|
+
- Fixed lint warnings across codebase (unused imports, formatting)
|
|
21
|
+
|
|
22
|
+
## [0.4.0] - 2026-06-01
|
|
23
|
+
|
|
24
|
+
### Added (Phase 4 — 15 new skills + 3 new tools)
|
|
25
|
+
|
|
26
|
+
**New skills:**
|
|
27
|
+
- `gitlab-badge` — project badge management (list, create, update, delete, preview)
|
|
28
|
+
- `gitlab-ci` — CI/CD pipeline and job operations (status, run, retry, trace, lint, artifacts)
|
|
29
|
+
- `gitlab-container` — container registry management (repositories, tags, cleanup)
|
|
30
|
+
- `gitlab-discussion` — threaded discussion management on MRs and issues
|
|
31
|
+
- `gitlab-file` — repository file operations via API (read, blame, create, update, delete)
|
|
32
|
+
- `gitlab-group` — group management (list, create, members, subgroups, projects)
|
|
33
|
+
- `gitlab-label` — label management via CLI and API
|
|
34
|
+
- `gitlab-milestone` — milestone and sprint management via CLI and API
|
|
35
|
+
- `gitlab-protected-branch` — branch protection rule management
|
|
36
|
+
- `gitlab-repo` — repository/project operations (clone, fork, view, create, archive)
|
|
37
|
+
- `gitlab-search` — search across GitLab (projects, issues, MRs, code, commits, users, wiki)
|
|
38
|
+
- `gitlab-variable` — CI/CD variable management via CLI and API
|
|
39
|
+
- `gitlab-vulnerability` — security vulnerability management (list, confirm, dismiss, resolve)
|
|
40
|
+
- `gitlab-webhook` — webhook management (list, create, update, delete, test)
|
|
41
|
+
- `gitlab-wiki` — wiki page management (list, read, create, update, delete, attachments)
|
|
42
|
+
|
|
43
|
+
**New tools:**
|
|
44
|
+
- `gitlab_search_query` — structured search across GitLab globally, within a group, or project
|
|
45
|
+
- `gitlab_ci_lint` — validate `.gitlab-ci.yml` configuration via CI lint API
|
|
46
|
+
- `gitlab_repo_view` — view detailed project/repository info with stats
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
- Updated `index.ts` header docstring to include Phase 4 tools and skills
|
|
12
50
|
|
|
13
51
|
## [0.3.0] - 2026-06-01
|
|
14
52
|
|
|
@@ -21,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
21
59
|
|
|
22
60
|
### Changed
|
|
23
61
|
- All Phase 3 tools are confirm-gated following the same `requireConfirm` pattern as Phase 2
|
|
62
|
+
- 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.
|
|
24
63
|
|
|
25
64
|
## [0.2.0] - 2026-06-01
|
|
26
65
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @gaodes/pi-gitlab
|
|
2
2
|
|
|
3
|
-
Pi extension package for GitLab workflows
|
|
3
|
+
Pi extension package for GitLab workflows using `glab` + in-package skills.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -95,9 +95,9 @@ Key: `pi-gitlab` in `~/.pi/agent/prime-settings.json`
|
|
|
95
95
|
```json
|
|
96
96
|
{
|
|
97
97
|
"pi-gitlab": {
|
|
98
|
-
"hostname": "gitlab.
|
|
99
|
-
"sshHostname": "gitlab-ssh.
|
|
100
|
-
"sshPort":
|
|
98
|
+
"hostname": "gitlab.example.com",
|
|
99
|
+
"sshHostname": "gitlab-ssh.example.com",
|
|
100
|
+
"sshPort": 22,
|
|
101
101
|
"tokenEnv": "PI_GITLAB_TOKEN",
|
|
102
102
|
"defaultProjectPath": null,
|
|
103
103
|
"render": {
|
package/package.json
CHANGED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-badge
|
|
3
|
+
description: >
|
|
4
|
+
GitLab project badge management. Use for listing, creating, updating,
|
|
5
|
+
and deleting project badges, previewing badge rendering, and managing
|
|
6
|
+
group-level badges.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GitLab Badge Skill
|
|
10
|
+
|
|
11
|
+
## Patterns
|
|
12
|
+
|
|
13
|
+
### List project badges
|
|
14
|
+
```
|
|
15
|
+
gitlab_api({ endpoint: "projects/:project/badges", project: "namespace/project" })
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Get a specific badge
|
|
19
|
+
```
|
|
20
|
+
gitlab_api({ endpoint: "projects/:project/badges/:badge_id", project: "namespace/project" })
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Create a badge
|
|
24
|
+
```
|
|
25
|
+
gitlab_api({
|
|
26
|
+
endpoint: "projects/:project/badges",
|
|
27
|
+
project: "namespace/project",
|
|
28
|
+
method: "POST",
|
|
29
|
+
body: {
|
|
30
|
+
link_url: "https://example.com",
|
|
31
|
+
image_url: "https://img.shields.io/badge/build-passing-brightgreen"
|
|
32
|
+
},
|
|
33
|
+
confirm: true
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Update a badge
|
|
38
|
+
```
|
|
39
|
+
gitlab_api({
|
|
40
|
+
endpoint: "projects/:project/badges/:badge_id",
|
|
41
|
+
project: "namespace/project",
|
|
42
|
+
method: "PUT",
|
|
43
|
+
body: { image_url: "https://new-badge-url" },
|
|
44
|
+
confirm: true
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Delete a badge
|
|
49
|
+
```
|
|
50
|
+
gitlab_api({
|
|
51
|
+
endpoint: "projects/:project/badges/:badge_id",
|
|
52
|
+
project: "namespace/project",
|
|
53
|
+
method: "DELETE",
|
|
54
|
+
confirm: true
|
|
55
|
+
})
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Preview badge rendering
|
|
59
|
+
```
|
|
60
|
+
gitlab_api({
|
|
61
|
+
endpoint: "projects/:project/badges/render",
|
|
62
|
+
project: "namespace/project",
|
|
63
|
+
query: { link_url: "https://example.com", image_url: "https://img.shields.io/..." }
|
|
64
|
+
})
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### List group badges
|
|
68
|
+
```
|
|
69
|
+
gitlab_api({ endpoint: "groups/:group_id/badges" })
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Rules
|
|
73
|
+
|
|
74
|
+
- All mutating operations (create, update, delete) require `confirm: true`.
|
|
75
|
+
- Badge IDs are numeric; use list first to find the ID.
|
|
76
|
+
- `link_url` and `image_url` are required when creating badges.
|
|
77
|
+
- For group badges, use the group numeric ID (not path).
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-ci
|
|
3
|
+
description: >
|
|
4
|
+
GitLab CI/CD pipeline and job operations. Use for viewing pipeline
|
|
5
|
+
status, running pipelines, retrying jobs, tracing logs, downloading
|
|
6
|
+
artifacts, and linting CI configuration.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GitLab CI/CD Skill
|
|
10
|
+
|
|
11
|
+
## Patterns
|
|
12
|
+
|
|
13
|
+
### Check pipeline status
|
|
14
|
+
```
|
|
15
|
+
gitlab_pipeline_status({ project: "namespace/project", ref: "main" })
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### View CI status (current branch)
|
|
19
|
+
```bash
|
|
20
|
+
glab ci status
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### View pipeline details
|
|
24
|
+
```bash
|
|
25
|
+
glab ci view
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### List pipelines
|
|
29
|
+
```bash
|
|
30
|
+
glab ci list
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Run a pipeline
|
|
34
|
+
```
|
|
35
|
+
gitlab_pipeline_run({ project: "namespace/project", ref: "main", confirm: true })
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Retry a failed job
|
|
39
|
+
```bash
|
|
40
|
+
glab ci retry <job-id>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Trace job logs
|
|
44
|
+
```
|
|
45
|
+
gitlab_job_logs({ project: "namespace/project", jobId: 123, tail: 100 })
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Download artifacts
|
|
49
|
+
```bash
|
|
50
|
+
glab ci artifact -b <branch> -j <job-name>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Lint CI configuration
|
|
54
|
+
```
|
|
55
|
+
gitlab_ci_lint({ project: "namespace/project" })
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Delete a pipeline
|
|
59
|
+
```bash
|
|
60
|
+
glab ci delete <pipeline-id>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Rules
|
|
64
|
+
|
|
65
|
+
- All mutating operations require `confirm: true`.
|
|
66
|
+
- Use `gitlab_pipeline_status` for structured pipeline info; use `glab ci status` for quick terminal view.
|
|
67
|
+
- Use `gitlab_job_logs` for structured log fetching with redaction.
|
|
68
|
+
- CI lint validates `.gitlab-ci.yml` without running a pipeline.
|
|
69
|
+
- For CI/CD variables, use the `gitlab-variable` skill instead.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-container
|
|
3
|
+
description: >
|
|
4
|
+
GitLab container registry management. Use for listing repositories,
|
|
5
|
+
viewing and deleting image tags, and cleaning up old container images.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# GitLab Container Registry Skill
|
|
9
|
+
|
|
10
|
+
## Patterns
|
|
11
|
+
|
|
12
|
+
### List container repositories
|
|
13
|
+
```
|
|
14
|
+
gitlab_api({ endpoint: "projects/:project/registry/repositories", project: "namespace/project" })
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Get a specific repository
|
|
18
|
+
```
|
|
19
|
+
gitlab_api({ endpoint: "projects/:project/registry/repositories/:repo_id", project: "namespace/project" })
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### List tags in a repository
|
|
23
|
+
```
|
|
24
|
+
gitlab_api({ endpoint: "projects/:project/registry/repositories/:repo_id/tags", project: "namespace/project" })
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Get tag details
|
|
28
|
+
```
|
|
29
|
+
gitlab_api({ endpoint: "projects/:project/registry/repositories/:repo_id/tags/:tag", project: "namespace/project" })
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Delete a tag
|
|
33
|
+
```
|
|
34
|
+
gitlab_api({
|
|
35
|
+
endpoint: "projects/:project/registry/repositories/:repo_id/tags/:tag",
|
|
36
|
+
project: "namespace/project",
|
|
37
|
+
method: "DELETE",
|
|
38
|
+
confirm: true
|
|
39
|
+
})
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Bulk delete tags by regex
|
|
43
|
+
```
|
|
44
|
+
gitlab_api({
|
|
45
|
+
endpoint: "projects/:project/registry/repositories/:repo_id/tags",
|
|
46
|
+
project: "namespace/project",
|
|
47
|
+
method: "DELETE",
|
|
48
|
+
body: { name_regex: ".*", keep_n: 5 },
|
|
49
|
+
confirm: true
|
|
50
|
+
})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Delete entire repository
|
|
54
|
+
```
|
|
55
|
+
gitlab_api({
|
|
56
|
+
endpoint: "projects/:project/registry/repositories/:repo_id",
|
|
57
|
+
project: "namespace/project",
|
|
58
|
+
method: "DELETE",
|
|
59
|
+
confirm: true
|
|
60
|
+
})
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Rules
|
|
64
|
+
|
|
65
|
+
- Container deletion operations are **destructive and irreversible** — always confirm with the user before proceeding.
|
|
66
|
+
- Use `keep_n` when bulk-deleting to preserve recent tags.
|
|
67
|
+
- Repository and tag IDs are numeric; list first to find IDs.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-discussion
|
|
3
|
+
description: >
|
|
4
|
+
GitLab threaded discussion management on merge requests and issues.
|
|
5
|
+
Use for listing, creating, and replying to discussion threads, and
|
|
6
|
+
resolving or unresolving discussions.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GitLab Discussion Skill
|
|
10
|
+
|
|
11
|
+
## Patterns
|
|
12
|
+
|
|
13
|
+
### List MR discussions
|
|
14
|
+
```
|
|
15
|
+
gitlab_api({ endpoint: "projects/:project/merge_requests/:iid/discussions", project: "namespace/project" })
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### List issue discussions
|
|
19
|
+
```
|
|
20
|
+
gitlab_api({ endpoint: "projects/:project/issues/:iid/discussions", project: "namespace/project" })
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Get a specific discussion
|
|
24
|
+
```
|
|
25
|
+
gitlab_api({ endpoint: "projects/:project/merge_requests/:iid/discussions/:discussion_id", project: "namespace/project" })
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Create a new discussion thread on an MR
|
|
29
|
+
```
|
|
30
|
+
gitlab_api({
|
|
31
|
+
endpoint: "projects/:project/merge_requests/:iid/discussions",
|
|
32
|
+
project: "namespace/project",
|
|
33
|
+
method: "POST",
|
|
34
|
+
body: { body: "Review comment on this MR" },
|
|
35
|
+
confirm: true
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Create a position-based (line-specific) discussion
|
|
40
|
+
```
|
|
41
|
+
gitlab_api({
|
|
42
|
+
endpoint: "projects/:project/merge_requests/:iid/discussions",
|
|
43
|
+
project: "namespace/project",
|
|
44
|
+
method: "POST",
|
|
45
|
+
body: {
|
|
46
|
+
body: "Nit: consider using const here",
|
|
47
|
+
position: {
|
|
48
|
+
base_sha: "abc123",
|
|
49
|
+
head_sha: "def456",
|
|
50
|
+
start_sha: "abc123",
|
|
51
|
+
position_type: "text",
|
|
52
|
+
new_path: "src/index.ts",
|
|
53
|
+
new_line: 42
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
confirm: true
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Reply to a discussion
|
|
61
|
+
```
|
|
62
|
+
gitlab_api({
|
|
63
|
+
endpoint: "projects/:project/merge_requests/:iid/discussions/:discussion_id/notes",
|
|
64
|
+
project: "namespace/project",
|
|
65
|
+
method: "POST",
|
|
66
|
+
body: { body: "Agreed, will fix" },
|
|
67
|
+
confirm: true
|
|
68
|
+
})
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Resolve a discussion
|
|
72
|
+
```
|
|
73
|
+
gitlab_api({
|
|
74
|
+
endpoint: "projects/:project/merge_requests/:iid/discussions/:discussion_id",
|
|
75
|
+
project: "namespace/project",
|
|
76
|
+
method: "PUT",
|
|
77
|
+
body: { resolved: true },
|
|
78
|
+
confirm: true
|
|
79
|
+
})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Delete a note
|
|
83
|
+
```
|
|
84
|
+
gitlab_api({
|
|
85
|
+
endpoint: "projects/:project/merge_requests/:iid/discussions/:discussion_id/notes/:note_id",
|
|
86
|
+
project: "namespace/project",
|
|
87
|
+
method: "DELETE",
|
|
88
|
+
confirm: true
|
|
89
|
+
})
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Rules
|
|
93
|
+
|
|
94
|
+
- All mutating operations require `confirm: true`.
|
|
95
|
+
- For line-specific code review comments, include the `position` object with SHA references.
|
|
96
|
+
- Discussion IDs and note IDs are numeric; list discussions first.
|
|
97
|
+
- Use `resolved: false` to unresolve a previously resolved discussion.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-file
|
|
3
|
+
description: >
|
|
4
|
+
GitLab repository file operations via API. Use for reading file content,
|
|
5
|
+
blame info, and creating, updating, or deleting files through the
|
|
6
|
+
GitLab API (not local files).
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# GitLab File Skill
|
|
10
|
+
|
|
11
|
+
## Patterns
|
|
12
|
+
|
|
13
|
+
### Get file metadata and content (base64)
|
|
14
|
+
```
|
|
15
|
+
gitlab_api({
|
|
16
|
+
endpoint: "projects/:project/repository/files/:encoded_path",
|
|
17
|
+
project: "namespace/project",
|
|
18
|
+
query: { ref: "main" }
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Get raw file content
|
|
23
|
+
```
|
|
24
|
+
gitlab_api({
|
|
25
|
+
endpoint: "projects/:project/repository/files/:encoded_path/raw",
|
|
26
|
+
project: "namespace/project",
|
|
27
|
+
query: { ref: "main" }
|
|
28
|
+
})
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Get file blame info
|
|
32
|
+
```
|
|
33
|
+
gitlab_api({
|
|
34
|
+
endpoint: "projects/:project/repository/files/:encoded_path/blame",
|
|
35
|
+
project: "namespace/project",
|
|
36
|
+
query: { ref: "main" }
|
|
37
|
+
})
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Create a file
|
|
41
|
+
```
|
|
42
|
+
gitlab_api({
|
|
43
|
+
endpoint: "projects/:project/repository/files/:encoded_path",
|
|
44
|
+
project: "namespace/project",
|
|
45
|
+
method: "POST",
|
|
46
|
+
body: {
|
|
47
|
+
branch: "main",
|
|
48
|
+
content: "file content here",
|
|
49
|
+
commit_message: "Add new file"
|
|
50
|
+
},
|
|
51
|
+
confirm: true
|
|
52
|
+
})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Update a file
|
|
56
|
+
```
|
|
57
|
+
gitlab_api({
|
|
58
|
+
endpoint: "projects/:project/repository/files/:encoded_path",
|
|
59
|
+
project: "namespace/project",
|
|
60
|
+
method: "PUT",
|
|
61
|
+
body: {
|
|
62
|
+
branch: "main",
|
|
63
|
+
content: "updated content",
|
|
64
|
+
commit_message: "Update file"
|
|
65
|
+
},
|
|
66
|
+
confirm: true
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Delete a file
|
|
71
|
+
```
|
|
72
|
+
gitlab_api({
|
|
73
|
+
endpoint: "projects/:project/repository/files/:encoded_path",
|
|
74
|
+
project: "namespace/project",
|
|
75
|
+
method: "DELETE",
|
|
76
|
+
body: { branch: "main", commit_message: "Remove file" },
|
|
77
|
+
confirm: true
|
|
78
|
+
})
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Rules
|
|
82
|
+
|
|
83
|
+
- File paths in endpoints must be URL-encoded (e.g. `src%2Findex.ts`).
|
|
84
|
+
- All mutating operations require `confirm: true`.
|
|
85
|
+
- `branch` and `commit_message` are required for create, update, and delete.
|
|
86
|
+
- For editing local files, use file editing tools — this skill is for API-side file operations only.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-group
|
|
3
|
+
description: >
|
|
4
|
+
GitLab group management. Use for listing and managing groups,
|
|
5
|
+
subgroups, group membership, and group-level projects.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# GitLab Group Skill
|
|
9
|
+
|
|
10
|
+
## Patterns
|
|
11
|
+
|
|
12
|
+
### List groups
|
|
13
|
+
```
|
|
14
|
+
gitlab_api({ endpoint: "groups" })
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Get group details
|
|
18
|
+
```
|
|
19
|
+
gitlab_api({ endpoint: "groups/:group_id" })
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### List subgroups
|
|
23
|
+
```
|
|
24
|
+
gitlab_api({ endpoint: "groups/:group_id/subgroups" })
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### List projects in a group
|
|
28
|
+
```
|
|
29
|
+
gitlab_api({ endpoint: "groups/:group_id/projects" })
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### List group members
|
|
33
|
+
```
|
|
34
|
+
gitlab_api({ endpoint: "groups/:group_id/members" })
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Add a member to a group
|
|
38
|
+
```
|
|
39
|
+
gitlab_api({
|
|
40
|
+
endpoint: "groups/:group_id/members",
|
|
41
|
+
method: "POST",
|
|
42
|
+
body: { user_id: 42, access_level: 30 },
|
|
43
|
+
confirm: true
|
|
44
|
+
})
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Update member access level
|
|
48
|
+
```
|
|
49
|
+
gitlab_api({
|
|
50
|
+
endpoint: "groups/:group_id/members/:user_id",
|
|
51
|
+
method: "PUT",
|
|
52
|
+
body: { access_level: 40 },
|
|
53
|
+
confirm: true
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Remove a member
|
|
58
|
+
```
|
|
59
|
+
gitlab_api({
|
|
60
|
+
endpoint: "groups/:group_id/members/:user_id",
|
|
61
|
+
method: "DELETE",
|
|
62
|
+
confirm: true
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Create a group
|
|
67
|
+
```
|
|
68
|
+
gitlab_api({
|
|
69
|
+
endpoint: "groups",
|
|
70
|
+
method: "POST",
|
|
71
|
+
body: { name: "new-group", path: "new-group" },
|
|
72
|
+
confirm: true
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Share a project with a group
|
|
77
|
+
```
|
|
78
|
+
gitlab_api({
|
|
79
|
+
endpoint: "projects/:project/share",
|
|
80
|
+
project: "namespace/project",
|
|
81
|
+
method: "POST",
|
|
82
|
+
body: { group_id: 42, group_access: 30 },
|
|
83
|
+
confirm: true
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Rules
|
|
88
|
+
|
|
89
|
+
- All mutating operations require `confirm: true`.
|
|
90
|
+
- Use numeric group IDs (not paths) in API endpoints.
|
|
91
|
+
- Access levels: 10 = Guest, 20 = Reporter, 30 = Developer, 40 = Maintainer, 50 = Owner.
|
|
92
|
+
- For project-level members, use the repo settings API instead.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitlab-label
|
|
3
|
+
description: >
|
|
4
|
+
GitLab label management using the glab CLI. Use for listing and
|
|
5
|
+
creating project labels to organize issues and merge requests.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# GitLab Label Skill
|
|
9
|
+
|
|
10
|
+
## Patterns
|
|
11
|
+
|
|
12
|
+
### List project labels
|
|
13
|
+
```bash
|
|
14
|
+
glab label list
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Create a label
|
|
18
|
+
```bash
|
|
19
|
+
glab label create "bug" -c "#FF0000" -d "Bug report"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### List labels via API (structured)
|
|
23
|
+
```
|
|
24
|
+
gitlab_api({ endpoint: "projects/:project/labels", project: "namespace/project" })
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Create label via API
|
|
28
|
+
```
|
|
29
|
+
gitlab_api({
|
|
30
|
+
endpoint: "projects/:project/labels",
|
|
31
|
+
project: "namespace/project",
|
|
32
|
+
method: "POST",
|
|
33
|
+
body: { name: "bug", color: "#FF0000", description: "Bug report" },
|
|
34
|
+
confirm: true
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Update a label
|
|
39
|
+
```
|
|
40
|
+
gitlab_api({
|
|
41
|
+
endpoint: "projects/:project/labels/:label_name",
|
|
42
|
+
project: "namespace/project",
|
|
43
|
+
method: "PUT",
|
|
44
|
+
body: { color: "#00FF00", description: "Updated description" },
|
|
45
|
+
confirm: true
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Delete a label
|
|
50
|
+
```
|
|
51
|
+
gitlab_api({
|
|
52
|
+
endpoint: "projects/:project/labels/:label_name",
|
|
53
|
+
project: "namespace/project",
|
|
54
|
+
method: "DELETE",
|
|
55
|
+
confirm: true
|
|
56
|
+
})
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Rules
|
|
60
|
+
|
|
61
|
+
- Color values must be in hex format (e.g. `#FF0000`).
|
|
62
|
+
- All mutating operations require `confirm: true`.
|
|
63
|
+
- For applying labels to issues or MRs, use `gitlab-issue` or `gitlab-mr` skills.
|
|
64
|
+
- Labels are project-scoped; group labels use the group API endpoint.
|