oki3505f-core-prompt-patcher
运行时提示词热补丁:在不重启的情况下修改智能体系统提示片段。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~oki3505f-core-prompt-patchercURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~oki3505f-core-prompt-patcher/file -o oki3505f-core-prompt-patcher.md## 概述(中文) 运行时提示词热补丁:在不重启的情况下修改智能体系统提示片段。 ## 技能正文 # Core Prompt Patcher **Dynamic SOUL.md-based persona injector** - Automatically syncs your workspace SOUL.md into OpenClaw's core system prompt after updates. ## 功能 本技能 reads your `workspace/SOUL.md` file and injects its content directly into OpenClaw's core system prompt. This ensures your custom persona persists even after OpenClaw updates that reset the `dist/` directory. ## 何时使用 - 在…之后 running `npm update -g openclaw` or `npm install -g openclaw` - 当 you edit your `SOUL.md` file and want changes applied immediately - 当 OpenClaw version changes (auto-detected) - Periodically to ensure your persona stays in sync ## 工作原理 1. **Reads your SOUL.md** - Loads the complete file from your workspace 2. **Detects changes** - Compares OpenClaw version and SOUL.md content hash 3. **Finds injection point** - Locates the correct position in the compiled JS (supports multiple OpenClaw versions) 4. **Injects your persona** - Inserts your SOUL.md content into the core system prompt 5. **追踪 state** - Remembers what was patched to avoid unnecessary re-runs ## 用法 ```bash # Auto-detect and patch if needed node /home/oki/.openclaw/workspace/skills/core-prompt-patcher/patcher.js # Force re-patch (ignore state) node /home/oki/.openclaw/workspace/skills/core-prompt-patcher/patcher.js --force # Verbose mode (show state and details) node /home/oki/.openclaw/workspace/skills/core-prompt-patcher/patcher.js --verbose ``` Or via OpenClaw: > "Patch the core system prompt with my SOUL.md" > "Sync my SOUL.md to the core prompt" > "更新 the persona after OpenClaw update" ## 要求 - **SOUL.md must exist** at `~/.openclaw/workspace/SOUL.md` - OpenClaw must be installed globally ## SOUL.md Format Your SOUL.md can contain any persona definition. The patcher extracts sections with headers (##) and converts them to system prompt format. Example: ```markdown # My AI Persona ## CORE IDENTITY **Name:** Assistant Name **Role:** Your role description ## PERSONALITY * **Tone:** Friendly, professional, witty * **Style:** How you communicate ## GUIDELINES 1. First principle 2. Second principle 3. Third principle ## RESPONSE STYLE How you structure responses and interact. ``` All content gets injected into the core system prompt, making it part of OpenClaw's foundation. ## Files | File | Purpose | |------|---------| | `patcher.js` | Main patching script | | `.patcher-state.json` | State tracking (version, last patch, SOUL hash) | | `SKILL.md` | This documentation | | `README.md` | Detailed usage guide | ## 功能 - ✅ **General-purpose** - Works with any SOUL.md content, not hardcoded personas - ✅ **Full SOUL.md support** - Injects entire file, not just extracted sections - ✅ **Better error handling** - Fails gracefully if SOUL.md is missing - ✅ **Version detection** - Automatically detects OpenClaw updates - ✅ **State tracking** - Only patches when something actually changed - ✅ **Multi-version support** - Works with different OpenClaw versions ## 故障排查 **"SOUL.md not found"** - Ensure file exists at `~/.openclaw/workspace/SOUL.md` - 创建 one if needed (see SOUL.md template in OpenClaw docs) **"Could not find insertion point"** - OpenClaw may have changed prompt structure - 运行 with `--verbose` to see detected patterns - May need to update patcher for new OpenClaw version **"失败 to write patched file"** - 检查 file permissions - Ensure disk space is available