Skip to content

viral: browser extension — score/humanize text in Gmail, Notion, LinkedIn before you send #284

Description

@devswha

Why it matters (viral lever)

A browser extension that scores the text you're typing in Gmail / Notion / LinkedIn puts patina into the daily writing loop ("check the score before you send"). High word-of-mouth, and distinct from the editor-focused VS Code extension (#206).

Reuse — the deterministic core, bundled for the browser

  • Score core: src/features/index.js analyzeText(text, opts) — pure JS, no LLM, no network. Returns { paragraphs: [{ hot, burstiness, mattr, lexicon }], hot }.
  • Hot-paragraph % score: replicate scripts/prose-score.mjs scoreText logic → score = hotCount / paragraphCount * 100 (keep parity with the Action/badge).
  • Lexicon caveat (precise): loadLexicon(lang, repoRoot) reads files from disk — that won't work in a browser. analyzeText accepts { lexicon } to bypass file reads. Build step must pre-generate lexicon-en.json / lexicon-ko.json from lexicon/ai-*.md and pass them in. (zh/ja lexicons don't exist yet — gate those langs off, consistent with current config.)

Scope (MVP)

  • Separate repo devswha/patina-extension, Manifest v3. Build with esbuild (new devDep is fine in the separate repo) bundling src/features/{index,segment,stylometry,lexicon}.js.
  • Content script adds a small hot-% indicator to Gmail compose first (LinkedIn, Notion in follow-ups).
  • Actions: "Score selection" (local), "Humanize selection" → defers to CLI/skill (no in-extension LLM).
  • Hard scope cut v1: scoring is fully local (audit-only); the score path makes zero network calls (sensitive drafts never leave the browser). No API key prompts.
  • Settings: language (auto|en|ko), gate threshold.

Acceptance criteria

  • Typing in Gmail shows a live hot-% badge that matches node src/cli.js --score for the same text/lang (parity test on a fixture).
  • DevTools Network panel shows no requests on the score path.
  • Lexicon JSON pre-bundled at build (no runtime file/network reads).
  • README cross-link from main repo docs/integrations/.

Dependencies / links

Metadata

Metadata

Assignees

No one assigned

    Labels

    integrationEditor, GitHub Action, pre-commit, or app integrationpriority: lowTriage: longer-horizon research or large build

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions