Read {skill_dir}/SDK.md in full before answering DataChain SDK questions or generating DataChain Python code. It holds the SDK rules: API usage, UDF signatures, settings, delta semantics, materialization patterns, saving, exporting. The last section below holds the steps that need a local checkout and the dc-knowledge/ knowledge base.
Scope of this skill
This skill does not own methodology. Decisions about which datasets to build, what scope, what shape (Container / Asset / Sense / Task), what fields to save, and when to dialogue with the user about layer choices — those are the CAST methodology, which lives in the datachain-knowledge skill at {knowledge_skill_dir}/CAST.md.
When knowledge is loaded, it is the orchestrator: it plans the layers (CAST §4), invokes the rules in SDK.md to write the code, then runs the KB pipeline. When knowledge is not loaded (raw SDK use, no dc-knowledge/ directory), SDK.md is self-sufficient — CAST doctrine simply does not apply.
If you find yourself reasoning about "should I build a Sense layer here?" or "should this be scoped to the bucket or the directory?" from inside this skill, stop — those questions belong upstream. Ask the user to load the knowledge skill, or fall through to a direct solve.
Before writing any pipeline code
- If
dc-knowledge/index.mdexists, read it first. - When the user's task overlaps with an existing dataset, read its
.mdunderdc-knowledge/datasets/for schema, code patterns, and lineage. - Bucket access: anonymous or authenticated? Check
dc-knowledge/buckets/for a.mdfile withanon: true/falsein frontmatter. If none, rundatachain bucket status <uri>to detect. Ifdeniedornot found, stop and ask the user.
Never create or modify files under dc-knowledge/ — that directory is owned by the knowledge skill.