Usage Guide v1.1.0
Everything you need to start solving problems with uber-polya — the math problem-solver for every AI coding assistant.
uber-polya is a free, open-source skill that implements George Polya's four-phase problem-solving cycle as an executable algorithm. You describe a problem in plain English. It finds the mathematical structure, selects the right algorithm, writes verified solver code, runs it, and gives you the answer with proof.
Don't guess. Solve.
Installation
Claude Code (primary)
That's it. No virtual environment, no build step. The skills are plain markdown files that your AI agent reads on demand.
Other platforms
uber-polya ships native config files for each platform. Clone the repo and the config is already in place:
| Platform | Config File(s) | Format |
|---|---|---|
| Claude Code | CLAUDE.md + skills/*/SKILL.md | Skills with YAML frontmatter |
| OpenAI Codex | AGENTS.md | Cross-tool standard |
| GitHub Copilot | .github/copilot-instructions.md | Markdown |
| Cursor | .cursor/rules/uber-polya.mdc | Markdown with glob targeting |
| Windsurf | .windsurf/rules/uber-polya.md | Markdown |
| Amazon Kiro | .kiro/steering/uber-polya.md | Markdown with YAML frontmatter |
| Qoder, Antigravity, others | AGENTS.md | Cross-tool standard |
All reference files (skills/*/references/) are pure markdown readable by any tool. The 36 worked examples use standard Python with no tool-specific dependencies.
Python dependencies
uber-polya generates Python solver code. Install the libraries as needed, or all at once:
Quick Start
Open your AI agent and type a problem. Here's an exam scheduling example using the three skills step by step.
Step 1: Model the problem
Step 2: Solve it
Step 3: Interpret the result
Or use the orchestrator to run all three steps automatically:
| Polya Phase | Skill | What it does |
|---|---|---|
| 1-2 Understand & Plan | /uber-model | Translates your problem into a formal mathematical model |
| 3 Execute | /uber-solve | Classifies, selects algorithm, solves, verifies |
| 4 Look Back | /uber-interpret | Translates the solution into actionable insight |
The Four Skills
uber-polya ships four skills. Use the orchestrator for most problems, or individual skills for more control.
/uber-polya Orchestrator
When to use: Most of the time. Just describe your problem.
Invocation: /uber-polya <describe your problem>
- Full Pipeline — complete model, solve, interpret cycle
- Fast-Track — skip Socratic dialogue for well-defined problems
- Stop-After-Model — just formalize, don't solve
- Stop-After-Solve — solve but skip interpretation
- PDF Report — generate a branded PDF report with equations and figures
/uber-model Phase A
When to use: When you want to understand the math without solving yet.
Walks through Polya's Phases 1-2 via Socratic questioning. Classifies the problem, identifies unknowns, data, and constraints, then builds a formal model with a mapping table connecting math variables to real-world meaning.
- Phase 0: Problem Reception & Classification
- Phase 1: Understanding (unknowns, data, conditions)
- Phase 2: Devising a Plan (heuristics, candidate structures)
- Phase 3: Formalization (formal model + mapping table)
- Phase 4: Bridge (hand off to /uber-solve)
References: heuristics.md, structures.md, problem-classification.md, common-mistakes.md, model-templates.md
/uber-solve Phase B
When to use: When you already have a well-defined math problem.
Classifies the problem to a named problem class, selects the right algorithm based on instance size and complexity, writes a complete Python solver with Instance/Solution dataclasses, runs it, and independently verifies the answer.
- Phase 0: Model Reception & Classification
- Phase 1: Algorithm Selection + verification method
- Phase 2: Solution Engineering (Python solver code)
- Phase 3: Execution & Verification
- Phase 4: Optimization & Hardening
References: algorithms.md, solvers.md, algorithms-statistics.md, solvers-statistics.md, solving-protocols.md, optimization-hardening.md
/uber-interpret Phase C
When to use: When you have a solution and need to explain it to stakeholders.
Translates mathematical output back to real-world meaning. Performs sensitivity analysis, generates visualizations, formulates actionable recommendations, and adapts communication for the audience (technical, decision-maker, or general).
- Phase 0: Context Recovery (mapping, objective, audience)
- Phase 1: Solution Translation
- Phase 2: Robustness & Sensitivity Analysis
- Phase 3: Visualization (matplotlib/seaborn)
- Phase 4: Recommendations & Communication
- Phase 5: Knowledge Transfer
References: interpretation-patterns.md, visualization.md
Problem Gallery
36 worked examples with complete solver code, independent verification, and sample data.
Everyday Problems 16
Technical Showcases 6
Knowledge Base
uber-polya ships 15 reference files that the AI reads on demand. These are the curated catalogs that power problem classification, algorithm selection, and solution interpretation.
Reference files by skill
| Skill | File | Contents |
|---|---|---|
| /uber-model | heuristics.md | 17 Polya heuristics with Socratic questions |
| structures.md | 43 structures across 10 domains with pattern matching | |
| problem-classification.md | Decision tree + quick-lookup table for rapid classification | |
| common-mistakes.md | 16 anti-patterns (modeling, solving, interpretation) | |
| model-templates.md | 5 fill-in-the-blank formal model templates | |
| /uber-solve | algorithms.md | 94 algorithms (discrete math + continuous optimization) |
| algorithms-statistics.md | 45 statistical algorithms (hypothesis tests, regression, Bayesian) | |
| solvers.md | 9 solver libraries (NetworkX, PuLP, Z3, SymPy, SciPy, OR-Tools, cvxpy, ...) | |
| solvers-statistics.md | 6 statistical libraries (scipy.stats, statsmodels, PyMC, ...) | |
| solving-protocols.md | 8 domain-specific solving workflows | |
| optimization-hardening.md | Performance tuning and production hardening | |
| /uber-interpret | interpretation-patterns.md | Domain-specific math-to-reality translation patterns |
| visualization.md | 20+ chart types with matplotlib templates |
Domains covered
| Domain | Status | What it adds |
|---|---|---|
| Graph Theory | Shipped | Coloring, shortest path, matching, flow, connectivity |
| Combinatorics | Shipped | Counting, permutations, combinations, inclusion-exclusion |
| Set Theory | Shipped | Set operations, partitions, covers |
| Logic | Shipped | SAT, SMT, propositional and first-order logic |
| Number Theory | Shipped | GCD, primality, modular arithmetic |
| Relations & Orders | Shipped | Topological sort, partial orders, lattices |
| Optimization | Shipped | ILP, LP, knapsack, assignment, scheduling |
| Discrete Probability | Shipped | Expected value, random variables, distributions |
| Continuous Optimization | Shipped | Convex QP, BFGS, gradient descent, interior point |
| Statistical Inference | Shipped | Hypothesis testing, regression, Bayesian, bootstrap |
| Game Theory | Shipped | Nash equilibrium, fair division, mechanism design |
| Machine Learning | Shipped | Classification, clustering, dimensionality reduction |
| Simulation | Shipped | Monte Carlo, discrete-event, agent-based |
| Time Series | Shipped | ARIMA, forecasting, anomaly detection |
| Decision Analysis | Shipped | Multi-criteria, decision trees, utility theory |
| Linear Algebra | Shipped | Matrix ops, decomposition, systems of equations |
| Calculus | Shipped | Symbolic differentiation, integration, optimization |
| Geometry | Shipped | Area, distance, convex hull, triangulation |
| Financial Math | Shipped | NPV, IRR, amortization, break-even |
| Multi-Objective | Shipped | Pareto frontier, epsilon-constraint, NSGA-II |
| Stochastic Processes | Shipped | Markov chains, Poisson, random walks |
| Survival Analysis | Shipped | Kaplan-Meier, Cox PH, survival curves |
| Numerical Methods | Shipped | Root finding, interpolation, quadrature |
| Causal Inference | Shipped | Propensity matching, DiD, doubly robust |
| Extended OR | Shipped | Inventory, bin packing, lot sizing, scheduling |
New domains plug in as reference files without changing the core Polya workflow. See CONTRIBUTING.md for how to add a domain.
Platform Compatibility
uber-polya ships native instruction files for 8 AI coding assistants. Each tool gets the full Polya methodology through its native config format, all pointing to the shared protocol in docs/methodology.md.
CLAUDE.md + skills/*/SKILL.mdAGENTS.md.github/copilot-instructions.md.cursor/rules/*.mdc.windsurf/rules/*.md.kiro/steering/*.mdAGENTS.mdAGENTS.mdPDF Report Output v1.1.0
uber-polya can generate professional PDF reports from any solved problem. When you invoke /uber-polya, you choose from three output formats:
| Format | Deliverable | System LaTeX needed? |
|---|---|---|
| Python (default) | Solver script + console output + solution.json | No |
| LaTeX/PDF | .tex source + compiled .pdf report | No (uses fpdf2) |
| Both | Full Python output AND compiled PDF report | No |
How it works
The PDF pipeline flows through three stages:
Report structure
Each PDF report contains branded sections matching the three Polya phases:
| Section | Template | Contents |
|---|---|---|
| Problem Formulation | section_model.tex.j2 | Universe, variables table, structure, mapping, constraints, objective |
| Solution | section_solve.tex.j2 | Answer, metrics, algorithm, verification checks |
| Interpretation | section_interpret.tex.j2 | Question, answer, explanation, sensitivity table, figures, recommendations |
| Appendix | section_appendix.tex.j2 | Python solver source code (optional) |
Generate from existing examples
Dependencies
Design Principles
Socratic, not didactic
Asks questions that could have occurred to you. Guides discovery through dialogue, never lectures.
Verify everything
Every solution includes independent verification. Feasibility checks, optimality certificates, cross-validation.
Right tool for the job
Algorithm selection based on problem class and instance size. Not the fanciest algorithm — the right one.
Audience adaptation
Results adapted for technical, decision-maker, or general audiences. Same math, different communication.
Knowledge transfer
Every problem teaches a reusable modeling pattern. You learn while getting your answer.
Modular expansion
New domains plug in as reference files without changing the core workflow. The architecture grows, not changes.
FAQ
pulp, graph problems need networkx, statistics need statsmodels and scipy. uber-polya tells you what to install when it writes solver code. Or install everything at once: pip install matplotlib numpy pulp scipy sympy networkx cvxpy z3-solver statsmodels/uber-model to just formalize a problem, /uber-solve to just solve a model, or /uber-interpret to just interpret a solution. Each skill's output feeds the next, but they work independently too.algorithms.md, structures to structures.md, interpretation patterns to interpretation-patterns.md, and at least one worked example. See CONTRIBUTING.md for the full checklist.docs/methodology.md. Clone the repo and the config is already in place./uber-polya, you'll be asked to choose an output format: Python (default), LaTeX/PDF, or Both. Choose LaTeX/PDF or Both to get a branded PDF report. You need pip install jinja2 fpdf2 matplotlib. No system LaTeX installation is required — PDF generation uses fpdf2 (pure Python). The .tex source is always saved for optional higher-quality compilation with pdflatex. You can also generate reports from existing examples with python utils/render_example.py examples/<name>/.verify() function that re-checks all constraints without sharing logic with the solver. For optimization problems, uber-polya also checks optimality via LP relaxation bounds or exhaustive comparison on small instances. The verification code is separate from the solver code — it's a genuine independent check.