360 Secure SkillHub
360 安全技能中心

math-review

面向数学密集型代码的审查流程:同步上下文并划分风险,把需求映射为数学不变量,用 CAS 复验推导并引用标准,评估条件数、精度、缩放与不确定性,检查边界用例与基准可复现性,记录证据后给出通过、有条件通过或阻断的结论。

athola
athola
热度 62.53
最近更新 2026-08-26 21:20:04
分类:开发依赖:代码执行 / 读写文件应用场景:代码审查 / 调试排错 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add nm-pensive-math-review
Metadata
name
math-review
description
Verifies math-heavy code for algorithmic correctness and numerical stability
version
1.9.8
triggers
["math","algorithms","numerical","stability","verification","scientific","reviewing scientific algorithms","ML models","or numerical code"]
metadata
{"openclaw":{"homepage":"https://github.com/athola/claude-night-market/tree/master/plugins/pensive","emoji":"🦞","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

  • 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
  • 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

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

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 | Issue | Fix

## Recommendation
Approve / Approve with actions / Block

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

Exit Criteria

  • Context synced, requirements mapped, derivations verified, stability assessed, evidence logged with citations