1
0

规范命名

This commit is contained in:
2026-02-06 14:55:59 +08:00
parent 1726616c48
commit 120edb82e6
11 changed files with 18 additions and 18 deletions

View File

@@ -57,7 +57,7 @@ uv是Astral开发的快速Python包管理器支持PEP 723内联元数据格
### Decision 2: 使用辅助脚本实现跨平台临时目录
**决策:** 创建`skills/uv-python-runner/script/get_temp_path.py`辅助脚本使用Python标准库的`tempfile`模块在系统临时目录中创建空的Python脚本文件并返回脚本文件路径。**辅助脚本本身也使用uv run执行保持一致性。**
**决策:** 创建`skills/python-runner/script/get_temp_path.py`辅助脚本使用Python标准库的`tempfile`模块在系统临时目录中创建空的Python脚本文件并返回脚本文件路径。**辅助脚本本身也使用uv run执行保持一致性。**
**理由:**
- `tempfile.gettempdir()`自动适配所有平台Windows/macOS/Linux
@@ -72,7 +72,7 @@ uv是Astral开发的快速Python包管理器支持PEP 723内联元数据格
- **功能**在系统临时目录创建空的Python脚本文件返回文件路径
- **无注释**:脚本只包含必要代码,没有文档字符串或注释
- **PEP 723格式**:包含空的依赖声明`# dependencies = []`
- **执行方式**`uv run skills/uv-python-runner/script/get_temp_path.py`
- **执行方式**`uv run skills/python-runner/script/get_temp_path.py`
- **输出**直接在stdout输出临时Python脚本文件的完整路径
- Linux/macOS: `/tmp/uv_script_xxx.py`
- Windows: `C:\Users\<username>\AppData\Local\Temp\uv_script_xxx.py`
@@ -220,13 +220,13 @@ uv是Astral开发的快速Python包管理器支持PEP 723内联元数据格
这是新skill的首次实现不存在迁移问题。
**部署步骤:**
1. 创建skill目录`skills/uv-python-runner/`
2. 创建skill文件`skills/uv-python-runner/SKILL.md`
1. 创建skill目录`skills/python-runner/`
2. 创建skill文件`skills/python-runner/SKILL.md`
3. 编写skill内容YAML元数据 + Markdown文档
4. 测试skill是否可以被正确加载和触发
**回滚策略:**
- 如有问题,直接删除`skills/uv-python-runner/`目录即可
- 如有问题,直接删除`skills/python-runner/`目录即可
- skill文件不影响系统或现有代码
## Open Questions

View File

@@ -9,9 +9,9 @@
## What Changes
**注:** 实现时将技能名称从 `uv-python-runner` 简化为 `python-runner`,以保持命名更通用和简洁,避免与未来可能的其他 Python runner 实现名称冲突。
**注:** 实现时将技能名称从 `python-runner` 简化为 `python-runner`,以保持命名更通用和简洁,避免与未来可能的其他 Python runner 实现名称冲突。
- 创建新的skill`python-runner` (proposal中为 `uv-python-runner`)
- 创建新的skill`python-runner` (proposal中为 `python-runner`)
- 指导大模型按照PEP 723规范编写Python脚本
- 提供临时文件创建和uv run执行的标准流程
- 严格错误处理模式
@@ -28,7 +28,7 @@
### New Capabilities
- `uv-python-runner`: 通用Python脚本执行工具指导大模型使用uv的隔离环境特性来执行临时Python脚本无需在系统环境预安装依赖。适用于数据处理、API交互、文件操作、科学计算等各种任务。
- `python-runner`: 通用Python脚本执行工具指导大模型使用uv的隔离环境特性来执行临时Python脚本无需在系统环境预安装依赖。适用于数据处理、API交互、文件操作、科学计算等各种任务。
### Modified Capabilities
@@ -36,7 +36,7 @@
## Impact
- **代码影响**新增skill文件 `skills/uv-python-runner/SKILL.md`
- **代码影响**新增skill文件 `skills/python-runner/SKILL.md`
- **依赖影响**要求系统安装uvhttps://docs.astral.sh/uv/
- **系统影响**skill只提供指导不直接修改系统
- **API影响**:无

View File

@@ -36,7 +36,7 @@ Skill SHALL指导LLM在系统临时目录中创建临时Python文件并使用
### 需求:跨平台临时目录支持
Skill SHALL使用`skills/uv-python-runner/script/get_temp_path.py`辅助脚本来获取平台特定的临时目录。Skill SHALL在创建临时Python文件之前先调用此辅助脚本获取临时目录路径。Skill SHALL支持Windows、macOS、Linux三个平台。
Skill SHALL使用`skills/python-runner/script/get_temp_path.py`辅助脚本来获取平台特定的临时目录。Skill SHALL在创建临时Python文件之前先调用此辅助脚本获取临时目录路径。Skill SHALL支持Windows、macOS、Linux三个平台。
#### 场景:获取临时目录路径
- **WHEN** LLM需要为Python脚本创建临时文件

View File

@@ -1,17 +1,17 @@
## 1. Skill结构设置
- [x] 1.1 创建skill目录`skills/uv-python-runner/`
- [x] 1.2 创建script子目录`skills/uv-python-runner/script/`
- [x] 1.3 创建辅助脚本:`skills/uv-python-runner/script/get_temp_path.py`
- [x] 1.1 创建skill目录`skills/python-runner/`
- [x] 1.2 创建script子目录`skills/python-runner/script/`
- [x] 1.3 创建辅助脚本:`skills/python-runner/script/get_temp_path.py`
- [x] 1.3.1 添加PEP 723元数据块`# dependencies = []`
- [x] 1.3.2 在系统临时目录创建空的Python脚本文件并返回路径
- [x] 1.3.3 直接在stdout输出脚本文件完整路径
- [x] 1.3.4 添加命令行支持,直接运行脚本
- [x] 1.4 创建skill文件`skills/uv-python-runner/SKILL.md`
- [x] 1.4 创建skill文件`skills/python-runner/SKILL.md`
## 2. 编写YAML前置元数据
- [x] 2.1 添加skill名称`uv-python-runner`
- [x] 2.1 添加skill名称`python-runner`
- [x] 2.2 添加英文skill描述
- [x] 2.3 添加参数提示不适用此skill无参数
@@ -33,7 +33,7 @@
- [x] 5.1.2 提供包含外部依赖的示例
- [x] 5.1.3 提供仅使用标准库的示例
- [x] 5.2 记录步骤2获取临时目录
- [x] 5.2.1 说明调用辅助脚本:`uv run skills/uv-python-runner/script/get_temp_path.py`
- [x] 5.2.1 说明调用辅助脚本:`uv run skills/python-runner/script/get_temp_path.py`
- [x] 5.2.2 说明辅助脚本直接在stdout输出临时目录路径
- [x] 5.2.3 说明大模型捕获stdout输出得到临时目录
- [x] 5.2.4 说明根据临时目录构造脚本文件路径:`<temp_dir>/uv_script_<timestamp>_<random>.py`

View File

@@ -2,7 +2,7 @@
## Purpose
Define requirements for the uv-python-runner skill, which enables execution of Python scripts with PEP 723 metadata using uv for isolated dependency management and cross-platform temporary file handling.
Define requirements for the python-runner skill, which enables execution of Python scripts with PEP 723 metadata using uv for isolated dependency management and cross-platform temporary file handling.
## Requirements
@@ -42,7 +42,7 @@ Skill SHALL指导LLM在系统临时目录中创建临时Python文件并使用
### 需求:跨平台临时目录支持
Skill SHALL使用`skills/uv-python-runner/script/get_temp_path.py`辅助脚本来获取平台特定的临时目录。Skill SHALL在创建临时Python文件之前先调用此辅助脚本获取临时目录路径。Skill SHALL支持Windows、macOS、Linux三个平台。
Skill SHALL使用`skills/python-runner/script/get_temp_path.py`辅助脚本来获取平台特定的临时目录。Skill SHALL在创建临时Python文件之前先调用此辅助脚本获取临时目录路径。Skill SHALL支持Windows、macOS、Linux三个平台。
#### 场景:获取临时目录路径
- **WHEN** LLM需要为Python脚本创建临时文件