# Datalad Save

> >

- **Type:** Skill
- **Install:** `agentstack add skill-neuroanalytics-data-science-harness-datalad-save`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [neuroanalytics](https://agentstack.voostack.com/s/neuroanalytics)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [neuroanalytics](https://github.com/neuroanalytics)
- **Source:** https://github.com/neuroanalytics/data-science-harness/tree/main/plugins/datalad-cli/skills/datalad-save

## Install

```sh
agentstack add skill-neuroanalytics-data-science-harness-datalad-save
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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
   ```
   - **Dataset found**: continue.
   - **No dataset found** (plain git repo or not tracked): fall back to standard
     `git add` + `git commit` workflow and inform the user:
     > "No DataLad dataset detected — using plain git commit instead."

2. **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."

3. **Determine save scope** — based on `$ARGUMENTS` and conversation context:
   - If specific paths are given (e.g., `code/analysis.py configs/`), save only those paths
   - If no paths given, save all changes (`datalad save` without path arguments saves everything)
   - Show the user which scope will be used and confirm if ambiguous

4. **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.

5. **Construct and show the save command**:
   ```
   datalad save -m "" [paths...]
   ```
   Show it to the user before executing.

6. **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

- Always require a meaningful `-m` message — never save with an empty string or
  placeholder like "save" or "update".
- Never use `git add` or `git commit` inside a DataLad dataset — `datalad save` handles
  both annexed and git-tracked files correctly; raw git commands can corrupt annex state.
- Never use `git annex add` manually — DataLad manages annex staging automatically.
- Always make the save scope explicit: tell the user whether all changes or specific
  paths are being saved.
- Always run `datalad status` before saving to show the user what will be recorded.
- Always run `datalad status` after saving to confirm a clean working tree.
- If the user asks to save outputs produced by a script, redirect them to `datalad run`
  instead — outputs should be recorded with the command that created them, not as
  standalone saves.
- Use `datalad save --to-git ` to force a file into git tracking rather than annex
  (useful for small config files, `.gitignore` fragments, etc. that should not be annexed).
- Use `datalad save --version-tag ` to tag an analysis milestone after saving.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [neuroanalytics](https://github.com/neuroanalytics)
- **Source:** [neuroanalytics/data-science-harness](https://github.com/neuroanalytics/data-science-harness)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-neuroanalytics-data-science-harness-datalad-save
- Seller: https://agentstack.voostack.com/s/neuroanalytics
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
