@yeyuan98/opencode-bioresearcher-plugin 1.3.0-alpha.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -0
- package/dist/skills/python-setup-uv/SKILL.md +141 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,8 +86,21 @@ Skills are reusable prompt templates discovered from multiple paths:
|
|
|
86
86
|
| `.claude/skills/` | Claude Code compatible |
|
|
87
87
|
| `.agents/skills/` | Agents compatible |
|
|
88
88
|
|
|
89
|
+
This plugin provides a skill tool that overrides Opencode's built-in to support plugin-shipped skills.
|
|
90
|
+
|
|
89
91
|
See [skill-tools/README.md](skill-tools/README.md) for full documentation.
|
|
90
92
|
|
|
93
|
+
### Supplied skills
|
|
94
|
+
|
|
95
|
+
- `demo-skill`: showcase skill tool mechanisms.
|
|
96
|
+
- `python-setup-uv`: setup python runtime in your working directory with uv.
|
|
97
|
+
|
|
98
|
+
Prompt the following and follow along:
|
|
99
|
+
|
|
100
|
+
```txt
|
|
101
|
+
Setup python uv with skill
|
|
102
|
+
```
|
|
103
|
+
|
|
91
104
|
## Installation
|
|
92
105
|
|
|
93
106
|
Add the plugin to your `opencode.json`:
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: python-setup-uv
|
|
3
|
+
description: Setup Python environment with uv package manager - download binaries, create symlink, and install packages
|
|
4
|
+
allowedTools:
|
|
5
|
+
- Bash
|
|
6
|
+
- Read
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Python Environment Setup with uv
|
|
10
|
+
|
|
11
|
+
This skill sets up a Python environment using the uv package manager.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
- Internet connection for downloading uv
|
|
15
|
+
- Python 3.8+ should be available on PATH (or uv will prompt to install it)
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
**ABSOLUTE RULE:** Follow steps below EXACTLY AS IS. Do NOT skip/modify steps (nor detailed subtasks in each step) nor assume anything based on user platform information. Use URLs below EXACTLY AS IS. Follow steps below INCLUDING ALL DETAILS AND SUBSTEPS EXACTLY AS IS.
|
|
20
|
+
|
|
21
|
+
### Step 1: Ask user question about which installer to use
|
|
22
|
+
|
|
23
|
+
Use the question tool to ask which installer should be used:
|
|
24
|
+
|
|
25
|
+
- Official astral-uv installer (https://astral.sh)
|
|
26
|
+
- China mainland uv-custom installer (https://gitee.com/wangnov/uv-custom)
|
|
27
|
+
|
|
28
|
+
### Step 2: Detect Shell and Download uv Binary
|
|
29
|
+
|
|
30
|
+
First, detect your shell environment:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Detect shell type
|
|
34
|
+
# MSYSTEM is set by Git Bash, MINGW_PREFIX by MSYS2
|
|
35
|
+
if [ -n "$MSYSTEM" ] || [ -n "$MINGW_PREFIX" ] || command -v curl >/dev/null 2>&1; then
|
|
36
|
+
echo "Unix-like shell detected (Git Bash, bash, zsh, etc.)"
|
|
37
|
+
IS_UNIX_SHELL=true
|
|
38
|
+
else
|
|
39
|
+
echo "Windows cmd.exe detected"
|
|
40
|
+
IS_UNIX_SHELL=false
|
|
41
|
+
fi
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then download uv based on your shell (see below).
|
|
45
|
+
|
|
46
|
+
Choose the correct `UV_INSTALLER_URL` depending on answer you received in Step 1 from the user:
|
|
47
|
+
|
|
48
|
+
- If opted "Official astral-uv", UV_INSTALLER_URL should be `https://astral.sh/uv/install.sh` (Unix-like) or `https://astral.sh/uv/install.ps1` (Windows)
|
|
49
|
+
- If opted "China mainland uv-custom", UV_INSTALLER_URL should be `https://gitee.com/wangnov/uv-custom/releases/download/latest/uv-installer-custom.sh` (Unix-like) or `https://gitee.com/wangnov/uv-custom/releases/download/latest/uv-installer-custom.ps1` (Windows)
|
|
50
|
+
|
|
51
|
+
**For Unix-like shells (Git Bash / macOS / Linux; use correct UV_INSTALLER_URL):**
|
|
52
|
+
```bash
|
|
53
|
+
mkdir -p .uv
|
|
54
|
+
curl -LsSf UV_INSTALLER_URL | UV_INSTALL_DIR="$(pwd)/.uv" sh
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**For Windows cmd.exe (if Git Bash unavailable; use correct UV_INSTALLER_URL):**
|
|
58
|
+
```bash
|
|
59
|
+
powershell -NoProfile -Command "New-Item -ItemType Directory -Force -Path .uv | Out-Null; $env:UV_INSTALL_DIR = (Get-Location).Path + '\.uv'; Invoke-RestMethod UV_INSTALLER_URL | Invoke-Expression"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Step 3: Create Symlink or Copy uv to Working Directory
|
|
63
|
+
|
|
64
|
+
**For Unix-like shells (Git Bash / macOS / Linux):**
|
|
65
|
+
```bash
|
|
66
|
+
ln -sf .uv/uv uv
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**For Windows cmd.exe:**
|
|
70
|
+
|
|
71
|
+
Try symlink first, fall back to copy if no Admin rights:
|
|
72
|
+
```bash
|
|
73
|
+
cmd /c "(mklink uv .uv\uv.exe) 2>nul || copy /Y .uv\uv.exe uv.exe"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 4: Create Virtual Environment and Install pandas
|
|
77
|
+
|
|
78
|
+
NOTE: this step (package installation) may timeout. If timed out, use the question tool to ask if the user would like to retry package installation. If successful, do NOT ask any question and continue to Step 5.
|
|
79
|
+
|
|
80
|
+
**For Unix-like shells:**
|
|
81
|
+
```bash
|
|
82
|
+
./uv venv
|
|
83
|
+
./uv pip install pandas
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**For Windows cmd.exe:**
|
|
87
|
+
```bash
|
|
88
|
+
uv.exe venv
|
|
89
|
+
uv.exe pip install pandas
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Step 5: Verification
|
|
93
|
+
|
|
94
|
+
**For Unix-like shells:**
|
|
95
|
+
```bash
|
|
96
|
+
./uv --version
|
|
97
|
+
./uv run python -c "import pandas; print(pandas.__version__)"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**For Windows cmd.exe:**
|
|
101
|
+
```bash
|
|
102
|
+
uv.exe --version
|
|
103
|
+
uv.exe run python -c "import pandas; print(pandas.__version__)"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Step 6: Update AGENTS.md
|
|
107
|
+
|
|
108
|
+
Use the question tool to ask if the user want to update AGENTS.md in WORKING DIRECTORY to "direct agents to use the installed UV Python" (options: "Yes" / "No"). If received no answer, continue to Step 7 (do NOT modify AGENTS.md NOR create directories). If received yes answer, follow steps belows.
|
|
109
|
+
|
|
110
|
+
1. If AGENTS.md not found in WORKING DIR, create an empty AGENTS.md.
|
|
111
|
+
2. Inspect AGENTS.md content. If you do not see the content block below, APPEND EXACTLY AS IS to end of AGENTS.md.
|
|
112
|
+
3. Check if `./.code/py` exist. If not, create the directories.
|
|
113
|
+
|
|
114
|
+
Content block:
|
|
115
|
+
|
|
116
|
+
```md
|
|
117
|
+
## Important note about Python
|
|
118
|
+
|
|
119
|
+
ALWAYS use the uv package manager available in WORKING DIRECTORY, including `uv add ...` or `uv pip ...` for package management and `uv run ...` to run python package executables.
|
|
120
|
+
|
|
121
|
+
ALWAYS save python scripts under path `./.code/py/` and run the script with `uv run python ...` whenever your work involves executing python scripts. Your script MUST contain concise docstrings and comments and use good engineering practices including separation of concerns.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Step 7: Return summary to user (Usage After Setup)
|
|
125
|
+
|
|
126
|
+
**For Unix-like shells:**
|
|
127
|
+
```bash
|
|
128
|
+
./uv run python your_script.py
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**For Windows cmd.exe:**
|
|
132
|
+
```bash
|
|
133
|
+
uv.exe run python your_script.py
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Notes
|
|
137
|
+
- Add `.uv/` and `.venv/` to `.gitignore`
|
|
138
|
+
- `uv run` handles venv activation automatically
|
|
139
|
+
- Use `./uv add <package>` (Unix) or `uv.exe add <package>` (Windows cmd.exe) for project dependencies
|
|
140
|
+
- Windows with Git Bash: Follow Unix-like shell instructions
|
|
141
|
+
- Windows cmd.exe without Admin rights: `uv.exe` is copied instead of symlinked
|