astro-dev-copy-optimizer — Brandon Hubbard Engineering
TYPESCRIPT · ASTRO DEV TOOLBAR

astro-dev-copy-optimizer — In-Browser Headline & Microcopy Editor for Astro

astro-dev-copy-optimizer adds point-and-click copy editing to the Astro Dev Toolbar so developers and designers can refine headings, CTAs, and descriptions in place. It generates layout-aware copy variations constrained to exact pixel widths and character budgets using local Chrome AI.

$ npm install -D astro-dev-copy-optimizer
GitHub ↗
01. Architectural Specifications STATUS: PRODUCTION READY
[ 01 // CAPABILITY ]

Inspect & Polish

Click any heading, CTA button, or paragraph in development to immediately audition rewritten copy variations.

[ 02 // CAPABILITY ]

Multi-Tier AI Fallback

Harnesses window.ai.rewriter, window.ai.writer, and Prompt API with automatic graceful degradation.

[ 03 // CAPABILITY ]

1-Click Clipboard Copy

Copies polished strings or previews in-situ replacements immediately with zero manual typing.

02. Implementation & Usage BUN / ASTRO 5+
// Installation CLI
bun add astro-dev-copy-optimizer
# or
pnpm add astro-dev-copy-optimizer
// Configuration astro.config.mjs
// astro.config.mjs
import { defineConfig } from "astro/config";
import devCopyOptimizer from "astro-dev-copy-optimizer";

export default defineConfig({
  integrations: [
    devCopyOptimizer({
      tones: ["concise", "cta", "technical", "casual"]
    })
  ]
});

// Chrome Built-in AI Prerequisites

  • 1. Open chrome://flags in Google Chrome 128+
  • 2. Set #prompt-api-for-gemini-nano to Enabled
  • 3. Set #optimization-guide-on-device-model to Enabled ByPassPerfRequirement
  • 4. Restart Chrome and verify model status at chrome://components