diff --git a/README.md b/README.md index 821e5bf..9f7cdc3 100644 --- a/README.md +++ b/README.md @@ -122,19 +122,21 @@ python3 toolkit/cli.py themes ## 安装 +**Claude Code**: + ```bash -git clone https://github.com/oaker-io/wewrite.git -cd wewrite -pip install -r requirements.txt +git clone --depth 1 https://github.com/oaker-io/wewrite.git ~/.claude/skills/wewrite +cd ~/.claude/skills/wewrite && pip install -r requirements.txt ``` -### 挂载为 Skill +**OpenClaw**: -**Claude Code**:`cp -r wewrite ~/.claude/skills/wewrite` +```bash +git clone --depth 1 https://github.com/oaker-io/wewrite.git ~/.openclaw/skills/wewrite +cd ~/.openclaw/skills/wewrite && pip install -r requirements.txt +``` -**OpenClaw**:`ln -s /path/to/wewrite/dist/openclaw ~/.openclaw/skills/wewrite` - -> `dist/openclaw/` 是自动构建的 OpenClaw 兼容版(工具名、路径变量已转换),push to main 时 CI 自动更新。 +安装后 skill 会在每次运行时自动检查新版本。有更新时说"更新"即可升级。 ### 配置(可选) diff --git a/SKILL.md b/SKILL.md index 3ef1936..c117bea 100644 --- a/SKILL.md +++ b/SKILL.md @@ -53,6 +53,7 @@ allowed-tools: - 读取 `writing-config.yaml`(如存在),检查是否有 AI 特征参数(emotional_arc: flat、paragraph_rhythm: structured、closing_style: summary) - 读取 `history.yaml` 最近 5 篇,检查 persona 使用和 WebSearch 降级情况 4. 综合输出自然语言报告 + 按优先级排序的改进建议 +- 用户说"更新"/"更新 WeWrite"/"升级" → 在 `{skill_dir}` 执行 `git pull origin main`,完成后告知版本变化 --- @@ -73,6 +74,17 @@ python3 -c "import markdown, bs4, cssutils, requests, yaml, pygments, PIL" 2>&1 | `wechat.appid` + `secret` | 静默 | 设 `skip_publish = true` | | `image.api_key` | 静默 | 设 `skip_image_gen = true` | +**1a-2. 版本检查**(静默通过或提醒): + +```bash +cd {skill_dir} && git fetch origin main --quiet 2>/dev/null +``` + +比对本地 `{skill_dir}/VERSION` 与远程 `git show origin/main:VERSION`: +- 相同 → 静默通过 +- 不同 → 提示用户:"WeWrite 有新版本可用(当前 X → 最新 Y),说「更新」即可升级。"**不阻断流程**,继续 Step 1b +- git 不可用(无 .git 目录或 fetch 失败)→ 静默跳过 + **1b. 加载风格**: ``` diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..26aaba0 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.2.0 diff --git a/scripts/build_openclaw.py b/scripts/build_openclaw.py index 321a9d9..3a3e019 100644 --- a/scripts/build_openclaw.py +++ b/scripts/build_openclaw.py @@ -23,6 +23,7 @@ COPY_FILES = [ "config.example.yaml", "style.example.yaml", "writing-config.example.yaml", + "VERSION", ] # Frontmatter keys to strip (OpenClaw ignores allowed-tools)