Install
$ agentstack add skill-jskherman-engg-skills-statistical-process-control ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
Statistical Process Control
Overview
Pure-Python SPC helpers:
- Individuals chart (I-MR) with control limits from the moving range.
- X-bar / R chart with constants from the standard SPC tables.
- Cp and Cpk capability indices.
The chart constants (A2, D3, D4, d2, etc.) are public-domain values widely republished in textbooks; verify against your quality system's standard before regulated reporting.
Prerequisites
uvavailable.
When to Use
- Computing control limits for a new chart.
- Estimating Cp / Cpk for a stable process with bilateral spec limits.
- Sanity-checking a vendor SPC report.
Don't use for
- Autocorrelated process data (
time-series-process-data-analysisfirst). - Left-censored or interval-censored measurements
(censored-regression).
- Attribute (count / defective) charts (p, np, c, u charts not
implemented).
- Multivariate SPC (Hotelling T², MEWMA — not implemented).
Utility Scripts
uv run scripts/spc.py individuals --values "12.3,12.5,12.1,12.4,12.6,12.2" --output /tmp/i.jsonuv run scripts/spc.py xbar-r --subgroups "12.3,12.5,12.1|12.4,12.6,12.2|12.2,12.4,12.3" --output /tmp/xr.jsonuv run scripts/spc.py capability --values "12.3,..." --usl 13 --lsl 11 --output /tmp/cap.json
Procedure
- Confirm the process is stable (no obvious shifts, trends, autocorr).
- Pick chart type:
- Individuals (I-MR) for one measurement per sample.
- X-bar / R for rational subgroups of 2-10.
- Compute control limits from a stable baseline window (Phase I); apply
in real time (Phase II).
- For capability, ensure the process is centred between spec limits;
compute Cp and Cpk.
- Flag out-of-control signals: points beyond 3-sigma, runs of 7+ on the
same side of the centre line, etc. (Western Electric rules).
Pitfalls
- Computing Cp / Cpk on a process that is not in statistical control
(Phase I diagnostics first).
- Using a one-sigma limit ("99.7% will be in tolerance") when the
underlying distribution is not normal.
- Mixing Phase I (limit estimation) and Phase II (limit application) data.
- Treating Cpk as Cp when only one spec limit applies.
- Ignoring the moving-range constant d2 = 1.128 for n = 2.
- Computing X-bar / R with unequal subgroup sizes (the chart constants
assume equal n).
- Applying control limits to data with strong autocorrelation; the limits
become too tight or too wide.
- Reporting Cp / Cpk with too few data points (< ~30 ideally).
Fallback Strategies
- If autocorrelation is suspected, use
time-series-process-data-analysis
to compute ACF; if significant, apply a pre-whitening filter (e.g. ARIMA residuals) before SPC.
- If censoring is suspected, see
censored-regression.
Verification
- Run the listed script with representative inputs and an
--outputfile when a deterministic calculation is available. - Confirm the JSON result contains
ok: true, expected units, and no unhandled warnings. - Check result magnitudes against the stated assumptions, references, and a hand calculation or known operating range before reporting them.
References
references/control_charts.md— chart constants and formulas.- Montgomery, Introduction to Statistical Quality Control.
Anti-Patterns
- Reporting "process out of control" from a single point beyond 3-sigma
without checking measurement quality.
- Computing Cpk on visibly bimodal data.
- Using SPC limits to decide on a process change instead of as a
monitoring tool.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: jskherman
- Source: jskherman/engg-skills
- License: Apache-2.0
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.