From grammarly-pack
Configures Grammarly API authentication via OAuth for enterprise accounts. Sets up env vars, fetches bearer tokens, and verifies connection with TypeScript scripts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grammarly-pack:grammarly-install-authThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Configure Grammarly API authentication using OAuth 2.0 Bearer tokens. Grammarly provides three main APIs: Writing Score API, AI Detection API, and Plagiarism Detection API. All use the same auth pattern via `api.grammarly.com`.
Configure Grammarly API authentication using OAuth 2.0 Bearer tokens. Grammarly provides three main APIs: Writing Score API, AI Detection API, and Plagiarism Detection API. All use the same auth pattern via api.grammarly.com.
scores-api:read, scores-api:write# .env (NEVER commit)
GRAMMARLY_CLIENT_ID=your_client_id
GRAMMARLY_CLIENT_SECRET=your_client_secret
GRAMMARLY_ACCESS_TOKEN= # Populated after OAuth
// auth.ts
import 'dotenv/config';
async function getAccessToken(): Promise<string> {
const response = await fetch('https://api.grammarly.com/ecosystem/api/v1/oauth/token', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({
grant_type: 'client_credentials',
client_id: process.env.GRAMMARLY_CLIENT_ID!,
client_secret: process.env.GRAMMARLY_CLIENT_SECRET!,
}),
});
const { access_token, expires_in } = await response.json();
console.log(`Token obtained, expires in ${expires_in}s`);
return access_token;
}
async function verify(token: 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: 'This is a test sentence for verification.' }),
});
if (response.ok) console.log('Grammarly API connection verified');
else console.error('Verification failed:', response.status);
}
| Error | Cause | Solution |
|---|---|---|
401 Unauthorized | Invalid or expired token | Re-authenticate |
403 Forbidden | Missing API scopes | Check enterprise admin settings |
invalid_client | Wrong credentials | Verify client ID and secret |
After auth, proceed to grammarly-hello-world.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin grammarly-packSets up Grammarly API local dev with TypeScript client, mocked Vitest tests, project structure, and fixtures for fast iteration and testing.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.