mgrep-code-search

$npx mdskill add mkurman/zorai/mgrep-code-search

Search complex codebases semantically with mgrep.

  • Finds features and intent in large nested directories.
  • Depends on the mgrep semantic search engine.
  • Uses natural language queries to optimize relevance.
  • Delivers full content or AI-synthesized answers.

SKILL.md

.github/skills/mgrep-code-searchView on GitHub ↗
---
name: mgrep-code-search
description: 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.

tags: [productivity, agent-skills, mgrep-code-search, git, search, nlp]
-----|-------------|
| `-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

More from mkurman/zorai

SkillDescription
account-management>
agile-scrum>
albumentationsFast image augmentation library (Albumentations). 70+ transforms for classification, segmentation, object detection, keypoints, and pose estimation. Optimized OpenCV-based pipeline with unified API across all CV tasks. Supports images, masks, bounding boxes, and keypoints simultaneously. Note: classic Albumentations (MIT) is no longer maintained; successor AlbumentationsX uses AGPL-3.0. For torchvision-native augmentations, use torchvision.transforms.v2.
aml-complianceAnti-Money Laundering (AML) and Know Your Customer (KYC) compliance workflow. Sanctions screening, PEP detection, transaction monitoring, suspicious activity reporting (SAR), and OFAC compliance.
anki-connectThis skill is for interacting with Anki through AnkiConnect, and should be used whenever a user asks to interact with Anki, including to read or modify decks, notes, cards, models, media, or sync operations.
approval-checkpoint-long-taskCanonical long-task pack for daemon-managed work with deliberate approval checkpoints, status summaries, rollback notes, and mobile-safe governance-aware updates.
auditing-goal-artifactsUse when reviewing recent zorai goal run outputs, closure markers, ledgers, or evidence bundles to judge whether completion is credible or to identify remaining uncertainty.
autogenAutoGen (Microsoft) — multi-agent conversation framework. Agent-to-agent chat, code generation & execution, tool use, group chat, and human-in-the-loop. Build collaborative AI systems with specialized agents.
backtraderPython backtesting framework for trading strategies. Data feeds, brokers, analyzers, and live trading support. Strategy development with commission models, slippage, and signal-based execution.
beautiful-mermaidRender Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library. Use when the user asks to render a Mermaid diagram.