# imbad0202/critical-thinking-for-humans architecture

> Architecture diagram of the GitHub repository imbad0202/critical-thinking-for-humans, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imbad0202/critical-thinking-for-humans
- Repository: https://github.com/imbad0202/critical-thinking-for-humans

## Overview

Critical-thinking-for-humans is a critical-thinking practice product with three entry paths: AI-coached skill sessions, a portable chat edition, and a bilingual browser Casebook. The web workflow selects a domain and fixed demo mode, presents an authored exercise, records local progress, and can optionally fetch and submit a Daily case for server-side adjudication. The graph includes the documented coaching modes and Passport alongside the sampled web runtime and Daily service. Unsampled browser routing and some skill-runtime behavior are represented only where documented; those links are omitted or marked unverified.

Main entry points: [`web/standalone/game-app.js`](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/game-app.js) (Casebook Game), [`SKILL.md`](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/SKILL.md) (Coaching Skill), [`web/server/content-provider.mjs`](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/content-provider.mjs) (Content Providers), [`web/api/answer.mjs`](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/api/answer.mjs) (Answer API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_coaching["AI Coaching"]
  node_skill["Coaching Skill<br/>[SKILL.md]"]
  node_drill["Drill Mode<br/>[drill.md]"]
  node_scene["Scene Mode<br/>[scene.md]"]
  node_expedition["Expedition Mode<br/>[expedition.md]"]
  node_detective["Detective Mode<br/>[detective.md]"]
  node_passport["Learning Passport<br/>[SCHEMA.md]"]
end

subgraph group_webplay["Web Casebook"]
  node_webapp["Casebook Game<br/>[game-app.js]"]
end

subgraph group_daily["Daily Dispatch"]
  node_dailyapi["Daily Case API<br/>[daily.mjs]"]
  node_answerapi["Answer API<br/>[answer.mjs]"]
  node_publishapi["Scheduled Publisher<br/>[publish-daily.mjs]"]
  node_dailyservice["Daily Case Service<br/>[daily-service.mjs]"]
  node_provider["Content Providers"]
  node_schema["Daily Validation<br/>[daily-schema.mjs]"]
  node_dates["Taipei Date Logic<br/>[daily-date.mjs]"]
  node_http["HTTP Helpers<br/>[http.mjs]"]
  node_ratelimit["Rate Limiter<br/>[rate-limit.mjs]"]
end

subgraph group_content["Content And State"]
  node_demos["Fixed Demo Content<br/>[demo-cases.js]"]
  node_uicopy["Localized UI Copy<br/>[ui-copy.js]"]
end

subgraph group_presentation["Game Presentation"]
  node_feedback["Game Feedback<br/>[game-feedback.js]"]
  node_music["Background Music<br/>[game-music.js]"]
  node_webgl["WebGL Effects<br/>[webgl.js]"]
end

node_player(("Player"))
node_privateblob[("Private Blob")]

node_player -->|"starts session"| node_skill
node_player -->|"plays demo"| node_webapp
node_skill -->|"offers mode"| node_drill
node_skill -->|"offers mode"| node_scene
node_skill -->|"offers mode"| node_expedition
node_skill -->|"offers mode"| node_detective
node_skill -->|"tracks progress"| node_passport
node_webapp -->|"loads content"| node_demos
node_webapp -->|"uses localization"| node_uicopy
node_webapp -->|"uses effects"| node_feedback
node_webapp -->|"uses audio"| node_music
node_webapp -->|"uses rendering"| node_webgl
node_webapp -.->|"requests Daily"| node_dailyapi
node_dailyapi -->|"resolves case"| node_dailyservice
node_dailyapi -->|"creates providers"| node_provider
node_dailyapi -->|"gets date"| node_dates
node_dailyapi -->|"formats response"| node_http
node_answerapi -->|"adjudicates"| node_dailyservice
node_answerapi -->|"creates providers"| node_provider
node_answerapi -->|"gets date"| node_dates
node_answerapi -->|"formats response"| node_http
node_answerapi -->|"limits requests"| node_ratelimit
node_publishapi -->|"publishes case"| node_dailyservice
node_publishapi -->|"creates providers"| node_provider
node_publishapi -->|"sets publish date"| node_dates
node_dailyservice -->|"reads or publishes"| node_provider
node_dailyservice -->|"validates and grades"| node_schema
node_provider -->|"validates records"| node_schema
node_provider -->|"reads and writes"| node_privateblob
node_schema -->|"checks dates"| node_dates
node_http -->|"computes cache TTL"| node_dates

click node_skill "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/SKILL.md"
click node_drill "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/modes/drill.md"
click node_scene "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/modes/scene.md"
click node_expedition "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/modes/expedition.md"
click node_detective "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/modes/detective.md"
click node_passport "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/passport/SCHEMA.md"
click node_webapp "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/game-app.js"
click node_demos "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/content/demo-cases.js"
click node_uicopy "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/content/ui-copy.js"
click node_dailyapi "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/api/daily.mjs"
click node_answerapi "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/api/answer.mjs"
click node_publishapi "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/api/cron/publish-daily.mjs"
click node_dailyservice "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/daily-service.mjs"
click node_provider "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/content-provider.mjs"
click node_schema "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/daily-schema.mjs"
click node_dates "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/daily-date.mjs"
click node_http "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/http.mjs"
click node_ratelimit "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/rate-limit.mjs"
click node_feedback "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/game-feedback.js"
click node_music "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/game-music.js"
click node_webgl "https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/webgl.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_skill,node_drill,node_scene,node_expedition,node_detective,node_passport toneBlue
class node_webapp,node_privateblob toneAmber
class node_dailyapi,node_answerapi,node_publishapi,node_dailyservice,node_provider,node_schema,node_dates,node_http,node_ratelimit toneMint
class node_demos,node_uicopy toneRose
class node_feedback,node_music,node_webgl,node_player toneIndigo
```

## Components

### AI Coaching

- [Coaching Skill](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/SKILL.md): `SKILL.md`
- [Drill Mode](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/modes/drill.md): `modes/drill.md`
- [Scene Mode](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/modes/scene.md): `modes/scene.md`
- [Expedition Mode](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/modes/expedition.md): `modes/expedition.md`
- [Detective Mode](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/modes/detective.md): `modes/detective.md`
- [Learning Passport](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/passport/SCHEMA.md): `passport/SCHEMA.md`

### Web Casebook

- [Casebook Game](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/game-app.js): `web/standalone/game-app.js`

### Daily Dispatch

- [Daily Case API](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/api/daily.mjs): `web/api/daily.mjs`
- [Answer API](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/api/answer.mjs): `web/api/answer.mjs`
- [Scheduled Publisher](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/api/cron/publish-daily.mjs): `web/api/cron/publish-daily.mjs`
- [Daily Case Service](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/daily-service.mjs): `web/server/daily-service.mjs`
- [Content Providers](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/content-provider.mjs): `web/server/content-provider.mjs`
- [Daily Validation](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/daily-schema.mjs): `web/server/daily-schema.mjs`
- [Taipei Date Logic](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/daily-date.mjs): `web/server/daily-date.mjs`
- [HTTP Helpers](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/http.mjs): `web/server/http.mjs`
- [Rate Limiter](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/server/rate-limit.mjs): `web/server/rate-limit.mjs`

### Content And State

- [Fixed Demo Content](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/content/demo-cases.js): `web/content/demo-cases.js`
- [Localized UI Copy](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/content/ui-copy.js): `web/content/ui-copy.js`

### Game Presentation

- [Game Feedback](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/game-feedback.js): `web/standalone/game-feedback.js`
- [Background Music](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/game-music.js): `web/standalone/game-music.js`
- [WebGL Effects](https://github.com/imbad0202/critical-thinking-for-humans/blob/main/web/standalone/webgl.js): `web/standalone/webgl.js`

### Other components

- **Player**
- **Private Blob**

## Connections

- Player → Coaching Skill: starts session (evidence: `README.md`)
- Player → Casebook Game: plays demo (evidence: `README.md`)
- Coaching Skill → Drill Mode: offers mode (evidence: `README.md`)
- Coaching Skill → Scene Mode: offers mode (evidence: `README.md`)
- Coaching Skill → Expedition Mode: offers mode (evidence: `README.md`)
- Coaching Skill → Detective Mode: offers mode (evidence: `README.md`)
- Coaching Skill → Learning Passport: tracks progress (evidence: `README.md`)
- Casebook Game → Fixed Demo Content: loads content (evidence: `web/standalone/game-app.js`)
- Casebook Game → Localized UI Copy: uses localization (evidence: `web/standalone/game-app.js`)
- Casebook Game → Game Feedback: uses effects (evidence: `web/standalone/game-app.js`)
- Casebook Game → Background Music: uses audio (evidence: `web/standalone/game-app.js`)
- Casebook Game → WebGL Effects: uses rendering (evidence: `web/standalone/game-app.js`)
- Casebook Game → Daily Case API: requests Daily
- Daily Case API → Daily Case Service: resolves case (evidence: `web/api/daily.mjs`)
- Daily Case API → Content Providers: creates providers (evidence: `web/api/daily.mjs`)
- Daily Case API → Taipei Date Logic: gets date (evidence: `web/api/daily.mjs`)
- Daily Case API → HTTP Helpers: formats response (evidence: `web/api/daily.mjs`)
- Answer API → Daily Case Service: adjudicates (evidence: `web/api/answer.mjs`)
- Answer API → Content Providers: creates providers (evidence: `web/api/answer.mjs`)
- Answer API → Taipei Date Logic: gets date (evidence: `web/api/answer.mjs`)
- Answer API → HTTP Helpers: formats response (evidence: `web/api/answer.mjs`)
- Answer API → Rate Limiter: limits requests (evidence: `web/api/answer.mjs`)
- Scheduled Publisher → Daily Case Service: publishes case (evidence: `web/api/cron/publish-daily.mjs`)
- Scheduled Publisher → Content Providers: creates providers (evidence: `web/api/cron/publish-daily.mjs`)
- Scheduled Publisher → Taipei Date Logic: sets publish date (evidence: `web/api/cron/publish-daily.mjs`)
- Daily Case Service → Content Providers: reads or publishes (evidence: `web/server/daily-service.mjs`)
- Daily Case Service → Daily Validation: validates and grades (evidence: `web/server/daily-service.mjs`)
- Content Providers → Daily Validation: validates records (evidence: `web/server/content-provider.mjs`)
- Content Providers → Private Blob: reads and writes (evidence: `web/server/content-provider.mjs`)
- Daily Validation → Taipei Date Logic: checks dates (evidence: `web/server/daily-schema.mjs`)
- HTTP Helpers → Taipei Date Logic: computes cache TTL (evidence: `web/server/http.mjs`)
