Skill: Generate DQ Rules
Skill: Generate DQ Rules
Context
This is a Claude Code slash-command skill (.claude/commands/dq-rules.md) that generates a structured set of data quality rules from a business requirement or data description. Install it in your project and invoke it with /dq-rules [requirement text] to get a rule set ready for your data contract or dbt schema.yml.
Unlike the interactive DQ Rules from Business Requirements prompt, this skill is designed for repeated use inside a build-cli session — you invoke it with one command and get structured output directly in your workflow.
The Prompt
Generate a set of data quality rules from the following business requirement or data description.
For each rule provide:- **Rule name** (snake_case, short)- **Description** (plain language — what it checks)- **DQ dimension** (Completeness / Uniqueness / Validity / Consistency / Timeliness / Accuracy)- **Implementation hint** (SQL WHERE clause, dbt test type, or Great Expectations check name)- **Severity** (Critical / Major / Minor)
Group rules by dimension. Flag any requirements that are ambiguous and need clarification before a rule can be written.
$ARGUMENTSHow to Install as a Claude Code Slash-Command
- Copy the prompt text above (the content between the triple backticks, including
$ARGUMENTS). - Create the file
.claude/commands/dq-rules.mdin your project root (or~/.claude/commands/dq-rules.mdfor global use). - Paste the prompt text as the entire file content.
- The
$ARGUMENTStoken is replaced by Claude Code with whatever text you type after the slash-command.
Usage Instructions
Once installed, invoke the skill in a build-cli session:
/dq-rules All customer records must have a non-null email address in valid email format. No two customers may share the same email address. Country code must be a valid ISO 3166-1 alpha-2 value.Claude Code will generate a grouped rule set with rule name, description, DQ dimension, implementation hint, and severity for each rule. Ambiguous requirements are flagged for clarification before rules are written.
Output tip: Ask for the output in schema.yml format if you want directly usable dbt test YAML.