Loading...
Loading...
Turn a chemical reaction into a self-contained microscopic 3D interactive demonstration webpage: The left/top section features a Three.js interactive molecular animation (drag the slider to view bond breaking, bond forming, and atomic recombination with step-by-step highlighting), while the right section includes KaTeX reaction equations + step-by-step explanations + atom conservation counting + optional energy-reaction progress curves. Three entry methods are supported—given text reactions/equations, random question generation, and demonstration after image upload and recognition. It covers combustion, combination/decomposition/single displacement/double displacement reactions, redox reactions (electron transfer visualization), and organic reaction mechanisms (esterification and other reactions involving catalysts and transition states). It is precisely driven by sympy: automatically balance equations, verify atom conservation and atomic mapping, deduce bond breaking/forming, ensuring consistency between answers and geometric models. Two built-in engines are available with automatic selection: morph (atomic deformation, demonstrating atom conservation) and mechanism (mechanism keyframes, demonstrating catalysis/transition states). Hybrid geometry: uses a self-built VSEPR molecular library by default; if RDKit is installed in the environment, it can generate conformations from SMILES (never installed automatically). Other agents can also call this skill to generate such webpages. Its form is parallel to edu-solid-geometry / edu-analytic-geometry, but uses Three.js + KaTeX to demonstrate molecular reactions. Trigger words: chemical reaction, microscopic demonstration, molecular animation, combustion, methane combustion, hydrogen combustion, water electrolysis, redox reaction, electron transfer, esterification reaction, reaction mechanism, bond breaking and forming, atom conservation, mass conservation, chemical equation balancing, solve this chemical reaction, generate a random chemical reaction, the chemical reaction in this image; chemistry reaction, microscopic/molecular animation, combustion, electrolysis, redox electron transfer, esterification mechanism, bond breaking and forming, atom conservation, balance equation, interactive chemistry reaction page.
npx skill4agent add wy51ai/edulab edu-chem-reactiontemplate/reaction.htmllib/reaction_kernel.pypython3python3 -c "import sympy"/opt/homebrew/bin/python3.11python3 -m pip install <library name>references/problem-schema.mdbalanced_coefficientsOutput Language Follows Prompt Language: English prompts → English webpage, Chinese prompts → Chinese webpage. Recordin the spec.meta.language
references/conventions.mdlib/reaction_kernel.pybalanced_coefficients(...)assemble_data(spec)datapython3 lib/reaction_kernel.py # Self-check for balancing + conservation + bond difference
python3 lib/molecules.py # Self-check for molecular library📍 Output Location (Important): The final HTML file must be written to the user's current working directory (), unless the user explicitly specifies a path. Never write to the skill's own directory (such asPath.cwd())—that is the internal development sample directory for the skill.skills/edu-chem-reaction/output/
build_*scripts/generate.pyrender_html(K.assemble_data(spec), out)from pathlib import Path
out = Path.cwd() / "reaction-<brief-reaction-description>.html" # Saved in user's current directory
render_html(K.assemble_data(spec), out)build_combustion_ch4species + atom_mapbuild_redox_na_cl2electronsbuild_esterificationatoms + fragments + keyframesgenerate.pypython3 <skill-directory>/scripts/generate.py combustion_ch4 ./reaction.html
python3 <skill-directory>/scripts/generate.py listassemble_data⚠️ Must Close Opened Ports/Services: Stop the local server immediately after preview checks are completed, never leave port-occupied processes running. If using the preview tool: runright after checking. Confirm the port is released before delivering the result to the user.preview_stop
reaction-<brief-reaction-description>.htmlassemble_datameta.engineautomorphmechanismautoorganicfragmentsflamecatalysttransitionGlowelectronsenergymeta.accentbuild_*species+atom_mapatoms+fragmentsgenerate.pyREGISTRY_LIBRARY_BUILDERSlib/molecules.pydatatemplate/reaction.htmltemplate/reaction.html__REACTION_DATA__lib/molecules.pylib/reaction_kernel.pyscripts/generate.pyreferences/problem-schema.mdreferences/conventions.md