Agent skill

mgrep-code-search

Semantic code search using mgrep for efficient codebase exploration. This skill should be used when searching or exploring codebases with more than 30 non-gitignored files and/or nested directory structures. It provides natural language semantic search that complements traditional grep/ripgrep for finding features, understanding intent, and exploring unfamiliar code.

Stars 232
Forks 19

Install this agent skill to your Project

npx add-skill https://github.com/intellectronica/agent-skills/tree/main/plugins/mgrep-code-search/skills

SKILL.md

mgrep Code Search

Overview

mgrep is a semantic search tool that enables natural language queries across code, text, PDFs, and images. It is particularly effective for exploring larger or complex codebases where traditional pattern matching falls short.

When to Use This Skill

Use mgrep when:

  • The codebase contains more than 30 non-gitignored files
  • There are nested directory structures
  • Searching for concepts, features, or intent rather than exact strings
  • Exploring an unfamiliar codebase
  • Need to understand "where" or "how" something is implemented

Use traditional grep/ripgrep when:

  • Searching for exact patterns or symbols
  • Regex-based refactoring
  • Tracing specific function or variable names

Quick Start

Indexing

Before searching, start the watcher to index the repository:

bash
bunx @mixedbread/mgrep watch

The watch command indexes the repository and maintains synchronisation with file changes. It respects .gitignore and .mgrepignore patterns.

Searching

bash
bunx @mixedbread/mgrep "your natural language query" [path]

Search Commands

Basic Search

bash
bunx @mixedbread/mgrep "where is authentication configured?"
bunx @mixedbread/mgrep "how do we handle errors in API calls?" src/
bunx @mixedbread/mgrep "database connection setup" src/lib

Search Options

Option Description
-m <count> Maximum results (default: 10)
-c, --content Display full result content
-a, --answer Generate AI-powered synthesis of results
-s, --sync Update index before searching
--no-rerank Disable relevance optimisation

Examples with Options

bash
# Get more results
bunx @mixedbread/mgrep -m 25 "user authentication flow"

# Show full content of matches
bunx @mixedbread/mgrep -c "error handling patterns"

# Get an AI-synthesised answer
bunx @mixedbread/mgrep -a "how does the caching layer work?"

# Sync index before searching
bunx @mixedbread/mgrep -s "payment processing" src/services

Workflow

  1. Start watcher (once per session or when files change significantly):

    bash
    bunx @mixedbread/mgrep watch
    
  2. Search semantically:

    bash
    bunx @mixedbread/mgrep "what you're looking for" [optional/path]
    
  3. Refine as needed using path constraints or options:

    bash
    bunx @mixedbread/mgrep -m 20 -c "refined query" src/specific/directory
    

Environment Variables

Configure defaults via environment variables:

Variable Purpose
MGREP_MAX_COUNT Default result limit
MGREP_CONTENT Enable content display (1/true)
MGREP_ANSWER Enable AI synthesis (1/true)
MGREP_SYNC Pre-search sync (1/true)

Important Notes

  • Always use bunx @mixedbread/mgrep to run commands (not npm/npx or direct installation)
  • Run bunx @mixedbread/mgrep watch before searching to ensure the index is current
  • mgrep respects .gitignore patterns automatically
  • Create .mgrepignore for additional exclusions

Expand your agent's capabilities with these related and highly-rated skills.

intellectronica/agent-skills

raindrop-api

This skill provides comprehensive instructions for interacting with the Raindrop.io bookmarks service via its REST API using curl and jq. It covers authentication, CRUD operations for collections, raindrops (bookmarks), tags, highlights, filters, import/export, and backups. Use this skill whenever the user asks to work with their bookmarks from Raindrop.io, including reading, creating, updating, deleting, searching, or organising bookmarks and collections.

232 19
Explore
intellectronica/agent-skills

ultrathink

Display colorful ANSI art of the word "ultrathink". Use when the user says "ultrathink" or invokes /ultrathink.

232 19
Explore
intellectronica/agent-skills

nano-banana-pro

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

232 19
Explore
intellectronica/agent-skills

upstash-redis-kv

Read and write to Upstash Redis-compatible key-value store via REST API. Use when there is a need to save or retrieve key-value data, use Redis features (caching, counters, lists, sets, hashes, sorted sets, etc.) for the current interaction, or when the user explicitly asks to use Upstash or Redis.

232 19
Explore
intellectronica/agent-skills

notion-api

This skill provides comprehensive instructions for interacting with the Notion API via REST calls. This skill should be used whenever the user asks to interact with Notion, including reading, creating, updating, or deleting pages, databases, blocks, comments, or any other Notion content. The skill covers authentication, all available endpoints, pagination, error handling, and best practices.

232 19
Explore
intellectronica/agent-skills

gpt-image-1-5

Generate and edit images using OpenAI's GPT Image 1.5 model. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports text-to-image generation and image editing with optional mask. DO NOT read the image file first - use this skill directly with the --input-image parameter.

232 19
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results