Skip to main content
AI/MLjeremylongshore

grammarly-reference-architecture

'Implement Grammarly reference architecture with best-practice project

Stars
2,267
Source
jeremylongshore/claude-code-plugins-plus-skills
Updated
2026-05-31
Slug
jeremylongshore--claude-code-plugins-plus-skills--grammarly-reference-architecture
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/HEAD/plugins/saas-packs/grammarly-pack/skills/grammarly-reference-architecture/SKILL.md -o .claude/skills/grammarly-reference-architecture.md

Drops the SKILL.md into .claude/skills/grammarly-reference-architecture.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

Grammarly Reference Architecture

Architecture

┌────────────────────────────────────┐
│         Your Application            │
├────────────────────────────────────┤
│    Content Quality Service          │
│  (Score, AI Detect, Plagiarism)     │
├────────────────────────────────────┤
│    Grammarly API Client             │
│  (Auth, Retry, Cache, Chunking)     │
├────────────────────────────────────┤
│    Grammarly APIs                   │
│  api.grammarly.com                  │
└────────────────────────────────────┘

Project Structure

grammarly-integration/
├── src/grammarly/
│   ├── client.ts        # API client with token management
│   ├── scoring.ts       # Writing Score API
│   ├── detection.ts     # AI + Plagiarism detection
│   ├── chunking.ts      # Large document splitting
│   └── types.ts         # TypeScript interfaces
├── src/services/
│   ├── quality-gate.ts  # Threshold enforcement
│   └── content-audit.ts # Full audit pipeline
├── tests/
└── .env.example

API Decision Matrix

Need API Notes
Grammar/style quality Writing Score v2 Sync, fast
AI content detection AI Detection v1 Sync, fast
Source matching Plagiarism v1 Async, poll
All three Combined pipeline Parallel where possible

Overview

This architecture separates text ingestion, consent/classification, typed client access, bounded asynchronous processing, aggregate observability, and deletion/rollback controls. Source text is never an architecture artifact or telemetry payload.

Prerequisites

  • A data owner for each source, consent/retention policy, destination allowlist, and owner for every integration edge.
  • Separate sandbox/staging/production identities and configuration, plus documented rollback for client, queue, and storage controls.

Instructions

  1. Draw every source-to-destination edge with data class, consent basis, owner, retention, access boundary, retry behavior, and rollback.
  2. Start with fictional sandbox text and fail closed on unknown consent, destination, or response shape.
  3. Make asynchronous work idempotent and bounded; quarantine uncertainty instead of resubmitting or retaining text for debugging.
  4. Canary one integration with aggregate metrics and retention probes before promotion, retaining the previous revision.
  5. Re-evaluate controls whenever source, credential, client, or retention policy changes.

Output

Produce an architecture record with component owners, source/destination classes, policy revisions, idempotency/retry behavior, observability signals, test evidence, retention, and rollback revision. Exclude text, suggestions, identities, and credentials.

Error Handling

Stop the flow for unknown consent/destination, failed redaction, non-idempotent retry, or retention-policy drift. Quarantine the opaque event and escalate rather than adding a broad fallback.

Examples

source=synthetic-editor; destination=sandbox-client; consent=test-only; retention=none; client=v4; probe=pass; rollback=arch-r17 is a reviewable architecture receipt.

Resources

Next Steps

Start with grammarly-install-auth.