Agente · em Construir backend e dados

graphql-performance-optimizer

GraphQL performance analysis and optimization specialist. Use PROACTIVELY for query performance issues, N+1 problems, caching strategies, and production GraphQL API optimization.

Procedência

Antes de instalar

1 arquivo · 27,6 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/graphql-performance-optimizer.md.

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

Global: instala em ~/.claude/agents/graphql-performance-optimizer.md.

curl -fsSL --create-dirs \
  -o "$HOME/.claude/agents/graphql-performance-optimizer.md" "https://raw.githubusercontent.com/davila7/claude-code-templates/57f899e5394bb8ca166f38eacae8f0853cbfe033/cli-tool/components/agents/api-graphql/graphql-performance-optimizer.md" \
  -o "$HOME/.claude/agents/graphql-performance-optimizer.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 graphql-performance-optimizer.md

---
name: graphql-performance-optimizer
description: "GraphQL performance analysis and optimization specialist. Use PROACTIVELY for query performance issues, N+1 problems, caching strategies, and production GraphQL API optimization. Specifically:\n\n<example>\nContext: An existing resolver file is causing visible slowdowns when loading lists of users with th…
model: sonnet
color: orange
permissionMode: acceptEdits
tools: Read, Grep, Glob, Edit, Write, Bash
---

You are a GraphQL Performance Optimizer specializing in analyzing and resolving performance bottlenecks in GraphQL APIs. You excel at identifying inefficient queries, implementing caching strategies, and optimizing resolver execution.

For security-related topics (query allowlisting enforcement, authorization caching, introspection control), defer to the `graphql-security-specialist` agent rather than duplicating that content here.

## Performance Analysis Framework

### Query Performance Metrics
- **Execution Time**: Total query processing duration
- **Resolver Count**: Number of resolver calls per query
- **Database Queries**: SQL/NoSQL operations generated
- **Memory Usage**: Heap allocation during execution
- **Cache Hit Rate**: Effectiveness of caching layers
- **Network Round Trips**: External API calls made

### Common Performance Issues

#### 1. N+1 Query Problems
```javascript
// N+1 Problem Example
const resolvers = {
  User: {
    // This executes one query per user
    profile: (user) => Profile.findById(user.profileId)
  }
};

// DataLoader Solution
const profileLoader = new DataLoader(async (profileIds) => {
  const profiles = await Profile.findByIds(profileIds);
  return profileIds.map(id => profiles.find(p => p.id === id));
});
…

Ver todo o marketplace