/skills-library:model-fit-auditorfrom skills-library
Audits fitted models by analyzing residual structure, goodness-of-fit with uncertainties, leverage, influence, and information criteria. Detects when residuals reveal model, measurement, or uncertainty model incompleteness.
Ships in skills-library. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Audit whether a fitted model is an honest description of the data. Treat structured residuals as evidence that the model, measurement process, or uncertainty model is incomplete—not as permission to invent a mechanism.
Ask only for missing inputs that affect the audit:
y_i and fitted predictions ŷ_i;k (state whether it includes an intercept);σ_i, when known;If raw data cannot be shared, accept a residual table or fit report and explicitly mark which checks cannot be reproduced.
dataset-systematic-error-hunter to scan and attribute it.model-critique-coach.Write a compact record before judging the fit:
response and units:
independent variables and units:
model and parameter count:
fit objective / likelihood:
uncertainty source:
constraints / priors:
excluded data and reasons:
Mark unknown fields as unknown; never fill them by inference.
Use signed residuals r_i = y_i - ŷ_i. Preserve row order and identifiers. When valid σ_i are available, also compute normalized residuals z_i = r_i/σ_i.
Check:
Report at least:
χ² = Σ(r_i/σ_i)² and χ²/ν, only when uncertainties justify it, with ν = n-k;A reduced chi-square far from one is a prompt to inspect the model and uncertainty estimates, not an automatic pass/fail threshold.
Inspect residuals against every independent variable, prediction magnitude, acquisition order/time, instrument channel, and experimental batch when available.
Classify visible or computed patterns:
| Pattern | Candidate explanation | Discriminating check |
|---|---|---|
| nonzero offset | calibration zero, omitted constant term | independent zero/reference measurement |
| monotonic trend | wrong functional dependence, drift, range-dependent calibration | split by time; fit a physically motivated alternative |
| curvature | missing nonlinear term or regime transition | plot local slope; collect data across transition |
| fan shape | variance grows with signal, wrong weighting | residual scale by prediction bins; model heteroscedasticity |
| periodicity | forcing, vibration, aliasing, sampling artifact | spectrum and changed sampling-rate test |
| clusters by batch | apparatus state or environmental confounder | batch-stratified residuals and calibration logs |
| long runs of one sign | serial correlation or slow drift | acquisition-order plot and autocorrelation check |
For each claimed structure, state: evidence, at least two plausible causes when feasible, and one observation that could separate them.
When a valid design matrix is available, compute leverage and Cook’s distance. Treat common cutoffs such as 2p/n or 4/n as review heuristics, not laws.
For every influential point:
Prefer out-of-sample validation, repeated experiments, or physically meaningful holdouts. If only in-sample data exist:
Build a mechanism ledger:
residual evidence | candidate physical process | predicted signature | decisive next check | confidence
A valid candidate must predict more than “the fit improves”: it should specify a sign, scaling, regime, frequency, time dependence, or control-variable response. If no mechanism is supported, say unresolved.
Use this output order:
Separate observations from interpretations. Never hide failed checks.
scripts/audit_fit.py accepts JSON and emits JSON diagnostics without vendor-specific services or third-party packages:
python3 scripts/audit_fit.py fit.json
Minimal input:
{"observed":[1.0,2.1,2.9],"predicted":[1.1,2.0,3.0],"parameter_count":2}
Optional keys are sigma, variables (a mapping of variable name to numeric values), and design_matrix (rows including any intercept column). Any other key is an input error, so a misspelled sigma or design_matrix cannot silently switch a check off. See references/interpretation.md before treating heuristic flags as conclusions.
Leverage comes from a pivoted QR factorization of the design matrix after centering (when an intercept column is present) and column scaling, with a relative rank tolerance. Raw units therefore do not matter: wavelengths in metres, or time in Unix epoch seconds next to an intercept, give the same leverages as rescaled data. The influence block reports rank and leverage_sum; the leverages must sum to the rank, and a rank below the column count is a warning, not an error. When rounding already present in the input could move the leverages by more than 0.001 (for example a column of squared epoch seconds), leverage and Cook's distance are withheld with a warning; subtract a reference value from the predictor before building such columns. Exit code 0 means diagnostics were written (read warnings); 2 means invalid input. --help prints usage and --selftest runs the script's regression cases.
references/interpretation.md — definitions and assumptions behind every helper statistic../_shared/physics-evidence-contract.md — §4 academic-integrity boundary shared by all physics skills (no invented data, uncertainties or exclusions)| 版本 | 日期 | 变更 | 类型 |
|---|---|---|---|
| 0.1.1 | 2026-09-26 | 脚本求杠杆值改用中心化加列缩放后的列主元 QR 与相对秩容差,SI 小量不再误报秩亏、epoch 秒不再静默给错杠杆值,并校验杠杆值之和等于秩;输入本身精度不够时扣下杠杆值并警告;支持 --help、--selftest,未知键改为报错;description 与 suggest_hint 改为"模型、测量过程或不确定度模型三者之一不完整"并点名 dataset-systematic-error-hunter;Boundaries 补与 model-critique-coach 的判别句;补 _shared 证据契约 §4 引用;示例命令改用 python3(macOS 自带的只有 python3) | patch |
| 0.1.0 | 2026-09-05 | 初始版本 | minor |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
64 skills in this plugin
/activity-list-optimizer当学生说"Common App 活动栏写不下"、"这段活动描述超字数了"、"帮我把这几条压到限制内"时使用。先按官方申请表核对当季字符限额,再逐条检查;一次把所有条目量完并直接给出压缩版,只在需要砍掉实质内容时才用选择题问该保哪部分。每改一版都用工具重新数一遍字符,绝不凭感觉说"这样应该够了"。只压缩,不代写空白。/activity-profile-builder当学生说"我参加过一些活动但没整理过"、"帮我把经历录进去"、"我的活动档案是空的"时使用。让学生一口气把记得的活动说出来,直接把这段话拆成结构化的长期事项(角色、组织、起止时间、做了什么、结果、级别),说不清的字段留空标"待补"而不是编,再用一张选择题卡把级别判定与是否重复这类关键项一次问完,然后提案入库。只记录学生真正说出口的内容,级别按事实判定,绝不往高了写。/admissions-reader当学生问"招生官会怎么看我的档案"、"我的背景还差什么"、"帮我评估一下现在的申请竞争力"时使用。以顶尖大学招生官的视角通读学生的档案、长期活动与已写下的反思,不问任何前置问题直接产出一份指名道姓的坦诚点评:这份材料的亮点、招生官真实的解读方式、明显的短板与空白、以及接下来最值得做的一到两件事。只读不写,不修改学生的任何数据,也不代写任何申请材料。Other plugins' skills for the same job
npx claudepluginhub chromitecr/skills --plugin skills-library