Datalad save

From nipreps/skills-comm · View interactive version

Datalad save is an AI agent skill from the GitHub repository nipreps/skills-comm. Auto-invoke inside a DataLad dataset (.datalad/ present) when about to use git add, git commit, or when saving code changes, scripts, or configs. Trigger on "save my changes", "commit this", "record these edits", "checkpoint my work", or /datalad-save. Replaces git add + git commit inside DataLad da

How to use this skill

Skill file

Skill: datalad-save

Record code changes, configuration edits, and non-run file modifications in a DataLad

dataset. datalad save is the correct replacement for git add + git commit inside

a DataLad dataset — it handles both git-tracked and annexed files correctly.

Steps

  1. Verify DataLad context — check for .datalad/ in the current directory or any

parent directory:

```bash

ls .datalad/ 2>/dev/null || git rev-parse --show-toplevel

```

git add + git commit workflow and inform the user:

> "No DataLad dataset detected — using plain git commit instead."

  1. Run datalad status — show the user what has changed:

```bash

datalad status

```

Present the output. If nothing is modified or untracked, stop:

> "Nothing to save — working tree is clean."

  1. Determine save scope — based on $ARGUMENTS and conversation context:
  1. Get or confirm the commit message — read from $ARGUMENTS or ask:

> "What should the commit message be? (describe what changed and why)"

Wait for the user's message. Never proceed with an empty or placeholder message.

  1. Construct and show the save command:

```

datalad save -m "<message>" [paths...]

```

Show it to the user before executing.

  1. Execute and confirm — run the command. Then run datalad status again and show

the output to confirm the working tree is clean. Report the commit hash.

Constraints

placeholder like "save" or "update".

both annexed and git-tracked files correctly; raw git commands can corrupt annex state.

paths are being saved.

instead — outputs should be recorded with the command that created them, not as

standalone saves.

(useful for small config files, .gitignore fragments, etc. that should not be annexed).

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.