Engineering Calculation Script Audit
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_ddcb4786/engineering-script-audit.
About this skill
What It Addresses
Engineering calculation scripts often fail not because of syntax, but because formulas are copied incorrectly, applicability limits are missed, numerical solvers are unstable, or invalid inputs cause crashes. This skill targets hydraulic, civil, and water-engineering calculation scripts that need formula review, standards compliance checks, abnormal result debugging, and numerical code inspection, especially against SL, GB, or DL references.
How It Works
The audit follows a staged engineering-review approach:
- Formula compliance validation: extracts core formulas, records code locations, variable meanings, and formula sources. User-provided standard text or retrieved clause text takes priority; internal notes such as formula_reference.md or draft calculation sheets are treated only as low-confidence clues. Findings are rated PASS, WARN, or FAIL with explicit confidence.
- Applicability checks: verifies parameters such as δ/H, P1/H, H0/Hd, and Fr stay within valid physical ranges, checks whether lookup tables are being extrapolated unsafely, and confirms classification logic near boundary values.
- Numerical robustness review: examines iterative solvers, prefers bisection for global localization before Newton polishing, and checks initial guesses, convergence criteria, iteration limits, division by zero, negative square roots, and logarithmic singularities.
- Defensive guards and result validation: requires high-risk operations to return clear, physics-aware errors instead of raw Python stack traces, then validates units, conservation, monotonic behavior, and degenerate cases.
Boundaries
This skill is best used to audit, verify, and debug existing engineering calculation scripts, not to replace a complete design report. When original standard text is unavailable, some findings may remain provisional and should not be treated as final defects.
Use Cases
- Audit weir and spillway scripts to verify jump distance and discharge coefficient formulas against SL253-2018.
- Debug open-channel critical depth iterations where Newton methods fail or converge to the wrong root.
- Check P1/H table lookups for out-of-range parameters and unsafe discharge coefficient extrapolation.
- Add defensive guards for negative square roots, division by zero, and log singularities to prevent crashes.
Best For
- Hydraulic engineers who need to verify calculation scripts against SL, GB, or DL standards.
- R&D engineers debugging unstable hydraulic script iterations or abnormal calculation results.
- Hydraulic design engineers reviewing lookup-table applicability and parameter boundaries.
- Backend developers adding defensive guards and producing audit conclusions for engineering code.
Related Skills
A one-shot coding agent built on Claude Code CLI that runs non-interactively, supports a specified workdir, and can be monitored in the foreground or background.
Preview and confirm file sorting by extension, with recursive cleanup, ignore rules, and transactional rollback.
An engineering assistant for static HTML/CSS/JS pages, design-token extraction, IE8-compatible review, and structured delivery.
An engineering workflow for requirement analysis, scenario modeling, risk planning, quality gates, testing, and knowledge capture, with lightweight, standard, and full modes.