Loading...
Loading...
Turn an analytic geometry problem into a self-contained interactive teaching webpage: left column with problem statement + dynamic console (a variable parameter slider driving real-time recalculation of geometric quantities + theoretical range/fixed value indication), middle column with step-by-step explanations using KaTeX, right column with 2D Canvas dynamic geometry drawing board (ellipse/hyperbola/parabola/circle + moving lines/moving points + vectors + annotations + brush doodling). Supports three entry points—given text problems, random problem generation, and solving problems after uploading and recognizing problem images. Covers problem types such as finding standard equations, chord lengths, vector dot product ranges/fixed values, triangle area maxima/minima, fixed points, fixed values (product of slopes), loci, and eccentricities. Uses a unified method of "setting parametric line x=my+c + simultaneous equations + Vieta's formulas + substitution/constant separation", driven by sympy for precise calculations (answers, coordinates, step values, and theoretical ranges of the interactive engine are consistent from the same source). Other agents can also call this skill to generate such webpages. It parallels edu-solid-geometry in form but uses Canvas-2D + KaTeX (instead of Three.js). Trigger words: 解析几何, 圆锥曲线, 椭圆, 双曲线, 抛物线, 直线与圆锥曲线, 焦点弦, 弦长, 数量积取值范围, 向量数量积, 定点问题, 定值问题, 斜率之积, 三角形面积最值, 轨迹方程, 离心率, 解这道解析几何题, 随机出一道圆锥曲线题, 这张图里的解析几何题; analytic geometry, conic sections, ellipse, hyperbola, parabola, chord length, dot product range, fixed point, fixed value, locus, eccentricity, interactive analytic geometry solution page.
npx skill4agent add wy51ai/edulab edu-analytic-geometry/Users/wuyi/code/code2026/6/template/code_artifact.htmllib/analytic_kernel.pypython3 -c "import sympy"/opt/homebrew/bin/python3.11python3 -m pip install <library name>python3analytic_kernel.is_clean(...)Output language follows prompt language: English prompts → English webpage, Chinese prompts → Chinese webpage. Recordin the spec.language
references/conventions.mdlib/analytic_kernel.pylib/conics.pyconics.ellipse/hyperbola/parabola/circle(...)eq_latexboardchord_setup(conic, through)x=my+cdot_product_exprchord_len_sq_exprtriangle_area_exprslope_product_centralrange_over_m(expr, horizontal_valid=?)is_constant_in_m(expr)python3 lib/analytic_kernel.py # Built-in assertion self-check for flagship problems⚠️ Endpoint open/closed = correctness critical point: For chords passing through foci, horizontal lines (x-axis, θ=0) and vertical lines (θ=90) are valid lines, and their endpoints should be included. Example: For an ellipse MA·MB problem, the x-axis gives −3 and the vertical line gives 7/4, so the answer is the closed interval(many teaching materials incorrectly write it as the open interval[-3, 7/4]).(-3, 7/4]has already made this determination, and the answer is consistent with the interactive tool — drag the slider to 0° to read −3. The "axis direction" of a parabola's focal chord is a degenerate line (intersects at only one point), and its limit endpoints are not included (range_over_mor restrict param range).horizontal_valid=False
📍 Output Location & Unique Product (Most Important): The only deliverable to the user is a singlefile, written to the current working directory (.html) (unless the user explicitly specifies a path). Do not leave any other files in the cwd — build scripts (Path.cwd()),.py, self-check screenshots (__pycache__), temporary files are not deliverables; place them in.pngor delete them after use. Never write into the skill's own directory (/tmpis for internal skill samples).skills/edu-analytic-geometry/output/
/tmp/ag_build.py.htmllessonstepsboardreferences/problem-schema.mdgenerate.render_html(data, out)template/board.html# Build script placed in /tmp (not cwd): /tmp/ag_build.py
import sys; sys.dont_write_bytecode = True # Do not generate __pycache__
sys.path.insert(0, "<skill directory>/scripts")
import generate
from pathlib import Path
data = {"lesson": {...}, "steps": [...], "board": {...}}
out = Path.cwd() / "solution-<problem brief>.html" # Unique product, located in user's current directory
generate.render_html(data, out)python3 -B /tmp/ag_build.py && rm -f /tmp/ag_build.py # -B does not write bytecode; delete temporary script after running, only .html remains in cwdsteps[*].contentK.tex(...)boardboardparamderivedreadoutsrangeBarconstantanswerBanda/b/c@paramstatusanswerBandbuild_*scripts/generate.pyellipse_dot_rangeellipse_chord_rangeellipse_area_maxellipse_slopeprod_constparabola_dot_consthyperbola_ecc_rangestatusanswerBand-B.htmlpython3 -B scripts/generate.py list # List problem types
python3 -B scripts/generate.py ellipse_dot_range ./sol.html
python3 -B scripts/generate.py all ./out_dir # All problem typeslesson.answerassertbuild_*rangeBarrange_over_mconstantag-preview.claude/launch.json.png.py.png__pycache__⚠️ Must close any ports/services you opened: Stop the server immediately after preview, never leave port-occupying processes running.
- Opened by preview tool:
(pass serverId).preview_stop- Directly started
: Usehttp.serverafter use, orkillto confirm release.lsof -nP -iTCP:<port> -sTCP:LISTEN- Confirm ports are released before notifying the user. Not closing ports = incomplete self-check.
solution-<problem brief>.html.html.py.png__pycache__git statuslsanalytic_kernel.pyrange_over_mis_constant_in_mbuild_*generate.pyreferences/conventions.mdconics.pyboard.htmlbuildSceneboard.htmlline_through_angleintersect_line_conicpoint_on_conicpoint_reflecttangent_atfoot_perptemplate/board.html__LESSON_DATA__lib/conics.pylib/analytic_kernel.pyscripts/generate.pyreferences/problem-schema.mdreferences/conventions.md