.claude/skills/jaxsr-review/SKILL.md
# JAXSR Review Skill — Red-Team, Engineering & Pedagogical Review Systematically review JAXSR code, documentation, guides, and notebooks for API correctness, engineering quality, and pedagogical clarity. ## Skill Activation Activate this skill when the user invokes `/jaxsr-review` or asks to review, audit, or check correctness of JAXSR-related files (notebooks, guides, templates, source code). ## Invocation Syntax ``` /jaxsr-review <TARGET> # all scopes on one file/
npx skillsauth add jkitchin/jaxsr .claude/skills/jaxsr-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Systematically review JAXSR code, documentation, guides, and notebooks for API correctness, engineering quality, and pedagogical clarity.
Activate this skill when the user invokes /jaxsr-review or asks to review, audit, or
check correctness of JAXSR-related files (notebooks, guides, templates, source code).
/jaxsr-review <TARGET> # all scopes on one file/dir
/jaxsr-review --scope api <TARGET> # API correctness only
/jaxsr-review --scope engineering <TARGET> # safety/robustness only
/jaxsr-review --scope pedagogy <TARGET> # clarity/explanation only
TARGET can be a file path, directory, or glob pattern.
If no target is given, review the whole project (examples/, docs/, src/jaxsr/).
| Scope | What it checks | CLAUDE.md checklists |
|-------|---------------|----------------------|
| api | Signatures, return types, imports, ANOVA filtering, copy-paste safety | #1 Red-Team, #5 Cross-Ref, #6 Copy-Paste |
| engineering | Numerical hazards, destructive ops, packaging, dead code, docstrings | #2 Software Engineering |
| pedagogy | Progression, term definitions, "why" explanations, coverage gaps | #3 Pedagogical, #4 Coverage Gap |
When no --scope is specified, run all three scopes.
--scope value (default: all three scopes).TARGET path(s). Resolve globs. Verify files exist..ipynb (notebook), .md (guide/doc), .py (source/template).api)This is the highest-priority review. Incorrect examples teach users wrong patterns.
For every JAXSR API call found in the target files, verify against this authoritative reference. Each entry lists: function/class, correct usage, and common mistake.
| API | Returns | Common Mistake |
|-----|---------|---------------|
| model.coefficient_intervals() | dict[str, (est, lo, hi, se)] — 4-tuple per term | Unpacking as (lo, hi) — it's a 4-tuple |
| bootstrap_coefficients() | dict with keys "coefficients", "mean", "std", "lower", "upper", "names" | Using result.intervals or result.names — it's a plain dict, use result["names"] |
| bootstrap_predict() | dict with keys "y_pred", "y_mean", "y_std", "lower", "upper" | Using result.upper, result.lower — it's a plain dict, use result["upper"] |
| conformal_predict_split() | dict with keys "y_pred", "lower", "upper", "quantile" | Tuple unpacking y_pred, lo, hi = conformal_predict_split(...) — returns dict |
| model.predict_conformal() | tuple (y_pred, lower, upper) | Treating like dict — the method returns a tuple, the standalone function returns dict |
| cross_validate() | dict with "mean_test_score", "std_test_score", etc. | Treating return as array |
| canonical_analysis() | CanonicalAnalysis dataclass | — |
| Class | Correct Attribute | Common Mistake |
|-------|-------------------|---------------|
| BayesianModelAverage | .weights (property, returns dict[str, float]) | .weights_ (no trailing underscore) |
| BayesianModelAverage | .expressions (property, returns list[str]) | .models_ (wrong name entirely) |
| CanonicalAnalysis | .stationary_response | .predicted_response (wrong name) |
| CanonicalAnalysis | .stationary_point, .eigenvalues, .eigenvectors, .nature, .b_vector, .B_matrix, .warnings | — |
| AnovaResult | .rows (list of AnovaRow) | — |
| AnovaRow | .source, .df, .sum_sq, .mean_sq, .f_value, .p_value | .p_value can be None for summary rows |
| Class/Function | Correct Signature | Common Mistake |
|----------------|-------------------|---------------|
| ActiveLearner(model, bounds, acquisition) | bounds is 2nd positional arg | ActiveLearner(model, acq, bounds) — wrong arg order |
| Composite(functions=[(w, acq), ...]) | functions is list of (weight, AcquisitionFunction) tuples | Composite([...], weights=[...]) — no separate weights param |
| ResponseSurface(n_factors=..., bounds=..., ...) | n_factors is required first arg | Missing n_factors |
| factorial_design(levels, n_factors, ...) | levels is required first arg | factorial_design(n_factors=3) — missing levels |
| fractional_factorial_design(n_factors, resolution=3) | Parameter is resolution | fraction=2 — wrong param name |
| canonical_analysis(model, bounds=...) | Parameter is bounds | factor_names=... — wrong param name |
| API | Correct Usage | Common Mistake |
|-----|---------------|---------------|
| model.get_params() | Returns dict of constructor params | Accessing non-constructor attrs |
| model.get_params(deep=True) | Includes nested estimator__param keys for MultiOutputSymbolicRegressor | Expecting only flat keys |
| model.set_params(key=val) | Sets constructor params, returns self | Passing non-constructor param names |
| mo.set_params(estimator__max_terms=8) | Double-underscore syntax for nested params | mo.set_params(max_terms=8) — wrong level |
| _clone_estimator(est) | Uses type(est)(**est.get_params(deep=False)) | Manual parameter listing |
| sklearn n_jobs | Always use n_jobs=1 | n_jobs=-1 — conflicts with JAX parallelism |
| BasisLibrary in Pipeline | Not a transformer; configure before creating estimator | Including as Pipeline step |
| Class | Correct Method | Common Mistake |
|-------|---------------|---------------|
| ResponseSurface | .ccd(), .box_behnken(), .factorial() — separate methods | .create_design() — wrong method name |
| Parameter | Valid Values | Common Mistake |
|-----------|-------------|---------------|
| SymbolicRegressor(information_criterion=) | "aic", "aicc", "bic" | "cv" — not supported as IC |
| compute_information_criterion(criterion=) | "aic", "aicc", "bic", "hqc", "mdl" | Note: "hqc" and "mdl" are valid HERE but NOT in SymbolicRegressor |
| add_transcendental(funcs=) | Defaults to ["log", "exp", "sqrt", "inv"] (4 funcs) | Listing 7 default funcs (sin, cos, tan are NOT default) |
| discrete_dims | dict[int, list] — maps dimension index to allowed values | list[int] — wrong type |
When iterating over anova_result.rows to compute percentages or display tables:
source in {"Model", "Residual", "Total"} — these are summary rows.p_value — it is None for "Residual" and "Total" rows.for row in result.rows:
if row.source in {"Model", "Residual", "Total"}:
continue # skip summary rows
pct = 100 * row.sum_sq / total_ss
Do NOT flag these as errors:
compute_information_criterion(..., criterion="hqc") — valid for standalone functionmodel.predict_interval() returning a tuple — the method returns (y_pred, lower, upper)BayesianModelAverage.weights without underscore — this IS correct (no trailing _)jaxsr that exist in __all__ — even if not commonly used.item() on JAX arrays outside JIT — this is fine outside JITFor each target file:
jaxsr.__init__.__all__."See guides/..." or "See templates/..." references point to files that exist.engineering)Check for:
jnp.linalg.inv() on potentially singular matrices → suggest lstsq, pinv, or SVDjnp.log(x) without guarding x > 0 → suggest jnp.log(jnp.clip(x, 1e-30))mean of empty, indexing empty)float() or int() on JAX tracers inside @jit-decorated functionsif/else on runtime values inside @jit → suggest jax.lax.cond or jnp.whereCheck for:
shutil.rmtree() without path validation against deny-list (/, /home, /usr, /etc, /var, /tmp, $HOME)os.remove() or os.unlink() without existence checksubprocess calls with unsanitized inputsCheck for:
__all__ that are not imported in __init__.py__init__.py that are not in __all__pyproject.toml (packages vs force-include).claude/skills/jaxsr/ and src/jaxsr/skill/ out of syncCheck for:
len(x), list(x) without assignment)Check that public functions have:
For .ipynb files:
scipy.special.erfinv not np.math.erfinvp_valuepedagogy)Read the target as a first-time user and evaluate:
Every code block must either:
Common failures to flag:
import numpy as np or from jaxsr import ...model variable before the fitting code blockCheck which JAXSR features are NOT covered by any guide, template, or notebook:
Currently covered:
Known gaps (flag as INFO if relevant to the target):
Produce a structured markdown report with this exact format:
# Review Report
**Target:** <file or directory path>
**Scope:** <api | engineering | pedagogy | all>
**Files reviewed:** <count>
## Summary
| Severity | Count |
|----------|-------|
| CRITICAL | N |
| WARNING | N |
| INFO | N |
## CRITICAL
### [C1] <short title>
- **File:** <path>, <location (line N or cell N, line N)>
- **Code:** `<offending code snippet>`
- **Problem:** <what is wrong>
- **Fix:** `<corrected code>`
- **Source:** <source file:line where the correct API is defined>
### [C2] ...
## WARNING
### [W1] <short title>
- **File:** <path>, <location>
- **Code:** `<relevant code>`
- **Problem:** <what could go wrong>
- **Suggestion:** <recommended change>
### [W2] ...
## INFO
### [I1] <short title>
- **File:** <path>, <location>
- **Note:** <observation or suggestion>
---
*Review generated by `/jaxsr-review` skill*
| Severity | Definition | |----------|-----------| | CRITICAL | Will cause runtime errors, wrong results, or teaches incorrect API usage. Must fix before merging. | | WARNING | Won't crash but is fragile, unclear, or inconsistent. Should fix. | | INFO | Stylistic, coverage gap, or minor improvement opportunity. Nice to have. |
information_criterion="cv") → CRITICALp_value → WARNINGjnp.linalg.inv() without singularity guard → WARNING.py, .md, and .ipynb files.src/jaxsr/__init__.py to get the current __all__ list.development
# JAXSR Skill — Symbolic Regression Assistant JAXSR is a JAX-based symbolic regression library that discovers interpretable algebraic expressions from data using sparse optimization. It follows ALAMO-style methodology: build a rich candidate basis, then select the simplest model that explains the data. ## Skill Activation Activate this skill when the user wants to: - Discover algebraic expressions or equations from data - Set up a Design of Experiments (DOE) study - Fit, interpret, or export
development
# JAXSR Skill — Symbolic Regression Assistant JAXSR is a JAX-based symbolic regression library that discovers interpretable algebraic expressions from data using sparse optimization. It follows ALAMO-style methodology: build a rich candidate basis, then select the simplest model that explains the data. ## Skill Activation Activate this skill when the user wants to: - Discover algebraic expressions or equations from data - Set up a Design of Experiments (DOE) study - Fit, interpret, or export
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.