fix: use ${CLAUDE_SKILL_DIR} for all skill-internal paths

Skill runs in the user's project directory, not the skill directory.
All references to tools/ and prompts/ must use the CLAUDE_SKILL_DIR
substitution variable so Claude Code resolves them correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
titanwings
2026-03-30 15:39:57 +08:00
parent f133e86b69
commit 89d8d73c0c

View File

@@ -36,15 +36,15 @@ allowed-tools: Read, Write, Edit, Bash
| 读取 PDF 文档 | `Read` 工具(原生支持 PDF |
| 读取图片截图 | `Read` 工具(原生支持图片) |
| 读取 MD/TXT 文件 | `Read` 工具 |
| 解析飞书消息 JSON 导出 | `Bash``python3 tools/feishu_parser.py` |
| 飞书全自动采集(推荐) | `Bash``python3 tools/feishu_auto_collector.py` |
| 飞书文档(浏览器登录态) | `Bash``python3 tools/feishu_browser.py` |
| 飞书文档MCP App Token | `Bash``python3 tools/feishu_mcp_client.py` |
| 钉钉全自动采集 | `Bash``python3 tools/dingtalk_auto_collector.py` |
| 解析邮件 .eml/.mbox | `Bash``python3 tools/email_parser.py` |
| 解析飞书消息 JSON 导出 | `Bash``python3 ${CLAUDE_SKILL_DIR}/tools/feishu_parser.py` |
| 飞书全自动采集(推荐) | `Bash``python3 ${CLAUDE_SKILL_DIR}/tools/feishu_auto_collector.py` |
| 飞书文档(浏览器登录态) | `Bash``python3 ${CLAUDE_SKILL_DIR}/tools/feishu_browser.py` |
| 飞书文档MCP App Token | `Bash``python3 ${CLAUDE_SKILL_DIR}/tools/feishu_mcp_client.py` |
| 钉钉全自动采集 | `Bash``python3 ${CLAUDE_SKILL_DIR}/tools/dingtalk_auto_collector.py` |
| 解析邮件 .eml/.mbox | `Bash``python3 ${CLAUDE_SKILL_DIR}/tools/email_parser.py` |
| 写入/更新 Skill 文件 | `Write` / `Edit` 工具 |
| 版本管理 | `Bash``python3 tools/version_manager.py` |
| 列出已有 Skill | `Bash``python3 tools/skill_writer.py --action list` |
| 版本管理 | `Bash``python3 ${CLAUDE_SKILL_DIR}/tools/version_manager.py` |
| 列出已有 Skill | `Bash``python3 ${CLAUDE_SKILL_DIR}/tools/skill_writer.py --action list` |
**基础目录**Skill 文件写入 `./colleagues/{slug}/`(相对于本项目目录)。
如需改为全局路径,用 `--base-dir ~/.openclaw/workspace/skills/colleagues`
@@ -55,7 +55,7 @@ allowed-tools: Read, Write, Edit, Bash
### Step 1基础信息录入
参考 `prompts/intake.md` 的问题序列,依次询问用户:
参考 `${CLAUDE_SKILL_DIR}/prompts/intake.md` 的问题序列,依次询问用户:
1. 同事姓名/代号(必填)
2. 公司 + 职级 + 职位(一句话说完,如"字节 2-1 算法工程师"
@@ -99,12 +99,12 @@ allowed-tools: Read, Write, Edit, Bash
首次使用需配置:
```bash
python3 tools/feishu_auto_collector.py --setup
python3 ${CLAUDE_SKILL_DIR}/tools/feishu_auto_collector.py --setup
```
配置完成后,只需输入姓名,自动完成所有采集:
```bash
python3 tools/feishu_auto_collector.py \
python3 ${CLAUDE_SKILL_DIR}/tools/feishu_auto_collector.py \
--name "{name}" \
--output-dir ./knowledge/{slug} \
--msg-limit 1000 \
@@ -131,12 +131,12 @@ python3 tools/feishu_auto_collector.py \
首次使用需配置:
```bash
python3 tools/dingtalk_auto_collector.py --setup
python3 ${CLAUDE_SKILL_DIR}/tools/dingtalk_auto_collector.py --setup
```
然后输入姓名,一键采集:
```bash
python3 tools/dingtalk_auto_collector.py \
python3 ${CLAUDE_SKILL_DIR}/tools/dingtalk_auto_collector.py \
--name "{name}" \
--output-dir ./knowledge/{slug} \
--msg-limit 500 \
@@ -163,12 +163,12 @@ python3 tools/dingtalk_auto_collector.py \
- **PDF / 图片**`Read` 工具直接读取
- **飞书消息 JSON 导出**
```bash
python3 tools/feishu_parser.py --file {path} --target "{name}" --output /tmp/feishu_out.txt
python3 ${CLAUDE_SKILL_DIR}/tools/feishu_parser.py --file {path} --target "{name}" --output /tmp/feishu_out.txt
```
然后 `Read /tmp/feishu_out.txt`
- **邮件文件 .eml / .mbox**
```bash
python3 tools/email_parser.py --file {path} --target "{name}" --output /tmp/email_out.txt
python3 ${CLAUDE_SKILL_DIR}/tools/email_parser.py --file {path} --target "{name}" --output /tmp/email_out.txt
```
然后 `Read /tmp/email_out.txt`
- **Markdown / TXT**`Read` 工具直接读取
@@ -200,7 +200,7 @@ python3 tools/dingtalk_auto_collector.py \
**选 1浏览器方案**
```bash
python3 tools/feishu_browser.py \
python3 ${CLAUDE_SKILL_DIR}/tools/feishu_browser.py \
--url "{feishu_url}" \
--target "{name}" \
--output /tmp/feishu_doc_out.txt
@@ -211,19 +211,19 @@ python3 tools/feishu_browser.py \
首次使用需初始化配置:
```bash
python3 tools/feishu_mcp_client.py --setup
python3 ${CLAUDE_SKILL_DIR}/tools/feishu_mcp_client.py --setup
```
之后直接读取:
```bash
python3 tools/feishu_mcp_client.py \
python3 ${CLAUDE_SKILL_DIR}/tools/feishu_mcp_client.py \
--url "{feishu_url}" \
--output /tmp/feishu_doc_out.txt
```
读取消息记录(需要群聊 ID格式 `oc_xxx`
```bash
python3 tools/feishu_mcp_client.py \
python3 ${CLAUDE_SKILL_DIR}/tools/feishu_mcp_client.py \
--chat-id "oc_xxx" \
--target "{name}" \
--limit 500 \
@@ -247,19 +247,19 @@ python3 tools/feishu_mcp_client.py \
将收集到的所有原材料和用户填写的基础信息汇总,按以下两条线分析:
**线路 AWork Skill**
- 参考 `prompts/work_analyzer.md` 中的提取维度
- 参考 `${CLAUDE_SKILL_DIR}/prompts/work_analyzer.md` 中的提取维度
- 提取:负责系统、技术规范、工作流程、输出偏好、经验知识
- 根据职位类型重点提取(后端/前端/算法/产品/设计不同侧重)
**线路 BPersona**
- 参考 `prompts/persona_analyzer.md` 中的提取维度
- 参考 `${CLAUDE_SKILL_DIR}/prompts/persona_analyzer.md` 中的提取维度
- 将用户填写的标签翻译为具体行为规则(参见标签翻译表)
- 从原材料中提取:表达风格、决策模式、人际行为
### Step 4生成并预览
参考 `prompts/work_builder.md` 生成 Work Skill 内容。
参考 `prompts/persona_builder.md` 生成 Persona 内容5 层结构)。
参考 `${CLAUDE_SKILL_DIR}/prompts/work_builder.md` 生成 Work Skill 内容。
参考 `${CLAUDE_SKILL_DIR}/prompts/persona_builder.md` 生成 Persona 内容5 层结构)。
向用户展示摘要(各 5-8 行),询问:
```
@@ -380,10 +380,10 @@ user-invocable: true
1. 按 Step 2 的方式读取新内容
2. 用 `Read` 读取现有 `colleagues/{slug}/work.md` 和 `persona.md`
3. 参考 `prompts/merger.md` 分析增量内容
3. 参考 `${CLAUDE_SKILL_DIR}/prompts/merger.md` 分析增量内容
4. 存档当前版本(用 Bash
```bash
python3 tools/version_manager.py --action backup --slug {slug} --base-dir ./colleagues
python3 ${CLAUDE_SKILL_DIR}/tools/version_manager.py --action backup --slug {slug} --base-dir ./colleagues
```
5. 用 `Edit` 工具追加增量内容到对应文件
6. 重新生成 `SKILL.md`(合并最新 work.md + persona.md
@@ -395,7 +395,7 @@ user-invocable: true
用户表达"不对"/"应该是"时:
1. 参考 `prompts/correction_handler.md` 识别纠正内容
1. 参考 `${CLAUDE_SKILL_DIR}/prompts/correction_handler.md` 识别纠正内容
2. 判断属于 Work技术/流程)还是 Persona性格/沟通)
3. 生成 correction 记录
4. 用 `Edit` 工具追加到对应文件的 `## Correction 记录` 节
@@ -407,12 +407,12 @@ user-invocable: true
`/list-colleagues`
```bash
python3 tools/skill_writer.py --action list --base-dir ./colleagues
python3 ${CLAUDE_SKILL_DIR}/tools/skill_writer.py --action list --base-dir ./colleagues
```
`/colleague-rollback {slug} {version}`
```bash
python3 tools/version_manager.py --action rollback --slug {slug} --version {version} --base-dir ./colleagues
python3 ${CLAUDE_SKILL_DIR}/tools/version_manager.py --action rollback --slug {slug} --version {version} --base-dir ./colleagues
```
`/delete-colleague {slug}`