From grammarly-pack
Generates TypeScript examples for Grammarly API: score text for engagement, correctness, clarity, tone; detect AI content and plagiarism.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grammarly-pack:grammarly-hello-worldThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Score a text document using Grammarly's Writing Score API. Returns an overall score plus sub-scores for engagement, correctness, tone, and clarity.
Score a text document using Grammarly's Writing Score API. Returns an overall score plus sub-scores for engagement, correctness, tone, and clarity.
grammarly-install-auth setupscores-api:read scope// hello-grammarly.ts
import 'dotenv/config';
const TOKEN = process.env.GRAMMARLY_ACCESS_TOKEN!;
async function scoreText(text: string) {
const response = await fetch('https://api.grammarly.com/ecosystem/api/v2/scores', {
method: 'POST',
headers: {
'Authorization': `Bearer ${TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ text }),
});
const result = await response.json();
console.log('Overall Score:', result.overallScore);
console.log('Engagement:', result.engagement);
console.log('Correctness:', result.correctness);
console.log('Clarity:', result.clarity);
console.log('Tone:', result.tone);
return result;
}
scoreText('Their going to the store tommorow to buy there supplys for the trip.').catch(console.error);
async function detectAI(text: string) {
const response = await fetch('https://api.grammarly.com/ecosystem/api/v1/ai-detection', {
method: 'POST',
headers: {
'Authorization': `Bearer ${TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ text }),
});
const result = await response.json();
console.log('AI Score:', result.score); // 0-100, higher = more likely AI
return result;
}
async function checkPlagiarism(text: string) {
// Step 1: Create score request
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();
// Step 2: Poll for results
let result;
do {
await new Promise(r => setTimeout(r, 3000));
const statusRes = await fetch(`https://api.grammarly.com/ecosystem/api/v1/plagiarism/${id}`, {
headers: { 'Authorization': `Bearer ${TOKEN}` },
});
result = await statusRes.json();
} while (result.status === 'pending');
console.log('Plagiarism score:', result.score);
console.log('Matches:', result.matches?.length || 0);
return result;
}
curl -X POST https://api.grammarly.com/ecosystem/api/v2/scores \
-H "Authorization: Bearer $GRAMMARLY_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text": "This is a test sentence."}' | python3 -m json.tool
| Error | Cause | Solution |
|---|---|---|
401 Unauthorized | Token expired | Re-authenticate |
400 Bad Request | Text too short (< 30 words) | Minimum 30 words required |
413 Payload Too Large | Text > 100,000 characters | Split into chunks |
429 Rate Limited | Too many requests | Implement backoff |
Proceed to grammarly-local-dev-loop for development workflow.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin grammarly-packIntegrates Grammarly APIs for AI content detection (0-100 score), async plagiarism checks, and content quality scoring via TypeScript functions with batch support.
Detects AI writing patterns in text and provides revision guidance to sound more natural. Use before finalizing AI-assisted content or when reviewing for undisclosed AI artifacts.
Removes AI-generated writing patterns like em dash overuse, passive voice, filler phrases, and promotional language from text. Makes prose sound natural and human-written; matches user voice from samples. Use for editing docs or reviews.