2.5 KiB
2.5 KiB
| description | allowed-tools | |||||||
|---|---|---|---|---|---|---|---|---|
| Create a new math worksheet document (JSON config + HTML + PDF) |
|
You are creating a new math worksheet document. Follow these steps:
Step 1: Gather requirements
Use AskUserQuestion to ask the user (ask all at once, not one by one):
- Theme — what visual theme? (space, forest, ocean, etc.). Currently only "space" theme with
space-basetemplate is available. - Pages — how many pages and what math task for each page? E.g. "Page 1: addition A+B where A 1-20, B 1-10. Page 2: multiplication A×B where A,B 1-5"
- Texts — title, subtitle, and footer bubble text (or use defaults from theme)
- Document name — filename for the output (used as
tasks/<name>.jsonandoutput/html/<name>.html)
Step 2: Create JSON task config
Read tasks/space-exploration-1.json as a format reference.
Create a new JSON file in tasks/<name>.json with:
- Unique
idmatching the filename labelswith title/subtitle/footerBubble from user inputthemematching the chosen visual themelayoutwith columns and problemsPerPagepagesarray — one entry per page with:task: free-text description of the math problemsproblemCount: number of problems (typically 20)heroImage: pick from available hero images (for space:assets/hero-images/spaceship{1-6}.jpeg)footerImage: pick from available footer images (for space:assets/footers/planet{1-6}.jpeg)heroDirection: alternate betweenrowandrow-reverseacross pages
Use different hero/footer images for each page.
Step 3: Generate HTML
- Read
src/templates/space-base.html(structure reference) - Read
src/examples/space-worksheet.html(finished output reference) - Read the JSON config you just created
Generate the HTML file at output/html/<name>.html:
- For each page, generate concrete math problems based on the
tasktext - Assign unique icons from
assets/icons/pack1/— no icon should repeat across the entire document. Shuffle minerals and plants together randomly - Randomize problem card alignment (justify-start, justify-center, justify-end) — no visible pattern
- Use
break-after: pagebetween pages (not on the last page) - Do NOT use
overflow-hiddenon the footer container (causes PDF hairline artifact)
Step 4: Generate PDF
Run: npm run pdf -- output/html/<name>.html
Step 5: Report
Tell the user:
- Path to JSON config
- Path to HTML file
- Path to PDF file
- Summary of what was generated (pages, problem types)