Ln 651 Query Efficiency Auditor

🌐Community
by levnikolaevich · vlatest · Repository

Analyzes query performance, identifies inefficiencies, and suggests optimizations to reduce costs for large language model applications.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add ln-651-query-efficiency-auditor npx -- -y @trustedskills/ln-651-query-efficiency-auditor
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "ln-651-query-efficiency-auditor": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/ln-651-query-efficiency-auditor"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

The Ln 651 Query Efficiency Auditor is a specialized AI agent worker designed to analyze database query patterns within your codebase for inefficiencies and potential misuse. It identifies redundant data fetches, incorrect batch operation usage, and issues with caching scope. The skill generates structured reports detailing these findings, including severity levels, locations of the problematic code, estimated effort required for remediation, and specific recommendations for optimization, ultimately aiming to reduce costs associated with large language model applications.

When to use it

  • Optimizing LLM application performance: Identify and fix slow queries impacting response times.
  • Reducing database costs: Eliminate redundant fetches and improve query efficiency to lower database usage charges.
  • Improving code quality: Proactively find and address inefficient coding practices related to database interactions.
  • Ensuring adherence to best practices: Verify that your codebase follows established database access guidelines.

Key capabilities

  • Redundant Fetch Detection: Identifies instances where the same entity is fetched from the database multiple times within a call chain.
  • Batch Operation Misuse Analysis: Detects improper use of batch operations, potentially leading to inefficiencies.
  • Caching Scope Problem Identification: Evaluates and flags issues with caching configurations.
  • Compliance Score Calculation: Calculates an overall compliance score (X/10) for query efficiency based on detected violations.
  • Report Generation: Creates a detailed markdown report outlining findings, including severity, location, effort estimates, and recommendations.

Example prompts

  • "Run the Query Efficiency Auditor against my codebase."
  • "Audit database queries in the service/handler directory for redundant entity fetches."
  • "Generate a report on query inefficiencies with a focus on batch operation usage."

Tips & gotchas

  • Context Store is Required: The skill requires a context store containing tech_stack, best_practices, db_config (database type, ORM settings), codebase_root, and output_dir.
  • Domain Awareness: The skill supports domain-specific analysis using domain_mode and current_domain.
  • Referenced Documentation: Review shared/references/audit_worker_core_contract.md and shared/references/two_layer_detection.md for detailed information on the audit process and detection methodology.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
levnikolaevich
Installs
39

🌐 Community

Passed automated security scans.