Dark mode improvements: - Fix DeploymentInfoModal background, title, footer colors - Fix badge contrast (StatusBadge, CodeBadge) with raw rgba/hex values - Fix padding syntax (Panda CSS gotcha: '1 2' → '4px 8px') Agent instructions refactoring: - Slim CLAUDE.md from 1,531 to 1,148 lines (-25%) - Create .claude/skills/database-migrations.md (consolidated skill) - Create .claude/reference/panda-css.md (styling gotchas) - Delete 40+ stale plan/status docs (16k+ lines removed) - Consolidate duplicate migration sections - Add skills/ and reference/ directory structure Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| addition | ||
| components | ||
| constants | ||
| hooks | ||
| typstHelpers | ||
| utils | ||
| AI_GRADING_EXECUTIVE_SUMMARY.md | ||
| AI_MASTERY_ASSESSMENT_PLAN.md | ||
| CONFIG_SCHEMA_GUIDE.md | ||
| HYBRID_LAYOUT_PLAN.md | ||
| IMPLEMENTATION_PLAN_WITH_PANELS.md | ||
| IMPLEMENTATION_STATUS.md | ||
| LAYOUT_REDESIGN_PROPOSALS.md | ||
| MASTERY_DEPENDENCIES.md | ||
| MASTERY_EXECUTIVE_SUMMARY.md | ||
| MASTERY_PROGRESSION_EXAMPLE.md | ||
| MASTERY_REDESIGN_PLAN.md | ||
| MASTERY_SIMPLIFIED.md | ||
| MASTERY_SYSTEM_PLAN.md | ||
| MASTERY_UI_PLAN.md | ||
| MASTERY_V2_ARCHITECTURE.md | ||
| OPERATOR_SPECIFIC_SETTINGS.md | ||
| PROBLEM_GENERATION_ARCHITECTURE.md | ||
| PROMPTING_STRATEGY.md | ||
| PUBLICATION_PLAN.md | ||
| README.md | ||
| README_CONFIG_PERSISTENCE.md | ||
| REFACTORING_PLAN.md | ||
| SHARE_PERSISTENCE_FIX_PLAN.md | ||
| SMART_DIFFICULTY_SPEC.md | ||
| SUBTRACTION_AND_OPERATOR_PLAN.md | ||
| SUBTRACTION_SCAFFOLDING_ANALYSIS.md | ||
| Screenshot 2025-11-10 at 08.43.34.png | ||
| Screenshot 2025-11-10 at 08.43.43.png | ||
| Screenshot 2025-11-10 at 08.43.50.png | ||
| Screenshot 2025-11-10 at 08.55.31.png | ||
| Screenshot 2025-11-10 at 08.55.36.png | ||
| Screenshot 2025-11-10 at 08.55.42.png | ||
| Screenshot 2025-11-10 at 08.55.47.png | ||
| Screenshot 2025-11-10 at 08.55.52.png | ||
| Screenshot 2025-11-10 at 08.55.57.png | ||
| TWO_MODE_IMPLEMENTATION_PLAN.md | ||
| TWO_MODE_SYSTEM_PLAN.md | ||
| TYPST_HELPERS_REFACTOR_PLAN.md | ||
| USER_WARNING_IMPROVEMENTS.md | ||
| UX_EXECUTIVE_SUMMARY.md | ||
| UX_UI_PLAN.md | ||
| WORKSHEET_VIRTUALIZATION_PROPOSALS.md | ||
| complexityLevels.ts | ||
| config-schemas.ts | ||
| difficultyProfiles.ts | ||
| displayRules.ts | ||
| generatePreview.ts | ||
| manualModePresets.ts | ||
| masteryLogic.ts | ||
| page.tsx | ||
| problemAnalysis.ts | ||
| problemGenerator.ts | ||
| progressionPath.ts | ||
| qrCodeGenerator.ts | ||
| skillMigration.ts | ||
| skills.ts | ||
| techniques.ts | ||
| types.ts | ||
| typstGenerator.ts | ||
| typstHelpers.ts | ||
| validation.ts | ||
README.md
Worksheet Generator
Create customizable math worksheets with progressive difficulty, problem space validation, and Typst-powered PDF generation.
Features
- Addition & Subtraction: Full support for multi-digit problems (1-5 digits)
- Progressive Difficulty: Smart Mode automatically scales difficulty based on skill level
- Problem Space Validation: Real-time warnings when configurations have limited unique problems
- Typst Integration: High-quality PDF generation with customizable layouts
- Display Rules: Configurable visual aids (carry boxes, ten frames, place-value colors, etc.)
- Mastery System: Adaptive learning with skill tracking and progression
Quick Start
// Access the worksheet studio at /create/worksheets/addition
// Configure settings, preview problems, download PDF
Architecture Documentation
Core Systems
Problem Generation - PROBLEM_GENERATION_ARCHITECTURE.md
- Complete technical documentation of problem generation algorithms
- Two generation strategies: generate-all + shuffle (small spaces) vs retry-based (large spaces)
- Problem space estimation and duplicate risk calculation
- Edge cases: single-digit constraints, mixed mastery mode, subtraction borrowing
- Performance considerations and testing guide
Quick Reference - .claude/PROBLEM_GENERATION.md
- Fast lookup for developers and Claude Code
- Strategy selection logic with code examples
- Debugging commands and common modifications
- Q&A troubleshooting section
UX Improvements - USER_WARNING_IMPROVEMENTS.md
- Recommended UI enhancements for problem space warnings
- Design mockups for config panel indicators
- Implementation phases and component structure
Additional Documentation
- Configuration Schema -
CONFIG_SCHEMA_GUIDE.md- Complete guide to worksheet configuration - Smart Difficulty -
addition/SMART_DIFFICULTY_SPEC.md- Smart Mode progression spec - Subtraction System -
SUBTRACTION_AND_OPERATOR_PLAN.md- Subtraction implementation - ⚠️ Operator-Specific Settings -
OPERATOR_SPECIFIC_SETTINGS.md- [NEEDS REFACTORING] Mixed mode architecture & refactoring plan
Key Concepts
Problem Space
The "problem space" is the set of all unique problems possible given your constraints:
- 1-digit 100% regrouping: Only 45 unique problems exist (e.g., 2+8, 3+7, 4+9...)
- 2-digit mixed regrouping: ~4,000 unique problems
- 3-digit problems: ~400,000 unique problems
Why it matters: Requesting more problems than exist in the space results in duplicates. The system warns you when this happens.
Generation Strategies
Generate-All + Shuffle (Small spaces < 10,000)
- Enumerates all valid problems upfront
- Shuffles deterministically
- Zero retries, guaranteed coverage
- Cycles through full set when requesting more than available
Retry-Based (Large spaces ≥ 10,000)
- Randomly generates problems
- Retries on duplicates (up to 100 times)
- Allows some duplicates to prevent performance issues
Progressive Difficulty
Smart Mode - Automatically adjusts difficulty based on:
- Student skill level (tracked via mastery system)
- Previous performance
- Target regrouping/borrowing probability
Manual Mode - You control:
- Digit range (1-5 digits)
- Regrouping/borrowing probability (0-100%)
- Progressive vs constant difficulty
Common Edge Cases
Single-Digit 100% Regrouping
Problem: Only 45 unique problems where both operands are 0-9 and result requires carrying.
Solution:
- Reduce pages to 1-2 (20-40 problems)
- Lower regrouping to 50%
- Increase to 2-digit problems
Mastery + Mixed Mode
Problem: Addition and subtraction use separate skill-based configs, making combined problem space estimation complex.
Solution: Validation is skipped for this mode. Each operator uses its own config independently.
Subtraction Multiple Borrowing
Problem: 1-2 digit subtraction cannot have 2+ borrow operations (mathematical impossibility).
Solution: System automatically falls back to single-borrow problems for these ranges.
File Structure
worksheets/
├── README.md (this file)
├── PROBLEM_GENERATION_ARCHITECTURE.md # Technical deep-dive
├── USER_WARNING_IMPROVEMENTS.md # UX enhancement plan
├── problemGenerator.ts # Core generation logic
├── utils/
│ └── validateProblemSpace.ts # Space estimation
├── components/
│ ├── config-panel/ # Configuration UI
│ └── worksheet-preview/ # Preview + warnings
│ ├── WorksheetPreviewContext.tsx # Validation state
│ └── DuplicateWarningBanner.tsx # Warning display
└── addition/
├── SMART_DIFFICULTY_SPEC.md # Smart Mode spec
└── page.tsx # Addition worksheet page
Testing
# Type check
npm run type-check
# Run all checks before committing
npm run pre-commit
See PROBLEM_GENERATION_ARCHITECTURE.md for comprehensive testing checklist.
Contributing
When modifying problem generation:
- Read
PROBLEM_GENERATION_ARCHITECTURE.mdfor complete system understanding - Check
.claude/PROBLEM_GENERATION.mdfor quick reference - Run the testing checklist
- Update inline comments if changing generation strategy
- Consider UX impact (see
USER_WARNING_IMPROVEMENTS.md)
Related Documentation
Parent: apps/web/README.md - Web application overview
Abacus Component: packages/abacus-react/README.md - Abacus visualization library