Chat Coach

Chat Coach is an interactive Google Chrome extension designed to coach users on prompting strategies, context handling, and advanced chatbot workflows in real time. Built as a custom wrapper that injects directly into host conversational interfaces, the extension overlays contextual guidance, lessons, and adaptive tips as the user interacts with the AI.

Chrome Extension & Web Platform
Role Lead Developer & Architect
Timeline 2025
Tech Stack
Chrome ExtensionFirebaseReactReact ShepherdGemini API

The Concept

Chat Coach is an interactive browser extension designed to guide users through advanced workflow design, structural context handling, and prompt optimization frameworks in real time. Built as a custom productivity wrapper that integrates directly with host conversational interfaces, the extension overlays contextual modules, adaptive tips, and live feedback as the user works.

My client, an enterprise workflow consultant, wanted to build a privacy-first utility capable of evaluating text structures in real time, scoring input clarity, and suggesting highly optimized structural alternatives from a pre-compiled framework library. To satisfy corporate data governance policies, the core engineering requirement was absolute data isolation: user text could never be logged, cached, or leaked through third-party analytics infrastructure.

Technical Validation & The Pipeline Shift

Achieving real-time contextual evaluation under strict privacy constraints presented an immediate execution bottleneck. I conducted an iterative technical validation process to establish a secure, low-latency processing loop:

Phase 1
Local In-Browser Inference (Inefficient)
❌ Failed: High friction, massive model downloads, and consumer hardware constraints introducing layout lag.
Phase 2
In-UI Host Interception (Fragile)
⚠️ Fragile: Brittle approach that consumed active user quotas and throttled the main UI thread.
Phase 3
Optimized Asynchronous Pipeline (Breakthrough)
✅ Secure, low-latency, transient evaluations, and independent background routing.

Phase 1: Local In-Browser Inference (Inefficient)

I initially evaluated running compact open-source language models directly within the extension context. However, downloading multi-gigabyte models created prohibitive initialization times, and consumer hardware constraints introduced severe layout lag during rapid execution loops.

Phase 2: In-UI Host Interception (Fragile)

We experimented with using the host application thread to analyze its own interface context via hidden operational injections. While functional, this approach was highly brittle—it consumed active user operation quotas and briefly throttled the main UI thread during processing sequences.

Phase 3: Optimized Asynchronous Pipeline (The Breakthrough)

To eliminate interface blocking and data pollution, I engineered an isolated, secure execution layer.

The final architecture utilizes an asynchronous background routing script to handle processing tasks completely independent of the host application's visible state. The extension executes secure, transient evaluations, streams metadata directly to custom UI widgets, and instantly clears transient session remnants. The user receives real-time optimization guidance, while their visible application history remains clean and private.

Solving Cross-Origin Restrictions & Dynamic Layout Constraints

The secondary engineering phase focused on building the interactive educational framework, including a persistent dashboard sidebar, guided learning tracks, and dynamic external embeds.

Cross-Origin Iframe Scaling

To showcase real-world workflow use cases, the sidebar needed to render external social feeds. Because of strict application Content Security Policies (CSP), direct third-party asset embedding was blocked at the browser level. I bypassed this limitation by routing the embedded assets through an extension-isolated sandboxed environment.

However, external layouts vary dynamically based on media and text length, frequently causing clipping or scrollbar bugs because parent elements cannot inherently read child document dimensions across origin boundaries. I implemented a cross-document message loop to bridge the gap:

Embedded External Media Measures DOM Rendered Footprint
Extension Content Script (Secure Window Post)
Sidebar UI Container
Dynamically adjusts height to prevent clipping

This communication loop programmatically tracked the structural footprint of the child element, dispatched the geometric calculations up through the script hierarchy, and instructed the parent container to scale dynamically to ensure pixel-perfect rendering.

Mutation-Tolerant UI Anchoring

A core module of Chat Coach is its interactive tour engine, which displays targeted, contextual tips pointing to specific application inputs to guide users through real-time formatting challenges.

Because modern web apps heavily utilize dynamic, obfuscated utility classes that change unpredictably across software deployments, hardcoding DOM selectors was impossible. To maintain structural stability, I developed a resilient parsing engine that scans for interactive landmarks, accessible roles, and structural landmarks rather than specific class names.

I integrated these selectors into a custom interface framework, refining its positioning architecture to elegantly handle deep DOM mutations, virtual page transitions, and asynchronous input states without breaking the application's layout cycle.

Architectural Summary

The resulting platform features a highly modular, decoupled infrastructure utilizing secure cloud synchronization layers for account authentication and user state persistence. Signing into the platform's primary portal automatically verifies authorization across the browser environment seamlessly.

Ultimately, the architecture is engineered to scale across diverse enterprise environments, supporting multiple deployment modes depending on corporate infrastructure requirements:

Processing Layer Privacy Footprint Infrastructure Cost
Isolated Session API Absolute Local Privacy
(Zero external data routing)
Zero (Leverages active workspace environment)
Independent Gateway Developer-Controlled Endpoints
(Direct provider connection)
Usage-based consumption tracking
Managed Proxy Pipeline Enterprise Governance
(Secure encrypted routing)
Fixed platform operational tier

Key Takeaways

Building Chat Coach demonstrated the importance of thinking outside standard frontend engineering paradigms when working around rigid platform limitations. Navigating strict host security rules, complex input state lifecycles, and continuously updating DOM structures required building resilient, client-side abstractions that protect user data privacy above all else.

Preload Preload Preload