Files
borghei__claude-skills/data-analytics
Amin Borghei 0b29afb0c4 refactor(skills): bring new scripts within Pattern 7 budget; fix linter false positives
Follow-up to the 25-skill batch, driven by running our own skill_lint.py
against it.

Linter precision (engineering/write-a-skill):
- A module imported from the same skill's scripts/ directory is a permitted
  local helper under Pattern 9, not a non-stdlib dependency. Previously flagged
  md_render, slide_render and stats_core as external.
- Pattern 7's argparse/__main__ requirements describe entry-point tools. Pure
  library modules imported by a sibling no longer fail for lacking a CLI.
- Genuine third-party imports and cross-skill imports still error.
- Checks extracted to lint_checks.py.

Script line budget — extracted cohesive units into same-directory helpers
rather than compressing, so no guidance text or docstrings were sacrificed:
- cloud-security: posture_auditor 323->230, iam_least_privilege 337->238
  (+ posture_rules.py, iam_rules.py)
- statistical-analyst: run_test 326->134 (+ test_impl.py)
- reflect: calibration_scorer 340->184 (+ calibration_core.py)
- clinical-research: protocol_auditor 319->292 (+ protocol_rules.py),
  sample_size_calculator 305->300 (+ power_formulas.py)

clinical-research also gains the conventional t-correction for the two-mean
design, so n now matches a t-test-based stats package (n=64/group at d=0.5,
was 63). NOTE_MEAN states the correction, the raw normal-approximation figure,
and that power-at-planned-n remains normal-approximation and marginally
optimistic. Two-proportion unchanged at n=93/group; survival unchanged at 247
Schoenfeld / 253 Freedman events at HR=0.7.

Every refactor verified byte-identical against its pre-refactor output on the
shipped samples. calibration_scorer holds its Murphy identity
(Brier = REL - RES + UNC) with selftest 12/12 and reference values
brier=0.294259 rel=0.109074 res=0.061728 unc=0.246914.

All 25 skills pass skill_lint. 72/83 documented workflow blocks exit 0; the
other 11 are documented CI gates firing on deliberately flawed sample data.

Also: capture and deep-work workflow examples now redirect into the ignored
build/ dir instead of the repo root.
2026-07-21 14:28:09 +02:00
..