# lhlhai/prompt-library architecture

> Architecture diagram of the GitHub repository lhlhai/prompt-library, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lhlhai/prompt-library
- Repository: https://github.com/lhlhai/prompt-library

## Overview

The repository is a collection of browser-based learning tools and utilities, centered on the Prompt Library: users search or filter prompts, inspect a prompt, then copy or download it. README also documents the SIT and AI Pattern Lab simulations; sampled source shows their animation and quiz behavior. Other documented-in-tree products include the 100-day lesson browser and Kibana/DSL converter. Edges are limited to relationships explicit in the README or sampled excerpts; unsampled pages and integrations are not inferred.

Main entry points: [`script.js`](https://github.com/lhlhai/prompt-library/blob/main/script.js) (Search and Actions), [`100-days/script.js`](https://github.com/lhlhai/prompt-library/blob/main/100-days/script.js) (Lesson Navigation), [`dsl-converter.html`](https://github.com/lhlhai/prompt-library/blob/main/dsl-converter.html) (Converter UI), [`prompts.html`](https://github.com/lhlhai/prompt-library/blob/main/prompts.html) (Library UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_library["Prompt Library"]
  node_library_ui["Library UI<br/>[prompts.html]"]
  node_prompt_data["Prompt Catalog<br/>[prompts.js]"]
  node_library_logic["Search and Actions<br/>[script.js]"]
  node_search_engine["Search Engine"]
  node_premium_logic["Premium Interactions<br/>[app.js]"]
  node_config["Collections Config<br/>[config.js]"]
  node_shared_ui["Shared Navigation"]
end

subgraph group_learning["Learning Simulations"]
  node_sit_ui["Scope Lab<br/>[index.html]"]
  node_sit_logic["Scope Simulation<br/>[app.js]"]
  node_sit_quiz["Scope Quiz<br/>[app.js]"]
  node_ai_ui["Pattern Lab<br/>[index.html]"]
  node_ai_logic["Pattern Simulation<br/>[app.js]"]
  node_ai_quiz["Pattern Quiz<br/>[app.js]"]
end

subgraph group_lessons["Lesson Browser"]
  node_lesson_ui["Lesson Browser<br/>[index.html]"]
  node_lesson_logic["Lesson Navigation<br/>[script.js]"]
  node_lesson_index["Lesson Index<br/>[index.json]"]
  node_lesson_posts["Lesson Records"]
end

subgraph group_converter["DSL Converter"]
  node_dsl_ui["Converter UI<br/>[dsl-converter.html]"]
  node_dsl_logic["URL and DSL Conversion<br/>[dsl.js]"]
end

node_visitor(("Visitor"))
node_clipboard["Clipboard"]
node_kibana["Kibana URL"]

node_visitor -->|"opens"| node_library_ui
node_library_ui -.->|"runs"| node_library_logic
node_library_logic -->|"filters"| node_prompt_data
node_library_logic -->|"searches"| node_search_engine
node_library_logic -->|"copies"| node_clipboard
node_library_logic -.->|"enables"| node_premium_logic
node_library_logic -.->|"uses"| node_config
node_visitor -->|"opens"| node_sit_ui
node_sit_ui -.->|"runs"| node_sit_logic
node_sit_logic -->|"renders"| node_sit_quiz
node_visitor -->|"opens"| node_ai_ui
node_ai_ui -.->|"runs"| node_ai_logic
node_ai_logic -->|"renders"| node_ai_quiz
node_visitor -.->|"opens"| node_lesson_ui
node_lesson_ui -.->|"runs"| node_lesson_logic
node_lesson_logic -->|"loads"| node_lesson_index
node_lesson_logic -->|"fetches"| node_lesson_posts
node_visitor -.->|"opens"| node_dsl_ui
node_dsl_ui -.->|"runs"| node_dsl_logic
node_kibana -.->|"provides URL"| node_dsl_ui

click node_library_ui "https://github.com/lhlhai/prompt-library/blob/main/prompts.html"
click node_prompt_data "https://github.com/lhlhai/prompt-library/blob/main/prompts.js"
click node_library_logic "https://github.com/lhlhai/prompt-library/blob/main/script.js"
click node_search_engine "https://github.com/lhlhai/prompt-library/blob/main/search-optimizer.js"
click node_premium_logic "https://github.com/lhlhai/prompt-library/blob/main/app.js"
click node_config "https://github.com/lhlhai/prompt-library/blob/main/config.js"
click node_shared_ui "https://github.com/lhlhai/prompt-library/blob/main/shared-components.js"
click node_sit_ui "https://github.com/lhlhai/prompt-library/blob/main/SIT/index.html"
click node_sit_logic "https://github.com/lhlhai/prompt-library/blob/main/SIT/app.js"
click node_sit_quiz "https://github.com/lhlhai/prompt-library/blob/main/SIT/app.js"
click node_ai_ui "https://github.com/lhlhai/prompt-library/blob/main/AI-2026/index.html"
click node_ai_logic "https://github.com/lhlhai/prompt-library/blob/main/AI-2026/app.js"
click node_ai_quiz "https://github.com/lhlhai/prompt-library/blob/main/AI-2026/app.js"
click node_lesson_ui "https://github.com/lhlhai/prompt-library/blob/main/100-days/index.html"
click node_lesson_logic "https://github.com/lhlhai/prompt-library/blob/main/100-days/script.js"
click node_lesson_index "https://github.com/lhlhai/prompt-library/blob/main/100-days/data/index.json"
click node_lesson_posts "https://github.com/lhlhai/prompt-library/tree/main/100-days/data"
click node_dsl_ui "https://github.com/lhlhai/prompt-library/blob/main/dsl-converter.html"
click node_dsl_logic "https://github.com/lhlhai/prompt-library/blob/main/dsl.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_library_ui,node_prompt_data,node_library_logic,node_search_engine,node_premium_logic,node_config,node_shared_ui toneBlue
class node_sit_ui,node_sit_logic,node_sit_quiz,node_ai_ui,node_ai_logic,node_ai_quiz toneAmber
class node_lesson_ui,node_lesson_logic,node_lesson_index,node_lesson_posts toneMint
class node_dsl_ui,node_dsl_logic toneRose
class node_visitor,node_clipboard,node_kibana toneIndigo
```

## Components

### Prompt Library

- [Library UI](https://github.com/lhlhai/prompt-library/blob/main/prompts.html): `prompts.html`
- [Prompt Catalog](https://github.com/lhlhai/prompt-library/blob/main/prompts.js): `prompts.js`
- [Search and Actions](https://github.com/lhlhai/prompt-library/blob/main/script.js): `script.js`
- [Search Engine](https://github.com/lhlhai/prompt-library/blob/main/search-optimizer.js): `search-optimizer.js`
- [Premium Interactions](https://github.com/lhlhai/prompt-library/blob/main/app.js): `app.js`
- [Collections Config](https://github.com/lhlhai/prompt-library/blob/main/config.js): `config.js`
- [Shared Navigation](https://github.com/lhlhai/prompt-library/blob/main/shared-components.js): `shared-components.js`

### Learning Simulations

- [Scope Lab](https://github.com/lhlhai/prompt-library/blob/main/SIT/index.html): `SIT/index.html`
- [Scope Simulation](https://github.com/lhlhai/prompt-library/blob/main/SIT/app.js): `SIT/app.js`
- [Scope Quiz](https://github.com/lhlhai/prompt-library/blob/main/SIT/app.js): `SIT/app.js`
- [Pattern Lab](https://github.com/lhlhai/prompt-library/blob/main/AI-2026/index.html): `AI-2026/index.html`
- [Pattern Simulation](https://github.com/lhlhai/prompt-library/blob/main/AI-2026/app.js): `AI-2026/app.js`
- [Pattern Quiz](https://github.com/lhlhai/prompt-library/blob/main/AI-2026/app.js): `AI-2026/app.js`

### Lesson Browser

- [Lesson Browser](https://github.com/lhlhai/prompt-library/blob/main/100-days/index.html): `100-days/index.html`
- [Lesson Navigation](https://github.com/lhlhai/prompt-library/blob/main/100-days/script.js): `100-days/script.js`
- [Lesson Index](https://github.com/lhlhai/prompt-library/blob/main/100-days/data/index.json): `100-days/data/index.json`
- [Lesson Records](https://github.com/lhlhai/prompt-library/tree/main/100-days/data): `100-days/data`

### DSL Converter

- [Converter UI](https://github.com/lhlhai/prompt-library/blob/main/dsl-converter.html): `dsl-converter.html`
- [URL and DSL Conversion](https://github.com/lhlhai/prompt-library/blob/main/dsl.js): `dsl.js`

### Other components

- **Visitor**
- **Clipboard**
- **Kibana URL**

## Connections

- Visitor → Library UI: opens (evidence: `README.md`)
- Library UI → Search and Actions: runs
- Search and Actions → Prompt Catalog: filters (evidence: `script.js`)
- Search and Actions → Search Engine: searches (evidence: `script.js`)
- Search and Actions → Clipboard: copies
- Search and Actions → Premium Interactions: enables
- Search and Actions → Collections Config: uses
- Visitor → Scope Lab: opens (evidence: `README.md`)
- Scope Lab → Scope Simulation: runs
- Scope Simulation → Scope Quiz: renders (evidence: `SIT/app.js`)
- Visitor → Pattern Lab: opens (evidence: `README.md`)
- Pattern Lab → Pattern Simulation: runs
- Pattern Simulation → Pattern Quiz: renders (evidence: `AI-2026/app.js`)
- Visitor → Lesson Browser: opens
- Lesson Browser → Lesson Navigation: runs
- Lesson Navigation → Lesson Index: loads (evidence: `100-days/script.js`)
- Lesson Navigation → Lesson Records: fetches (evidence: `100-days/script.js`)
- Visitor → Converter UI: opens
- Converter UI → URL and DSL Conversion: runs
- Kibana URL → Converter UI: provides URL
