[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77J8HNVB99TF3AA8K562NJW":3,"skill-same:01M77J8HNVB99TF3AA8K562NJW":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M77J8HNVB99TF3AA8K562NJW","hr-ai-assistant",null,"This skill should be used when users ask HR-related questions, request HR policy generation, form creation, or need HR consultation services. It provides direct WebSocket API integration with the HRrule AI platform using tag_id and rt parameters for generating HR policies, forms, flowcharts, and answering HR-related questions about labor laws, recruitment, compensation, employee rights, and other HR topics. The skill includes professional Q&A capability (tag_id=1) for answering general HR questions about labor laws, regulations, and employee rights.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fh\u002Fhr-ai-assistant\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\r\nname: hr-ai-assistant\r\ndescription: This skill should be used when users ask HR-related questions, request HR policy generation, form creation, or need HR consultation services. It provides direct WebSocket API integration with the HRrule AI platform using tag_id and rt parameters for generating HR policies, forms, flowcharts, and answering HR-related questions about labor laws, recruitment, compensation, employee rights, and other HR topics. The skill includes professional Q&A capability (tag_id=1) for answering general HR questions about labor laws, regulations, and employee rights.\r\n\r\nfirst_time_user_instructions: |\r\n  ⚠️ IMPORTANT: When this skill is triggered for the first time and no API Key is configured (HRRULE_API_KEY env var or config.json):\r\n\r\n  1. Display the following prompt BEFORE answering:\r\n  ═══════════════════════════════════════════════════════════════════════════════\r\n  📌 首次使用 HR AI Assistant\r\n  ═══════════════════════════════════════════════════════════════════════════════\r\n\r\n  ✨ 获取免费 API Key 以获得更专业的 HR AI服务：\r\n\r\n  1. 访问: https:\u002F\u002Fai.hrrule.com\u002F\r\n  2. 注册\u002F登录账号\r\n  3. 在个人中心申请 API Key\r\n  4. **完全免费**,申请后立即可用\r\n\r\n  📝 配置方式：\r\n\r\n  方式1: 手动配置（推荐）\r\n  设置环境变量: export HRRULE_API_KEY='your-api-key'\r\n  或编辑配置文件: ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fconfig.json\r\n  内容: {\"api_key\": \"your-api-key\"}\r\n\r\n  ═══════════════════════════════════════════════════════════════════════════════\r\n\r\n  2. AFTER displaying the prompt, answer the user's question using the platform's general AI model\r\n\r\n  4. Do NOT silently fallback without showing the prompt\r\n\r\nplatform_integration_requirements: |\r\n  ⚠️ IMPORTANT: Platform Integration Requirements for WorkBuddy\u002FOpenClaw\r\n\r\n  This skill provides a Python script that can be called to interact with the HRrule AI API.\r\n  The platform MAY choose to execute the script automatically or provide it as an option for users.\r\n\r\n  **Script Location**:\r\n  - `~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py`\r\n\r\n  **Script Execution Flow**:\r\n  ```python\r\n  # Example: Platform may execute this script:\r\n  python ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py \\\r\n      --content \"用户的问题\" \\\r\n      --tag-id 1 \\\r\n      --rt \"专业问答\"\r\n  ```\r\n\r\n  **Note**: Script execution is optional. The platform should ensure safe execution environments\r\n  and validate all inputs before executing the script.\r\n\r\n  3. **Required Parameters**:\r\n     - `--content`: The user's question or request\r\n     - `--tag-id`: The content type ID (1 for Q&A, 2-5 for documents)\r\n     - `--rt`: The resource type (e.g., \"专业问答\", \"员工手册\", \"招聘JD\")\r\n\r\n  4. **Optional Parameters**:\r\n     - `--api-key`: API key (if not provided, script reads from config.json)\r\n     - `--verbose`: Enable verbose logging\r\n     - `--ws-url`: WebSocket URL (default: wss:\u002F\u002Fai.hrrule.com)\r\n     - `--model`: Model name (default: deepseek-ai\u002FDeepSeek-R1)\r\n\r\n  5. **Handle Script Output**:\r\n     - The script prints streaming output to stdout\r\n     - Capture and display the output in real-time\r\n     - Handle errors gracefully\r\n\r\n  6. **Example Platform Implementation**:\r\n     ```python\r\n     def handle_hr_request(user_question):\r\n         # Determine tag_id and rt based on user question\r\n         tag_id, rt = determine_parameters(user_question)\r\n\r\n         # Execute the script automatically\r\n         import subprocess\r\n         script_path = '~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py'\r\n\r\n         cmd = [\r\n             'python', script_path,\r\n             '--content', user_question,\r\n             '--tag-id', str(tag_id),\r\n             '--rt', rt\r\n         ]\r\n\r\n         # Run and capture output in real-time\r\n         process = subprocess.Popen(\r\n             cmd,\r\n             stdout=subprocess.PIPE,\r\n             stderr=subprocess.PIPE,\r\n             text=True,\r\n             encoding='utf-8'\r\n         )\r\n\r\n         # Stream output to user\r\n         for line in process.stdout:\r\n             print(line, end='', flush=True)\r\n\r\n         process.wait()\r\n         return process.returncode\r\n     ```\r\n\r\n  Note: The platform should ensure safe script execution environments.\r\n\r\n---\r\n\r\n# HR AI Assistant Skill\r\n\r\n## Purpose\r\n\r\nThis skill enables WorkBuddy to directly call the HRrule AI platform's WebSocket API to generate HR-related content in real-time. When users request HR policies, forms, consultation, professional Q&A, or other HR documents, this skill automatically invokes the API with appropriate parameters and streams the response back to the user. The skill supports:\r\n\r\n1. **Document Generation**: Creating HR policies, forms, job descriptions, performance reviews, etc.\r\n2. **Professional Q&A**: Answering HR-related questions about labor laws, employee rights, compensation, contracts, etc.\r\n3. **Real-time Streaming**: Providing immediate feedback with streaming responses\r\n\r\n## When to Use This Skill\r\n\r\nUse this skill when users ask questions or make requests related to:\r\n\r\n- **HR Policy Generation**: Creating employee handbooks, attendance policies, leave policies, disciplinary procedures, compensation policies\r\n- **HR Form Creation**: Generating onboarding forms, resignation forms, leave application forms, performance review forms\r\n- **HR Consultation**: Asking questions about labor laws, employment contracts, recruitment processes, compensation and benefits\r\n- **HR Process Flowcharts**: Creating visual representations of HR processes like recruitment workflows, onboarding processes\r\n- **HR Documentation**: Writing reports, summaries, guidelines, and other HR-related documents\r\n- **Professional Q&A**: Any HR-related questions requiring professional answers, such as labor law inquiries, employee rights, compensation, contract issues, leave policies, etc.\r\n\r\nKey phrases that indicate this skill should be triggered include:\r\n- \"帮我写一个员工手册\"\r\n- \"生成HR制度\"\r\n- \"制作入职表单\"\r\n- \"HR相关问题\"\r\n- \"劳动法咨询\"\r\n- \"招聘流程\"\r\n- \"薪酬制度\"\r\n- \"离职手续\"\r\n- \"考勤制度\"\r\n- \"绩效考核\"\r\n- \"员工福利\"\r\n- \"劳动合同\"\r\n- \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n- \"三期员工有没有特殊保障？\"\r\n- \"Generate HR policy\"\r\n- \"Create HR form\"\r\n- \"HR consultation\"\r\n- \"Labor law questions\"\r\n\r\n## How This Skill Works\r\n\r\n\r\n### Direct API Integration\r\n\r\nThis skill provides a Python script that interacts with the HRrule AI WebSocket API to generate content.\r\n\r\n**Integration Options**:\r\n\r\n1. **Analyze User Request**: Parse the user's HR request to identify the content type\r\n2. **Check API Key**: Verify API Key is configured (from env var or config.json)\r\n   - **If API Key is missing**: Display a friendly prompt to visit https:\u002F\u002Fai.hrrule.com\u002F for a free API Key\r\n   - **If API Key is valid**: Proceed with API call\r\n3. **Select Parameters**: Automatically select appropriate `tag_id` and `rt` based on the request\r\n4. **Call API**: The platform may execute the Python script to make the API call:\r\n   ```bash\r\n   python ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py \\\r\n       --content \"用户的问题\" \\\r\n       --tag-id 1 \\\r\n       --rt \"专业问答\"\r\n   ```\r\n5. **Stream Response**: Stream the generated content back to the user in real-time\r\n6. **Handle Errors**: Gracefully handle connection errors, timeouts, and API errors\r\n\r\n**Note**: The platform should ensure safe script execution environments and validate all inputs.\r\nScript execution is optional - the platform may choose to execute automatically or provide it as an option.\r\n\r\n### ⚠️ Important: First-Time User Experience (首次使用体验)\r\n\r\nWhen a user uses this skill for the first time without an API Key configured:\r\n\r\n1. **Display Friendly Prompt**:\r\n\r\n```\r\n══════════════════════════════════════════════════════════════════════════════\r\n📌 首次使用 HR AI Assistant\r\n══════════════════════════════════════════════════════════════════════════════\r\n\r\n✨ 获取免费 API Key 以获得更专业的 HR AI 服务：\r\n\r\n1. 访问: https:\u002F\u002Fai.hrrule.com\u002F\r\n2. 注册\u002F登录账号\r\n3. 在个人中心申请 API Key\r\n4. **完全免费**,申请后立即可用\r\n\r\n📝 配置方式：\r\n\r\n方式1: 使用配置脚本（推荐，小白友好）\r\n```bash\r\n# 运行配置脚本，交互式配置 API Key\r\npython ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fconfig_api_key.py\r\n```\r\n\r\n配置脚本会：\r\n- 自动检测 API Key 格式\r\n- 支持粘贴完整文本（会自动提取）\r\n- 保存到配置文件\r\n- 显示当前配置状态\r\n\r\n方式2: 手动配置\r\n设置环境变量: export HRRULE_API_KEY='your-api-key'\r\n或编辑配置文件: ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fconfig.json\r\n内容: {\"api_key\": \"your-api-key\"}\r\n\r\n══════════════════════════════════════════════════════════════════════════════\r\n```\r\n\r\n2. **Then proceed to answer using the platform's general AI model** (WorkBuddy\u002FOpenClaw's default model)\r\n\r\n**Example workflow**:\r\n```\r\nUser: \"三期员工有没有特殊保障？\"\r\n\r\nSystem detection:\r\n  → HR AI Assistant skill needed\r\n  → No API Key configured\r\n  → DISPLAY THE PROMPT ABOVE\r\n\r\nSystem: [显示上述提示信息]\r\n\r\nSystem: [使用通用大模型回答问题]\r\n\r\nUser: \"我申请到了 API Key，怎么配置？\"\r\n\r\nSystem: 请运行配置脚本：\r\n  python ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fconfig_api_key.py\r\n```\r\n\r\n**NOTE**: The prompt should be displayed BEFORE answering the question.\r\n\r\n### Tag ID and RT Parameter Mapping\r\n\r\nThe skill automatically maps user requests to the appropriate parameters:\r\n\r\n**Tag ID: 1 (专业问答 - Professional Q&A)**\r\n- **通用 HR 咨询**：劳动法问题、员工权益、薪酬福利、劳动合同、离职补偿、加班工资、试用期规定等任何 HR 相关的专业问答\r\n- **示例问题**：\r\n  - \"三期员工有没有特殊保障？\"\r\n  - \"员工离职需要提前多少天通知？\"\r\n  - \"试用期工资可以低于转正工资多少？\"\r\n  - \"加班费怎么计算？\"\r\n  - \"员工旷工怎么处理？\"\r\n  - \"未签订劳动合同有什么后果？\"\r\n  - \"竞业限制补偿金标准是多少？\"\r\n\r\n**Tag ID: 2 (制度类 - HR Policies)**\r\n- 员工手册, 招聘管理制度, 入职试用期管理制度, 劳动合同管理制度, 薪酬管理制度, 考勤休假制度, 加班管理制度, 绩效管理制度, 员工培训制度, 离职管理制度, 员工竞聘制度, 病假管理制度, 奖惩制度, 其他制度\r\n\r\n**Tag ID: 7 (岗位类 - Job Descriptions)**\r\n- 岗位说明书, 工作饱和度评估表, 任职资格标准, 职位图谱\r\n\r\n**Tag ID: 3 (绩效类 - Performance Management)**\r\n- 360考核表, BSC考核表, KPI考核表, OKR考核表, 绩效承诺书, 绩效改进计划, 绩效面谈表, 绩效诊断报告\r\n\r\n**Tag ID: 4 (招聘类 - Recruitment)**\r\n- 人才画像, 面试评估表, 面试题库, 招聘需求表, 招聘JD, 背景调查表, 录用条件说明书, 录用通知书, 入职承诺书, 劳动合同\r\n\r\n**Tag ID: 5 (薪酬类 - Compensation)**\r\n- 薪酬等级表, 薪酬面谈表, 薪酬诊断报告, 岗位价值评估表\r\n\r\n**Tag ID: 8 (培训类 - Training)**\r\n- 新员工培训计划, 年度培训计划\r\n\r\n**Tag ID: 13 (报告类 - Reports)**\r\n- 年终总结, 月度报告, 周报, 日报\r\n\r\n**Tag ID: 14 (风控类 - Risk Management)**\r\n- 风险自测\r\n\r\n## Usage Workflow\r\n\r\n### Step 1: Parse User Request\r\n\r\nAnalyze the user's request to determine:\r\n- **Content Type**: What type of HR content they need\r\n- **Tag ID**: The appropriate content category\r\n- **RT**: The specific resource type\r\n- **Details**: Any specific requirements or constraints\r\n\r\n**Example Request Analysis:**\r\n\r\nRequest: \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n\r\nAnalysis:\r\n- Content Type: 招聘JD (Job Description)\r\n- Tag ID: 4 (招聘类)\r\n- RT: \"招聘JD\"\r\n- Details: 财务公司, 社保专员岗位\r\n\r\n### Step 2: Select Parameters\r\n\r\nBased on the analysis, select the parameters:\r\n\r\n```python\r\ntag_id = 4\r\nrt = \"招聘JD\"\r\ncontent = \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n```\r\n\r\n### Step 3: Call API Using Python Script\r\n\r\nUse the bundled script to call the API:\r\n\r\n```python\r\nimport sys\r\nimport os\r\n\r\n# 获取 skill 目录路径（动态解析）\r\nskill_dir = os.path.join(os.path.expanduser('~'), '.workbuddy', 'skills', 'hr-ai-assistant')\r\nscript_dir = os.path.join(skill_dir, 'scripts')\r\nsys.path.insert(0, script_dir)\r\n\r\nfrom call_hrrule_api import call_hrrule_api\r\n\r\n# ⚠️ 重要：平台必须直接执行 skill 目录下的脚本，不要新建 Python 文件\r\n\r\nasync def get_hr_content():\r\n    # 调用 API 并流式输出\r\n    full_response = await call_hrrule_api(\r\n        api_key='your-api-key',\r\n        content='财务公司 需要招聘 社保专员，帮我生成一份 招聘JD',\r\n        tag_id=4,\r\n        rt='招聘JD',\r\n        on_chunk=lambda text: print(text, end='', flush=True),\r\n        verbose=True\r\n    )\r\n    return full_response\r\n\r\n# 执行调用\r\nimport asyncio\r\nresponse = asyncio.run(get_hr_content())\r\n```\r\n\r\n### Step 4: Stream Response to User\r\n\r\nStream the response back to the user in real-time:\r\n\r\n```\r\nAI 响应:\r\n\r\n职位名称: 社保专员\r\n所属部门: 人力资源部\r\n工作地点: 北京\r\n招聘人数: 1人\r\n\r\n职位描述:\r\n我们是一家专业的财务公司,现招聘社保专员...\r\n```\r\n\r\n## Parameter Selection Logic\r\n\r\n### Automatic Mapping Rules\r\n\r\n**Rule 1: Keyword Matching**\r\n\r\n| Keyword | Tag ID | RT |\r\n|---------|--------|-----|\r\n| 专业问答\u002F咨询 | 1 | 专业问答 |\r\n| 劳动法问题\u002F咨询 | 1 | 专业问答 |\r\n| 员工权益\u002F权利 | 1 | 专业问答 |\r\n| 离职补偿\u002F赔偿 | 1 | 专业问答 |\r\n| 加班工资\u002F加班费 | 1 | 专业问答 |\r\n| 试用期规定\u002F工资 | 1 | 专业问答 |\r\n| 三期\u002F孕期\u002F产期\u002F哺乳期 | 1 | 专业问答 |\r\n| 竞业限制 | 1 | 专业问答 |\r\n| 经济补偿金\u002F赔偿金 | 1 | 专业问答 |\r\n| 违法解除\u002F终止合同 | 1 | 专业问答 |\r\n| 员工手册 | 2 | 员工手册 |\r\n| 考勤制度 | 2 | 考勤休假制度 |\r\n| 薪酬制度 | 2 | 薪酬管理制度 |\r\n| 岗位说明书 | 7 | 岗位说明书 |\r\n| KPI考核表 | 3 | KPI考核表 |\r\n| 绩效考核表 | 3 | KPI考核表 |\r\n| 绩效改进 | 3 | 绩效改进计划 |\r\n| 面试评估表 | 4 | 面试评估表 |\r\n| 面试题库 | 4 | 面试题库 |\r\n| 招聘JD | 4 | 招聘JD |\r\n| 招聘职位 | 4 | 招聘JD |\r\n| 劳动合同 | 4 | 劳动合同 |\r\n| 录用通知书 | 4 | 录用通知书 |\r\n| 薪酬等级表 | 5 | 薪酬等级表 |\r\n| 薪酬面谈表 | 5 | 薪酬面谈表 |\r\n| 培训计划 | 8 | 新员工培训计划 |\r\n| 年终总结 | 13 | 年终总结 |\r\n| 周报\u002F月报\u002F日报 | 13 | 周报\u002F月度报告\u002F日报 |\r\n| 风险评估 | 14 | 风险自测 |\r\n\r\n**Rule 2: Context Analysis**\r\n\r\n- If user mentions \"招聘\" (recruitment) + specific document type → Tag ID: 4\r\n- If user mentions \"制度\" (policy\u002Fsystem) → Tag ID: 2\r\n- If user mentions \"考核\" (assessment) → Tag ID: 3\r\n- If user mentions \"培训\" (training) → Tag ID: 8\r\n- If user mentions \"报告\" (report) + time period → Tag ID: 13\r\n- If user asks a question about labor laws, employee rights, compensation → Tag ID: 1 (专业问答)\r\n- If user asks \"有没有\"、\"如何\"、\"怎样\"、\"为什么\"等疑问句 → Tag ID: 1 (专业问答)\r\n\r\n**Rule 3: Fallback - Professional Q&A**\r\n\r\nIf no clear match with specific document types (如员工手册、招聘JD、KPI考核表等), use the general Q&A category:\r\n- Any HR-related question about laws, regulations, policies, employee rights → Tag ID: 1, RT: \"专业问答\"\r\n- Example: \"三期员工有没有特殊保障？\", \"员工离职需要提前多久通知？\"\r\n- Example: \"试用期工资规定\", \"加班费计算方式\"\r\n\r\n**Rule 4: Default Fallback**\r\n\r\nIf still unclear, use the safest default:\r\n- HR policy\u002Fguidance → Tag ID: 2, RT: \"其他制度\"\r\n- General HR question → Tag ID: 1, RT: \"专业问答\"\r\n\r\n## Script Usage\r\n\r\n### Script Location\r\n\r\n**IMPORTANT**: The script is located at:\r\n`~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py`\r\n\r\nThe platform should dynamically resolve this path using:\r\n```python\r\nimport os\r\nskill_dir = os.path.join(os.path.expanduser('~'), '.workbuddy', 'skills', 'hr-ai-assistant')\r\nscript_path = os.path.join(skill_dir, 'scripts', 'call_hrrule_api.py')\r\n```\r\n\r\n**DO NOT use hardcoded paths like `C:\u002FUsers\u002Fjikr\u002F...`**\r\n\r\n### Function Signature\r\n\r\n```python\r\nasync def call_hrrule_api(\r\n    api_key: str,\r\n    content: str,\r\n    tag_id: int,\r\n    rt: str,\r\n    ws_url: str = \"ws:\u002F\u002F192.168.112.114:5000\",\r\n    model: str = \"deepseek-ai\u002FDeepSeek-R1\",\r\n    on_chunk: Optional[Callable[[str], None]] = None,\r\n    on_complete: Optional[Callable[[], None]] = None,\r\n    on_error: Optional[Callable[[str], None]] = None,\r\n    verbose: bool = False\r\n) -> str\r\n```\r\n\r\n### Parameters\r\n\r\n- `api_key`: API 密钥(必需)\r\n- `content`: 用户问题或需求(必需)\r\n- `tag_id`: 内容类型 ID(必需)\r\n- `rt`: 资源类型(必需)\r\n- `ws_url`: WebSocket 地址(默认: ws:\u002F\u002F192.168.112.114:5000)\r\n- `model`: 模型名称(默认: deepseek-ai\u002FDeepSeek-R1)\r\n- `on_chunk`: 收到内容块时的回调函数\r\n- `on_complete`: 完成时的回调函数\r\n- `on_error`: 错误时的回调函数\r\n- `verbose`: 是否显示详细日志\r\n\r\n### Return Value\r\n\r\nReturns the complete response content as a string.\r\n\r\n### Command Line Usage\r\n\r\n```bash\r\npython call_hrrule_api.py \\\r\n    --api-key \"your-api-key\" \\\r\n    --content \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\" \\\r\n    --tag-id 4 \\\r\n    --rt \"招聘JD\" \\\r\n    --verbose\r\n```\r\n\r\n## Example Workflows\r\n\r\n### Example 1: Generate Job Description (JD)\r\n\r\n**User Request:**\r\n```\r\n财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: \"招聘JD\" → Tag ID: 4, RT: \"招聘JD\"\r\n   - Extract context: 财务公司, 社保专员\r\n\r\n2. **Construct Content:**\r\n   ```python\r\n   content = \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n   tag_id = 4\r\n   rt = \"招聘JD\"\r\n   ```\r\n\r\n3. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content=content,\r\n       tag_id=tag_id,\r\n       rt=rt,\r\n       on_chunk=lambda text: print(text, end='', flush=True),\r\n       verbose=True\r\n   )\r\n   ```\r\n\r\n4. **Stream Response:**\r\n   The AI response is streamed back in real-time.\r\n\r\n### Example 2: Generate Employee Handbook\r\n\r\n**User Request:**\r\n```\r\n帮我写一个员工手册,适用于50人的科技公司\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: \"员工手册\" → Tag ID: 2, RT: \"员工手册\"\r\n   - Extract context: 50人, 科技公司\r\n\r\n2. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content='帮我写一个员工手册,适用于50人的科技公司',\r\n       tag_id=2,\r\n       rt='员工手册',\r\n       on_chunk=lambda text: print(text, end='', flush=True)\r\n   )\r\n   ```\r\n\r\n### Example 3: Create Performance Review Form\r\n\r\n**User Request:**\r\n```\r\n为销售部门设计KPI考核表\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: \"KPI考核表\" → Tag ID: 3, RT: \"KPI考核表\"\r\n   - Extract context: 销售部门\r\n\r\n2. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content='为销售部门设计KPI考核表',\r\n       tag_id=3,\r\n       rt='KPI考核表',\r\n       on_chunk=lambda text: print(text, end='', flush=True)\r\n   )\r\n   ```\r\n\r\n### Example 4: Professional Q&A (Labor Law Question)\r\n\r\n**User Request:**\r\n```\r\n三期员工有没有特殊保障？\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: Question about labor law\u002Femployee rights → Tag ID: 1, RT: \"专业问答\"\r\n   - Extract context: 三期员工 (孕期、产期、哺乳期), 特殊保障\r\n\r\n2. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content='三期员工有没有特殊保障？',\r\n       tag_id=1,\r\n       rt='专业问答',\r\n       on_chunk=lambda text: print(text, end='', flush=True),\r\n       verbose=True\r\n   )\r\n   ```\r\n\r\n3. **Stream Response:**\r\n   ```\r\n   AI 响应:\r\n\r\n   根据《劳动合同法》和《女职工劳动保护特别规定》，三期员工（孕期、产期、哺乳期）确实享有特殊保障，主要包括：\r\n\r\n   1. 不得单方面解除劳动合同\r\n      - 用人单位不得依据《劳动合同法》第40条、第41条单方面解除合同\r\n      - 除非员工有严重违纪等《劳动合同法》第39条规定的情况\r\n\r\n   2. 孕期保护\r\n      - 不得安排从事高强度、有毒有害工作\r\n      - 不得延长劳动时间或安排夜班工作\r\n      - 孕期7个月以上，每天应安排1小时工间休息\r\n\r\n   3. 产期保护\r\n      - 享有98天产假（难产或多胞胎适当增加）\r\n      - 产假期间工资照发\r\n      - 生育保险报销医疗费用\r\n\r\n   4. 哺乳期保护\r\n      - 每日享有1小时哺乳时间\r\n      - 不得安排有毒有害工作\r\n\r\n   5. 经济补偿\r\n      - 如劳动合同期满，合同自动顺延至三期结束\r\n      - 顺延期间不视为续签劳动合同\r\n   ```\r\n\r\n### Example 5: General HR Consultation\r\n\r\n**User Request:**\r\n```\r\n员工离职需要提前多少天通知？\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: Question about resignation → Tag ID: 1, RT: \"专业问答\"\r\n   - Extract context: 员工离职, 提前通知时间\r\n\r\n2. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content='员工离职需要提前多少天通知？',\r\n       tag_id=1,\r\n       rt='专业问答',\r\n       on_chunk=lambda text: print(text, end='', flush=True)\r\n   )\r\n   ```\r\n\r\n## Error Handling\r\n\r\nThe script handles various error scenarios:\r\n\r\n### Connection Errors\r\n- Invalid WebSocket URL\r\n- Network connectivity issues\r\n- Firewall blocking\r\n\r\n### Authentication Errors\r\n- Invalid API Key\r\n- API Key expired\r\n- Permission denied\r\n\r\n### API Errors\r\n- Invalid parameters\r\n- Server errors\r\n- Timeout (120 seconds)\r\n\r\n### Error Handling Example\r\n\r\n```python\r\ndef handle_error(error_msg: str):\r\n    print(f\"错误: {error_msg}\")\r\n    # 提供用户友好的错误信息\r\n    if \"Unauthorized\" in error_msg or \"401\" in error_msg:\r\n        print(\"API Key 无效,请检查您的 API Key\")\r\n    elif \"Connection\" in error_msg:\r\n        print(\"连接失败,请检查网络和 WebSocket URL\")\r\n    else:\r\n        print(\"发生未知错误,请稍后重试\")\r\n\r\nresponse = await call_hrrule_api(\r\n    api_key='your-api-key',\r\n    content='your content',\r\n    tag_id=2,\r\n    rt='员工手册',\r\n    on_error=handle_error,\r\n    verbose=True\r\n)\r\n```\r\n\r\n## Best Practices\r\n\r\n### 1. First-Time User Experience (首次使用体验)\r\n\r\n**Note**: 当首次使用此 skill 且未配置 API Key 时，平台（WorkBuddy\u002FOpenClaw）应该：\r\n\r\n✅ **推荐做法**：\r\n1. 检测到没有 API Key\r\n2. **先显示**友好的提示信息（访问 https:\u002F\u002Fai.hrrule.com\u002F 免费申请）\r\n3. **然后**使用平台的通用大模型回答问题\r\n4. 用户手动配置 API Key（通过环境变量、配置文件或配置脚本）\r\n\r\n**应该显示的提示信息**：\r\n```\r\n══════════════════════════════════════════════════════════════════════════════\r\n📌 首次使用 HR AI Assistant\r\n══════════════════════════════════════════════════════════════════════════════\r\n\r\n✨ 获取免费 API Key 以获得更专业的 HR AI 服务：\r\n\r\n1. 访问: https:\u002F\u002Fai.hrrule.com\u002F\r\n2. 注册\u002F登录账号\r\n3. 在个人中心申请 API Key\r\n4. **完全免费**,申请后立即可用\r\n\r\n📝 配置方式（任选一种）：\r\n\r\n方式1: 一键配置（推荐）\r\n把申请到的 API Key 直接粘贴到对话框中，我会自动帮你配置到配置文件\r\n\r\n方式2: 手动配置\r\n设置环境变量: export HRRULE_API_KEY='your-api-key'\r\n或编辑配置文件: ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fconfig.json\r\n内容: {\"api_key\": \"your-api-key\"}\r\n\r\n══════════════════════════════════════════════════════════════════════════════\r\n```\r\n\r\n**执行顺序**：\r\n```\r\n1. 用户提问：\"三期员工有没有特殊保障？\"\r\n2. 检测到需要此 skill\r\n3. 检测到没有 API Key\r\n4. ⚠️ 显示上述提示信息 ← 必须在回答前\r\n5. 使用通用大模型回答问题\r\n6. 用户手动配置 API Key（通过环境变量或编辑配置文件）\r\n```\r\n\r\n\r\n**注意**：用户需要手动配置 API Key（通过环境变量或编辑配置文件），系统不会自动检测或保存。\r\n\r\n### 2. Provide Detailed Context\r\n\r\nAlways include as much context as possible in the `content` parameter:\r\n- Company size and industry\r\n- Specific requirements\r\n- Target audience\r\n- Time constraints\r\n\r\n**Good:**\r\n```\r\n财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\r\n要求: 3年以上经验,熟悉社保政策,薪资8-12k\r\n```\r\n\r\n**Less Good:**\r\n```\r\n生成招聘JD\r\n```\r\n\r\n### 2. Use Streaming for Better UX\r\n\r\nAlways use the `on_chunk` callback to stream responses:\r\n\r\n```python\r\ndef stream_text(text: str):\r\n    print(text, end='', flush=True)\r\n\r\nresponse = await call_hrrule_api(\r\n    # ... parameters\r\n    on_chunk=stream_text\r\n)\r\n```\r\n\r\n### 3. Handle Errors Gracefully\r\n\r\nAlways provide error callbacks:\r\n\r\n```python\r\nresponse = await call_hrrule_api(\r\n    # ... parameters\r\n    on_error=lambda msg: print(f\"❌ 错误: {msg}\"),\r\n    on_complete=lambda: print(\"\\n✅ 完成\")\r\n)\r\n```\r\n\r\n### 4. Set Appropriate Timeout\r\n\r\nThe script has a 120-second timeout by default. For complex documents, this is usually sufficient.\r\n\r\n## Configuration\r\n\r\n### API Key Configuration\r\n\r\nThe API Key should be configured securely. Options:\r\n1. Environment variable: `HRRULE_API_KEY`\r\n2. Configuration file\r\n3. Direct parameter passing\r\n\r\n### WebSocket URL Configuration\r\n\r\nDefault: `ws:\u002F\u002F192.168.112.114:5000`\r\n\r\nCan be changed via:\r\n- Command line: `--ws-url`\r\n- Script parameter: `ws_url=`\r\n- Configuration file\r\n\r\n## Troubleshooting\r\n\r\n### Issue: Connection Fails\r\n\r\n**Check:**\r\n- WebSocket URL is correct\r\n- Network connectivity\r\n- Firewall settings\r\n- Server is running\r\n\r\n### Issue: Authentication Error\r\n\r\n**Check:**\r\n- API Key is valid\r\n- API Key has not expired\r\n- API Key has proper permissions\r\n\r\n### Issue: No Response\r\n\r\n**Check:**\r\n- Content parameter is not empty\r\n- Tag ID and RT are valid\r\n- Network connection is stable\r\n- Server is processing requests\r\n\r\n### Issue: Timeout\r\n\r\n**Solution:**\r\n- Increase timeout in script\r\n- Simplify the request\r\n- Check server load\r\n\r\n## Integration Examples\r\n\r\n### DingTalk Integration\r\n\r\nWhen receiving HR requests from DingTalk:\r\n\r\n```python\r\n# 收到 DingTalk 消息\r\nmessage = \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n\r\n# 调用 skill\r\nimport sys\r\nimport os\r\n\r\n# 获取 skill 目录路径（动态解析）\r\nskill_dir = os.path.join(os.path.expanduser('~'), '.workbuddy', 'skills', 'hr-ai-assistant')\r\nscript_dir = os.path.join(skill_dir, 'scripts')\r\nsys.path.insert(0, script_dir)\r\n\r\nfrom call_hrrule_api import call_hrrule_api\r\n\r\n# ⚠️ 重要：平台必须直接执行 skill 目录下的脚本，不要新建 Python 文件\r\n\r\nasync def handle_dingtalk_message(message: str):\r\n    # 解析请求\r\n    tag_id, rt = parse_request(message)  # 4, \"招聘JD\"\r\n\r\n    # 调用 API\r\n    response = await call_hrrule_api(\r\n        api_key=os.getenv('HRRULE_API_KEY'),\r\n        content=message,\r\n        tag_id=tag_id,\r\n        rt=rt,\r\n        on_chunk=lambda text: send_to_dingtalk(text)  # 实时发送到 DingTalk\r\n    )\r\n\r\n    return response\r\n\r\n# 执行\r\nresponse = asyncio.run(handle_dingtalk_message(message))\r\n```\r\n\r\n### QQ Integration\r\n\r\nSimilar to DingTalk, parse the QQ message and call the API:\r\n\r\n```python\r\nasync def handle_qq_message(message: str):\r\n    # 解析请求\r\n    tag_id, rt = parse_request(message)\r\n\r\n    # 调用 API\r\n    response = await call_hrrule_api(\r\n        api_key='your-api-key',\r\n        content=message,\r\n        tag_id=tag_id,\r\n        rt=rt,\r\n        on_chunk=lambda text: send_to_qq(text)\r\n    )\r\n\r\n    return response\r\n```\r\n\r\n## Summary\r\n\r\nThis skill provides **direct API integration** with the HRrule AI platform, enabling WorkBuddy to:\r\n- Automatically parse HR requests\r\n- Select appropriate parameters (tag_id, rt)\r\n- Call WebSocket API in real-time\r\n- Stream responses back to users\r\n- Handle errors gracefully\r\n\r\nThe skill is designed for seamless integration with chat platforms like DingTalk and QQ, making it easy to generate HR documents on demand.\r\n\r\n## Reference Materials\r\n\r\n- API Reference: `references\u002Fapi_reference.md`\r\n- Example Prompts: `references\u002Fexample_prompts.md`\r\n- Usage Guide: `README.md`\r\n- Test Page: `assets\u002Fchat_example.html`\r\n- Original Test: `test_open_chat.html`\r\n","# HR AI Assistant Skill\r\n\r\n## Purpose\r\n\r\nThis skill enables WorkBuddy to directly call the HRrule AI platform's WebSocket API to generate HR-related content in real-time. When users request HR policies, forms, consultation, professional Q&A, or other HR documents, this skill automatically invokes the API with appropriate parameters and streams the response back to the user. The skill supports:\r\n\r\n1. **Document Generation**: Creating HR policies, forms, job descriptions, performance reviews, etc.\r\n2. **Professional Q&A**: Answering HR-related questions about labor laws, employee rights, compensation, contracts, etc.\r\n3. **Real-time Streaming**: Providing immediate feedback with streaming responses\r\n\r\n## When to Use This Skill\r\n\r\nUse this skill when users ask questions or make requests related to:\r\n\r\n- **HR Policy Generation**: Creating employee handbooks, attendance policies, leave policies, disciplinary procedures, compensation policies\r\n- **HR Form Creation**: Generating onboarding forms, resignation forms, leave application forms, performance review forms\r\n- **HR Consultation**: Asking questions about labor laws, employment contracts, recruitment processes, compensation and benefits\r\n- **HR Process Flowcharts**: Creating visual representations of HR processes like recruitment workflows, onboarding processes\r\n- **HR Documentation**: Writing reports, summaries, guidelines, and other HR-related documents\r\n- **Professional Q&A**: Any HR-related questions requiring professional answers, such as labor law inquiries, employee rights, compensation, contract issues, leave policies, etc.\r\n\r\nKey phrases that indicate this skill should be triggered include:\r\n- \"帮我写一个员工手册\"\r\n- \"生成HR制度\"\r\n- \"制作入职表单\"\r\n- \"HR相关问题\"\r\n- \"劳动法咨询\"\r\n- \"招聘流程\"\r\n- \"薪酬制度\"\r\n- \"离职手续\"\r\n- \"考勤制度\"\r\n- \"绩效考核\"\r\n- \"员工福利\"\r\n- \"劳动合同\"\r\n- \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n- \"三期员工有没有特殊保障？\"\r\n- \"Generate HR policy\"\r\n- \"Create HR form\"\r\n- \"HR consultation\"\r\n- \"Labor law questions\"\r\n\r\n## How This Skill Works\r\n\r\n\r\n### Direct API Integration\r\n\r\nThis skill provides a Python script that interacts with the HRrule AI WebSocket API to generate content.\r\n\r\n**Integration Options**:\r\n\r\n1. **Analyze User Request**: Parse the user's HR request to identify the content type\r\n2. **Check API Key**: Verify API Key is configured (from env var or config.json)\r\n   - **If API Key is missing**: Display a friendly prompt to visit https:\u002F\u002Fai.hrrule.com\u002F for a free API Key\r\n   - **If API Key is valid**: Proceed with API call\r\n3. **Select Parameters**: Automatically select appropriate `tag_id` and `rt` based on the request\r\n4. **Call API**: The platform may execute the Python script to make the API call:\r\n   ```bash\r\n   python ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py \\\r\n       --content \"用户的问题\" \\\r\n       --tag-id 1 \\\r\n       --rt \"专业问答\"\r\n   ```\r\n5. **Stream Response**: Stream the generated content back to the user in real-time\r\n6. **Handle Errors**: Gracefully handle connection errors, timeouts, and API errors\r\n\r\n**Note**: The platform should ensure safe script execution environments and validate all inputs.\r\nScript execution is optional - the platform may choose to execute automatically or provide it as an option.\r\n\r\n### ⚠️ Important: First-Time User Experience (首次使用体验)\r\n\r\nWhen a user uses this skill for the first time without an API Key configured:\r\n\r\n1. **Display Friendly Prompt**:\r\n\r\n```\r\n══════════════════════════════════════════════════════════════════════════════\r\n📌 首次使用 HR AI Assistant\r\n══════════════════════════════════════════════════════════════════════════════\r\n\r\n✨ 获取免费 API Key 以获得更专业的 HR AI 服务：\r\n\r\n1. 访问: https:\u002F\u002Fai.hrrule.com\u002F\r\n2. 注册\u002F登录账号\r\n3. 在个人中心申请 API Key\r\n4. **完全免费**,申请后立即可用\r\n\r\n📝 配置方式：\r\n\r\n方式1: 使用配置脚本（推荐，小白友好）\r\n```bash\r\n# 运行配置脚本，交互式配置 API Key\r\npython ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fconfig_api_key.py\r\n```\r\n\r\n配置脚本会：\r\n- 自动检测 API Key 格式\r\n- 支持粘贴完整文本（会自动提取）\r\n- 保存到配置文件\r\n- 显示当前配置状态\r\n\r\n方式2: 手动配置\r\n设置环境变量: export HRRULE_API_KEY='your-api-key'\r\n或编辑配置文件: ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fconfig.json\r\n内容: {\"api_key\": \"your-api-key\"}\r\n\r\n══════════════════════════════════════════════════════════════════════════════\r\n```\r\n\r\n2. **Then proceed to answer using the platform's general AI model** (WorkBuddy\u002FOpenClaw's default model)\r\n\r\n**Example workflow**:\r\n```\r\nUser: \"三期员工有没有特殊保障？\"\r\n\r\nSystem detection:\r\n  → HR AI Assistant skill needed\r\n  → No API Key configured\r\n  → DISPLAY THE PROMPT ABOVE\r\n\r\nSystem: [显示上述提示信息]\r\n\r\nSystem: [使用通用大模型回答问题]\r\n\r\nUser: \"我申请到了 API Key，怎么配置？\"\r\n\r\nSystem: 请运行配置脚本：\r\n  python ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fconfig_api_key.py\r\n```\r\n\r\n**NOTE**: The prompt should be displayed BEFORE answering the question.\r\n\r\n### Tag ID and RT Parameter Mapping\r\n\r\nThe skill automatically maps user requests to the appropriate parameters:\r\n\r\n**Tag ID: 1 (专业问答 - Professional Q&A)**\r\n- **通用 HR 咨询**：劳动法问题、员工权益、薪酬福利、劳动合同、离职补偿、加班工资、试用期规定等任何 HR 相关的专业问答\r\n- **示例问题**：\r\n  - \"三期员工有没有特殊保障？\"\r\n  - \"员工离职需要提前多少天通知？\"\r\n  - \"试用期工资可以低于转正工资多少？\"\r\n  - \"加班费怎么计算？\"\r\n  - \"员工旷工怎么处理？\"\r\n  - \"未签订劳动合同有什么后果？\"\r\n  - \"竞业限制补偿金标准是多少？\"\r\n\r\n**Tag ID: 2 (制度类 - HR Policies)**\r\n- 员工手册, 招聘管理制度, 入职试用期管理制度, 劳动合同管理制度, 薪酬管理制度, 考勤休假制度, 加班管理制度, 绩效管理制度, 员工培训制度, 离职管理制度, 员工竞聘制度, 病假管理制度, 奖惩制度, 其他制度\r\n\r\n**Tag ID: 7 (岗位类 - Job Descriptions)**\r\n- 岗位说明书, 工作饱和度评估表, 任职资格标准, 职位图谱\r\n\r\n**Tag ID: 3 (绩效类 - Performance Management)**\r\n- 360考核表, BSC考核表, KPI考核表, OKR考核表, 绩效承诺书, 绩效改进计划, 绩效面谈表, 绩效诊断报告\r\n\r\n**Tag ID: 4 (招聘类 - Recruitment)**\r\n- 人才画像, 面试评估表, 面试题库, 招聘需求表, 招聘JD, 背景调查表, 录用条件说明书, 录用通知书, 入职承诺书, 劳动合同\r\n\r\n**Tag ID: 5 (薪酬类 - Compensation)**\r\n- 薪酬等级表, 薪酬面谈表, 薪酬诊断报告, 岗位价值评估表\r\n\r\n**Tag ID: 8 (培训类 - Training)**\r\n- 新员工培训计划, 年度培训计划\r\n\r\n**Tag ID: 13 (报告类 - Reports)**\r\n- 年终总结, 月度报告, 周报, 日报\r\n\r\n**Tag ID: 14 (风控类 - Risk Management)**\r\n- 风险自测\r\n\r\n## Usage Workflow\r\n\r\n### Step 1: Parse User Request\r\n\r\nAnalyze the user's request to determine:\r\n- **Content Type**: What type of HR content they need\r\n- **Tag ID**: The appropriate content category\r\n- **RT**: The specific resource type\r\n- **Details**: Any specific requirements or constraints\r\n\r\n**Example Request Analysis:**\r\n\r\nRequest: \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n\r\nAnalysis:\r\n- Content Type: 招聘JD (Job Description)\r\n- Tag ID: 4 (招聘类)\r\n- RT: \"招聘JD\"\r\n- Details: 财务公司, 社保专员岗位\r\n\r\n### Step 2: Select Parameters\r\n\r\nBased on the analysis, select the parameters:\r\n\r\n```python\r\ntag_id = 4\r\nrt = \"招聘JD\"\r\ncontent = \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n```\r\n\r\n### Step 3: Call API Using Python Script\r\n\r\nUse the bundled script to call the API:\r\n\r\n```python\r\nimport sys\r\nimport os\r\n\r\n# 获取 skill 目录路径（动态解析）\r\nskill_dir = os.path.join(os.path.expanduser('~'), '.workbuddy', 'skills', 'hr-ai-assistant')\r\nscript_dir = os.path.join(skill_dir, 'scripts')\r\nsys.path.insert(0, script_dir)\r\n\r\nfrom call_hrrule_api import call_hrrule_api\r\n\r\n# ⚠️ 重要：平台必须直接执行 skill 目录下的脚本，不要新建 Python 文件\r\n\r\nasync def get_hr_content():\r\n    # 调用 API 并流式输出\r\n    full_response = await call_hrrule_api(\r\n        api_key='your-api-key',\r\n        content='财务公司 需要招聘 社保专员，帮我生成一份 招聘JD',\r\n        tag_id=4,\r\n        rt='招聘JD',\r\n        on_chunk=lambda text: print(text, end='', flush=True),\r\n        verbose=True\r\n    )\r\n    return full_response\r\n\r\n# 执行调用\r\nimport asyncio\r\nresponse = asyncio.run(get_hr_content())\r\n```\r\n\r\n### Step 4: Stream Response to User\r\n\r\nStream the response back to the user in real-time:\r\n\r\n```\r\nAI 响应:\r\n\r\n职位名称: 社保专员\r\n所属部门: 人力资源部\r\n工作地点: 北京\r\n招聘人数: 1人\r\n\r\n职位描述:\r\n我们是一家专业的财务公司,现招聘社保专员...\r\n```\r\n\r\n## Parameter Selection Logic\r\n\r\n### Automatic Mapping Rules\r\n\r\n**Rule 1: Keyword Matching**\r\n\r\n| Keyword | Tag ID | RT |\r\n|---------|--------|-----|\r\n| 专业问答\u002F咨询 | 1 | 专业问答 |\r\n| 劳动法问题\u002F咨询 | 1 | 专业问答 |\r\n| 员工权益\u002F权利 | 1 | 专业问答 |\r\n| 离职补偿\u002F赔偿 | 1 | 专业问答 |\r\n| 加班工资\u002F加班费 | 1 | 专业问答 |\r\n| 试用期规定\u002F工资 | 1 | 专业问答 |\r\n| 三期\u002F孕期\u002F产期\u002F哺乳期 | 1 | 专业问答 |\r\n| 竞业限制 | 1 | 专业问答 |\r\n| 经济补偿金\u002F赔偿金 | 1 | 专业问答 |\r\n| 违法解除\u002F终止合同 | 1 | 专业问答 |\r\n| 员工手册 | 2 | 员工手册 |\r\n| 考勤制度 | 2 | 考勤休假制度 |\r\n| 薪酬制度 | 2 | 薪酬管理制度 |\r\n| 岗位说明书 | 7 | 岗位说明书 |\r\n| KPI考核表 | 3 | KPI考核表 |\r\n| 绩效考核表 | 3 | KPI考核表 |\r\n| 绩效改进 | 3 | 绩效改进计划 |\r\n| 面试评估表 | 4 | 面试评估表 |\r\n| 面试题库 | 4 | 面试题库 |\r\n| 招聘JD | 4 | 招聘JD |\r\n| 招聘职位 | 4 | 招聘JD |\r\n| 劳动合同 | 4 | 劳动合同 |\r\n| 录用通知书 | 4 | 录用通知书 |\r\n| 薪酬等级表 | 5 | 薪酬等级表 |\r\n| 薪酬面谈表 | 5 | 薪酬面谈表 |\r\n| 培训计划 | 8 | 新员工培训计划 |\r\n| 年终总结 | 13 | 年终总结 |\r\n| 周报\u002F月报\u002F日报 | 13 | 周报\u002F月度报告\u002F日报 |\r\n| 风险评估 | 14 | 风险自测 |\r\n\r\n**Rule 2: Context Analysis**\r\n\r\n- If user mentions \"招聘\" (recruitment) + specific document type → Tag ID: 4\r\n- If user mentions \"制度\" (policy\u002Fsystem) → Tag ID: 2\r\n- If user mentions \"考核\" (assessment) → Tag ID: 3\r\n- If user mentions \"培训\" (training) → Tag ID: 8\r\n- If user mentions \"报告\" (report) + time period → Tag ID: 13\r\n- If user asks a question about labor laws, employee rights, compensation → Tag ID: 1 (专业问答)\r\n- If user asks \"有没有\"、\"如何\"、\"怎样\"、\"为什么\"等疑问句 → Tag ID: 1 (专业问答)\r\n\r\n**Rule 3: Fallback - Professional Q&A**\r\n\r\nIf no clear match with specific document types (如员工手册、招聘JD、KPI考核表等), use the general Q&A category:\r\n- Any HR-related question about laws, regulations, policies, employee rights → Tag ID: 1, RT: \"专业问答\"\r\n- Example: \"三期员工有没有特殊保障？\", \"员工离职需要提前多久通知？\"\r\n- Example: \"试用期工资规定\", \"加班费计算方式\"\r\n\r\n**Rule 4: Default Fallback**\r\n\r\nIf still unclear, use the safest default:\r\n- HR policy\u002Fguidance → Tag ID: 2, RT: \"其他制度\"\r\n- General HR question → Tag ID: 1, RT: \"专业问答\"\r\n\r\n## Script Usage\r\n\r\n### Script Location\r\n\r\n**IMPORTANT**: The script is located at:\r\n`~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py`\r\n\r\nThe platform should dynamically resolve this path using:\r\n```python\r\nimport os\r\nskill_dir = os.path.join(os.path.expanduser('~'), '.workbuddy', 'skills', 'hr-ai-assistant')\r\nscript_path = os.path.join(skill_dir, 'scripts', 'call_hrrule_api.py')\r\n```\r\n\r\n**DO NOT use hardcoded paths like `C:\u002FUsers\u002Fjikr\u002F...`**\r\n\r\n### Function Signature\r\n\r\n```python\r\nasync def call_hrrule_api(\r\n    api_key: str,\r\n    content: str,\r\n    tag_id: int,\r\n    rt: str,\r\n    ws_url: str = \"ws:\u002F\u002F192.168.112.114:5000\",\r\n    model: str = \"deepseek-ai\u002FDeepSeek-R1\",\r\n    on_chunk: Optional[Callable[[str], None]] = None,\r\n    on_complete: Optional[Callable[[], None]] = None,\r\n    on_error: Optional[Callable[[str], None]] = None,\r\n    verbose: bool = False\r\n) -> str\r\n```\r\n\r\n### Parameters\r\n\r\n- `api_key`: API 密钥(必需)\r\n- `content`: 用户问题或需求(必需)\r\n- `tag_id`: 内容类型 ID(必需)\r\n- `rt`: 资源类型(必需)\r\n- `ws_url`: WebSocket 地址(默认: ws:\u002F\u002F192.168.112.114:5000)\r\n- `model`: 模型名称(默认: deepseek-ai\u002FDeepSeek-R1)\r\n- `on_chunk`: 收到内容块时的回调函数\r\n- `on_complete`: 完成时的回调函数\r\n- `on_error`: 错误时的回调函数\r\n- `verbose`: 是否显示详细日志\r\n\r\n### Return Value\r\n\r\nReturns the complete response content as a string.\r\n\r\n### Command Line Usage\r\n\r\n```bash\r\npython call_hrrule_api.py \\\r\n    --api-key \"your-api-key\" \\\r\n    --content \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\" \\\r\n    --tag-id 4 \\\r\n    --rt \"招聘JD\" \\\r\n    --verbose\r\n```\r\n\r\n## Example Workflows\r\n\r\n### Example 1: Generate Job Description (JD)\r\n\r\n**User Request:**\r\n```\r\n财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: \"招聘JD\" → Tag ID: 4, RT: \"招聘JD\"\r\n   - Extract context: 财务公司, 社保专员\r\n\r\n2. **Construct Content:**\r\n   ```python\r\n   content = \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n   tag_id = 4\r\n   rt = \"招聘JD\"\r\n   ```\r\n\r\n3. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content=content,\r\n       tag_id=tag_id,\r\n       rt=rt,\r\n       on_chunk=lambda text: print(text, end='', flush=True),\r\n       verbose=True\r\n   )\r\n   ```\r\n\r\n4. **Stream Response:**\r\n   The AI response is streamed back in real-time.\r\n\r\n### Example 2: Generate Employee Handbook\r\n\r\n**User Request:**\r\n```\r\n帮我写一个员工手册,适用于50人的科技公司\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: \"员工手册\" → Tag ID: 2, RT: \"员工手册\"\r\n   - Extract context: 50人, 科技公司\r\n\r\n2. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content='帮我写一个员工手册,适用于50人的科技公司',\r\n       tag_id=2,\r\n       rt='员工手册',\r\n       on_chunk=lambda text: print(text, end='', flush=True)\r\n   )\r\n   ```\r\n\r\n### Example 3: Create Performance Review Form\r\n\r\n**User Request:**\r\n```\r\n为销售部门设计KPI考核表\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: \"KPI考核表\" → Tag ID: 3, RT: \"KPI考核表\"\r\n   - Extract context: 销售部门\r\n\r\n2. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content='为销售部门设计KPI考核表',\r\n       tag_id=3,\r\n       rt='KPI考核表',\r\n       on_chunk=lambda text: print(text, end='', flush=True)\r\n   )\r\n   ```\r\n\r\n### Example 4: Professional Q&A (Labor Law Question)\r\n\r\n**User Request:**\r\n```\r\n三期员工有没有特殊保障？\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: Question about labor law\u002Femployee rights → Tag ID: 1, RT: \"专业问答\"\r\n   - Extract context: 三期员工 (孕期、产期、哺乳期), 特殊保障\r\n\r\n2. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content='三期员工有没有特殊保障？',\r\n       tag_id=1,\r\n       rt='专业问答',\r\n       on_chunk=lambda text: print(text, end='', flush=True),\r\n       verbose=True\r\n   )\r\n   ```\r\n\r\n3. **Stream Response:**\r\n   ```\r\n   AI 响应:\r\n\r\n   根据《劳动合同法》和《女职工劳动保护特别规定》，三期员工（孕期、产期、哺乳期）确实享有特殊保障，主要包括：\r\n\r\n   1. 不得单方面解除劳动合同\r\n      - 用人单位不得依据《劳动合同法》第40条、第41条单方面解除合同\r\n      - 除非员工有严重违纪等《劳动合同法》第39条规定的情况\r\n\r\n   2. 孕期保护\r\n      - 不得安排从事高强度、有毒有害工作\r\n      - 不得延长劳动时间或安排夜班工作\r\n      - 孕期7个月以上，每天应安排1小时工间休息\r\n\r\n   3. 产期保护\r\n      - 享有98天产假（难产或多胞胎适当增加）\r\n      - 产假期间工资照发\r\n      - 生育保险报销医疗费用\r\n\r\n   4. 哺乳期保护\r\n      - 每日享有1小时哺乳时间\r\n      - 不得安排有毒有害工作\r\n\r\n   5. 经济补偿\r\n      - 如劳动合同期满，合同自动顺延至三期结束\r\n      - 顺延期间不视为续签劳动合同\r\n   ```\r\n\r\n### Example 5: General HR Consultation\r\n\r\n**User Request:**\r\n```\r\n员工离职需要提前多少天通知？\r\n```\r\n\r\n**Skill Execution:**\r\n\r\n1. **Parse Request:**\r\n   - Identify: Question about resignation → Tag ID: 1, RT: \"专业问答\"\r\n   - Extract context: 员工离职, 提前通知时间\r\n\r\n2. **Call API:**\r\n   ```python\r\n   response = await call_hrrule_api(\r\n       api_key='your-api-key',\r\n       content='员工离职需要提前多少天通知？',\r\n       tag_id=1,\r\n       rt='专业问答',\r\n       on_chunk=lambda text: print(text, end='', flush=True)\r\n   )\r\n   ```\r\n\r\n## Error Handling\r\n\r\nThe script handles various error scenarios:\r\n\r\n### Connection Errors\r\n- Invalid WebSocket URL\r\n- Network connectivity issues\r\n- Firewall blocking\r\n\r\n### Authentication Errors\r\n- Invalid API Key\r\n- API Key expired\r\n- Permission denied\r\n\r\n### API Errors\r\n- Invalid parameters\r\n- Server errors\r\n- Timeout (120 seconds)\r\n\r\n### Error Handling Example\r\n\r\n```python\r\ndef handle_error(error_msg: str):\r\n    print(f\"错误: {error_msg}\")\r\n    # 提供用户友好的错误信息\r\n    if \"Unauthorized\" in error_msg or \"401\" in error_msg:\r\n        print(\"API Key 无效,请检查您的 API Key\")\r\n    elif \"Connection\" in error_msg:\r\n        print(\"连接失败,请检查网络和 WebSocket URL\")\r\n    else:\r\n        print(\"发生未知错误,请稍后重试\")\r\n\r\nresponse = await call_hrrule_api(\r\n    api_key='your-api-key',\r\n    content='your content',\r\n    tag_id=2,\r\n    rt='员工手册',\r\n    on_error=handle_error,\r\n    verbose=True\r\n)\r\n```\r\n\r\n## Best Practices\r\n\r\n### 1. First-Time User Experience (首次使用体验)\r\n\r\n**Note**: 当首次使用此 skill 且未配置 API Key 时，平台（WorkBuddy\u002FOpenClaw）应该：\r\n\r\n✅ **推荐做法**：\r\n1. 检测到没有 API Key\r\n2. **先显示**友好的提示信息（访问 https:\u002F\u002Fai.hrrule.com\u002F 免费申请）\r\n3. **然后**使用平台的通用大模型回答问题\r\n4. 用户手动配置 API Key（通过环境变量、配置文件或配置脚本）\r\n\r\n**应该显示的提示信息**：\r\n```\r\n══════════════════════════════════════════════════════════════════════════════\r\n📌 首次使用 HR AI Assistant\r\n══════════════════════════════════════════════════════════════════════════════\r\n\r\n✨ 获取免费 API Key 以获得更专业的 HR AI 服务：\r\n\r\n1. 访问: https:\u002F\u002Fai.hrrule.com\u002F\r\n2. 注册\u002F登录账号\r\n3. 在个人中心申请 API Key\r\n4. **完全免费**,申请后立即可用\r\n\r\n📝 配置方式（任选一种）：\r\n\r\n方式1: 一键配置（推荐）\r\n把申请到的 API Key 直接粘贴到对话框中，我会自动帮你配置到配置文件\r\n\r\n方式2: 手动配置\r\n设置环境变量: export HRRULE_API_KEY='your-api-key'\r\n或编辑配置文件: ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fconfig.json\r\n内容: {\"api_key\": \"your-api-key\"}\r\n\r\n══════════════════════════════════════════════════════════════════════════════\r\n```\r\n\r\n**执行顺序**：\r\n```\r\n1. 用户提问：\"三期员工有没有特殊保障？\"\r\n2. 检测到需要此 skill\r\n3. 检测到没有 API Key\r\n4. ⚠️ 显示上述提示信息 ← 必须在回答前\r\n5. 使用通用大模型回答问题\r\n6. 用户手动配置 API Key（通过环境变量或编辑配置文件）\r\n```\r\n\r\n\r\n**注意**：用户需要手动配置 API Key（通过环境变量或编辑配置文件），系统不会自动检测或保存。\r\n\r\n### 2. Provide Detailed Context\r\n\r\nAlways include as much context as possible in the `content` parameter:\r\n- Company size and industry\r\n- Specific requirements\r\n- Target audience\r\n- Time constraints\r\n\r\n**Good:**\r\n```\r\n财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\r\n要求: 3年以上经验,熟悉社保政策,薪资8-12k\r\n```\r\n\r\n**Less Good:**\r\n```\r\n生成招聘JD\r\n```\r\n\r\n### 2. Use Streaming for Better UX\r\n\r\nAlways use the `on_chunk` callback to stream responses:\r\n\r\n```python\r\ndef stream_text(text: str):\r\n    print(text, end='', flush=True)\r\n\r\nresponse = await call_hrrule_api(\r\n    # ... parameters\r\n    on_chunk=stream_text\r\n)\r\n```\r\n\r\n### 3. Handle Errors Gracefully\r\n\r\nAlways provide error callbacks:\r\n\r\n```python\r\nresponse = await call_hrrule_api(\r\n    # ... parameters\r\n    on_error=lambda msg: print(f\"❌ 错误: {msg}\"),\r\n    on_complete=lambda: print(\"\\n✅ 完成\")\r\n)\r\n```\r\n\r\n### 4. Set Appropriate Timeout\r\n\r\nThe script has a 120-second timeout by default. For complex documents, this is usually sufficient.\r\n\r\n## Configuration\r\n\r\n### API Key Configuration\r\n\r\nThe API Key should be configured securely. Options:\r\n1. Environment variable: `HRRULE_API_KEY`\r\n2. Configuration file\r\n3. Direct parameter passing\r\n\r\n### WebSocket URL Configuration\r\n\r\nDefault: `ws:\u002F\u002F192.168.112.114:5000`\r\n\r\nCan be changed via:\r\n- Command line: `--ws-url`\r\n- Script parameter: `ws_url=`\r\n- Configuration file\r\n\r\n## Troubleshooting\r\n\r\n### Issue: Connection Fails\r\n\r\n**Check:**\r\n- WebSocket URL is correct\r\n- Network connectivity\r\n- Firewall settings\r\n- Server is running\r\n\r\n### Issue: Authentication Error\r\n\r\n**Check:**\r\n- API Key is valid\r\n- API Key has not expired\r\n- API Key has proper permissions\r\n\r\n### Issue: No Response\r\n\r\n**Check:**\r\n- Content parameter is not empty\r\n- Tag ID and RT are valid\r\n- Network connection is stable\r\n- Server is processing requests\r\n\r\n### Issue: Timeout\r\n\r\n**Solution:**\r\n- Increase timeout in script\r\n- Simplify the request\r\n- Check server load\r\n\r\n## Integration Examples\r\n\r\n### DingTalk Integration\r\n\r\nWhen receiving HR requests from DingTalk:\r\n\r\n```python\r\n# 收到 DingTalk 消息\r\nmessage = \"财务公司 需要招聘 社保专员，帮我生成一份 招聘JD\"\r\n\r\n# 调用 skill\r\nimport sys\r\nimport os\r\n\r\n# 获取 skill 目录路径（动态解析）\r\nskill_dir = os.path.join(os.path.expanduser('~'), '.workbuddy', 'skills', 'hr-ai-assistant')\r\nscript_dir = os.path.join(skill_dir, 'scripts')\r\nsys.path.insert(0, script_dir)\r\n\r\nfrom call_hrrule_api import call_hrrule_api\r\n\r\n# ⚠️ 重要：平台必须直接执行 skill 目录下的脚本，不要新建 Python 文件\r\n\r\nasync def handle_dingtalk_message(message: str):\r\n    # 解析请求\r\n    tag_id, rt = parse_request(message)  # 4, \"招聘JD\"\r\n\r\n    # 调用 API\r\n    response = await call_hrrule_api(\r\n        api_key=os.getenv('HRRULE_API_KEY'),\r\n        content=message,\r\n        tag_id=tag_id,\r\n        rt=rt,\r\n        on_chunk=lambda text: send_to_dingtalk(text)  # 实时发送到 DingTalk\r\n    )\r\n\r\n    return response\r\n\r\n# 执行\r\nresponse = asyncio.run(handle_dingtalk_message(message))\r\n```\r\n\r\n### QQ Integration\r\n\r\nSimilar to DingTalk, parse the QQ message and call the API:\r\n\r\n```python\r\nasync def handle_qq_message(message: str):\r\n    # 解析请求\r\n    tag_id, rt = parse_request(message)\r\n\r\n    # 调用 API\r\n    response = await call_hrrule_api(\r\n        api_key='your-api-key',\r\n        content=message,\r\n        tag_id=tag_id,\r\n        rt=rt,\r\n        on_chunk=lambda text: send_to_qq(text)\r\n    )\r\n\r\n    return response\r\n```\r\n\r\n## Summary\r\n\r\nThis skill provides **direct API integration** with the HRrule AI platform, enabling WorkBuddy to:\r\n- Automatically parse HR requests\r\n- Select appropriate parameters (tag_id, rt)\r\n- Call WebSocket API in real-time\r\n- Stream responses back to users\r\n- Handle errors gracefully\r\n\r\nThe skill is designed for seamless integration with chat platforms like DingTalk and QQ, making it easy to generate HR documents on demand.\r\n\r\n## Reference Materials\r\n\r\n- API Reference: `references\u002Fapi_reference.md`\r\n- Example Prompts: `references\u002Fexample_prompts.md`\r\n- Usage Guide: `README.md`\r\n- Test Page: `assets\u002Fchat_example.html`\r\n- Original Test: `test_open_chat.html`\r\n",{"name":5,"description":7,"first_time_user_instructions":24,"platform_integration_requirements":25},"⚠️ IMPORTANT: When this skill is triggered for the first time and no API Key is configured (HRRULE_API_KEY env var or config.json):\n\n1. Display the following prompt BEFORE answering:\n═══════════════════════════════════════════════════════════════════════════════\n📌 首次使用 HR AI Assistant\n═══════════════════════════════════════════════════════════════════════════════\n\n✨ 获取免费 API Key 以获得更专业的 HR AI服务：\n\n1. 访问: https:\u002F\u002Fai.hrrule.com\u002F\n2. 注册\u002F登录账号\n3. 在个人中心申请 API Key\n4. **完全免费**,申请后立即可用\n\n📝 配置方式：\n\n方式1: 手动配置（推荐）\n设置环境变量: export HRRULE_API_KEY='your-api-key'\n或编辑配置文件: ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fconfig.json\n内容: {\"api_key\": \"your-api-key\"}\n\n═══════════════════════════════════════════════════════════════════════════════\n\n2. AFTER displaying the prompt, answer the user's question using the platform's general AI model\n\n4. Do NOT silently fallback without showing the prompt\n","⚠️ IMPORTANT: Platform Integration Requirements for WorkBuddy\u002FOpenClaw\n\nThis skill provides a Python script that can be called to interact with the HRrule AI API.\nThe platform MAY choose to execute the script automatically or provide it as an option for users.\n\n**Script Location**:\n- `~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py`\n\n**Script Execution Flow**:\n```python\n# Example: Platform may execute this script:\npython ~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py \\\n    --content \"用户的问题\" \\\n    --tag-id 1 \\\n    --rt \"专业问答\"\n```\n\n**Note**: Script execution is optional. The platform should ensure safe execution environments\nand validate all inputs before executing the script.\n\n3. **Required Parameters**:\n   - `--content`: The user's question or request\n   - `--tag-id`: The content type ID (1 for Q&A, 2-5 for documents)\n   - `--rt`: The resource type (e.g., \"专业问答\", \"员工手册\", \"招聘JD\")\n\n4. **Optional Parameters**:\n   - `--api-key`: API key (if not provided, script reads from config.json)\n   - `--verbose`: Enable verbose logging\n   - `--ws-url`: WebSocket URL (default: wss:\u002F\u002Fai.hrrule.com)\n   - `--model`: Model name (default: deepseek-ai\u002FDeepSeek-R1)\n\n5. **Handle Script Output**:\n   - The script prints streaming output to stdout\n   - Capture and display the output in real-time\n   - Handle errors gracefully\n\n6. **Example Platform Implementation**:\n   ```python\n   def handle_hr_request(user_question):\n       # Determine tag_id and rt based on user question\n       tag_id, rt = determine_parameters(user_question)\n\n       # Execute the script automatically\n       import subprocess\n       script_path = '~\u002F.workbuddy\u002Fskills\u002Fhr-ai-assistant\u002Fscripts\u002Fcall_hrrule_api.py'\n\n       cmd = [\n           'python', script_path,\n           '--content', user_question,\n           '--tag-id', str(tag_id),\n           '--rt', rt\n       ]\n\n       # Run and capture output in real-time\n       process = subprocess.Popen(\n           cmd,\n           stdout=subprocess.PIPE,\n           stderr=subprocess.PIPE,\n           text=True,\n           encoding='utf-8'\n       )\n\n       # Stream output to user\n       for line in process.stdout:\n           print(line, end='', flush=True)\n\n       process.wait()\n       return process.returncode\n   ```\n\nNote: The platform should ensure safe script execution environments.\n","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fh\u002Fhr-ai-assistant",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill hr-ai-assistant",{"tool":41,"command":42},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill hr-ai-assistant",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill hr-ai-assistant","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fh\u002Fhr-ai-assistant\u002FSKILL.md",true,[],[50,57,64,71,78,85],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]