agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when validating a dataset or building quality checks into a pipeline. Covers profiling, schema and constraint validation, freshness and completeness checks, anomaly detection, and failing a pipeline correctly.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill data-quality --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/data-qualityContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when validating a dataset or building quality checks into a pipeline. Covers profiling, schema and constraint validation, freshness and completeness checks, anomaly detection, and failing a pipeline correctly.
name: data-quality description: Use when validating a dataset or building quality checks into a pipeline. Covers profiling, schema and constraint validation, freshness and completeness checks, anomaly detection, and failing a pipeline correctly. metadata: category: data version: 1.0.0 tags: [data-quality, validation, profiling, pipelines, testing]
Catch bad data before it reaches a dashboard, a model, or a customer. A pipeline that silently propagates corrupt data is worse than one that fails, because the failure is discovered downstream, later, by someone who trusts the number.
1. **Profile before you trust** — Row count, null rate, cardinality, min/max, and the distribution of every column. The documented schema and the actual data disagree more often than not. 2. **Validate the schema at the boundary** — Column presence, types, and nullability, checked on ingest. A silently added column or a type change upstream is the most common pipeline break. 3. **Assert the business rules** — Uniqueness on keys, referential integrity, valid ranges, and formats. `total_cents >= 0` is a rule; assert it. 4. **Check freshness and volume** — Is the data recent, and is there roughly as much of it as usual? A pipeline that runs successfully on an empty file is the failure that is hardest to notice. 5. **Quarantine, do not drop** — Failing rows go to a quarantine table with the reason. Dropping them silently destroys the evidence needed to fix the source. 6. **Fail loudly and stop** — A pipeline that continues past a failed quality gate has published bad data. Stop, alert, and keep the previous good version live.
**Quality gate with hard and soft rules:**
import pandera as pa
from pandera.typing import Series
class OrderSchema(pa.DataFrameModel):
order_id: Series[str] = pa.Field(unique=True, str_matches=r"^ord_[0-9A-Z]{10}$")
customer_id: Series[str] = pa.Field(nullable=False)
total_cents: Series[int] = pa.Field(ge=0, le=100_000_000) # no negatives, no absurd values
currency: Series[str] = pa.Field(isin=["USD", "EUR", "GBP"])
created_at: Series[pa.DateTime] = pa.Field(nullable=False)
class Config:
strict = True # an unexpected column is an error, not a shrug
coerce = False # a wrong type is an error, not a silent conversion
def load(df: pd.DataFrame) -> pd.DataFrame:
try:
valid = OrderSchema.validate(df, lazy=True) # collect all failures, not just the first
except pa.errors.SchemaErrors as e:
failures = e.failure_cases # row index + column + reason
quarantine.write(df.loc[failures["index"].dropna().unique()], reasons=failures)
alert(f"{len(failures)} rows quarantined on orders load", failures.head(20))
raise PipelineHalted("orders failed schema validation") # do not publish
return valid**The check that catches the silent failure:**
# Volume and freshness. A pipeline that "succeeded" with 0 rows, or with
# yesterday's data, has failed in the way that is hardest to notice.
expected = baseline.median_rows(window_days=28)
actual = len(df)
if actual == 0:
raise PipelineHalted("orders load produced 0 rows — upstream is likely broken")
if actual < expected * 0.5:
alert(f"orders volume anomaly: {actual} rows vs a 28-day median of {expected}")
max_age = utcnow() - df["created_at"].max()
if max_age > timedelta(hours=6):
raise PipelineHalted(f"orders data is stale: newest record is {max_age} old")A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…