跳到主要内容
知仓学习社ZHICANG

math-review

Verifies math-heavy code for algorithmic correctness and numerical stability. Use when reviewing scientific algorithms, ML models, or numerical code.

不碰外部(只输出文字)无严重或高危命中athola/claude-night-market

它会碰到什么

扫了多少5 个文本文件,20 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Table of Contents

  • [Quick Start](#quick-start)
  • [When to Use](#when-to-use)
  • [Required TodoWrite Items](#required-todowrite-items)
  • [Core Workflow](#core-workflow)
  • [1. Context Sync](#1-context-sync)
  • [2. Requirements Mapping](#2-requirements-mapping)
  • [3. Derivation Verification](#3-derivation-verification)
  • [4. Stability Assessment](#4-stability-assessment)
  • [5. Proof of Work](#5-proof-of-work)
  • [Progressive Loading](#progressive-loading)
  • [Essential Checklist](#essential-checklist)
  • [Output Format](#output-format)
  • [Summary](#summary)
  • [Context](#context)
  • [Requirements Analysis](#requirements-analysis)
  • [Derivation Review](#derivation-review)
  • [Stability Analysis](#stability-analysis)
  • [Issues](#issues)
  • [Recommendation](#recommendation)
  • [Exit Criteria](#exit-criteria)

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

  • Changes to mathematical models or algorithms
  • Statistical routines or probabilistic logic
  • Numerical integration or optimization
  • Scientific computing code
  • ML/AI model implementations
  • Safety-critical calculations

When NOT To Use

  • General algorithm review -

use architecture-review

  • Performance optimization - use parseltongue:python-performance

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
  6. math-review:findings-verified

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.md

3. Derivation Verification

Re-derive formulas using CAS. Challenge approximations. Cite authoritative standards (NASA-STD-7009, ASME VVUQ). Load: modules/derivation-verification.md

4. Stability Assessment

Evaluate conditioning, precision, scaling, randomness. Compare complexity. Quantify uncertainty. Load: modules/numerical-stability.md

5. 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.md

6. Verify Findings Are Grounded (math-review:findings-verified)

Every issue must cite a real location and a verbatim anchor. Write

findings to .review/findings.json and confirm each citation resolves:

python plugins/imbue/scripts/citation_verifier.py \
  --findings .review/findings.json --repo-root .

Drop or label UNVERIFIED any finding the verifier fails (exit 1);

only verified findings enter the report. See Skill(imbue:review-core)

Step 5 for the protocol and Skill(imbue:structured-output) for the

finding schema.

Progressive 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 | Standards

## Requirements Analysis
| Invariant | Verified | Evidence |

## Derivation Review
[Status and conflicts]

## Stability Analysis
Condition number | Precision | Risks

## Issues
[M1] [Title]
- Location: file.py:123
- Anchor: `verbatim source text at line 123`
- Issue: [what is wrong] | Fix: [remediation] | Evidence: [E1]

## Recommendation
Approve / Approve with actions / Block

Every issue's Anchor is the exact source text at Location; it is what

citation_verifier.py re-reads to prove the finding is real.

Verification: Run the command with --help flag to verify availability.

Exit Criteria

  • Context synced, requirements mapped, derivations verified, stability assessed, evidence logged with citations
  • Every reported issue carries a Location + verbatim Anchor, and citation_verifier.py confirmed all citations (exit 0) or unverified issues were dropped or labeled UNVERIFIED

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。