Skip to content

Commit 8cfd46e

Browse files
authored
feat: add DeePMD installation agent skill (#5974)
## Summary - add the `deepmd-install` Agent Skill with concise routes for pip, conda, dp1s, offline packages, Docker, source builds, C/C++, and LAMMPS - fetch version-matched official documentation before rendering version-sensitive commands, using exact-ref raw Markdown from GitHub or the official Gitee mirror - treat dynamic command values as literal process arguments rather than shell source - pin pip and Conda installations to the selected release and fail verification on a normalized version mismatch - make source runtime and compiled-backend selection explicit, including the documented backend-neutral C/C++ route - keep a compact failure-mode reference for environment identity, backend and accelerator selection, source builds, native loader checks, Docker, and LAMMPS - document skill installation in the README and installation docs, using the official Gitee mirror as the network fallback ## Design The skill provides route selection, safety boundaries, and verification criteria without duplicating the installation manual. It assumes no local source checkout. The agent opens the direct official page first, resolves a release to its tag, and falls back to the corresponding Markdown at that exact tag or commit when versioned web documentation is unavailable. Source installation remains the recommended path when a compiler is available and build time is acceptable. TensorFlow, PyTorch, JAX, Paddle, and backend-neutral C/C++ libraries are represented, while version-specific package, accelerator, and build commands remain owned by the official documentation. ## Validation - official `quick_validate.py skills/deepmd-install` - repository pre-commit hooks for all changed files - shell-free argv round-trip with spaces, command-substitution syntax, backticks, semicolons, and option-looking values - PEP 440 release normalization and exact pip requirement parsing - Conda exact-version MatchSpec parsing, including rejection of the fuzzy single-equals form - direct GitHub and official Gitee raw-documentation fetch at an exact upstream commit - official Gitee and upstream `master` commit identity check - source build environment-assignment shell check - local Git checkout checks for both a normal ref and an option-looking ref - `git diff --check`
1 parent 14a71f1 commit 8cfd46e

11 files changed

Lines changed: 637 additions & 12 deletions

File tree

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,26 @@ plugins. Applications can therefore open the backend required by a model
230230
without directly linking every framework.
231231

232232
> [!NOTE]
233-
> Working with an AI coding or scientific agent? DeePMD-kit ships
233+
> Working with an AI coding or scientific agent? Start with
234+
> [Install with an AI agent][agent-install], or browse the
234235
> [official Agent Skills][agent-skills] for model selection, training,
235236
> fine-tuning, Python inference, and LAMMPS workflows.
237+
>
238+
> ```bash
239+
> npx -y skills add https://github.com/deepmodeling/deepmd-kit/tree/master/skills \
240+
> --skill deepmd-install -y
241+
> ```
242+
>
243+
> If direct GitHub access fails, clone the official Gitee mirror and install
244+
> from the local checkout:
245+
>
246+
> ```bash
247+
> git clone --depth 1 \
248+
> https://gitee.com/deepmodeling/deepmd-kit.git \
249+
> deepmd-kit-skill-source
250+
> npx -y skills add ./deepmd-kit-skill-source/skills \
251+
> --skill deepmd-install -y
252+
> ```
236253
237254
## 📚 Documentation and community
238255
@@ -269,6 +286,7 @@ that matches the version used and the method-specific papers listed in
269286
DeePMD-kit is licensed under the
270287
[GNU Lesser General Public License v3.0 or later](./LICENSE).
271288
289+
[agent-install]: https://docs.deepmodeling.com/projects/deepmd/en/latest/install/install-with-agent.html
272290
[agent-skills]: https://docs.deepmodeling.com/projects/deepmd/en/latest/agent-skills.html
273291
[ase]: https://docs.deepmodeling.com/projects/deepmd/en/latest/third-party/ase.html
274292
[backends]: https://docs.deepmodeling.com/projects/deepmd/en/latest/backend.html

doc/agent-skills.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
DeePMD-kit provides official [Agent Skills](https://agentskills.io/what-are-skills) that help AI agents run
44
DeePMD-kit workflows in a reproducible way. These skills capture
5-
project-specific operating knowledge—such as training inputs, model
5+
project-specific operating knowledge—such as installation, training inputs, model
66
selection, deployment, LAMMPS integration, and Python inference patterns—so an
77
agent can turn a high-level request into concrete files, commands, and
88
validation steps.
@@ -14,6 +14,11 @@ in the DeePMD-kit repository under `skills/`.
1414

1515
## List of skills
1616

17+
- `deepmd-install`: Select a pip, conda, `dp1s`, offline, Docker, or source
18+
installation path, load the official documentation matching the requested
19+
version, and verify the requested Python, C/C++, or LAMMPS interface. A
20+
compact failure-mode reference covers issues not resolved by the install
21+
pages.
1722
- `deepmd-train`: Choose a DeePMD-kit model family, then train from scratch.
1823
The skill uses progressive disclosure: the top-level workflow handles common
1924
training steps and model selection, while model-specific configuration lives
@@ -40,6 +45,10 @@ paper:
4045

4146
## Install skills
4247

48+
To have an agent install DeePMD-kit itself, send
49+
[Install with an AI agent](install/install-with-agent.md) and ask it to load
50+
`deepmd-install`.
51+
4352
### If you are a user
4453

4554
The easiest way is to send this page to your agent and ask it to install the
@@ -51,23 +60,33 @@ If you already have a DeePMD-kit checkout, run this command from the repository
5160
root:
5261

5362
```bash
54-
npx -y skills add ./skills -a openclaw -y
63+
npx -y skills add ./skills --skill '*' -y
5564
```
5665

5766
If you do not have a checkout, the same skills can also be installed directly
5867
from GitHub:
5968

6069
```bash
6170
npx -y skills add https://github.com/deepmodeling/deepmd-kit/tree/master/skills \
62-
-a openclaw -y
71+
--skill '*' -y
72+
```
73+
74+
If direct GitHub access fails, clone the official Gitee mirror and install from
75+
that checkout:
76+
77+
```bash
78+
git clone --depth 1 \
79+
https://gitee.com/deepmodeling/deepmd-kit.git \
80+
deepmd-kit-skill-source
81+
npx -y skills add ./deepmd-kit-skill-source/skills --skill '*' -y
6382
```
6483

65-
The examples above require Node.js/npm so that `npx` is available, and they
66-
install the skills for OpenClaw. Replace `openclaw` with the target agent name
67-
when installing for another agent. The GitHub command lets the skill CLI fetch
68-
the repository for you. For large repositories or slow networks, this can take
69-
longer than installing from an existing local checkout. Refresh or restart the
70-
session afterward so the installed skills are reloaded.
84+
The examples require Node.js/npm so that `npx` is available. The Skills CLI
85+
installs every official skill for the detected agent. To target one product,
86+
add its agent name, for example `--agent cursor` or `--agent claude-code`. The
87+
GitHub command lets the CLI fetch the repository; installing from an existing
88+
checkout avoids that download. Refresh or restart the session afterward so the
89+
installed skills are reloaded.
7190

7291
## Minimal verification
7392

@@ -80,3 +99,6 @@ without launching an expensive calculation. For example:
8099
water dataset and draft a training input, but do not start training.”
81100
- “Use the `lammps-deepmd` skill to prepare an NVT LAMMPS input file for a
82101
DeePMD-kit model, and explain each command.”
102+
- “Use the `deepmd-install` skill to install the current stable release with
103+
PyTorch and CUDA. Read the matching official documentation before choosing
104+
packages, then verify a tensor operation on the GPU.”

doc/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ New and noteworthy
276276
:link-type: doc
277277
:shadow: sm
278278

279-
Give AI agents reproducible guidance for training, fine-tuning,
280-
inference, and LAMMPS workflows.
279+
Give AI agents reproducible guidance for installation, training,
280+
fine-tuning, inference, and LAMMPS workflows.
281281

282282
Documentation map
283283
=================

doc/install/easy-install.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
There are various easy methods to install DeePMD-kit. Choose one that you prefer. If you want to build by yourself, jump to the next two sections.
44

5+
An AI agent can perform the same installation. See [Install with an AI agent](install-with-agent.md).
6+
57
After your easy installation, DeePMD-kit (`dp`) and LAMMPS (`lmp`) will be available to execute. You can try `dp -h` and `lmp -h` to see the help. `mpirun` is also available considering you may want to train models or run LAMMPS in parallel.
68

79
> [!NOTE]

doc/install/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Installation
55
:maxdepth: 1
66

77
easy-install
8+
install-with-agent
89
install-from-source
910
install-from-c-library
1011
install-lammps

doc/install/install-from-source.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Install from source code
22

3+
An AI agent can walk through this source build, including the C++ interface
4+
and LAMMPS with Kokkos. See [Install with an AI agent](install-with-agent.md).
5+
36
Please follow our [GitHub](https://github.com/deepmodeling/deepmd-kit) webpage to download the source code of a specific version or the [development version](https://github.com/deepmodeling/deepmd-kit/tree/master).
47

58
Or get the DeePMD-kit source code by `git clone`

doc/install/install-lammps.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Install LAMMPS
22

3+
An AI agent can build LAMMPS with the DeePMD-kit module and Kokkos. DPA4/SeZM
4+
uses `pair_style deepmd/kk`; DPA4C uses `pair_style dpa4spin/kk`. See
5+
[Install with an AI agent](install-with-agent.md).
6+
37
There are two ways to install LAMMPS: the built-in mode and the plugin mode. The built-in mode builds LAMMPS along with the DeePMD-kit and DeePMD-kit will be loaded automatically when running LAMMPS. The plugin mode builds LAMMPS and a plugin separately, so one needs to use `plugin load` command to load the DeePMD-kit's LAMMPS plugin library.
48

59
## Install LAMMPS's DeePMD-kit module (built-in mode)

doc/install/install-with-agent.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Install with an AI agent
2+
3+
DeePMD-kit ships an official Agent Skill, `deepmd-install`, that walks an AI
4+
agent through installing the package. The skill covers easy methods (conda,
5+
pip, Docker, offline installers, `dp1s`) and source builds of the Python
6+
package, the C++ interface, and LAMMPS.
7+
8+
The skill inspects the target machine, asks only for decisions required by the
9+
selected installation path, reads the official documentation matching the
10+
requested version, and verifies the requested interface. Version-specific
11+
package and build commands remain in the installation documentation instead
12+
of being duplicated in the skill.
13+
14+
The full skill catalog is in [Agent Skills](../agent-skills.md). For a
15+
manual install, use [Easy install](easy-install.md) or
16+
[Install from source](install-from-source.md).
17+
18+
## If you are a user
19+
20+
Send this page to your agent and ask it to install the official
21+
`deepmd-install` skill, then install DeePMD-kit. You do not need to run the
22+
commands below yourself.
23+
24+
## If you are an agent
25+
26+
Install `deepmd-install` first, then load it and install DeePMD-kit with the
27+
required backend, accelerator, and optional native interfaces.
28+
29+
If this machine already has a DeePMD-kit checkout, run from the repository
30+
root:
31+
32+
```bash
33+
npx -y skills add ./skills --skill deepmd-install -y
34+
```
35+
36+
If there is no checkout, install the same skill from GitHub:
37+
38+
```bash
39+
npx -y skills add https://github.com/deepmodeling/deepmd-kit/tree/master/skills \
40+
--skill deepmd-install -y
41+
```
42+
43+
If direct GitHub access fails, clone the official Gitee mirror and install from
44+
the local checkout:
45+
46+
```bash
47+
git clone --depth 1 \
48+
https://gitee.com/deepmodeling/deepmd-kit.git \
49+
deepmd-kit-skill-source
50+
npx -y skills add ./deepmd-kit-skill-source/skills \
51+
--skill deepmd-install -y
52+
```
53+
54+
The examples require Node.js/npm so that `npx` is available. The Skills CLI
55+
uses the detected agent. To target one product, add `--agent cursor`,
56+
`--agent claude-code`, or another supported agent name. Refresh or restart the
57+
session afterward so the skill is reloaded.
58+
59+
Then use the `deepmd-install` skill. The agent selects one installation method,
60+
loads the version-matched official documentation, executes its commands in the
61+
chosen environment, and verifies the requested Python, C/C++, or LAMMPS
62+
interface.

0 commit comments

Comments
 (0)