method-verify
Runs an analysis-output sanity gate: sample size, leakage, effect direction, missing data, PHI, figures, reproducibility, P recomputation. Use when a step finishes.
- License 许可
- MIT
- 最近更新
- 2026-11-01
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- method-verify
- description
- Runs an analysis-output sanity gate: sample size, leakage, effect direction, missing data, PHI, figures, reproducibility, P recomputation. Use when a step finishes.
- argument-hint
- [optional: path to specific output file or directory to verify]
02 资源文件 2
- 参考文档references/check-catalog.md13.2 KB
- 脚本scripts/verify_stats.py18.1 KB
03 SKILL.md 正文
Analysis Verification Gate
Skill Value
- Problem it solves: Analysis errors are cheaper to catch between steps than at final manuscript or code review.
- Use when: The user finishes an analysis step or wants a quick sanity check before marking work done.
- Output: Pass/fail verification notes with blockers and recommended fixes.
- Ask only if: Only when target output, SAP section, or expected direction cannot be inferred.
- Do not do: Do not replace full code review, reporting-checklist review, or data QA.
- Interaction: Check repo/config/chat evidence first. Ask one decision-changing question at a time; use the current harness's blocking question UI when available, otherwise present numbered choices and wait.
Quick mid-workflow sanity check on analysis outputs. Distinct from the reporting checklist (method-checklist + method-reporting-checklist-reviewer) which fires at manuscript time — this skill catches errors during analysis execution.
Stack Profile
The repository root is pre-resolved at skill load:
!git rev-parse --show-toplevel 2>/dev/null || true
Use the resolved absolute path or resolve it at runtime, then read .methodsmith/config.local.yaml with the native file-read tool. In a linked worktree, fall back to the main checkout when the machine-local file is absent. Parse language, data_root, and reporting; if no config can be read, infer them from project files.
Input
<verify_input> #$ARGUMENTS </verify_input>
If empty, verify all analysis outputs found under output/, analysis/, and any data_root from the stack profile.
Verification Checks
Run each check from the catalog in references/check-catalog.md. Each check produces one of:
- PASS — check passed, no action needed
- WARN — potential issue, surfaces for human review but does not block
- FAIL — definite problem, blocks task completion when invoked by
method-work
Core Workflow
Step 1: Gather context
Read the stack profile for language and data paths. Check for:
analysis/research-question.yaml— for hypothesis direction check- The SAP:
analysis/sap.md, or any markdown file withsap_versionin its frontmatter (for example underdocs/plans/) — for sample size and imputation checks - The data QA report:
reports/data-qa/<extract_id>.md(written bymethod-data-qa), falling back to legacyanalysis/data-qa-report.md— for expected N from the data QA gate analysis/power/— for minimum sample size from power calculationanalysis/signoff/signoff-ledger.json— for unresolved human signoffs surfaced bymethod-signoff__CE_CLIF__ active=truein context — for CLIF-specific checks- Sensitive-data boundary. Resolve
phi_environment.modein.methodsmith/config.local.yaml(worktree, then main checkout; legacycompliant: true=approved,compliant: false=schema-only,sensitive_data: false=no-sensitive-data; any schema-only signal wins; unreadable =schema-only).approvedorno-sensitive-data: proceed silently and never mention the boundary again.schema-only: headings, types, counts, and aggregates only; never open, print, or paste data values; run data-reading scripts asmethod-safe-run -- <command>(path in the guard's deny message); save results as aggregate tables (counts under 11 suppressed) inoutput/or aphi_environment.aggregate_dirsentry. Unset, interactive: ask once with the blocking question tool (else a numbered list) offeringApproved endpoint: full access,Not approved or unsure: schema-only, andNo sensitive data: public or synthetic; save the answer asphi_environment.modethere oncegit check-ignore -q .methodsmith/config.local.yamlpasses (else first add.methodsmith/*.local.yamlto.gitignore) so the guard hook sees it. Unset, headless: schema-only. Inschema-only, run every check (including the PHI scan) through scripts that return only file names, column headings, counts, and categories, never rows or matched values.
Step 2: Run check catalog
Execute each applicable check from references/check-catalog.md. Skip checks that don't apply (e.g., skip leakage scan if no train/test split exists; skip figure quality if no figures found).
Number gate. Load the method-numbers skill and run its check on the manuscript sources, rendered copies, and tables (it reads analysis/numbers/registry.json). A FAIL exit, or a gate that could not run, blocks readiness: quote its file:line: reason: token lines as printed, and never add a result to the allowlist or edit the registry to make it pass. Run it whenever analysis/numbers/registry.json exists or the outputs feed a manuscript, table, caption, or model card; each FAIL line is a FAIL check.
Statistic recomputation gate. When outputs or tables report t/F/chi2/z statistics with P values, or means and percentages with an N, extract the printed numbers into a claims file (values and reported P as the printed strings — their rounding drives the tolerance). Record alternative from the SAP (two-sided, greater, less, or unknown); ordinary F/chi2 tests use greater. Record p_method="ordinary" only for an unadjusted reference-distribution P value; identify adjusted, exact, permutation or sequential values separately. Unknown sidedness and unsupported P methods remain WARN/not checked, never a substituted two-sided calculation. Pass the SAP alpha with --alpha and run:
SKILL_DIR="<absolute path of the directory containing this SKILL.md>";
python3 "$SKILL_DIR/scripts/verify_stats.py" check analysis/numbers/stat-claims.json --alpha <SAP-alpha> --out qc/stat_check.json
If python3 is unavailable, probe python then py; if none is available, recompute a sample of the reported statistics by hand and report the sweep as incomplete, never as passed. Each script FAIL (a decision error, an arithmetically impossible summary, or a malformed item) is a FAIL check; each WARN is a WARN check.
Step 3: Emit verification report
## Verification Report
1. [PASS] Sample size: N=8,234 matches cohort definition (data-qa reported N=8,234)
2. [PASS] No data leakage signals detected
3. [WARN] Effect direction: OR=0.72 (protective) — hypothesis predicted harmful exposure
4. [PASS] Missing data: BMI 3.2% missing (MAR assumed), MI m=20 with outcome in imputation model, matches SAP-8
5. [PASS] No PHI detected in output/
6. [WARN] Figure analysis/figures/fig1.png: legend overlaps data region
7. [PASS] Seeds set, renv.lock present
Result: 5 PASS, 2 WARN, 0 FAIL
Step 4: Emit signal
__CE_VERIFY__ pass=5 warn=2 fail=0 blocking=<true|false>
blocking=true when any FAIL exists. method-work reads this signal to gate task completion.
What this skill does NOT do
- Does not replace
method-data-qa— that skill runs pre-modeling as a GO/NO-GO gate between extraction and analysis - Does not replace
method-checklistormethod-reporting-checklist-reviewer— those verify reporting guideline compliance at manuscript time - Does not replace
method-signoff— that skill builds PI-facing review packets and validates the signoff ledger - Does not modify analysis files — read-only verification
- Does not run or rerun statistical analyses — the recomputation gate rechecks printed statistics for internal consistency (P from t/F/chi2/z, GRIM on means and percentages); it does not fit models or verify model correctness
References
references/check-catalog.md — Full catalog of verification checks with pass/warn/fail criteria
04 同仓库更多 Skills
skill-one
Sample skill
disabled-skill
A skill with model invocation disabled
claude-only-skill
A skill restricted to Claude Code only
default-skill
暂无简介
custom-skill
暂无简介
method-write
Drafts, revises, and audits evidence-bound manuscripts, sections, abstracts, and reviewer responses with claim provenance. Use when scientific prose must be written or revised (entry point).