Datalad clone

From nipreps/skills-comm · View interactive version

Datalad clone is an AI agent skill from the GitHub repository nipreps/skills-comm. Auto-invoke when the user wants to obtain a copy of a dataset from a URL or path, install a dataset, add a nested subdataset, or link external data as input to a project. Trigger on "clone a dataset", "get a copy of", "install dataset", "add subdataset", "link this data as input", or /datalad-clone.

How to use this skill

Skill file

Skill: datalad-clone

Obtain a copy of a DataLad dataset from a URL or local path. Optionally register it as

a subdataset inside an existing DataLad dataset (YODA-style nested layout).

Steps

  1. Identify source — read the source URL or path from $ARGUMENTS. If not provided,

ask the user for the source before continuing. If the URL begins with ria+, this is

a RIA store. Accepted formats: ria+ssh://user@host/path, ria+http://host/path,

ria+file:///local/path. Load ${CLAUDE_PLUGIN_ROOT}/../references/siblings-and-remotes.md

for RIA store URL details.

  1. Determine mode — decide whether this clone should be:

Check whether the current working directory is a DataLad dataset:

```bash

ls .datalad/ 2>/dev/null

```

or a target path like inputs/raw/sub-01 — default to subdataset mode

> "Should this be registered as a subdataset of the current dataset, or cloned

> as a standalone dataset?"

  1. Determine destination path — read from $ARGUMENTS or derive from the source

name (last path/URL component, minus .git). Show the planned destination and confirm

if it differs from what the user expects.

  1. Construct and show command:

```

datalad clone <source> [<dest>]

```

```

datalad clone -d . <source> <dest>

```

When cloning on the same filesystem (e.g., HPC scratch → project directory),

--reckless=shared-local skips the safety copy and is substantially faster. Only use

on trusted local filesystems.

Always show the full command before executing.

  1. Execute — run the command. Report the installed path and the commit SHA recorded.
  1. Post-clone reminder (subdataset mode only) — after cloning as a subdataset, the

superdataset's working tree is modified but not yet committed. Remind the user:

> "The subdataset pointer is not yet saved. Run:

> datalad save -m 'add <name> as subdataset'

> to record it in the superdataset history."

Reference

Load ${CLAUDE_PLUGIN_ROOT}/../references/subdataset-patterns.md when the user asks

about nested layouts, why -d . is needed, or the YODA neuroimaging project structure.

Load ${CLAUDE_PLUGIN_ROOT}/../references/yoda-layout.md when the user asks about the

YODA directory layout, .gitattributes rules, or how inputs/ and outputs/ are

structured.

Constraints

configuration and special remote registrations.

datalad clone -d ..

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.