Agent skill

grammarly-observability

Implement Grammarly observability with metrics and logging. Use when setting up monitoring, tracking API performance, or implementing alerting for Grammarly integrations. Trigger with phrases like "grammarly monitoring", "grammarly metrics", "grammarly observability", "grammarly logging", "grammarly alerts".

Stars 1,803
Forks 241

Install this agent skill to your Project

npx add-skill https://github.com/jeremylongshore/claude-code-plugins-plus-skills/tree/main/plugins/saas-packs/grammarly-pack/skills/grammarly-observability

SKILL.md

Grammarly Observability

Instructions

Step 1: API Call Metrics

typescript
class GrammarlyMetrics {
  private calls = { score: 0, ai: 0, plagiarism: 0 };
  private errors = 0;
  private latencies: number[] = [];

  recordCall(api: 'score' | 'ai' | 'plagiarism', latencyMs: number) {
    this.calls[api]++;
    this.latencies.push(latencyMs);
  }

  recordError() { this.errors++; }

  report() {
    const sorted = [...this.latencies].sort((a, b) => a - b);
    return {
      totalCalls: Object.values(this.calls).reduce((a, b) => a + b, 0),
      callsByAPI: this.calls,
      errors: this.errors,
      p50: sorted[Math.floor(sorted.length * 0.5)] || 0,
      p95: sorted[Math.floor(sorted.length * 0.95)] || 0,
    };
  }
}

Step 2: Structured Logging

typescript
function logGrammarlyCall(api: string, duration: number, status: number, textLength: number) {
  console.log(JSON.stringify({
    service: 'grammarly',
    api,
    duration_ms: duration,
    status,
    text_length: textLength,
    timestamp: new Date().toISOString(),
  }));
}

Step 3: Alerting

typescript
// Alert on error rate > 10%
const errorRate = metrics.errors / (metrics.totalCalls || 1);
if (errorRate > 0.1) {
  console.error(`ALERT: Grammarly error rate ${(errorRate * 100).toFixed(1)}%`);
}

Resources

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results