An AI agent skill that provides comprehensive GitLab integration — fetch issues and merge requests, generate executive summaries, perform structured code reviews, and automate end-to-end issue resolution workflows.
SaferSkills independently audited gitlab-skill (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill provides comprehensive GitLab integration capabilities, enabling automated workflows for issue management, code review, and project insights. It bridges GitLab data with intelligent analysis and action, supporting both read operations (summaries, reviews) and write operations (posting comments, creating merge requests).
Invoke this skill when:
This skill supports multiple GitLab instances through a configuration file, making it easy to work with different GitLab servers (work, personal, clients, etc.).
Option 1: Configuration File (Recommended for Multiple Instances)
Create a gitlab_config.json file in one of these locations:
./gitlab_config.json (current directory)~/.gitlab/config.json (user home directory)Example configuration:
{
"default": "work",
"instances": {
"work": {
"url": "https://gitlab.company.com",
"token": "glpat-xxxxxxxxxxxxxxxxxxxx",
"description": "Company GitLab instance"
},
"personal": {
"url": "https://gitlab.com",
"token": "glpat-yyyyyyyyyyyyyyyyyyyy",
"description": "Personal GitLab projects"
},
"client": {
"url": "https://gitlab.client.com",
"token": "glpat-zzzzzzzzzzzzzzzzzzzz",
"description": "Client project GitLab"
}
}
}See gitlab_config.json.template in the skill directory for a complete example.
Option 2: Environment Variables (Single Instance)
For a single GitLab instance, set environment variables:
export GITLAB_URL="https://gitlab.com"
export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx"Generating a GitLab Personal Access Token:
api scopeListing Configured Instances:
To see all configured GitLab instances:
python scripts/gitlab_api.py list-instancesTo avoid typing full project IDs repeatedly, configure project aliases in your gitlab_config.json:
{
"default": "work",
"instances": { ... },
"projects": {
"webapp": {
"project_id": "acme/webapp",
"instance": "work",
"description": "Main company web application"
},
"blog": {
"project_id": "john/personal-blog",
"instance": "personal",
"description": "My personal blog"
},
"mobile": {
"project_id": "123",
"instance": "client",
"description": "Client mobile app (numeric ID)"
}
}
}Benefits:
webapp instead of acme/webappListing Configured Projects:
To see all configured project aliases:
python scripts/gitlab_api.py list-projectsUsing Project Aliases:
# Use project alias - automatically uses the configured instance
python scripts/gitlab_api.py get-issue webapp 123
# Use full project ID (still works)
python scripts/gitlab_api.py get-issue "acme/webapp" 123
# Override instance for a specific command
python scripts/gitlab_api.py --instance=personal get-issue webapp 123When using the configuration file, specify which instance to use with the --instance=<name> flag:
# Use the default instance (specified in config)
python scripts/gitlab_api.py get-issue "acme/webapp" 123
# Use a specific instance
python scripts/gitlab_api.py --instance=personal get-issue "myproject" 456
python scripts/gitlab_api.py --instance=client list-issues "client/project"If no --instance flag is provided, the skill uses the instance marked as "default" in the config file.
Configure project aliases to avoid typing full project IDs and to automatically use the correct instance:
# With project alias (automatically uses configured instance)
python scripts/gitlab_api.py get-issue webapp 123
python scripts/gitlab_api.py list-mrs api
# List all configured project aliases
python scripts/gitlab_api.py list-projectsInstance Resolution Priority:
--instance=<name> flag (highest priority)Examples:
# Uses instance from project config (webapp → work instance)
python scripts/gitlab_api.py get-issue webapp 123
# Override with explicit instance flag
python scripts/gitlab_api.py --instance=personal get-issue webapp 123
# Full project ID with explicit instance
python scripts/gitlab_api.py --instance=client get-issue "client/project" 456Trigger Examples:
Steps:
python scripts/gitlab_api.py get-issue <project_id> <issue_iid>This returns JSON with issue details, description, labels, state, and all comments.
Read references/issue_summary_format.md to understand the executive summary structure.
Follow the format defined in references/issue_summary_format.md:
If requested, post the summary back to the issue:
python scripts/gitlab_api.py post-issue-comment <project_id> <issue_iid> "<summary_markdown>"Examples:
User: "Summarize issue #247 in acme/webapp"
1. Fetch: python scripts/gitlab_api.py get-issue "acme/webapp" 247
2. Read references/issue_summary_format.md
3. Analyze issue data focusing on business impact
4. Generate executive summary following the format
5. Present summary to userUser: "Summarize issue #123 in webapp"
1. Resolve project: "webapp" → "acme/webapp" (instance: work)
2. Fetch: python scripts/gitlab_api.py get-issue webapp 123
3. Read references/issue_summary_format.md
4. Analyze and generate summary
5. Present to userUser: "Summarize issue #456 in my blog project"
1. Determine project alias: "blog" from context
2. Resolve: "blog" → "john/personal-blog" (instance: personal)
3. Fetch: python scripts/gitlab_api.py get-issue blog 456
4. Read references/issue_summary_format.md
5. Analyze and generate summary
6. Present to userTrigger Examples:
Steps:
python scripts/gitlab_api.py get-mr <project_id> <mr_iid>This returns MR metadata, changes (diffs), and comments.
python scripts/gitlab_api.py get-diff <project_id> <mr_iid>This returns the unified diff format for all file changes.
Read references/code_review_style.md to understand the review structure and focus areas.
Review across four dimensions:
Follow the format from references/code_review_style.md:
python scripts/gitlab_api.py post-mr-comment <project_id> <mr_iid> "<review_markdown>"Example:
User: "Review MR !89 in acme/webapp"
1. Fetch: python scripts/gitlab_api.py get-mr "acme/webapp" 89
2. Get diff: python scripts/gitlab_api.py get-diff "acme/webapp" 89
3. Read references/code_review_style.md
4. Analyze code across security, logic, performance, quality dimensions
5. Structure comprehensive review with categorized issues
6. Post review commentTrigger Examples:
Steps:
python scripts/gitlab_api.py get-issue <project_id> <issue_iid>Analyze the issue description and comments to understand:
python scripts/auto_resolve_issue.py create-branch <issue_iid> "<issue_title>"This creates a branch named issue-{iid}-{sanitized-title}.
git add .
git commit -m "Fix issue #<iid>: <brief description>
<detailed explanation>
Closes #<issue_iid>" python scripts/auto_resolve_issue.py push-branch <branch_name> python scripts/auto_resolve_issue.py create-mr <project_id> <source_branch> <target_branch> "Fix #<iid>: <title>" "<description>" <issue_iid>This automatically links the MR to the issue with "Closes #<iid>".
python scripts/gitlab_api.py post-issue-comment <project_id> <issue_iid> "I've implemented a fix for this issue. Please review MR !<mr_iid>."Example:
User: "Fix issue #123 in acme/webapp"
1. Fetch: python scripts/gitlab_api.py get-issue "acme/webapp" 123
2. Analyze issue requirements
3. Create branch: python scripts/auto_resolve_issue.py create-branch 123 "Fix checkout discount bug"
4. Implement the fix using Read, Write, Edit tools
5. Commit: git commit with reference to #123
6. Push: python scripts/auto_resolve_issue.py push-branch "issue-123-fix-checkout-discount-bug"
7. Create MR: python scripts/auto_resolve_issue.py create-mr "acme/webapp" "issue-123-..." "main" "Fix #123: Checkout discount bug" "..." 123
8. Post comment: python scripts/gitlab_api.py post-issue-comment "acme/webapp" 123 "Fix implemented in MR !<iid>"Trigger Examples:
Steps:
python scripts/gitlab_api.py aggregate-issues <project_id> [days]This returns statistics including:
Create a structured summary:
If deeper analysis is needed:
python scripts/gitlab_api.py list-issues <project_id> [state] [labels...]Example:
User: "Status report for acme/webapp"
1. Fetch: python scripts/gitlab_api.py aggregate-issues "acme/webapp" 7
2. Analyze statistics and recent activity
3. Generate insights report highlighting:
- 15 open issues (3 critical)
- Bug reports increased 40% this week
- 2 critical issues unassigned
- Recommendation: Triage unassigned critical bugsTrigger Examples:
Steps:
python scripts/gitlab_api.py list-issues <project_id> [state] [label1 label2 ...]Parameters:
state: "opened" (default), "closed", or "all"labels: Optional filter by label(s) python scripts/gitlab_api.py list-mrs <project_id> [state]Parameters:
state: "opened" (default), "closed", "merged", or "all"Example:
User: "Show me all open bugs in acme/api"
1. Fetch: python scripts/gitlab_api.py list-issues "acme/api" "opened" "bug"
2. Format results as table showing: IID, Title, Priority, Assignee, Updated
3. Present to userPrimary script for GitLab API interactions.
Usage:
python scripts/gitlab_api.py [--instance=<name>] <command> [args...]Options:
--instance=<name> - Specify which GitLab instance to use (from config file)Commands:
list-instances - List all configured GitLab instanceslist-projects - List all configured project aliasesget-issue <project> <issue_iid> - Fetch issue with commentslist-issues <project> [state] [labels...] - List issues with optional filtersget-mr <project> <mr_iid> - Fetch merge request with changes and commentslist-mrs <project> [state] - List merge requestspost-issue-comment <project> <issue_iid> <comment> - Post comment on issuepost-mr-comment <project> <mr_iid> <comment> - Post comment on MRget-diff <project> <mr_iid> - Get unified diff for MRaggregate-issues <project> [days] - Get issue statisticsProject Parameter:
Examples:
# List configured instances and projects
python scripts/gitlab_api.py list-instances
python scripts/gitlab_api.py list-projects
# Use project alias (automatically uses configured instance)
python scripts/gitlab_api.py get-issue webapp 123
# Use full project ID with default instance
python scripts/gitlab_api.py get-issue "acme/webapp" 123
# Use specific instance
python scripts/gitlab_api.py --instance=personal get-issue blog 456
# Override project's configured instance
python scripts/gitlab_api.py --instance=work get-issue blog 789Automation script for issue resolution workflow.
Usage:
python scripts/auto_resolve_issue.py [--instance=<name>] <command> [args...]Options:
--instance=<name> - Specify which GitLab instance to use (only needed for create-mr command)Commands:
create-branch <issue_iid> <issue_title> - Create feature branch from issuepush-branch <branch_name> - Push branch to remotecreate-mr <project> <source_branch> <target_branch> <title> <description> <issue_iid> - Create MR with issue linkNotes:
--instance flag is only required for the create-mr command, which needs to authenticate with GitLab API<project> can be a project alias or full project ID--instance flag)Examples:
# Create MR using project alias
python scripts/auto_resolve_issue.py create-mr webapp "feature-branch" "main" "Add feature" "Description" 123
# Create MR using full project ID with specific instance
python scripts/auto_resolve_issue.py --instance=client create-mr "client/project" "fix-bug" "main" "Fix" "..." 456Comprehensive guide for generating executive summaries of GitLab issues. Defines:
When to use: Before generating any issue summary, read this file to ensure consistency and quality.
Detailed guide for performing comprehensive code reviews on merge requests. Covers:
When to use: Before reviewing any merge request, read this file to ensure thorough and consistent reviews.
Configure Project Aliases for Frequently Used Projects:
projects sectionExample:
{
"projects": {
"api": {
"project_id": "acme/backend-api",
"instance": "work",
"description": "Main backend API service"
},
"docs": {
"project_id": "acme/documentation",
"instance": "work",
"description": "Technical documentation site"
}
}
}Benefits:
All scripts handle errors gracefully and output to stderr. If a script fails:
python scripts/gitlab_api.py list-instances to verify config--instance flagapi scope permissionsCommon configuration errors:
gitlab_config.json or set environment variablesWhen the user doesn't specify a project ID:
git remote get-url originFor issues or MRs with extensive comments or large diffs:
When posting comments back to GitLab:
gitlab_config.json to your .gitignoregitlab_config.json.template) for sharingchmod 600 ~/.gitlab/config.jsonIssue: "GitLab configuration not found"
gitlab_config.json file in one of the searched locationsGITLAB_URL and GITLAB_TOKEN environment variablespython scripts/gitlab_api.py list-instances to check configurationIssue: "Instance 'X' not found in config"
python scripts/gitlab_api.py list-instances to see available instancesIssue: "No default instance specified in config"
--instance=<name> flag explicitlyIssue: Project alias not found
python scripts/gitlab_api.py list-projects to see available aliasesIssue: "HTTP 404 Not Found"
Issue: "HTTP 401 Unauthorized"
api scopeIssue: "HTTP 403 Forbidden"
Issue: Git commands fail in auto_resolve_issue.py
User: "What's issue #456 about in webapp?"
Response steps:
1. Identify project alias: "webapp"
2. Fetch: python scripts/gitlab_api.py get-issue webapp 456
3. Read references/issue_summary_format.md
4. Generate concise summary focusing on: what, impact, status
5. Present to userUser: "Review !234 and post your feedback"
Response steps:
1. Fetch MR: python scripts/gitlab_api.py get-mr "acme/webapp" 234
2. Get diff: python scripts/gitlab_api.py get-diff "acme/webapp" 234
3. Read references/code_review_style.md
4. Analyze across all four dimensions
5. Structure review with critical issues, concerns, suggestions
6. Post: python scripts/gitlab_api.py post-mr-comment "acme/webapp" 234 "<review>"
7. Confirm to user that review was postedUser: "Please fix issue #123 in the webapp project"
Response steps:
1. Identify project: "webapp" alias
2. Fetch: python scripts/gitlab_api.py get-issue webapp 123
3. Analyze requirements from issue description
4. Create branch: python scripts/auto_resolve_issue.py create-branch 123 "Fix login bug"
5. Implement fix using development tools
6. Test the fix
7. Commit changes with message referencing #123
8. Push: python scripts/auto_resolve_issue.py push-branch "issue-123-fix-login-bug"
9. Create MR: python scripts/auto_resolve_issue.py create-mr webapp "issue-123-fix-login-bug" "main" "Fix #123: Login bug" "Fixes the login authentication issue" 123
10. Post update: python scripts/gitlab_api.py post-issue-comment webapp 123 "Fix implemented in MR !<iid>"
11. Provide MR link to userThis skill works seamlessly with:
To add custom functionality:
scripts/ for new automation workflowsreferences/ for new formats or standards~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.