katas-critical-self-correction

Cross-checks declared numeric values against recomputed totals and flags mismatches for human review.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/JaviMontano/claude-plugins --skill katas-critical-self-correction-javimontano
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: katas-critical-self-correction
Source: https://github.com/JaviMontano/claude-plugins/tree/main/plugins/claude-native-toolkit/skills/katas-critical-self-correction
Command: npx skills add https://github.com/JaviMontano/claude-plugins --skill katas-critical-self-correction-javimontano

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When an agent extracts or calculates numbers from documents (invoice totals, sums, counts, derived dates), it can silently trust a wrong declared value or quietly overwrite it with its own calculation. This Skill enforces a numeric cross-check between the stated value and the deterministically recomputed value, emitting a typed mismatch flag with both values and the delta instead of silently correcting, so billing, accounting, and tax pipelines never approve a plausible hallucination. ## Core Features & Use Cases - Stated vs computed cross-check: Extracts the declared value and recalculates the value in code, comparing them with abs(stated - computed) > epsilon. - Typed mismatch output: Returns stated_total, computed_total, delta, mismatch, and needs_human_review, preserving both values and never choosing one unilaterally. - Domain-aware epsilon: Zero tolerance for integer counts, a justified cent-rounding epsilon for currency amounts. - Use Case: An invoice declares a total of 1,900.00 USD but its line items sum to 1,800.00 USD; the Skill emits mismatch=true with the 100.00 delta and routes the case to human review instead of approving payment. ## Quick Start Ask the agent to extract the total from the attached invoice and verify that the declared total matches the sum of its line items, flagging any mismatch for human review.

Frequently Asked Questions about katas-critical-self-correction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify an invoice total against its line items?▼

Extract the declared total as stated, recompute the sum of line items in code as computed, and compare them with abs(stated - computed) > epsilon. If they differ beyond the tolerance, return both values with the delta, set mismatch to true, and route to human review.

What epsilon tolerance should I use for numeric cross-checks?▼

Use zero tolerance for integer counts and derived quantities requiring exact equality. For currency amounts, use a small epsilon based on cent rounding, such as 0.01, and justify the chosen value explicitly rather than assuming it.

What happens when a document does not declare a total?▼

Return the recomputed value as computed_total with stated_total set to null and mismatch set to false. The Skill does not fabricate a conflict when there is no declared comparator, and it records the calculation provenance.

Why is silently correcting a mismatched total dangerous?▼

Silent correction hides the discrepancy from reviewers, so the pipeline trusts whichever number looks more plausible, which may be a hallucination. In billing, accounting, or tax contexts this becomes an operational incident because no human ever sees the conflict.

When should this numeric cross-check not be activated?▼

Do not activate it for purely qualitative tasks like copywriting where there are no extracted totals, sums, counts, or derived dates to verify. It requires a stated value from a source and a deterministically recomputable counterpart.