Extension Architecture¶
The project uses a no-build architecture so it can be loaded directly into Chrome as an unpacked extension.
Manifest Strategy¶
- Manifest Version: MV3
- Background worker initializes defaults
- Content scripts are loaded in order on supported AI domains
- Popup and options pages manage user configuration
Script Order¶
content/aiOverlay.jscontent/liveCoachBubble.jscontent/quickBuilder.jscontent/monitor.jscontent/interactionTracker.js
This order ensures toast runtime exists first, UI surfaces are injected, then prompt and behavior monitors run.
Main Runtime Components¶
content/quickBuilder.js: in-page Prompt Builder launcher + panel, role selector,Build + Insert,Build + Send, keyboard shortcuts (Ctrl/Cmd + Oand command fallbackCtrl/Cmd + Shift + O) when focused in chat composercontent/monitor.js: prompt capture, send detection, realtime scoring, bad-prompt detection, dependency metricscontent/liveCoachBubble.js: floating realtime HUD for prompt score + habit snapshot, draggable, persisted, and auto-remounted on dynamic UI rerendercontent/interactionTracker.js: copy/paste monitoring, fast-copy detection, large-paste warningscontent/aiOverlay.js: toast rendering layer (top-right notifications)
Reliability Considerations¶
- MutationObserver re-attaches listeners when AI UI nodes rerender
- prompt deduping prevents duplicate warnings on fast UI updates
- prompt snapshot is captured before send clears the composer
- live draft scoring runs on debounced input updates without inflating send counters
- all settings are merged with defaults to avoid corrupt local state