| name | auditing_calculations |
| description | Audit and double-check math calculations across all book types. Use when asked to verify, check, double-check, audit, or review calculations, answers, solutions, explanations, or math accuracy in any book type: study guide, workbook, worksheet, quiz, puzzles, steps, 30 days, 10 days, test question banks 1 or 2, or practice tests. Covers all LaTeX answer environments (answerExplain, worksheetAnswer, puzzleAnswer, correctAnswer, answer, answerTF, answerMC) and worked examples. |
Auditing Math Calculations
Overview
This skill guides you through a rigorous calculation audit of any book type in the math project. The goal is to catch wrong answers, incorrect intermediate steps, and explanation errors — then fix them with minimal changes.
HARD RULE — Do not touch the LaTeX unless there is a confirmed miscalculation.
If every answer, every intermediate step, and every explanation is mathematically correct, make zero edits to the file. Do not reword, restyle, reformat, or "improve" anything. The only reason to change a .tex file during an audit is to correct objectively wrong math.
When to Use
- User asks to "check", "verify", "double-check", "audit", or "review" calculations or answers
- User mentions "math accuracy", "correct answers", "wrong answer", or "calculation errors"
- User references a specific book type, chapter, topic, or file to verify
- User asks to review "practices", "examples", "quiz questions", "worksheet answers", "puzzle solutions", or "step-by-step solutions"
Supported Book Types
| Book Type | Source Folders | Answer Commands | Explanation? |
|---|
| Study Guide | topics/, topics_additional/, topics_modified/ | \answerExplain{A}{E}, \answerTF{T/F} | Yes |
| Workbook | topics_workbook/, topics_workbook_additional/, topics_workbook_modified/ | \answerExplain{A}{E}, \answerTF{T/F} | Yes |
| Worksheet | topics_worksheet/, topics_worksheet_additional/, topics_worksheet_modified/ | \worksheetAnswer{bold answer + explanation} | Yes (inline) |
| Quiz | topics_quiz/, topics_quiz_additional/, topics_quiz_modified/ | \answerExplain{letter (answer)}{E} | Yes |
| Puzzles | topics_puzzles/, topics_puzzles_additional/, topics_puzzles_modified/ | \puzzleAnswer{explanation} | Yes |
| Steps | steps_topics/, steps_topics_additional/, steps_topics_modified/ | \answer{A} | No (answer only) |
| In 30 Days | topics_in30days/, topics_in30days_additional/, topics_in30days_modified/ | \answer{A}, \answerExplain{A}{E}, \answerTF{}, \answerMC{} | Mixed |
| In 10 Days | topics_in10days/, topics_in10days_additional/, topics_in10days_modified/ | \answerExplain{A}{E} | Yes |
| Test Bank 1 | tests_questions_bank/topics/, .../topics_additional/, .../topics_modified/ | \correctAnswer{X}, \explanation{} | Yes |
| Test Bank 2 | tests_questions_bank_2/topics/, .../topics_additional/, .../topics_modified/ | \correctAnswer{X}, \explanation{} | Yes |
For test question banks (Bank 1 or Bank 2), also consult the auditing_question_bank_accuracy skill for the bank-specific audit-review PDF workflow and the deeper MC-choice-expansion procedure.
Procedure
Step 0: Determine Scope
Ask the user (or infer from the request) two things:
- Which book type? — This determines which folder(s) and answer commands to look for.
- Which chapter, topic, or file? — Could be a single file, a chapter, or all files of a book type.
If the user says "check the workbook chapter 3", that means all files in topics_workbook/ that start with ch03-. If they say "check this file", use the currently open file.
Step 1: Discover the Files
Single file
If the user specifies a file or has one open, use that directly.
By chapter
Run the discovery script to list all topics for that chapter:
python scripts/get_chapter_topic_facts.py --chapter {N}
Then map the output to the correct book type folder. The script returns paths relative to topic type (topics/, topics_additional/, topics_modified/). Prepend the book type prefix:
| Book type | Prefix for core | Prefix for additional | Prefix for modified |
|---|
| Study Guide | topics/ | topics_additional/ | topics_modified/ |
| Workbook | topics_workbook/ | topics_workbook_additional/ | topics_workbook_modified/ |
| Worksheet | topics_worksheet/ | topics_worksheet_additional/ | topics_worksheet_modified/ |
| Quiz | topics_quiz/ | topics_quiz_additional/ | topics_quiz_modified/ |
| Puzzles | topics_puzzles/ | topics_puzzles_additional/ | topics_puzzles_modified/ |
| Steps | steps_topics/ | steps_topics_additional/ | steps_topics_modified/ |
| In 30 Days | topics_in30days/ | topics_in30days_additional/ | topics_in30days_modified/ |
| In 10 Days | topics_in10days/ | topics_in10days_additional/ | topics_in10days_modified/ |
| Test Bank 1 | tests_questions_bank/topics/ | tests_questions_bank/topics_additional/ | tests_questions_bank/topics_modified/ |
| Test Bank 2 | tests_questions_bank_2/topics/ | tests_questions_bank_2/topics_additional/ | tests_questions_bank_2/topics_modified/ |
Not every file listed by the script will exist in every book type. Check existence before reading.
Step 2: Read Every Source File in Full
Read each file completely. Do not skim or sample. Every problem, example, and answer must be checked.
Step 3: Verify All Calculations
Work through the file top-to-bottom, checking every piece of verifiable math. The checks differ by what you find:
3a. Worked Examples (workedExample, sideBySideExample, stepExample, quickLesson)
These are teaching sections with step-by-step solutions.
- Re-solve the problem independently before reading the example's solution.
- Walk through every intermediate step. Verify each arithmetic operation, algebraic manipulation, and simplification.
- Check the final result matches what the example claims.
- Verify formulas used are correct (e.g., area of a circle is $\pi r^2$, not $\pi d^2$; volume of a cylinder is $\pi r^2 h$, not $\pi r h$).
3b. \answerExplain{answer}{explanation}
Used in: Study Guide, Workbook, Quiz, In 10 Days, In 30 Days.
- Solve the problem independently. Compute the answer from the question text alone.
- Compare your answer with the first argument (the answer field).
- Walk through the explanation (second argument) and verify every intermediate calculation.
- Check consistency: Does the explanation arrive at the same answer stated in the first argument?
For Quiz questions — the answer field includes the choice letter (e.g., "B ($\sqrt{5}$)"): 5. Verify the correct answer matches the choice text. If \answerExplain{B (...)}{} is given, confirm \choiceB{} actually contains that value. 6. Evaluate ALL four choices. Confirm the three wrong choices are genuinely wrong. This catches bugs where two choices simplify to the same value.
3c. \worksheetAnswer{text}
Used in: Worksheet.
- The bold portion is the answer and the rest is the explanation. Parse both.
- Solve the problem independently from the question/activity instructions above.
- Verify the bold answer is correct.
- Walk through the inline explanation and check each calculation.
- For multi-part activities (circleIt, sortCut, matchIt, errorDetective): verify every individual item, not just the first one.
3d. \puzzleAnswer{text}
Used in: Puzzles.
- Read the puzzle setup carefully — clues, constraints, and difficulty level.
- Solve the puzzle yourself using only the clues given.
- Verify the explanation in
\puzzleAnswer{} follows logically from the clues.
- For sort/classify puzzles: check every single item is correctly categorized.
- For mystery number puzzles: verify each clue eliminates what the answer claims.
3e. \answer{text}
Used in: Steps, In 30 Days.
- Solve the problem independently.
- Compare your result with the answer text.
- For multi-sentence answers (e.g., "No. Since 15 is not a perfect square..."), verify the reasoning too.
3f. \answerTF{True/False} and \answerMC{letter}
Used in: Study Guide, In 30 Days.
- Evaluate the statement (for True/False) or work through all choices (for MC).
- Confirm the keyed value is correct.
3g. \correctAnswer{X} and \explanation{}
Used in: Test Question Banks 1 and 2.
Follow the detailed procedure in the auditing_question_bank_accuracy skill, which covers:
- Independently computing the answer before looking at choices
- Expanding/evaluating EVERY multiple-choice option
- Walking through the explanation step by step
- Checking for contradictions between explanation and keyed answer
3h. Concept Boxes, Tips, and Definitions
Also verify math in non-question environments:
\begin{conceptBox} — formulas, equations, identities stated as facts
\begin{tipBox} / \mascotSays{} / \begin{keyIdea} — shortcuts, rules of thumb
\begin{errorBox} — the "wrong work" must actually contain the stated error, and the correction must be right
\stepResult{} — final result in step cards
- Inline math in prose — any equation or calculation woven into explanatory text
Step 4: Classify Findings
Only flag issues where the math is objectively wrong:
- A calculation error (arithmetic, algebra, formula)
- The answer doesn't match the explanation
- A formula is stated incorrectly
- A worked example produces the wrong result
- A True/False or MC answer is keyed incorrectly
- An explanation contradicts the stated answer
- For worksheets: the bold answer doesn't match the explanation logic
- For puzzles: the clues don't actually lead to the stated answer
Do NOT flag (and do NOT edit):
- Style or wording preferences
- Alternative solution methods that still produce the correct answer
- Minor phrasing differences in explanations
- Rounding variations when both values are acceptable
- Distractor choices in MC (don't rewrite wrong answers — only flag if the correct answer is wrong or if two choices are identical)
- Formatting, whitespace, comments, or LaTeX structure
- Anything that is not a mathematical error
If the math is correct, leave the file unchanged — no exceptions.
Step 5: Fix ONLY Miscalculations — Nothing Else
If the audit found no miscalculations, skip this step entirely and do not edit any file.
For each confirmed error:
- Change only what is necessary. If the answer is wrong but the explanation is correct, change only the answer. If both are wrong, fix both.
- Preserve the original phrasing — change numbers and math, not prose.
- Do not restructure surrounding content that is correct.
- For MC questions: Change only
\correctAnswer and/or \explanation. Never modify \choiceA–\choiceD. If a distractor happens to equal the correct answer, change only the key and explanation to point to the right choice.
- For worksheetAnswer: Change only the bold answer and/or the calculation within the explanation.
Step 6: Compile and Validate (Optional)
If the user wants visual confirmation, compile the changed files:
For test question banks — use the audit-review PDF workflow:
cp audit_review_template.tex tests/audit_review.tex
latexmk -xelatex -interaction=nonstopmode -halt-on-error -outdir=build tests/audit_review.tex
open build/audit_review.pdf
See the auditing_question_bank_accuracy skill for detailed instructions on the audit-review template.
For other book types — compile the relevant main file:
| Book type | Compile command |
|---|
| Study Guide | latexmk -xelatex -outdir=build study_guide_main.tex |
| Workbook | latexmk -xelatex -outdir=build workbook_main.tex |
| Steps | latexmk -xelatex -outdir=build steps_main.tex |
Or, for a quick single-file check, use the audit-review template with an \input{} of the changed file.
Step 7: Report Results
Provide a structured summary:
- Files audited — list every file read (with count).
- Issues found and fixed — for each fix:
- File name and location in the file (problem number or environment)
- What was wrong (the specific calculation error)
- What it was changed to (the corrected math)
- Issues found but NOT fixed — if any require user judgment (e.g., ambiguous question wording that could affect the answer).
- Clean bill of health — explicitly state if no errors were found, so the user knows the audit is complete, not abandoned.
Common Error Patterns
These are the most frequent calculation bugs across all book types:
| Error Type | Example | Book Types Most Affected |
|---|
| Sign errors | $-3 - 5 = -2$ instead of $-8$ | All (especially with negatives) |
| Fraction operations | $\frac{2}{3} + \frac{1}{4} = \frac{3}{7}$ (wrong LCD) | Study guide, workbook, quiz |
| Exponent rules | $x^2 \cdot x^3 = x^6$ instead of $x^5$ | Steps, 10-day, study guide |
| Order of operations | $2 + 3 \times 4 = 20$ instead of $14$ | All |
| Formula misapplication | Using $\pi r h$ instead of $\pi r^2 h$ for cylinder volume | Geometry topics |
| Decimal placement | $0.3 \times 0.4 = 1.2$ instead of $0.12$ | Workbook, worksheet |
| Percent errors | Percent increase: using new/original instead of change/original | Study guide, quiz, 30 days |
| Coordinate mistakes | Reflecting $(3,4)$ over $x$-axis gives $(3,4)$ instead of $(3,-4)$ | All geometry topics |
| Slope calculation | Swapping $x$ and $y$ in $\frac{y_2-y_1}{x_2-x_1}$ | Linear equations topics |
| Pythagorean theorem | $a^2 + b^2 = c$ instead of $c^2$ | Geometry topics |
| Scientific notation | $3.2 \times 10^{-3} = 0.0032$ instead of $0.0032$ (correct) but writing the conversion wrong | Powers/roots chapter |
| Square root simplification | $\sqrt{50} = 5\sqrt{5}$ instead of $5\sqrt{2}$ | Irrational numbers chapter |
| Distribution errors | $-2(x-3) = -2x - 6$ instead of $-2x + 6$ | Expressions/equations |
| Explanation contradicts answer | Explanation derives A but answer says B | All book types |
Workflow by Request Type
"Check this file" (single file)
→ Read it → Verify all math → Fix errors → Report
"Check [book type] chapter N"
→ Run get_chapter_topic_facts.py --chapter N → Map to folders → Read all files → Verify → Fix → Report
"Check all [book type] files"
→ List all files in the folder(s) → Read each → Verify → Fix → Report (this may be very large; suggest doing it chapter by chapter)
"Check the answers in [book type] for topic X"
→ Find the specific file by topic slug → Read → Verify only the answers → Fix → Report