Nm Pensive Math Review
by @athola
Verifies math-heavy code for algorithmic correctness and numerical stability
clawhub install nm-pensive-math-reviewπ About This Skill
name: math-review description: | Verify math-heavy code for algorithm correctness, numerical stability, and standards alignment version: 1.9.4 triggers: - math - algorithms - numerical - stability - verification - scientific metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/pensive", "emoji": "\ud83e\udd9e", "requires": {"config": ["night-market.pensive:shared", "night-market.imbue:proof-of-work"]}}} source: claude-night-market source_plugin: pensive
> Night Market Skill β ported from claude-night-market/pensive. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
Table of Contents
Mathematical Algorithm Review
Intensive analysis ensuring numerical stability and alignment with standards.
Quick Start
/math-review
Verification: Run the command with --help flag to verify availability.When To Use
When NOT To Use
Required TodoWrite Items
1. math-review:context-synced
2. math-review:requirements-mapped
3. math-review:derivations-verified
4. math-review:stability-assessed
5. math-review:evidence-logged
Core Workflow
1. Context Sync
pwd && git status -sb && git diff --stat origin/main..HEAD
Verification: Run git status to confirm working tree state.
Enumerate math-heavy files (source, tests, docs, notebooks). Classify risk: safety-critical, financial, ML fairness.2. Requirements Mapping
Translate requirements β mathematical invariants. Document pre/post conditions, conservation laws, bounds. Load:modules/requirements-mapping.md3. Derivation Verification
Re-derive formulas using CAS. Challenge approximations. Cite authoritative standards (NASA-STD-7009, ASME VVUQ). Load:modules/derivation-verification.md4. Stability Assessment
Evaluate conditioning, precision, scaling, randomness. Compare complexity. Quantify uncertainty. Load:modules/numerical-stability.md5. Proof of Work
pytest tests/math/ --benchmark
jupyter nbconvert --execute derivation.ipynb
Verification: Run pytest -v tests/math/ to verify.
Log deviations, recommend: Approve / Approve with actions / Block. Load: modules/testing-strategies.mdProgressive Loading
Default (200 tokens): Core workflow, checklists +Requirements (+300 tokens): Invariants, pre/post conditions, coverage analysis +Derivation (+350 tokens): CAS verification, standards, citations +Stability (+400 tokens): Numerical properties, precision, complexity +Testing (+350 tokens): Edge cases, benchmarks, reproducibility
Total with all modules: ~1600 tokens
Essential Checklist
Correctness: Formulas match spec | Edge cases handled | Units consistent | Domain enforced Stability: Condition number OK | Precision sufficient | No cancellation | Overflow prevented Verification: Derivations documented | References cited | Tests cover invariants | Benchmarks reproducible Documentation: Assumptions stated | Limitations documented | Error bounds specified | References linked
Output Format
## Summary
[Brief findings]Context
Files | Risk classification | StandardsRequirements Analysis
| Invariant | Verified | Evidence |Derivation Review
[Status and conflicts]Stability Analysis
Condition number | Precision | RisksIssues
[M1] [Title]: Location | Issue | FixRecommendation
Approve / Approve with actions / Block
Verification: Run the command with --help flag to verify availability.Exit Criteria
Troubleshooting
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag
β‘ When to Use
π‘ Examples
/math-review
Verification: Run the command with --help flag to verify availability.π Tips & Best Practices
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag