统一skill命名
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: docx-reader
|
||||
name: lyxy-reader-docx
|
||||
description: 优先解析 docx 文档的 skill,将 DOCX 文件转换为纯文本内容,不支持图片和格式提取。
|
||||
compatibility: Requires Python 3.6+ and at least one of: markitdown or python-docx
|
||||
---
|
||||
@@ -10,18 +10,18 @@ compatibility: Requires Python 3.6+ and at least one of: markitdown or python-do
|
||||
|
||||
## Purpose
|
||||
|
||||
**依赖选项**: 此 skill 可以使用 python-runner skill(推荐)或直接使用 Python 执行。
|
||||
**依赖选项**: 此 skill 可以使用 lyxy-runner-python skill(推荐)或直接使用 Python 执行。
|
||||
|
||||
### 优先使用 python-runner
|
||||
### 优先使用 lyxy-runner-python
|
||||
|
||||
如果环境中存在 python-runner skill,应优先使用它来执行 docx_parser.py 脚本:
|
||||
- python-runner 使用 uv 管理依赖,自动安装 markitdown 或 python-docx
|
||||
如果环境中存在 lyxy-runner-python skill,应优先使用它来执行 docx_parser.py 脚本:
|
||||
- lyxy-runner-python 使用 uv 管理依赖,自动安装 markitdown 或 python-docx
|
||||
- 环境隔离,不污染系统 Python
|
||||
- 跨平台兼容(Windows/macOS/Linux)
|
||||
|
||||
### 降级到直接执行
|
||||
|
||||
如果环境中不存在 python-runner skill,则直接使用 Python 执行 docx_parser.py:
|
||||
如果环境中不存在 lyxy-runner-python skill,则直接使用 Python 执行 docx_parser.py:
|
||||
- 需要手动安装 markitdown 或 python-docx
|
||||
- 脚本内部实现了多策略解析降级:MarkItDown → python-docx → XML 原生
|
||||
|
||||
@@ -97,27 +97,27 @@ compatibility: Requires Python 3.6+ and at least one of: markitdown or python-do
|
||||
|
||||
## Execution
|
||||
|
||||
### 优先使用 python-runner
|
||||
### 优先使用 lyxy-runner-python
|
||||
|
||||
**推荐执行方式**(如果 python-runner skill 可用):
|
||||
**推荐执行方式**(如果 lyxy-runner-python skill 可用):
|
||||
|
||||
```bash
|
||||
# 使用 python-runner 执行(推荐)
|
||||
uv run --with markitdown skills/docx-reader/scripts/docx_parser.py /path/to/document.docx
|
||||
# 使用 lyxy-runner-python 执行(推荐)
|
||||
uv run --with markitdown skills/lyxy-reader-docx/scripts/docx_parser.py /path/to/document.docx
|
||||
|
||||
# 或使用 python-docx
|
||||
uv run --with python-docx skills/docx-reader/scripts/docx_parser.py /path/to/document.docx
|
||||
uv run --with python-docx skills/lyxy-reader-docx/scripts/docx_parser.py /path/to/document.docx
|
||||
```
|
||||
|
||||
**大模型应优先检查 python-runner skill 是否存在,如果存在则使用它执行。**
|
||||
**大模型应优先检查 lyxy-runner-python skill 是否存在,如果存在则使用它执行。**
|
||||
|
||||
### 降级到直接执行
|
||||
|
||||
如果 python-runner skill 不可用,则直接使用 Python:
|
||||
如果 lyxy-runner-python skill 不可用,则直接使用 Python:
|
||||
|
||||
```bash
|
||||
# 直接使用 Python 执行
|
||||
python3 skills/docx-reader/scripts/docx_parser.py /path/to/document.docx
|
||||
python3 skills/lyxy-reader-docx/scripts/docx_parser.py /path/to/document.docx
|
||||
```
|
||||
|
||||
**提示用户**: 建议用户安装 markitdown 或 python-docx 以获得更好的解析效果:
|
||||
@@ -209,9 +209,9 @@ python3 docx_parser.py -s "关键词" -n 5 /path/to/document.docx
|
||||
|
||||
## 依赖安装
|
||||
|
||||
### 推荐方式:使用 python-runner
|
||||
### 推荐方式:使用 lyxy-runner-python
|
||||
|
||||
如果使用 python-runner skill,依赖会自动管理,无需手动安装。
|
||||
如果使用 lyxy-runner-python skill,依赖会自动管理,无需手动安装。
|
||||
|
||||
### 手动安装(降级模式)
|
||||
|
||||
@@ -253,7 +253,7 @@ pip install python-docx
|
||||
|
||||
## Notes
|
||||
|
||||
### 为什么选择 python-runner?
|
||||
### 为什么选择 lyxy-runner-python?
|
||||
|
||||
| 特性 | 优势 |
|
||||
| ------ | ------ |
|
||||
@@ -265,9 +265,9 @@ pip install python-docx
|
||||
|
||||
### 最佳实践
|
||||
|
||||
1. **优先使用 python-runner**: 如果环境中存在,应优先使用 python-runner 执行脚本
|
||||
1. **优先使用 lyxy-runner-python**: 如果环境中存在,应优先使用 lyxy-runner-python 执行脚本
|
||||
2. **大文件处理**: 对于大文档,建议使用章节提取或关键词搜索来限制处理范围
|
||||
3. **依赖管理**: 使用 python-runner 可以自动管理依赖,避免环境配置问题
|
||||
3. **依赖管理**: 使用 lyxy-runner-python 可以自动管理依赖,避免环境配置问题
|
||||
4. **错误处理**: 脚本会自动尝试多种解析方法,确保最大兼容性
|
||||
5. **禁止自动安装**: 在降级到直接 Python 执行时,仅向用户提示安装依赖,不得自动执行 pip install
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
name: js-runner
|
||||
name: lyxy-runner-js
|
||||
description: Any task that requires Javascript/Typescript processing should use this skill.
|
||||
compatibility: Requires Bun runtime (https://bun.sh)
|
||||
---
|
||||
|
||||
# js-runner
|
||||
# lyxy-runner-js
|
||||
|
||||
基于 Bun 的 JavaScript/TypeScript 执行技能,提供隔离的脚本执行和自动依赖管理。
|
||||
|
||||
@@ -24,7 +24,7 @@ compatibility: Requires Bun runtime (https://bun.sh)
|
||||
|
||||
### 安装 Bun
|
||||
|
||||
js-runner 需要安装 Bun。Bun 是一个快速的 JavaScript 运行时,内置包管理器。
|
||||
lyxy-runner-js 需要安装 Bun。Bun 是一个快速的 JavaScript 运行时,内置包管理器。
|
||||
|
||||
**macOS/Linux:**
|
||||
|
||||
@@ -120,11 +120,11 @@ bun ./scripts/new-script.js
|
||||
bun --version
|
||||
|
||||
# 步骤 2: 生成临时文件路径
|
||||
TEMP_FILE=$(bun skills/js-runner/scripts/get_temp_path.js js)
|
||||
TEMP_FILE=$(bun skills/lyxy-runner-js/scripts/get_temp_path.js js)
|
||||
|
||||
# 步骤 3: 将脚本内容写入临时文件
|
||||
cat <<EOF > "$TEMP_FILE"
|
||||
const greeting = "Hello from js-runner!";
|
||||
const greeting = "Hello from lyxy-runner-js!";
|
||||
console.log(greeting);
|
||||
EOF
|
||||
|
||||
@@ -139,7 +139,7 @@ bun "$TEMP_FILE"
|
||||
|
||||
```bash
|
||||
# 生成 TypeScript 临时文件
|
||||
TEMP_TS=$(bun skills/js-runner/scripts/get_temp_path.js ts)
|
||||
TEMP_TS=$(bun skills/lyxy-runner-js/scripts/get_temp_path.js ts)
|
||||
|
||||
# 写入 TypeScript 脚本
|
||||
cat <<EOF > "$TEMP_TS"
|
||||
@@ -192,19 +192,19 @@ const axios = require('axios')
|
||||
**CLI 使用方式:**
|
||||
|
||||
```bash
|
||||
bun skills/js-runner/scripts/get_temp_path.js <extension>
|
||||
bun skills/lyxy-runner-js/scripts/get_temp_path.js <extension>
|
||||
```
|
||||
|
||||
**参数:**
|
||||
|
||||
- `extension` (可选): 文件扩展名。默认为 `js`。常用值: `js`, `ts`, `mjs`, `mts`
|
||||
|
||||
**输出:** 返回类似 `/var/folders/.../js-runner-1234567890-abc123.js` 的路径
|
||||
**输出:** 返回类似 `/var/folders/.../lyxy-runner-js-1234567890-abc123.js` 的路径
|
||||
|
||||
**路径格式:**
|
||||
|
||||
- 使用操作系统临时目录(Unix 上为 `/tmp`,Windows 上为 `%TEMP%`)
|
||||
- 前缀: `js-runner-`
|
||||
- 前缀: `lyxy-runner-js-`
|
||||
- 时间戳: 自纪元以来的毫秒数
|
||||
- 随机字符串: 7 字符字母数字
|
||||
- 扩展名: 参数中提供的值
|
||||
@@ -212,11 +212,11 @@ bun skills/js-runner/scripts/get_temp_path.js <extension>
|
||||
**示例:**
|
||||
|
||||
```bash
|
||||
$ bun skills/js-runner/scripts/get_temp_path.js js
|
||||
/var/folders/8m/0hm18pdd7ts2bwp0530drz500000gn/T/js-runner-1770257905333-na6ujx.js
|
||||
$ bun skills/lyxy-runner-js/scripts/get_temp_path.js js
|
||||
/var/folders/8m/0hm18pdd7ts2bwp0530drz500000gn/T/lyxy-runner-js-1770257905333-na6ujx.js
|
||||
|
||||
$ bun skills/js-runner/scripts/get_temp_path.js ts
|
||||
/var/folders/8m/0hm18pdd7ts2bwp0530drz500000gn/T/js-runner-1770257905333-v8yzt.ts
|
||||
$ bun skills/lyxy-runner-js/scripts/get_temp_path.js ts
|
||||
/var/folders/8m/0hm18pdd7ts2bwp0530drz500000gn/T/lyxy-runner-js-1770257905333-v8yzt.ts
|
||||
```
|
||||
|
||||
## 错误处理
|
||||
@@ -4,7 +4,7 @@ import { join } from "path";
|
||||
export function getTempPath(extension) {
|
||||
const timestamp = Date.now();
|
||||
const random = Math.random().toString(36).substring(7);
|
||||
return join(tmpdir(), `js-runner-${timestamp}-${random}.${extension}`);
|
||||
return join(tmpdir(), `lyxy-runner-js-${timestamp}-${random}.${extension}`);
|
||||
}
|
||||
|
||||
// CLI interface: accepts extension as first argument
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: python-runner
|
||||
name: lyxy-runner-python
|
||||
description: Any task that requires Python processing should use this skill.
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user