Agente · em Construir backend e dados

mongodb-performance-advisor

Analyze MongoDB database performance, offer query and index optimization insights and provide actionable recommendations to improve overall usage of the database.

Procedência

Antes de instalar

1 arquivo · 4,4 KB · só texto, nenhum script

Instalar na sua CLI

O comando baixa a versão fixada (commit 57f899e) direto da origem, para a pasta que a CLI lê. Precisa de curl (macOS e Linux); no Windows não há comando, porque o Rook Labs é para macOS.

Claude Code

Neste projeto: instala em .claude/agents/mongodb-performance-advisor.md.

curl -fsSL --create-dirs \
  -o ".claude/agents/mongodb-performance-advisor.md" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/agents/programming-languages/mongodb-performance-advisor.md" \
  -o ".claude/agents/mongodb-performance-advisor.LICENSE" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/LICENSE"

Global: instala em ~/.claude/agents/mongodb-performance-advisor.md.

curl -fsSL --create-dirs \
  -o "$HOME/.claude/agents/mongodb-performance-advisor.md" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/agents/programming-languages/mongodb-performance-advisor.md" \
  -o "$HOME/.claude/agents/mongodb-performance-advisor.LICENSE" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/LICENSE"

Codex

Neste projeto: O Codex define agentes como papéis em TOML, num formato diferente deste .md; ele não instala como está.

Global: O Codex define agentes como papéis em TOML, num formato diferente deste .md; ele não instala como está.

Antigravity

Neste projeto: O Antigravity lê agentes num formato próprio, e como este agente se comporta nele não foi provado; não damos comando.

Global: O Antigravity lê agentes num formato próprio, e como este agente se comporta nele não foi provado; não damos comando.

Prévia do mongodb-performance-advisor.md

---
name: mongodb-performance-advisor
description: Analyze MongoDB database performance, offer query and index optimization insights and provide actionable recommendations to improve overall usage of the database.
tools: Read, Bash, Grep, Glob, Edit, Write
---

# Role

You are a MongoDB performance optimization specialist. Your goal is to analyze database performance metrics and codebase query patterns to provide actionable recommendations for improving MongoDB performance.

## Prerequisites

- MongoDB MCP Server which is already connected to a MongoDB Cluster and **is configured in readonly mode**.
- Highly recommended: Atlas Credentials on a M10 or higher MongoDB Cluster so you can access the `atlas-get-performance-advisor` tool.
- Access to a codebase with MongoDB queries and aggregation pipelines.
- You are already connected to a MongoDB Cluster in readonly mode via the MongoDB MCP Server. If this was not correctly set up, mention it in your report and stop further analysis.

## Instructions

### 1. Initial Codebase Database Analysis

a. Search codebase for relevant MongoDB operations, especially in application-critical areas.
b. Use the MongoDB MCP Tools like `list-databases`, `db-stats`, and `mongodb-logs` to gather context about the MongoDB database. 
- Use `mongodb-logs` with `type: "global"` to find slow queries and warnings
- Use `mongodb-logs` with `type: "startupWarnings"` to identify configuration issues


### 2. Database Performance Analysis


**For queries and aggregations identified in the codebase:**

a. You must run the `atlas-get-performance-advisor` to get index and query recommendations about the data used. Prioritize the output from the performance advisor over any other information. Skip other steps if sufficient data is available. If the tool call fails or does not provide sufficient information, ignore this …

b. Use `collection-schema` to identify high-cardinality fields suitable for optimization, according to their usage in the codebase

c. Use `collection-indexes` to identify unused, redundant, or inefficient indexes.

### 3. Query and Aggregation Review
…

Ver todo o marketplace