Datalad init

From nipreps/skills-comm · View interactive version

Datalad init is an AI agent skill from the GitHub repository nipreps/skills-comm. Create a new DataLad dataset with YODA layout, or initialize provenance tracking in an existing directory. Trigger on "create a new DataLad dataset", "set up YODA dataset", "initialize data provenance tracking", "start a datalad project", or /datalad-init. Does NOT trigger for saving changes (use da

How to use this skill

Skill file

Skill: datalad-init

Create a new DataLad dataset following YODA principles for reproducible, provenance-tracked

local analysis projects. The -c yoda configuration is always applied — it sets up the

correct directory layout and .gitattributes rules.

Steps

  1. Determine target path — read $ARGUMENTS. If a path is given, use it. If empty,

use the current working directory. Show the resolved absolute path and ask the user to

confirm before proceeding.

  1. Pre-flight checks — before running any command:

> "A DataLad dataset already exists at <path>. Re-initializing would overwrite

> dataset configuration. Run datalad status to check its state."

```bash

git annex config annex.backend 2>/dev/null

```

If it returns MD5E, warn:

> "The existing annex uses the legacy MD5E backend. Migrating backends after the

> fact is complex. Consider initializing a fresh dataset at a new path and

> re-ingesting data."

Stop unless the user explicitly asks to continue anyway.

run git rev-parse --git-dir from the target path. If a .git/ is found but no

.datalad/, warn:

> "Target path is inside a plain git repository. Creating a DataLad dataset here

> will nest it inside an untracked git repo, which can cause unexpected behavior.

> Consider initializing at the git repo root, or outside the git tree. Proceed anyway?"

Wait for user confirmation before continuing.

  1. Create the dataset — run:

```

datalad create -c yoda <path>

```

Show the command before executing. Report the full output. Optionally suggest adding

--annex-backend SHA256E (recommended; avoids the legacy MD5E backend which causes

compatibility issues with some special remotes):

```

datalad create -c yoda --annex-backend SHA256E <path>

```

  1. Report the YODA structure — after creation, display what was created:

```

<path>/

├── code/ ← version-controlled scripts and notebooks (annexed: never)

├── outputs/ ← results produced by datalad run (annexed: everything)

├── inputs/ ← input data, ideally linked as subdatasets (annexed: everything)

└── README.md ← dataset description

```

Explain each directory's role briefly (see ${CLAUDE_PLUGIN_ROOT}/../references/yoda-layout.md

for full detail).

  1. Explain YODA principles — briefly state the three principles:
  1. Suggest next steps — close with:

Constraints

confirmation before proceeding.

about YODA conventions, .gitattributes behavior, or subdataset patterns.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.