explain-data-code
Skill3 starsChanged 31 days agoMITView on GitHub
Explains SQL, Python, dbt, and analytics code at beginner, analyst, or analytics-engineer depth with traced data behavior and verified semantics. Use when a user asks what data code does, why it works, or how to learn from it.
In this repository24 other files it gives its agents.
- analytics-requirementsSkill
- api-pipelineSkill
- bi-modelSkill
- build-modelSkill
- data-model-reviewSkill
- data-profileSkill
- data-quality-investigationSkill
- dbt-healthSkill
- freshness-investigationSkill
- incremental-modelSkill
- metric-definitionSkill
- migration-planSkill
- model-documentationSkill
- model-testsSkill
- project-profileSkill
- pr-reviewSkill
- refactor-modelSkill
- rename-modelSkill
- semantic-layerSkill
- source-setupSkill
- sql-reviewSkill
- trace-lineageSkill
- validate-dbtSkill
- yaml-maintenanceSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 41
Verify claims from code or safe evidence.
- Distinctive: line 78
Operational notes: when relevant.
- Distinctive: line 79
Verification questions/tests: if behavior is unresolved.
- Distinctive: line 88
Check every expression used to classify or match rows for null propagation that can exclude a row from a numerator while retaining it in …
- Distinctive: line 90
Check that stated grain changes match joins and aggregations.
- Distinctive: line 92
Ensure terminology and detail match the selected level.
- Distinctive: line 96
Do not execute code, query data, or open connected systems without explicit instruction.
- Distinctive: line 98
Use synthetic examples when row values are unnecessary.
- Distinctive: line 103
Do not assume names equal semantics, comments are current, inputs satisfy constraints, joins are one-to-one, ordering is deterministic, …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
<!-- Generated by scripts/build_targets.py from src/skills. Edit the source and rebuild; changes made here are overwritten. -->Self-contained install.
<skill-dir>is the directory holding this file: substitute its absolute path in the commands below and run them from the repository root. Read<skill-dir>/references/operating-rules.mdbefore acting; it holds the toolkit's always-on rules, which this install cannot load on its own. This install has no safety hooks, so the approvals those rules describe rest on you and the agent rather than on an enforced gate.
Explain Data Code
Explain what the code does to data, why, and under which assumptions. Do not confuse a plausible reading with verified behavior.
When to use
- Explain a query, model, notebook, pipeline transformation, macro, test, or code diff.
- Teach syntax and analytics concepts or document unfamiliar data code.
- Diagnose meaning, but use an incident/review skill when the primary request is defect triage.
Required context
Obtain:
- Complete relevant code, language/dialect/framework, and directly referenced definitions.
- Intended input/output, known schema, and business purpose.
- Requested explanation level: beginner, analyst, or analytics-engineer.
If level is unstated, infer it from the user's vocabulary. Default silently to Work mode and optimize for concise operational understanding. In Learn mode, teach progressively and invite a check for understanding. In Assessment mode, ask the learner to explain first and evaluate only their submitted reasoning; do not provide an answer or answer-equivalent walkthrough.
Inspection procedure
- Establish the code boundary, dialect/runtime, entry point, and declared purpose.
- Inspect definitions needed to resolve macros, helper functions, models, configuration, and schemas.
- Trace inputs through transformations to outputs in execution order, noting grain and schema changes.
- Explain filters, joins, aggregations, windows, state, side effects, error paths, and temporal behavior. For predicates, concatenation, arithmetic, and conditional aggregates, trace how a null in each nullable input affects row eligibility, numerator membership, denominator membership, and the final value.
- Separate syntax mechanics, data semantics, business assumptions, and operational behavior.
- Choose depth:
- Beginner: define terms, use a tiny example, explain one transformation at a time, minimize jargon.
- Analyst: emphasize grain, joins, metrics, nulls, filters, and how results should be interpreted.
- Analytics-engineer: include compilation/runtime, lineage, materialization, incremental behavior, contracts, testing, performance, and maintainability.
- Identify ambiguities or risks without turning the response into an unsolicited rewrite.
- Verify claims from code or safe evidence. Suggest execution only when static inspection cannot answer.
Connected repositories, warehouses, notebooks, or execution require an explicit user trigger. Any stateful, costly, or data-revealing action requires approval.
Decision framework
For each point, label mentally or explicitly:
- Certain from code — directly follows from visible semantics.
- Context-dependent — depends on schema, dialect, configuration, or data.
- Business assumption — requires domain confirmation.
- Runtime unknown — needs execution, logs, or query-plan evidence.
Prioritize the user's goal and level. Explain conceptual invariants before incidental syntax.
Failure modes
- Paraphrasing every line without explaining data flow.
- Inventing source schemas, business meanings, or macro behavior.
- Saying a join is safe without cardinality evidence.
- Overwhelming beginners or under-explaining operational behavior to engineers.
- Running code solely to make the explanation feel authoritative.
- Presenting a bug hypothesis as what the code necessarily does.
Evidence required
Anchor claims to a function, CTE, expression, config, or traced path. Include a compact worked example when it materially clarifies grain, nulls, windows, or aggregation. State what evidence would resolve context-dependent claims. Never fabricate output rows.
Output contract
Return:
- One-sentence purpose.
- Inputs and output — including grain when relevant.
- Step-by-step data flow at the chosen level.
- Key concepts appropriate to beginner, analyst, or analytics-engineer depth.
- Assumptions and edge cases.
- Operational notes when relevant.
- Verification questions/tests if behavior is unresolved.
In Learn mode, end with one short comprehension check or next concept. In Assessment mode, provide evaluation criteria and targeted feedback rather than silently completing the exercise.
For Analyst and Analytics Engineer levels, default to the 3–5 highest-impact risks and verification checks. Keep direct code semantics separate from repository facts: cite the exact config/artifact for adapter, variable, materialization, or runtime claims, otherwise label them unknown. Avoid peripheral repository details and do not repeat the same caveat in flow, risks, and runtime-unknown sections.
Verification
- Re-trace the explanation against the code in execution order.
- Check every expression used to classify or match rows for null propagation that can exclude a row from a numerator while retaining it in the denominator.
- Confirm dialect/framework-specific claims.
- Check that stated grain changes match joins and aggregations.
- Distinguish static facts from runtime/data-dependent behavior.
- Ensure terminology and detail match the selected level.
Safety/privacy
- Do not execute code, query data, or open connected systems without explicit instruction.
- Redact credentials, secrets, personal data, and proprietary values from examples.
- Use synthetic examples when row values are unnecessary.
- Warn when code appears to mutate, export, or broaden access to data.
What not to assume
Do not assume names equal semantics, comments are current, inputs satisfy constraints, joins are one-to-one, ordering is deterministic, macros are standard, the environment is production-safe, or the user already understands unexplained jargon.
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.

