diff options
| author | tanaka takashi <isazaka@gmail.com> | 2026-08-10 00:57:30 +0900 |
|---|---|---|
| committer | tanaka takashi <isazaka@gmail.com> | 2026-08-10 00:57:30 +0900 |
| commit | 6394dfcc50fb1804ab07be309d940017eb11ef7d (patch) | |
| tree | efaf80787e9a205c6758c4c7a541077b2dbd53ce /skills/python-via-uv | |
| parent | e4a951d8b953c37b9078a48bce43cac6fd09edac (diff) | |
feat(skills): add uv-assisted Python workflow
Add a concise Japanese companion prompt that asks the model to be approachable, clarify uncertainty, select available skills and tools, verify results, and report the next useful action without adding excessive context.
Add the standard skills/python-via-uv/SKILL.md package and UI metadata. The workflow uses uv python find offline to resolve an interpreter, then asks the Broker to launch the separately approved Python executable. It deliberately avoids uv run because the v1 OS child-process restriction must reject descendants created directly by uv.
Support standard skills/<name>/SKILL.md directories while retaining legacy top-level Markdown loading. Skip reparse-point skill directories, load deterministically, package the complete skills tree, and avoid loading nested reference Markdown as independent skills.
Validation: skill-creator quick_validate PASS; uv 0.11.23 resolved Python and the two-stage Python execution printed UV_BROKER_TWO_STAGE_OK. Release build passed with 0 warnings/errors; Core tests passed 49/49 with skip 0. The 1.0.0 Bundle and manifest were regenerated with the prompt and Skill.
Diffstat (limited to 'skills/python-via-uv')
| -rw-r--r-- | skills/python-via-uv/SKILL.md | 27 | ||||
| -rw-r--r-- | skills/python-via-uv/agents/openai.yaml | 4 |
2 files changed, 31 insertions, 0 deletions
diff --git a/skills/python-via-uv/SKILL.md b/skills/python-via-uv/SKILL.md new file mode 100644 index 0000000..d840e4d --- /dev/null +++ b/skills/python-via-uv/SKILL.md @@ -0,0 +1,27 @@ +--- +name: python-via-uv +description: uv経由でPythonコードを作成・実行・検証する。ユーザーがPythonによる計算、データ処理、自動化、試作、デバッグ、またはスクリプト実行を求めたときに使用する。 +--- + +# Python via uv + +1. 作業directoryと必要な入出力を確認し、コードは許可されたdirectory内の`.py`へ`file_edit`で保存する。複雑なコードを`python -c`へ詰め込まない。 +2. 承認済み`uv.exe`を`process_run`し、projectではcwdから`uv python find --offline --no-python-downloads --resolve-links`、単独scriptでは同じ引数へ`--no-project`を追加してinterpreterの絶対pathを取得する。 +3. 取得した承認済み`python.exe`を別の`process_run`で起動し、`-I <script>`を渡す。shellを経由せず、引数は配列で分離する。 +4. v1 Sandboxは全descendant生成を禁止するため、`uv run`は使用しない。uvが返したPythonをBrokerから直接起動することで、両方のpath/SHA-256 approvalとchild-process禁止を維持する。 +5. dependencyが環境にない場合は勝手にnetwork接続やinstallを行わず、必要なpackageと許可をユーザーへ確認する。依頼なしに`uv add`や`uv pip install`を実行しない。 +6. `stdout`、`stderr`、exit codeを確認する。exit code 0と期待結果を確認できた場合だけ成功と報告し、生成・変更したfileも示す。 + +`process_run`の基本形: + +```text +executable: <承認済みuv.exe> +args: ["python", "find", "--offline", "--no-python-downloads", "--resolve-links", "--no-project"] +cwd: <許可された作業directory> + +executable: <uvが返した承認済みpython.exe> +args: ["-I", "script.py"] +cwd: <許可された作業directory> +``` + +`uv.exe`または`python.exe`が未承認、あるいは作業directoryのread/write/execute権限が不足している場合は迂回せず、必要な設定を具体的に報告する。 diff --git a/skills/python-via-uv/agents/openai.yaml b/skills/python-via-uv/agents/openai.yaml new file mode 100644 index 0000000..de95aab --- /dev/null +++ b/skills/python-via-uv/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Python via uv" + short_description: "Run reproducible Python tasks safely through uv" + default_prompt: "Use $python-via-uv to create and run Python code, then verify the result." |
