math-logic-reasoning/SKILL.md
Activate this skill for any problem requiring rigorous mathematical reasoning, formal logical deduction, or structured constraint solving. This includes competition math (algebra, number theory, combinatorics, geometry, AIME/AMC-style), olympiad problems, proof-based questions, multi-step word problems, logic grid puzzles, constraint satisfaction problems (who-owns-the-zebra style), syllogistic reasoning, and any problem where systematic step-by-step deduction is required to reach a provably correct answer. Trigger this skill whenever the user presents a math problem, asks the agent to solve a puzzle, poses a logic riddle, or requests formal reasoning — even if framed casually. When in doubt, use this skill. Precision and correctness matter more than speed.
npx skillsauth add ahoynodnarb/reasoning-based-skills math-logic-reasoningInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill governs how the agent approaches problems that demand exact, verifiable answers through structured reasoning. It applies to two broad problem families — mathematical reasoning and logical deduction — with shared principles and specialized techniques for each.
The most common source of error is "obvious" steps that aren't verified. Write out every nontrivial manipulation. A step that takes 2 seconds to write saves minutes of backtracking.
Before any computation, articulate:
This prevents solving the wrong problem.
Your scratch work can be messy. Your final answer should be clearly stated, with the key logical chain summarized. Never bury the answer in the middle of working.
Every answer should pass at least one check:
Stuckness usually means the current representation is wrong. Try: different variable naming, a diagram, a small concrete case, the contrapositive, casework, symmetry arguments, or modular arithmetic.
Before computing anything, ask:
Read the problem twice. Misreading is the #1 cause of wasted effort.
Phase 1 — Setup
Phase 2 — Strategy Selection Choose your approach before executing. Common strategies:
| Situation | Strategy | |-----------|----------| | System of equations | Substitution, elimination, or matrix methods | | Divisibility / modular | Factor, use mod arithmetic, check small cases | | Counting | Bijection, complementary counting, inclusion-exclusion | | Geometric | Coordinate geometry, similarity, area ratios, trigonometry | | Optimization | AM-GM, Cauchy-Schwarz, calculus (if allowed), Lagrange multipliers | | Recursion / sequences | Find closed form, characteristic equation, generating functions | | Existence / construction | Explicit construction OR pigeonhole / probabilistic |
Phase 3 — Execution
Phase 4 — Verification
This covers constraint satisfaction, logic grid puzzles, syllogistic chains, and any problem where you must derive what must be true given a set of rules.
Never guess. Never assume. Only record what is forced by the constraints.
If you can't prove something is true, it isn't known yet.
Inventory: List all entities, attributes, and possible values.
Build an elimination grid for each (attribute × entity) pair. Start with all values possible.
Translate each clue into one or more constraint statements:
Repeat until no new inferences can be drawn:
Direct assignment: If only one value remains possible for a cell, assign it and propagate (eliminate that value from all other cells in the same row/column).
Forced by elimination: If a value can only go in one cell in a group, assign it there.
Linked constraints: Combine two clues to produce a new one.
Positional arithmetic: For ordered arrangements, use inequalities and count remaining slots.
Case analysis (last resort): If stuck, branch on the most constrained unknown. Mark it clearly, follow to contradiction or resolution, then try the other branch.
| Error | Prevention | |-------|-----------| | Assuming a clue implies its converse | Only conclude what the clue directly states | | Forgetting a constraint exists | After each deduction, re-check all clues for new implications | | Conflating "neighbor" with "immediately left/right" | Re-read the problem's definition | | Assigning before confirming uniqueness | Count remaining options before assigning |
Once a complete assignment is found:
[Brief restatement of what's being solved]
**Setup:**
[Define variables, state given conditions]
**Solution:**
[Step-by-step work with clear transitions]
**Answer: [X]**
**Verification:**
[Substitute back or check the answer]
[List of entities and attributes]
**Deduction trace:**
[Numbered steps, each citing the clue used]
Step 1: From clue 3, ...
Step 2: Since step 1 forces ..., combined with clue 7, ...
**Solution:**
[Final assignment table]
**Verification:**
[Every clue checked: ✓ Clue 1: ..., ✓ Clue 2: ...]
references/competition-techniques.md for deeper treatment of specific math techniques (generating functions, modular inverses, projective geometry, etc.)references/logic-patterns.md for a catalog of common constraint types and their propagation rulesHard problems (AIME #13-15, multi-constraint logic grids) often require:
Elegance is a signal of correctness. If the answer is ugly, look for a cleaner path.
development
Evaluate scientific claims and evidence quality. Use for assessing experimental design validity, identifying biases and confounders, applying evidence grading frameworks (GRADE, Cochrane Risk of Bias), or teaching critical analysis. Best for understanding evidence quality, identifying flaws. For formal peer review writing use peer-review.
testing
Creative research ideation and exploration. Use for open-ended brainstorming sessions, exploring interdisciplinary connections, challenging assumptions, or identifying research gaps. Best for early-stage research planning when you do not have specific observations yet. For formulating testable hypotheses from data use hypothesis-generation.
testing
Apply this skill whenever the user writes in a non-English language, asks questions about regional/cultural knowledge tied to a specific country or language community, poses math or logic problems in any language, or needs to follow multi-step instructions given in a non-English language. Also use when the user explicitly asks the agent to respond in a specific language, when a task requires cross-lingual reasoning or comparison, or when the user is testing the agent's multilingual ability. This skill dramatically improves performance on multilingual instruction-following, regional knowledge, mathematical reasoning, and logic tasks in any language. Use it proactively — don't wait for the user to ask about "multilingual" explicitly.
development
Structured hypothesis formulation from observations. Use when you have experimental observations or data and need to formulate testable hypotheses with predictions, propose mechanisms, and design experiments to test them. Follows scientific method framework. For open-ended ideation use scientific-brainstorming; for automated LLM-driven hypothesis testing on datasets use hypogenic.