dot-skill

Unified meta-skill engine for distilling colleague, relationship, or celebrity characters into reusable Skills. | 统一的 meta-skill 引擎,把 colleague、relationship、celebrity 三类对象蒸馏成可复用 Skill。

By titanwings · 437 installs

npx skills add titanwings/distilly --skill dot-skill

Source repository · Upstream listing

Language / 语言 : This skill supports both English and Chinese. Detect the user's language from their first message and respond in the same language throughout. Below are instructions in both languages — follow the one matching the user's language. 本 Skill 支持中英文。根据用户第一条消息的语言,全程使用同一语言回复。下方提供了两种语言的指令,按用户语言选择对应版本执行。 同事.skill 创建器(Claude Code 版) 触发条件 当用户说以下任意内容时启动: /create colleague "帮我创建一个同事 skill" "我想蒸馏一个同事" "新建同事" "给我做一个 XX 的 skill" 当用户对已有同事 Skill 说以下内容时,进入进化模式: "我有新文件" / "追加" "这不对" / "他不会这样" / "他应该是" /update colleague {slug} 当用户说 /list colleagues 时列出所有已生成的同事。 工具使用规则 本 Skill 运行在 Claude Code 环境,使用以下工具: 任务 使用工具 读取 PDF 文档 Read 工具(原生支持 PDF) 读取图片截图 Read 工具(原生支持图片) 读取 MD/TXT 文件 Read 工具 解析飞书消息 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 ${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 。 主流程:创建新同事 Skill Step 1:基础信息录入(3 个问题) 参考 ${CLAUDE SKILL DIR}/prompts/intake.md 的问题序列,只问 3 个问题: 1. 花名/代号 (必填) 2. 基本信息 (一句话:公司、职级、职位、性别,想到什么写什么) 示例: 字节 2 1 后端工程师 男 3. 性格画像 (一句话:MBTI、星座、个性标签、企业文化、印象) 示例: INTJ 摩羯座 甩锅高手 字节范 CR很严格但从来不解释原因 除姓名外均可跳过。收集完后汇总确认再进入下一步。 Step 2:原材料导入 询问用户提供原材料,展示四种方式供选择: 方式 A:飞书自动采集(推荐) 首次使用需配置: 群聊采集 (使用 tenant access token,需 bot 在群内): 私聊采集 (需要 user access token + 私聊 chat id): 私聊消息只能通过用户身份(user access token)获取,应用身份无权访问私聊。 前置条件 : 用户需要提供以下信息: 1. 飞书应用凭证 : app id 和 app secret (在飞书开放平台创建自建应用获取) 2. 用户权限 :应用需开通以下用户权限(scope): im:message — 以用户身份读取/发送消息 im:chat — 以用户身份读取会话列表 3. OAuth 授权码(code) :用户在浏览器中完成 OAuth 授权后,从回调 URL 中获取 如果用户缺少以上任何信息,引导他们完成配置。不要假设用户已经配好了。 获取 user access token 的完整流程 : 当用户提供了 app id、app secret,并确认已开通用户权限后: 1. 帮用户生成 OAuth 授权链接: ⚠️ 注意: redirect uri 需要在飞书应用的「安全设置 → 重定向 URL」中添加 http://www.example.com 2. 用户在浏览器打开链接,登录并授权 3. 页面会跳转到 http://www.example.com?code=xxx ,用户复制 code 给你 4. 用 code 换取 token: 或者你自己写 Python 脚本调飞书 API 换取: 获取私聊 chat id : 用户通常不知道 chat id。当用户有了 user access token 但没有 chat id 时,你应该 自己写 Python 脚本 来获取: 方法 :用 user access token 向对方的 open id 发一条消息,返回值中会包含 chat id 注意 : GET /im/v1/chats 不会返回私聊会话,这是飞书 API 的限制,不是权限问题,不要尝试用这个接口找私聊 如果用户不知道对方的 open id,可以用 tenant access token 调通讯录 API 搜索: 执行采集 : 拿到 user access token 和 chat id 后: 灵活性原则 :以上 API 调用不一定要用 collector 脚本,如果脚本跑不通或者场景不匹配,你可以直接写 Python 脚本调飞书 API 完成任务。核心 API 参考: 获取 token: POST /auth/v3/app access token/internal 、 POST /authen/v1/oidc/access token 发消息(获取 chat id): POST /im/v1/messages?receive id type=open id 拉消息: GET /im/v1/messages?container id type=chat&container id={chat id} 查通讯录: GET /contact/v3/scopes 、 GET /contact/v3/users/{user id} 自动采集内容: 群聊:所有与他共同群聊中他发出的消息(过滤系统消息、表情包) 私聊:与他的私聊完整对话(含双方消息,用于理解对话语境) 他创建/编辑的飞书文档和 Wiki 相关多维表格(如有权限) 采集完成后用 Read 读取输出目录下的文件: knowledge/{slug}/messages.txt → 消息记录(群聊 + 私聊) knowledge/{slug}/docs.txt → 文档内容 knowledge/{slug}/collection summary.json → 采集摘要 如果采集失败,根据报错自行判断原因并尝试修复,常见问题: 群聊采集:bot 未添加到群聊 私聊采集:user access token 过期(有效期 2 小时,可用 refresh token 刷新) 权限不足:引导用户在飞书开放平台开通对应权限并重新授权 或改用方式 B/C 方式 B:钉钉自动采集 首次使用需配置: 然后输入姓名,一键采集: 采集内容: 他创建/编辑的钉钉文档和知识库 多维表格 消息记录(⚠️ 钉钉 API 不支持历史消息拉取,自动切换浏览器采集) 采集完成后 Read 读取: knowledge/{slug}/docs.txt knowledge/{slug}/bitables.txt knowledge/{slug}/messages.txt 如消息采集失败,提示用户截图聊天记录后上传。 方式 D:上传文件 PDF / 图片 : Read 工具直接读取 飞书消息 JSON 导出 : 然后 Read /tmp/feishu out.txt 邮件文件 .eml / .mbox : 然后 Read /tmp/email out.txt Markdown / TXT : Read 工具直接读取 方式 C:飞书链接 用户提供飞书文档/Wiki 链接时,询问读取方式: 选 1(浏览器方案) : 首次使用若未登录,会弹出浏览器窗口要求登录(一次性)。 选 2(MCP 方案) : 首次使用需初始化配置: 之后直接读取: 读取消息记录(需要群聊 ID,格式 oc xxx ): 两种方式输出后均用 Read 读取结果文件,进入分析流程。 方式 E:直接粘贴 用户粘贴的内容直接作为文本原材料,无需调用任何工具。 如果用户说"没有文件"或"跳过",仅凭 Step 1 的手动信息生成 Skill。 Step 3:分析原材料 将收集到的所有原材料和用户填写的基础信息汇总,按以下两条线分析: 线路 A(Work Skill) : 参考 ${CLAUDE SKILL DIR}/prompts/work analyzer.md 中的提取维度 提取:负责系统、技术规范、工作流程、输出偏好、经验知识 根据职位类型重点提取(后端/前端/算法/产品/设计不同侧重) 线路 B(Persona) : 参考 ${CLAUDE SKILL DIR}/prompts/persona analyzer.md 中的提取维度 将用户填写的标签翻译为具体行为规则(参见标签翻译表) 从原材料中提取:表达风格、决策模式、人际行为 Step 4:生成并预览 参考 ${CLAUDE SKILL DIR}/prompts/work builder.md 生成 Work Skill 内容。 参考 ${CLAUDE SKILL DIR}/prompts/persona builder.md 生成 Persona 内容(5 层结构)。 向用户展示摘要(各 5 8 行),询问: Step 5:写入文件 用户确认后,执行以下写入操作: 1. 创建目录结构 (用 Bash): 2. 写入 work.md (用 Write 工具): 路径: colleagues/{slug}/work.md 3. 写入 persona.md (用 Write 工具): 路径: colleagues/{slug}/persona.md 4. 写入 meta.json (用 Write 工具): 路径: colleagues/{slug}/meta.json 内容: 5. 生成完整 SKILL.md (用 Write 工具): 路径: colleagues/{slug}/SKILL.md SKILL.md 结构: 告知用户: 进化模式:追加文件 用户提供新文件或文本时: 1. 按 Step 2 的方式读取新内容 2. 用 Read 读取现有 colleagues/{slug}/work.md 和 persona.md 3. 参考 ${CLAUDE SKILL DIR}/prompts/merger.md 分析增量内容 4. 存档当前版本(用 Bash): 5. 用 Edit 工具追加增量内容到对应文件 6. 重新生成 SKILL.md (合并最新 work.md + persona.md) 7. 更新 meta.json 的 version 和 updated at 进化模式:对话纠正 用户表达"不对"/"应该是"时: 1. 参考 ${CLAUDE SKILL DIR}/prompts/correction handler.md 识别纠正内容 2. 判断属于 Work(技术/流程)还是 Persona(性格/沟通) 3. 生成 correction 记录 4. 用 Edit 工具追加到对应文件的 Correction 记录 节 5. 重新生成 SKILL.md 管理命令 /list colleagues : /colleague rollback {slug} {version} : /delete colleague {slug} : 确认后执行: English Version Colleague.skill Creator (Claude Code Edition) Trigger Conditions Activate when the user says any of the following: /create colleague "Help me create a colleague skill" "I want to distill a colleague" "New colleague" "Make a skill for XX" Enter evolution mode when the user says: "I have new files" / "append" "That's wrong" / "He wouldn't do that" / "He should be" /update colleague {slug} List all generated colleagues when the user says /list colleagues . Tool Usage Rules This Skill runs in the Claude Code environment with the following tools: Task Tool Read PDF documents Read tool (native PDF support) Read image screenshots Read tool (native image support) Read MD/TXT files Read tool Parse Feishu message JSON export Bash → python3 ${CLAUDE SKILL DIR}/tools/feishu parser.py Feishu auto collect (recommended) Bash → python3 ${CLAUDE SKILL DIR}/tools/feishu auto collector.py Feishu docs (browser session) Bash → python3 ${CLAUDE SKILL DIR}/tools/feishu browser.py Feishu docs (MCP App Token) Bash → python3 ${CLAUDE SKILL DIR}/tools/feishu mcp client.py DingTalk auto collect Bash → python3 ${CLAUDE SKILL DIR}/tools/dingtalk auto collector.py Parse email .eml/.mbox Bash → python3 ${CLAUDE SKILL DIR}/tools/email parser.py Write/update Skill files Write / Edit tool Version management Bash → python3 ${CLAUDE SKILL DIR}/tools/version manager.py List existing Skills Bash → python3 ${CLAUDE SKILL DIR}/tools/skill writer.py action list Base directory : Skill files are written to ./colleagues/{slug}/ (relative to the project directory). For a global path, use base dir ~/.openclaw/workspace/skills/colleagues . Main Flow: Create a New Colleague Skill Step 1: Basic Info Collection (3 questions) Refer to ${CLAUDE SKILL DIR}/prompts/intake.md for the question sequence. Only ask 3 questions: 1. Alias / Codename (required) 2. Basic info (one sentence: company, level, role, gender — say whatever comes to mind) Example: ByteDance L2 1 backend engineer male 3. Personality profile (one sentence: MBTI, zodiac, traits, corporate culture, impressions) Example: INTJ Capricorn blame shifter ByteDance style strict in CR but never explains why Everything except the alias can be skipped. Summarize and confirm before moving to the next step. Step 2: Source Material Import Ask the user how they'd like to provide materials: Option A: Feishu Auto Collect (Recommended) First time setup: Group chat collection (uses tenant access token, bot must be in the group): Private chat (P2P) collection (requires user access token + p2p chat id): Private messages can only be accessed via user identity (user access token). App identity cannot access private chats. Prerequisites : The user needs to provide: 1. Feishu app credentials : app id and app secret (from Feishu Open Platform) 2. User scopes : The app must have these user scopes enabled: im:message — read/send messages as user im:chat — read chat list as user 3. OAuth authorization code : obtained after user completes OAuth in browser If the user is missing any of these, guide them through setup. Don't assume anything is pre configured. Getting user access token : Once the user provides app id, app secret, and confirms scopes are enabled: 1. Generate the OAuth URL for them: ⚠️ The redirect uri must be added in the app's "Security Settings → Redirect URLs" 2. User opens URL, logs in, authorizes 3. Page redirects to http://www.example.com?code=xxx , user copies the code 4. Exchange code for token: Or write a Python script to call the Feishu API directly: Getting the p2p chat id : Users typically don't know their chat id. When the user has a user access token but no chat id, write a Python script yourself to obtain it: Method : Send a message to the other user's open id — the response includes the chat id Important : GET /im/v1/chats does NOT return p2p chats — this is a Feishu API limitation, not a permission issue. Do not try to use it for finding private chats. If the user doesn't know the target's open id, use tenant access token to search contacts: Running collection : Once you have user access token and chat id: Flexibility principle : The above API calls don't have to go through the collector script. If the script doesn't work or doesn't fit the scenario, write Python scripts directly to call Feishu APIs. Key API reference: Get token: POST /auth/v3/app access token/internal , POST /authen/v1/oidc/access token Send message (get chat id): POST /im/v1/messages?receive id type=open id Fetch messages: GET /im/v1/messages?container id type=chat&container id={chat id} Search contacts: GET /contact/v3/scopes , GET /contact/v3/users/{user id} Auto collected content: Group chats: messages sent by them (system messages and stickers filtered) Private chats: full conversation with both parties (for context understanding) Feishu docs and Wikis they created/edited Related spreadsheets (if accessible) After collection, Read the output files: knowledge/{slug}/messages.txt → messages (group + private) knowledge/{slug}/docs.txt → document content knowledge/{slug}/collection summary.json → collection summary If collection fails, diagnose the error and attempt to fix it. Common issues: Group chat: bot not added to the group Private chat: user access token expired (2 hour TTL, refresh with refresh token) Insufficient permissions: guide user to enable scopes and re authorize Or switch to Option B/C Option B: DingTalk Auto Collect First time setup: Then enter the name: Collected content: DingTalk docs and knowledge bases they created/edited Spreadsheets Messages (⚠️ Din