agentleFS
grandcamelgrandcamel/GitLab-Assistant-Skills/skills/gitlab-search/SKILL.md

gitlab-search

Skill4 starsChanged 10 months agoMITView on GitHub

GitLab search operations via API. ALWAYS use this skill when user wants to: (1) search across GitLab globally, (2) find issues/MRs/code/commits, (3) search within a group or project, (4) find users or projects by keyword.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Search operations for GitLab using glab api raw endpoint calls.

    line 12
  2. Distinctive:

    Note: Search results are limited to resources the authenticated user can access.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Search Skill

Search operations for GitLab using glab api raw endpoint calls.

Quick Reference

OperationCommand PatternRisk
Search projectsglab api "search?scope=projects&search=..."-
Search issuesglab api "search?scope=issues&search=..."-
Search MRsglab api "search?scope=merge_requests&search=..."-
Search codeglab api "search?scope=blobs&search=..."-
Search commitsglab api "search?scope=commits&search=..."-
Search usersglab api "search?scope=users&search=..."-
Search wikiglab api "search?scope=wiki_blobs&search=..."-
Project searchglab api "projects/:id/search?scope=...&search=..."-
Group searchglab api "groups/:id/search?scope=...&search=..."-

Risk Legend: - Safe | ⚠️ Caution | ⚠️⚠️ Warning | ⚠️⚠️⚠️ Danger

When to Use This Skill

ALWAYS use when:

  • User wants to search or find something across GitLab
  • User mentions "search", "find", "query", "look for"
  • User asks "where is", "which project has", "find all"
  • User wants to search code, issues, MRs, commits, or wikis

NEVER use when:

  • User wants to list all items (use specific skill: gitlab-issue, gitlab-mr, etc.)
  • User knows the exact project/issue/MR ID
  • User wants to search local files (use grep/find locally)

API Prerequisites

Required Token Scopes: read_api or api

Note: Search results are limited to resources the authenticated user can access.

Search Scopes

ScopeDescriptionAvailable At
projectsSearch project names/descriptionsGlobal, Group
issuesSearch issue titles/descriptionsGlobal, Group, Project
merge_requestsSearch MR titles/descriptionsGlobal, Group, Project
milestonesSearch milestone titlesGlobal, Group, Project
snippet_titlesSearch snippet titlesGlobal
wiki_blobsSearch wiki contentGlobal, Group, Project
commitsSearch commit messagesGlobal, Group, Project
blobsSearch code/file contentGlobal, Group, Project
notesSearch commentsGlobal, Group, Project
usersSearch usernames/namesGlobal

Available Commands

Global Search

# Search projects by name
glab api "search?scope=projects&search=api+gateway" --method GET

# Search issues globally
glab api "search?scope=issues&search=authentication+bug" --method GET

# Search merge requests
glab api "search?scope=merge_requests&search=refactor" --method GET

# Search code (blobs)
glab api "search?scope=blobs&search=TODO+fixme" --method GET

# Search commits
glab api "search?scope=commits&search=fix+security" --method GET

# Search wiki content
glab api "search?scope=wiki_blobs&search=installation" --method GET

# Search users
glab api "search?scope=users&search=john" --method GET

# Search milestones
glab api "search?scope=milestones&search=v2.0" --method GET

# Search comments/notes
glab api "search?scope=notes&search=approved" --method GET

Project-Scoped Search

# Search issues in specific project
glab api "projects/123/search?scope=issues&search=bug" --method GET

# Search code in project
glab api "projects/123/search?scope=blobs&search=function+authenticate" --method GET

# Search commits in project
glab api "projects/123/search?scope=commits&search=fix" --method GET

# Search wiki in project
glab api "projects/123/search?scope=wiki_blobs&search=setup" --method GET

# Search MRs in project
glab api "projects/123/search?scope=merge_requests&search=feature" --method GET

# Search notes in project
glab api "projects/123/search?scope=notes&search=LGTM" --method GET

# Search milestones in project
glab api "projects/123/search?scope=milestones&search=sprint" --method GET

# Using project path (URL-encoded)
glab api "projects/$(echo 'mygroup/myproject' | jq -Rr @uri)/search?scope=blobs&search=TODO"

Group-Scoped Search

# Search issues in group
glab api "groups/456/search?scope=issues&search=urgent" --method GET

# Search code across group
glab api "groups/456/search?scope=blobs&search=api+key" --method GET

# Search projects in group
glab api "groups/456/search?scope=projects&search=backend" --method GET

# Search MRs in group
glab api "groups/456/search?scope=merge_requests&search=hotfix" --method GET

# Using group path (URL-encoded)
glab api "groups/$(echo 'mygroup' | jq -Rr @uri)/search?scope=issues&search=bug"

Pagination

# Get more results per page
glab api "search?scope=issues&search=bug&per_page=50" --method GET

# Get specific page
glab api "search?scope=issues&search=bug&per_page=50&page=2" --method GET

# Auto-paginate all results
glab api "search?scope=projects&search=api" --paginate

Advanced Search Syntax

# Exact phrase search (use quotes, URL-encoded)
glab api "search?scope=blobs&search=%22exact+phrase%22" --method GET

# Filename filter in code search
glab api "search?scope=blobs&search=authenticate+filename:auth.py" --method GET

# Extension filter
glab api "search?scope=blobs&search=class+extension:java" --method GET

# Path filter
glab api "search?scope=blobs&search=config+path:src/main" --method GET

Output Processing

Extract Key Fields

# Get issue IDs and titles
glab api "search?scope=issues&search=bug" | \
  jq -r '.[] | "\(.project_id)#\(.iid): \(.title)"'

# Get project names and URLs
glab api "search?scope=projects&search=api" | \
  jq -r '.[] | "\(.path_with_namespace): \(.web_url)"'

# Get code matches with file paths
glab api "search?scope=blobs&search=TODO" | \
  jq -r '.[] | "\(.project_id):\(.path):\(.startline) \(.data)"'

# Get commit info
glab api "search?scope=commits&search=fix" | \
  jq -r '.[] | "\(.short_id): \(.title)"'

Count Results

# Count matching issues
glab api "search?scope=issues&search=bug" --paginate | jq 'length'

# Count by project
glab api "search?scope=issues&search=bug" --paginate | \
  jq 'group_by(.project_id) | map({project: .[0].project_id, count: length})'

Common Workflows

Workflow 1: Find All TODOs in Codebase

# Search for TODO comments across all accessible projects
glab api "search?scope=blobs&search=TODO" --paginate | \
  jq -r '.[] | "\(.project_id):\(.path):\(.startline)"'

Workflow 2: Find Issues Across Team Projects

# Get group ID
group_id=$(glab api "groups/$(echo 'myteam' | jq -Rr @uri)" | jq -r '.id')

# Search for critical issues in group
glab api "groups/$group_id/search?scope=issues&search=critical" --paginate | \
  jq -r '.[] | "\(.references.full): \(.title)"'

Workflow 3: Find Who Worked on Feature

# Search commits mentioning feature
glab api "projects/123/search?scope=commits&search=authentication" | \
  jq -r '.[] | "\(.author_name): \(.title)"'

Workflow 4: Find Security-Related Code

# Search for potential security patterns
for term in "password" "secret" "api_key" "token"; do
  echo "=== Searching for: $term ==="
  glab api "projects/123/search?scope=blobs&search=$term" | \
    jq -r '.[] | "\(.path):\(.startline)"'
done

Workflow 5: Find Related MRs

# Search MRs by feature name
glab api "search?scope=merge_requests&search=oauth+integration" | \
  jq -r '.[] | "!\(.iid) [\(.state)]: \(.title)"'

Search Tips

Effective Search Terms

ForSearch Examples
Bug fixesfix bug, resolve issue, patch
Featuresadd feature, implement, new
Refactoringrefactor, cleanup, improve
Securitysecurity, vulnerability, CVE
Performanceperformance, optimize, speed
Documentationdocs, readme, documentation

URL Encoding Special Characters

# Space -> +
glab api "search?scope=issues&search=fix+bug"

# Quotes (for exact match) -> %22
glab api "search?scope=blobs&search=%22exact+phrase%22"

# Hash -> %23
glab api "search?scope=issues&search=issue%231234"

Troubleshooting

IssueCauseSolution
Empty resultsNo matches or no accessVerify search term, check permissions
Partial resultsPagination neededUse --paginate flag
400 Bad RequestInvalid scopeCheck scope is valid for endpoint
Slow searchLarge result setAdd filters or narrow scope
No code resultsBasic search disabledContact admin to enable advanced search

Search Limitations

  • Basic search searches titles/descriptions only
  • Advanced search (Elasticsearch) required for code search
  • Results limited to accessible resources
  • Rate limits apply for large searches

Related Documentation

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.