From grammarly-pack
Polls Grammarly plagiarism API for results using callbacks and emits custom events via Node EventEmitter for score and AI detection handling.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin grammarly-packThis skill is limited to using the following tools:
Grammarly's current API is request/response based — there are no push webhooks. For async operations (plagiarism detection), you poll for results. Build your own event system around Grammarly API results.
Generates TypeScript examples for Grammarly API: score text for engagement, correctness, clarity, tone; detect AI content and plagiarism.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Grammarly's current API is request/response based — there are no push webhooks. For async operations (plagiarism detection), you poll for results. Build your own event system around Grammarly API results.
async function plagiarismWithCallback(
text: string,
token: string,
onComplete: (result: any) => void
) {
const createRes = await fetch('https://api.grammarly.com/ecosystem/api/v1/plagiarism', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ text }),
});
const { id } = await createRes.json();
const poll = async () => {
const res = await fetch(`https://api.grammarly.com/ecosystem/api/v1/plagiarism/${id}`, {
headers: { 'Authorization': `Bearer ${token}` },
});
const result = await res.json();
if (result.status === 'pending') { setTimeout(poll, 3000); return; }
onComplete(result);
};
poll();
}
import { EventEmitter } from 'events';
const grammarlyEvents = new EventEmitter();
grammarlyEvents.on('score.completed', (data) => {
if (data.overallScore < 60) console.warn('Low quality content detected');
});
grammarlyEvents.on('ai.detected', (data) => {
if (data.score > 70) console.warn('Likely AI-generated content');
});
For performance, see grammarly-performance-tuning.