Skip to main content
AI/MLjeremylongshore

grammarly-performance-tuning

'Optimize Grammarly API performance with caching, batching, and connection

Stars
2,267
Source
jeremylongshore/claude-code-plugins-plus-skills
Updated
2026-05-31
Slug
jeremylongshore--claude-code-plugins-plus-skills--grammarly-performance-tuning
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/HEAD/plugins/saas-packs/grammarly-pack/skills/grammarly-performance-tuning/SKILL.md -o .claude/skills/grammarly-performance-tuning.md

Drops the SKILL.md into .claude/skills/grammarly-performance-tuning.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

Grammarly Performance Tuning

Latency Benchmarks

API Typical Latency Notes
Writing Score 1-3s Depends on text length
AI Detection 1-2s Fast for short text
Plagiarism 10-60s Async, requires polling

Instructions

Cache Score Results

import { LRUCache } from 'lru-cache';
import { createHash } from 'crypto';

const scoreCache = new LRUCache<string, any>({ max: 500, ttl: 3600000 });

async function cachedScore(text: string, token: string) {
  const key = createHash('sha256').update(text).digest('hex');
  const cached = scoreCache.get(key);
  if (cached) return cached;
  const score = await grammarlyClient.score(text);
  scoreCache.set(key, score);
  return score;
}

Parallel API Calls

// Score + AI detect in parallel (they're independent)
async function fullAudit(text: string, token: string) {
  const [score, ai] = await Promise.all([
    grammarlyClient.score(text),
    grammarlyClient.detectAI(text),
  ]);
  return { score, ai };
}

Resources

Next Steps

For cost optimization, see grammarly-cost-tuning.