feat: 添加 skill 发布功能和混淆构建优化
- build.py: 移除 --obfuscate 参数,默认混淆模式;从 git config 读取 author,动态注入 SKILL.md - publish.py: 新增发布脚本,自动 clone 目标仓库、同步 build/ 内容、git commit+push - publish.sh: 新增一键构建+发布脚本 - skill-publishing spec: 新增发布规范 - skill-packaging spec: 更新构建规范
This commit is contained in:
39
README.md
39
README.md
@@ -40,6 +40,9 @@ tests/ # 测试套件
|
||||
│ └── fixtures/ # 静态测试文件(Git LFS 管理)
|
||||
│ └── xls/ # XLS 旧格式测试文件
|
||||
openspec/ # OpenSpec 规范文档
|
||||
build.py # 构建脚本(混淆模式)
|
||||
publish.py # 发布脚本
|
||||
publish.sh # 一键构建+发布
|
||||
README.md # 本文档(开发者文档)
|
||||
SKILL.md # AI Skill 文档
|
||||
```
|
||||
@@ -266,6 +269,42 @@ uv run \
|
||||
- 错误处理:自定义异常 + 清晰信息 + 位置上下文
|
||||
- Git 提交:`类型: 简短描述`(feat/fix/refactor/docs/style/test/chore)
|
||||
|
||||
## 构建与发布
|
||||
|
||||
### 构建脚本
|
||||
|
||||
项目提供 `build.py` 用于构建 Skill 包,使用 PyArmor 进行代码混淆:
|
||||
|
||||
```bash
|
||||
uv run --with pyarmor python build.py
|
||||
```
|
||||
|
||||
构建产物输出到 `build/` 目录,包含:
|
||||
- `SKILL.md`(动态注入 version 和 author)
|
||||
- `scripts/`(混淆后的代码)
|
||||
|
||||
### 发布脚本
|
||||
|
||||
提供 `publish.py` 用于自动发布到目标仓库:
|
||||
|
||||
```bash
|
||||
uv run python publish.py
|
||||
```
|
||||
|
||||
发布流程:
|
||||
1. 在临时目录 clone `https://github.com/lanyuanxiaoyao/skills.git`(--depth 1)
|
||||
2. 清空 `skills/lyxy-document-reader/` 目录
|
||||
3. 复制 `build/` 内容到目标路径
|
||||
4. Git 提交并推送
|
||||
|
||||
### 一键发布
|
||||
|
||||
使用 `publish.sh` 一键完成构建+发布:
|
||||
|
||||
```bash
|
||||
./publish.sh
|
||||
```
|
||||
|
||||
## 文档说明
|
||||
|
||||
- **README.md**(本文档):面向项目开发者
|
||||
|
||||
Reference in New Issue
Block a user