HRDIUtilities / instructions
Copilot instructions6 starsChanged 5 months agoMITView on GitHub
Add a comment at the end of every file you create or modify: Contains AI-generated edits. - Python files: # Contains AI-generated edits. - SQL files: -- Contains AI-generated edits. - Markdown / YAML / CSV: <!-- Contains AI-generated edits. --> - Notebooks (.ipynb): add a markdown cell at the end with > Contains AI-generated edits. This workspace implements the DQ-Coworker — an intelligent Data Quality framework for enterprise data platforms. All code, notebooks, and metadata produced here must align…
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,336 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- FabricAccessOnboarding/.github/instructions/copilot-instructions.mdCopilot instructions
- FabricCLI/.github/instructions/copilot-instructions.mdCopilot instructions
- MaskIQ/.github/instructions/copilot-instructions.mdCopilot instructions
- Prompt2Data/.github/instructions/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
30 rules. About 0 are common, 16 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Add a comment at the end of every file you create or modify: Contains AI-generated edits.
- Distinctive: line 24
When a user asks you to recommend, design, generate, review, or execute any Data Quality checks, always consult the DQSkillRecommender …
- Distinctive: line 40
Never place Silver or Gold DQ logic in the Bronze layer, and never skip Bronze checks before promoting data to Silver.
- Distinctive: line 47
When generating or modifying DQ metadata (CSV, Delta table, or dict):
- Very specific: line 49
Every rule must have: RuleID, RuleName, DQDimension, RuleType, Entity, EntityType, WorkflowGroup, ObjectWeight, IsActive.
- Very specific: line 56
Always populate AIConfidenceScore and AIRecommendationReason for any AI-generated rule.
- Very specific: line 58
Use AllowedVariance = 0 as the default.
- Very specific: line 69
Follow .github/python-coding.instructions.md (snake_case, PEP 8, type hints, docstrings).
- Very specific: line 70
All DQ validation functions must be modular, parameterised, and return a standard result dict with keys: dimension, check, entity, …
- Very specific: line 73
Use the function signatures from dq_functions.py as the canonical pattern.
- Distinctive: line 78
Never hardcode connection strings, credentials, storage paths, or workspace IDs.
- Distinctive: line 79
Use parameters or environment variables.
- Distinctive: line 80
All custom SQL injected by users must be validated for syntax before execution.
- Distinctive: line 81
Never execute untrusted raw SQL strings directly — parameterise or validate first.
- Very specific: line 86
Use NULLIF to guard against division-by-zero in percentage calculations.
- Very specific: line 87
Prefer COUNT(*) FILTER (WHERE ...) syntax for Spark SQL / Fabric SQL.
- Very specific: line 88
Always alias computed columns clearly (e.g., AS null_pct, AS dup_count).
- Very specific: line 98
Always include a results aggregation cell that computes an overall DQ Score as passed_checks / total_checks * 100.
- Distinctive: line 100
Always include a final Markdown summary cell with pass/fail statistics.
- Distinctive: line 106
When presenting DQ check recommendations to a user:
- Distinctive: line 109
Use the structured recommendation format:
- Very specific: line 120
If a check is rejected, ask for the rejection reason and record it in AIRejectionReason.
- Distinctive: line 122
If a user modifies a threshold, confirm the change and update the metadata row before moving to the next check.
- Distinctive: line 124
If a user provides custom SQL or Python logic, validate syntax and confirm acceptance before incorporating.
- Distinctive: line 132
When analysing a column, apply these automatic rules before asking the user:
- Distinctive: line 157
Do not generate code that bypasses row-level security, column masking, or workspace access controls.
- Distinctive: line 159
When generating connection code, always use managed identity / service principal patterns — never username/password in code.
- Very specific: line 166
Every P1 rule failure must trigger an alert.
- Distinctive: line 167
Write DQ results to a persistent Delta table after each run for trending.
- Very specific: line 169
Always emit a DQ score metric keyed as dq_score_<entity>_<layer>.
≈ “Common” is an estimate: at least 1 in 5 of the 3,779 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DQ-Coworker – GitHub Copilot Workspace Instructions
File Annotation
Add a comment at the end of every file you create or modify: Contains AI-generated edits.
- Python files:
# Contains AI-generated edits. - SQL files:
-- Contains AI-generated edits. - Markdown / YAML / CSV:
<!-- Contains AI-generated edits. --> - Notebooks (.ipynb): add a markdown cell at the end with
> Contains AI-generated edits.
Project Purpose
This workspace implements the DQ-Coworker — an intelligent Data Quality
framework for enterprise data platforms. All code, notebooks, and metadata
produced here must align with the DQ-Coworker architecture documented in
.github/prompts/DQSkillRecommender.prompts.md.prompt.md.
When a user asks you to recommend, design, generate, review, or execute any Data Quality checks, always consult the DQSkillRecommender prompt for dimension definitions, threshold guidance, metadata schema, and code patterns.
Architecture Context
This project operates across three data layers. Always respect layer boundaries:
| Layer | Role | DQ Focus |
| Bronze | Raw ingestion | Availability, Completeness (keys), Validity (format), Uniqueness, Freshness, Timeliness |
| Silver | Cleansed / transformed | Accuracy, Consistency, Referential Integrity, Conformity, full Completeness |
| Gold | Analytical / reporting | Accuracy (reconciliation), Freshness (SLA), Distribution drift, Cross-system Consistency |
Never place Silver or Gold DQ logic in the Bronze layer, and never skip Bronze checks before promoting data to Silver.
DQ Metadata Schema Rules
When generating or modifying DQ metadata (CSV, Delta table, or dict):
- Every rule must have:
RuleID,RuleName,DQDimension,RuleType,Entity,EntityType,WorkflowGroup,ObjectWeight,IsActive. - Auto-derive where possible:
RuleLevel,DataType,IsNullable,IsPrimaryKey,IsForeignKey,LayerTarget,GeneratedBy,GeneratedTimestamp. - Set
FailedPipelineInd = Yonly for P1 rules on primary keys, financial fields, or regulatory-tagged columns. - Always populate
AIConfidenceScoreandAIRecommendationReasonfor any AI-generated rule. - Use
AllowedVariance = 0as the default; only increase after explicit human approval. - Valid
ObjectWeightvalues:P1(critical),P2(required),P3(optional). - Valid
WorkflowGroupvalues:Bronze,Silver,Gold, or a custom domain name.
Code Generation Standards
Python
- Follow
.github/python-coding.instructions.md(snake_case, PEP 8, type hints, docstrings). - All DQ validation functions must be modular, parameterised, and return a
standard result dict with keys:
dimension,check,entity,attribute,passed,details,evaluated_at. - Use the function signatures from
dq_functions.pyas the canonical pattern. - Functions must be platform-agnostic: support both Pandas DataFrames and
PySpark DataFrames where feasible. Use
isinstance(df, pd.DataFrame)guards. - Target compatibility: Microsoft Fabric, Azure Synapse, Databricks, and standalone PySpark.
- Never hardcode connection strings, credentials, storage paths, or workspace IDs. Use parameters or environment variables.
- All custom SQL injected by users must be validated for syntax before execution. Never execute untrusted raw SQL strings directly — parameterise or validate first.
SQL
- Follow
.github/general-coding.instructions.md. - Use
NULLIFto guard against division-by-zero in percentage calculations. - Prefer
COUNT(*) FILTER (WHERE ...)syntax for Spark SQL / Fabric SQL. - Always alias computed columns clearly (e.g.,
AS null_pct,AS dup_count).
Notebooks
- Structure every generated DQ notebook using the 17-cell sequence defined in Section 7 of the DQSkillRecommender prompt.
- Cell 1 must be a Markdown title cell with: entity name, WorkflowGroup, platform target, and generation timestamp.
- Cell 2 must auto-detect the execution platform
(Fabric / Databricks / Synapse / local) and set
PLATFORMvariable. - Always include a results aggregation cell that computes an overall DQ Score
as
passed_checks / total_checks * 100. - Always include a final Markdown summary cell with pass/fail statistics.
Human-in-the-Loop Rules
When presenting DQ check recommendations to a user:
- Present checks one entity at a time, grouped by DQ dimension.
- Use the structured recommendation format:
Entity : <name> Attribute : <col> Dimension : <dimension> Rule : <RuleName> Reason : <why recommended> Threshold : <value> Severity : P1 / P2 / P3 [APPROVE] [REJECT] [MODIFY THRESHOLD] [ADD CUSTOM LOGIC] - Never generate the final metadata CSV or notebook without at least one explicit human approval.
- If a check is rejected, ask for the rejection reason and record it in
AIRejectionReason. - If a user modifies a threshold, confirm the change and update the metadata row before moving to the next check.
- If a user provides custom SQL or Python logic, validate syntax and confirm acceptance before incorporating.
- Summarise
approved / rejected / modifiedcounts before emitting output.
DQ Dimension Mapping Shortcuts
When analysing a column, apply these automatic rules before asking the user:
| Column Trait | Recommended Dimensions |
| Primary key | Uniqueness, Completeness, Validity |
| Foreign key | Integrity, Referential Integrity |
| NOT NULL constraint | Completeness |
| Timestamp / date column | Timeliness, Freshness |
| Numeric (amount, quantity) | Accuracy (range), Validity |
| Low-cardinality categorical | Validity (allowed values) |
| Email / phone / postal pattern | Validity (regex) |
| PII / financial / regulatory | Completeness, Validity, Accuracy (P1) |
| Date-range pair (start / end) | Consistency (temporal) |
| High-cardinality identifier | Uniqueness |
Security & Governance
- Never log, display, or store raw PII values in DQ result outputs. Log counts and percentages only.
- Tag all rules touching PII or regulated data with appropriate
DataClassificationandRegulatoryTagfields. - Validate all user-supplied regex patterns are safe (no ReDoS risk) before compiling.
- Do not generate code that bypasses row-level security, column masking, or workspace access controls.
- When generating connection code, always use managed identity / service principal patterns — never username/password in code.
Observability & Alerting
- Every P1 rule failure must trigger an alert. Default
AlertChannel = Teams. - Write DQ results to a persistent Delta table after each run for trending.
- Enable
TrendingEnabled = Yby default for all P1 and P2 rules. - Always emit a DQ score metric keyed as
dq_score_<entity>_<layer>.
Output Formats
| Requested Output | Format |
| DQ metadata | CSV with headers matching the metadata schema in DQSkillRecommender prompt |
| Validation library | Python module dq_functions.py with functions per Section 5.1 |
| DQ runner | Python module dq_runner.py with dispatch router per Section 5.2 |
| Notebook | .ipynb following the 17-cell structure in Section 7 |
| Architecture diagram | ASCII art aligned with Section 8.1 |
| DQ results | JSON array of result dicts, one per rule executed |
<!-- Contains AI-generated edits. -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

