agentsclimarketplace

Grammarly multi env setup

Skill jeremylongshore/claude-code-plugins-plus-skills/skills/.curated/grammarly-multi-env-setup

425 plugins, 2,810 skills, 200 agents for Claude Code. Open-source marketplace at tonsofskills.com with the ccpi CLI package manager.

Install
npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill grammarly-multi-env-setup

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

'Configure Grammarly across multiple environments.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.4 KB, as published. Nobody here has run it

Grammarly Multi-Environment Setup

Overview

Grammarly integration requires environment separation to isolate API credentials, enforce team-scoped style guides, and manage rate limits per tier. Development uses mock API responses for fast iteration without consuming quota, staging connects to the Grammarly sandbox for real grammar checks with test content, and production runs against the live API with full team configurations. Each environment has its own client credentials and style guide settings to prevent dev experiments from affecting production writing standards.

Environment Configuration

const grammarlyConfig = (env: string) => ({
  development: {
    clientId: process.env.GRAMMARLY_DEV_CLIENT_ID!, clientSecret: process.env.GRAMMARLY_DEV_CLIENT_SECRET!,
    baseUrl: "http://localhost:3100/mock-grammarly", useMockApi: true, concurrency: 1, intervalCap: 2,
  },
  staging: {
    clientId: process.env.GRAMMARLY_STG_CLIENT_ID!, clientSecret: process.env.GRAMMARLY_STG_CLIENT_SECRET!,
    baseUrl: "https://api.grammarly.com/sandbox", useMockApi: false, concurrency: 2, intervalCap: 5,
  },
  production: {
    clientId: process.env.GRAMMARLY_PROD_CLIENT_ID!, clientSecret: process.env.GRAMMARLY_PROD_CLIENT_SECRET!,
    baseUrl: "https://api.grammarly.com", teamId: process.env.GRAMMARLY_TEAM_ID!, concurrency: 5, intervalCap: 10,
  },
}[env]);

Environment Files

# Per-env files: .env.development, .env.staging, .env.production
GRAMMARLY_{DEV|STG|PROD}_CLIENT_ID=<client-id>
GRAMMARLY_{DEV|STG|PROD}_CLIENT_SECRET=<secret>
GRAMMARLY_BASE_URL={http://localhost:3100/mock|https://api.grammarly.com/sandbox|https://api.grammarly.com}
GRAMMARLY_TEAM_ID=<team-id>          # staging + production only

Environment Validation

function validateGrammarlyEnv(env: string): void {
  const suffix = { development: "_DEV", staging: "_STG", production: "_PROD" }[env];
  const required = [`GRAMMARLY${suffix}_CLIENT_ID`, `GRAMMARLY${suffix}_CLIENT_SECRET`];
  if (env === "production") required.push("GRAMMARLY_TEAM_ID");
  const missing = required.filter((k) => !process.env[k]);
  if (missing.length) throw new Error(`Missing Grammarly vars for ${env}: ${missing.join(", ")}`);
}

Promotion Workflow

# 1. Verify mock API coverage in dev
npm test -- --grep "grammarly" --env development

# 2. Run style guide checks against Grammarly sandbox
curl -X POST "https://api.grammarly.com/sandbox/check" \
  -H "Authorization: Bearer $GRAMMARLY_STG_TOKEN" -d @test-content.json

# 3. Compare suggestion quality between staging and baseline
node scripts/grammarly-diff.js --env staging --baseline expected-suggestions.json

# 4. Rotate credentials and deploy to production
GRAMMARLY_PROD_CLIENT_SECRET=$(vault read -field=secret grammarly/prod)
npm run deploy -- --env production

Environment Matrix

SettingDevStagingProd
API EndpointMock (localhost)Grammarly SandboxLive API
Team Style GuideNoneTest guideProduction guide
Rate Limit1 concurrent / 2 per interval2 / 55 / 10
Quota TrackingDisabledEnabledEnabled + alerts
User ScopeDeveloper onlyQA teamAll team members

Error Handling

IssueCauseFix
401 UnauthorizedClient credentials expired or wrong envRotate credentials in Grammarly developer console for target env
Rate limit 429Concurrency exceeds tier planLower intervalCap or upgrade Grammarly plan
Mock API returns emptyLocal mock server not runningStart mock with npm run mock:grammarly before dev tests
Style guide mismatchTeam ID points to wrong guideVerify GRAMMARLY_TEAM_ID matches the intended style guide
Suggestions differ across envsSandbox uses older model versionExpected behavior; validate core rules only in staging

Resources

Next Steps

See grammarly-deploy-integration.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.