# wy51ai/edulab architecture

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

- Interactive diagram: https://gitdiagram.com/wy51ai/edulab
- Repository: https://github.com/wy51ai/edulab

## Overview

#### Purpose and Distribution
edulab is a collection of installable Claude/`skills` education skills that transform a problem or reaction into a standalone interactive HTML lesson. It is distributed as both a skills package and Claude plugin marketplace entry via `.claude-plugin/plugin.json` and `.claude-plugin/marketplace.json`.

#### Invocation and Entry Points
Each domain skill accepts normalized text problems, image-derived problems, or seeded/random examples through its skill definition and CLI generator:
- Solid geometry: `skills/edu-solid-geometry/SKILL.md`, `skills/edu-solid-geometry/scripts/generate.py`
- Analytic geometry: `skills/edu-analytic-geometry/SKILL.md`, `skills/edu-analytic-geometry/scripts/generate.py`
- Chemistry: `skills/edu-chem-reaction/SKILL.md`, `skills/edu-chem-reaction/scripts/generate.py`

The CLI writes self-contained HTML to an explicit output path or the current working directory.

#### Shared Pipeline
All three skills follow a domain-specific pipeline: structured problem/reaction specification → exact or validated kernel computation → lesson/model data assembly → injection into a generic browser template → generated HTML delivery. Reference schemas and conventions establish the contract between skill prompting, generators, and kernels, e.g. `skills/edu-solid-geometry/references/problem-schema.md` and `skills/edu-chem-reaction/references/conventions.md`.

#### Solid Geometry Solver and Renderer
`skills/edu-solid-geometry/lib/geometry_kernel.py` is the SymPy-backed exact solver for coordinate/vector formulations, answers, intermediate values, and Three.js coordinates. `skills/edu-solid-geometry/lib/bodies.py` supplies solid edge topology. The generator packages this model into `skills/edu-solid-geometry/template/lesson.html`, a data-driven 3D lesson renderer using Three.js and MathJax.

#### Analytic Geometry Solver and Board
`skills/edu-analytic-geometry/lib/analytic_kernel.py` solves conic problems using parameterized lines, systems, Vieta relations, substitutions, and endpoint attainability checks. `skills/edu-analytic-geometry/lib/conics.py` defines supported curves. Its output feeds `skills/edu-analytic-geometry/template/board.html`, which provides Canvas-based conic interaction, parameter-driven constructions, live values, and KaTeX rendering.

#### Chemistry Validation and Molecular Animation
`skills/edu-chem-reaction/lib/reaction_kernel.py` is the consistency boundary: it balances equations with SymPy, validates atom-map bijections and conservation, computes broken/formed bonds, and assembles render data. `skills/edu-chem-reaction/lib/molecules.py` supplies default VSEPR molecular geometry; RDKit is optionally used when already present for SMILES conformers. `skills/edu-chem-reaction/template/reaction.html` is a unified Three.js renderer supporting morph and mechanism position-resolution engines, equation/narration UI, counters, and optional energy curves.

#### Runtime and External Boundaries
Generation runs under Python 3 with SymPy required by all compute kernels. Generated lessons are static browser artifacts: solid geometry and chemistry use Three.js; analytic geometry uses Canvas; math presentation uses MathJax or KaTeX by template. There is no server-side application runtime or required external API. `index.html` is a completed sample artifact rather than a runtime entry point.

Main entry points: [`.claude-plugin/plugin.json`](https://github.com/wy51ai/edulab/blob/master/.claude-plugin/plugin.json) (Claude plugin entry), [`skills/edu-solid-geometry/SKILL.md`](https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/SKILL.md) (Solid skill), [`skills/edu-solid-geometry/lib/geometry_kernel.py`](https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/lib/geometry_kernel.py) (Exact geometry solver), [`skills/edu-analytic-geometry/lib/analytic_kernel.py`](https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/lib/analytic_kernel.py) (Conic solver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_distribution["Distribution"]
  node_plugin["Claude plugin entry<br/>plugin manifest<br/>[plugin.json]"]
  node_marketplace["Marketplace entry<br/>marketplace manifest<br/>[marketplace.json]"]
end

subgraph group_solid["Solid Geometry"]
  node_solid_skill["Solid skill<br/>skill definition<br/>[SKILL.md]"]
  node_solid_generator["Solid generator<br/>Python CLI<br/>[generate.py]"]
  node_geometry_kernel["Exact geometry solver<br/>SymPy kernel<br/>[geometry_kernel.py]"]
  node_body_topology["Solid topology<br/>body definitions<br/>[bodies.py]"]
  node_solid_template["3D lesson template<br/>HTML renderer<br/>[lesson.html]"]
end

subgraph group_analytic["Analytic Geometry"]
  node_analytic_skill["Analytic skill<br/>skill definition<br/>[SKILL.md]"]
  node_analytic_generator["Analytic generator<br/>Python CLI<br/>[generate.py]"]
  node_analytic_kernel["Conic solver<br/>analytic kernel<br/>[analytic_kernel.py]"]
  node_conics["Supported conics<br/>curve definitions<br/>[conics.py]"]
  node_analytic_template["Interactive board<br/>HTML renderer<br/>[board.html]"]
end

subgraph group_chemistry["Chemistry"]
  node_chem_skill["Chemistry skill<br/>skill definition<br/>[SKILL.md]"]
  node_chem_generator["Reaction generator<br/>Python CLI<br/>[generate.py]"]
  node_reaction_kernel["Reaction validator<br/>SymPy kernel<br/>[reaction_kernel.py]"]
  node_molecules["Molecular geometry<br/>VSEPR models<br/>[molecules.py]"]
  node_chem_template["Reaction lesson template<br/>HTML renderer<br/>[reaction.html]"]
end

subgraph group_runtime["Generated Lesson Runtime"]
  node_html_output["Standalone HTML lesson<br/>static artifact"]
end

node_shared_contract["Problem contracts<br/>reference schemas<br/>[problem-schema.md]"]

node_marketplace -->|"lists"| node_plugin
node_plugin -->|"publishes"| node_solid_skill
node_plugin -->|"publishes"| node_analytic_skill
node_plugin -->|"publishes"| node_chem_skill
node_shared_contract -.->|"defines input"| node_solid_skill
node_solid_skill -->|"invokes"| node_solid_generator
node_solid_generator -->|"solves specification"| node_geometry_kernel
node_body_topology -->|"provides edges"| node_geometry_kernel
node_geometry_kernel -->|"injects lesson data"| node_solid_template
node_solid_template -->|"renders"| node_html_output
node_analytic_skill -->|"invokes"| node_analytic_generator
node_analytic_generator -->|"solves specification"| node_analytic_kernel
node_conics -->|"defines curves"| node_analytic_kernel
node_analytic_kernel -->|"injects board data"| node_analytic_template
node_analytic_template -->|"renders"| node_html_output
node_chem_skill -->|"invokes"| node_chem_generator
node_chem_generator -->|"validates reaction"| node_reaction_kernel
node_molecules -->|"provides geometry"| node_reaction_kernel
node_reaction_kernel -->|"injects render data"| node_chem_template
node_chem_template -->|"renders"| node_html_output

click node_plugin "https://github.com/wy51ai/edulab/blob/master/.claude-plugin/plugin.json"
click node_marketplace "https://github.com/wy51ai/edulab/blob/master/.claude-plugin/marketplace.json"
click node_shared_contract "https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/references/problem-schema.md"
click node_solid_skill "https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/SKILL.md"
click node_solid_generator "https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/scripts/generate.py"
click node_geometry_kernel "https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/lib/geometry_kernel.py"
click node_body_topology "https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/lib/bodies.py"
click node_solid_template "https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/template/lesson.html"
click node_analytic_skill "https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/SKILL.md"
click node_analytic_generator "https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/scripts/generate.py"
click node_analytic_kernel "https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/lib/analytic_kernel.py"
click node_conics "https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/lib/conics.py"
click node_analytic_template "https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/template/board.html"
click node_chem_skill "https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/SKILL.md"
click node_chem_generator "https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/scripts/generate.py"
click node_reaction_kernel "https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/lib/reaction_kernel.py"
click node_molecules "https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/lib/molecules.py"
click node_chem_template "https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/template/reaction.html"

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_plugin,node_marketplace toneBlue
class node_solid_skill,node_solid_generator,node_geometry_kernel,node_body_topology,node_solid_template toneAmber
class node_analytic_skill,node_analytic_generator,node_analytic_kernel,node_conics,node_analytic_template toneMint
class node_chem_skill,node_chem_generator,node_reaction_kernel,node_molecules,node_chem_template toneRose
class node_html_output toneIndigo
class node_shared_contract toneNeutral
```

## Components

### Distribution

- [Claude plugin entry](https://github.com/wy51ai/edulab/blob/master/.claude-plugin/plugin.json): plugin manifest · Publishes the skills package and marketplace entry. · `.claude-plugin/plugin.json`
- [Marketplace entry](https://github.com/wy51ai/edulab/blob/master/.claude-plugin/marketplace.json): marketplace manifest · `.claude-plugin/marketplace.json`

### Solid Geometry

- [Solid skill](https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/SKILL.md): skill definition · `skills/edu-solid-geometry/SKILL.md`
- [Solid generator](https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/scripts/generate.py): Python CLI · `skills/edu-solid-geometry/scripts/generate.py`
- [Exact geometry solver](https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/lib/geometry_kernel.py): SymPy kernel · Computes exact results, intermediates, and 3D coordinates. · `skills/edu-solid-geometry/lib/geometry_kernel.py`
- [Solid topology](https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/lib/bodies.py): body definitions · `skills/edu-solid-geometry/lib/bodies.py`
- [3D lesson template](https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/template/lesson.html): HTML renderer · Data-driven Three.js and MathJax lesson. · `skills/edu-solid-geometry/template/lesson.html`

### Analytic Geometry

- [Analytic skill](https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/SKILL.md): skill definition · `skills/edu-analytic-geometry/SKILL.md`
- [Analytic generator](https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/scripts/generate.py): Python CLI · `skills/edu-analytic-geometry/scripts/generate.py`
- [Conic solver](https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/lib/analytic_kernel.py): analytic kernel · Uses parameterized lines, systems, Vieta, and attainability checks. · `skills/edu-analytic-geometry/lib/analytic_kernel.py`
- [Supported conics](https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/lib/conics.py): curve definitions · `skills/edu-analytic-geometry/lib/conics.py`
- [Interactive board](https://github.com/wy51ai/edulab/blob/master/skills/edu-analytic-geometry/template/board.html): HTML renderer · Canvas board with live constructions and KaTeX. · `skills/edu-analytic-geometry/template/board.html`

### Chemistry

- [Chemistry skill](https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/SKILL.md): skill definition · `skills/edu-chem-reaction/SKILL.md`
- [Reaction generator](https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/scripts/generate.py): Python CLI · `skills/edu-chem-reaction/scripts/generate.py`
- [Reaction validator](https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/lib/reaction_kernel.py): SymPy kernel · Balances equations, validates atom maps, derives bonds, and assembles render data. · `skills/edu-chem-reaction/lib/reaction_kernel.py`
- [Molecular geometry](https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/lib/molecules.py): VSEPR models · Optionally uses available RDKit conformers. · `skills/edu-chem-reaction/lib/molecules.py`
- [Reaction lesson template](https://github.com/wy51ai/edulab/blob/master/skills/edu-chem-reaction/template/reaction.html): HTML renderer · Three.js morph/mechanism animation with equation and energy UI. · `skills/edu-chem-reaction/template/reaction.html`

### Generated Lesson Runtime

- **Standalone HTML lesson**: static artifact · CLI writes to an explicit path or current directory; no server runtime.

### Other components

- [Problem contracts](https://github.com/wy51ai/edulab/blob/master/skills/edu-solid-geometry/references/problem-schema.md): reference schemas · Conventions connect skill prompting, generators, and compute kernels. · `skills/edu-solid-geometry/references/problem-schema.md`

## Connections

- Marketplace entry → Claude plugin entry: lists
- Claude plugin entry → Solid skill: publishes
- Claude plugin entry → Analytic skill: publishes
- Claude plugin entry → Chemistry skill: publishes
- Problem contracts → Solid skill: defines input
- Solid skill → Solid generator: invokes
- Solid generator → Exact geometry solver: solves specification
- Solid topology → Exact geometry solver: provides edges
- Exact geometry solver → 3D lesson template: injects lesson data
- 3D lesson template → Standalone HTML lesson: renders
- Analytic skill → Analytic generator: invokes
- Analytic generator → Conic solver: solves specification
- Supported conics → Conic solver: defines curves
- Conic solver → Interactive board: injects board data
- Interactive board → Standalone HTML lesson: renders
- Chemistry skill → Reaction generator: invokes
- Reaction generator → Reaction validator: validates reaction
- Molecular geometry → Reaction validator: provides geometry
- Reaction validator → Reaction lesson template: injects render data
- Reaction lesson template → Standalone HTML lesson: renders
