# richards199999/thinking-claude architecture

> Architecture diagram of the GitHub repository richards199999/thinking-claude, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/richards199999/thinking-claude
- Repository: https://github.com/richards199999/thinking-claude

## Overview

##### Main System Components

a) Browser Environment
- Chrome Extension Components
- Web Page Integration (Claude.ai)
- User Interface Elements

b) Extension Architecture
- Background Service
- Content Scripts
- Feature Modules
- UI Components

##### Key Relationships to Highlight

a) Extension Integration Flow:
**Browser -> Chrome Extension -> Claude.ai Interface**

b) Feature Management Flow:
**Extension Manager -> Feature Manager -> Individual Features**

##### Detailed Component Breakdown

Create these specific sections:

##### Core Extension Components
- Background Service (/src/background)
- Content Scripts (/src/content)
- UI Components (/src/components)

##### Feature Modules
- Instruction Selector
- Thinking Block
- Content Synchronization

##### Supporting Services
- Mutation Observer
- Content Sync Hooks
- Utility Services

##### Feature Management
**Extension Manager**
- Feature Manager
- Instruction Selector
- Thinking Block
- Content Sync

##### UI Component Hierarchy
**UI Components**
- Instruction Selector
- Instruction Description
- Instruction Item
- Base UI Elements
- Accordion
- Button
- Select
- Others

##### Data Flow Representation

Key flows:

##### User Interaction Flow
**User Input -> Content Scripts -> Feature Processing -> UI Updates**

##### Content Synchronization
**Claude.ai Content -> Mutation Observer -> Content Sync -> UI Update**

##### Important Notes

- Version compatibility (Chrome v3 manifest)
- Extension boundaries vs. webpage context
- Integration points with Claude.ai
- Configuration flow for instruction sets

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Browser
        Chrome[Chrome Browser]
        Claude[Claude.ai Interface]:::external
    end

    subgraph Extension[Chrome Extension]
        direction TB
        
        subgraph Core[Core Components]
            direction TB
            BS[Background Service]:::core
            CS[Content Scripts]:::core
            EM[Extension Manager]:::core
            FM[Feature Manager]:::core
        end

        subgraph Features[Feature Modules]
            direction TB
            IS[Instruction Selector]:::feature
            TB[Thinking Block]:::feature
            BF[Base Feature]:::feature
        end

        subgraph Services[Supporting Services]
            direction TB
            MO[Mutation Observer]:::service
            CSH[Content Sync Hook]:::service
        end

        subgraph UI[UI Components]
            direction TB
            ISU[Instruction Selector UI]:::ui
            
            subgraph BaseUI[Base UI Elements]
                direction TB
                ACC[Accordion]:::ui
                BTN[Button]:::ui
                SEL[Select]:::ui
            end
        end
    end

    %% Connections
    Chrome --> Extension
    Extension --> Claude
    BS --> CS
    CS --> EM
    EM --> FM
    FM --> IS
    FM --> TB
    IS --> ISU
    TB --> MO
    MO --> CSH
    CSH --> UI
    BF --> IS
    BF --> TB

    %% Click Events
    click BS "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/background/index.ts"
    click CS "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/content/index.ts"
    click EM "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/content/v3/managers/extension-manager.ts"
    click FM "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/content/v3/managers/feature-manager.ts"
    click IS "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/content/v3/features/instruction-selector/index.ts"
    click TB "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/content/v3/features/thinking-block/index.ts"
    click UI "https://github.com/richards199999/Thinking-Claude/tree/main/extensions/chrome/src/components"
    click ACC "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/components/ui/accordion.tsx"
    click BTN "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/components/ui/button.tsx"
    click SEL "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/components/ui/select.tsx"
    click MO "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/services/mutation-observer.ts"
    click CSH "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/hooks/use-content-sync.ts"
    click ISU "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/components/instruction-selector/index.tsx"
    click BF "https://github.com/richards199999/Thinking-Claude/blob/main/extensions/chrome/src/content/v3/features/base-feature.ts"

    %% Styles
    classDef core fill:#2196F3,color:white
    classDef feature fill:#4CAF50,color:white
    classDef service fill:#9C27B0,color:white
    classDef ui fill:#FF9800,color:white
    classDef external fill:#9E9E9E,color:white

    %% Legend
    subgraph Legend
        C[Core Components]:::core
        F[Features]:::feature
        S[Services]:::service
        U[UI Elements]:::ui
        E[External Systems]:::external
    end
```
