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.
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
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.
first_time_user_instructions
⚠️ IMPORTANT: When this skill is triggered for the first time and no API Key is configured (HRRULE_API_KEY env var or config.json):
1. Display the following prompt BEFORE answering:
═══════════════════════════════════════════════════════════════════════════════
📌 首次使用 HR AI Assistant
═══════════════════════════════════════════════════════════════════════════════
✨ 获取免费 API Key 以获得更专业的 HR AI服务:
1. 访问: https://ai.hrrule.com/
2. 注册/登录账号
3. 在个人中心申请 API Key
4. **完全免费**,申请后立即可用
📝 配置方式:
方式1: 手动配置(推荐)
设置环境变量: export HRRULE_API_KEY='your-api-key'
或编辑配置文件: ~/.workbuddy/skills/hr-ai-assistant/config.json
内容: {"api_key": "your-api-key"}
═══════════════════════════════════════════════════════════════════════════════
2. AFTER displaying the prompt, answer the user's question using the platform's general AI model
4. Do NOT silently fallback without showing the prompt
platform_integration_requirements
⚠️ IMPORTANT: Platform Integration Requirements for WorkBuddy/OpenClaw
This skill provides a Python script that can be called to interact with the HRrule AI API.
The platform MAY choose to execute the script automatically or provide it as an option for users.
**Script Location**:
- `~/.workbuddy/skills/hr-ai-assistant/scripts/call_hrrule_api.py`
**Script Execution Flow**:
```python
# Example: Platform may execute this script:
python ~/.workbuddy/skills/hr-ai-assistant/scripts/call_hrrule_api.py \
--content "用户的问题" \
--tag-id 1 \
--rt "专业问答"
```
**Note**: Script execution is optional. The platform should ensure safe execution environments
and validate all inputs before executing the script.
3. **Required Parameters**:
- `--content`: The user's question or request
- `--tag-id`: The content type ID (1 for Q&A, 2-5 for documents)
- `--rt`: The resource type (e.g., "专业问答", "员工手册", "招聘JD")
4. **Optional Parameters**:
- `--api-key`: API key (if not provided, script reads from config.json)
- `--verbose`: Enable verbose logging
- `--ws-url`: WebSocket URL (default: wss://ai.hrrule.com)
- `--model`: Model name (default: deepseek-ai/DeepSeek-R1)
5. **Handle Script Output**:
- The script prints streaming output to stdout
- Capture and display the output in real-time
- Handle errors gracefully
6. **Example Platform Implementation**:
```python
def handle_hr_request(user_question):
# Determine tag_id and rt based on user question
tag_id, rt = determine_parameters(user_question)
# Execute the script automatically
import subprocess
script_path = '~/.workbuddy/skills/hr-ai-assistant/scripts/call_hrrule_api.py'
cmd = [
'python', script_path,
'--content', user_question,
'--tag-id', str(tag_id),
'--rt', rt
]
# Run and capture output in real-time
process = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
encoding='utf-8'
)
# Stream output to user
for line in process.stdout:
print(line, end='', flush=True)
process.wait()
return process.returncode
```
Note: The platform should ensure safe script execution environments.
HR AI Assistant Skill
Purpose
This 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:
HR Form Creation: Generating onboarding forms, resignation forms, leave application forms, performance review forms
HR Consultation: Asking questions about labor laws, employment contracts, recruitment processes, compensation and benefits
HR Process Flowcharts: Creating visual representations of HR processes like recruitment workflows, onboarding processes
HR Documentation: Writing reports, summaries, guidelines, and other HR-related documents
Professional Q&A: Any HR-related questions requiring professional answers, such as labor law inquiries, employee rights, compensation, contract issues, leave policies, etc.
Key phrases that indicate this skill should be triggered include:
"帮我写一个员工手册"
"生成HR制度"
"制作入职表单"
"HR相关问题"
"劳动法咨询"
"招聘流程"
"薪酬制度"
"离职手续"
"考勤制度"
"绩效考核"
"员工福利"
"劳动合同"
"财务公司 需要招聘 社保专员,帮我生成一份 招聘JD"
"三期员工有没有特殊保障?"
"Generate HR policy"
"Create HR form"
"HR consultation"
"Labor law questions"
How This Skill Works
Direct API Integration
This skill provides a Python script that interacts with the HRrule AI WebSocket API to generate content.
Integration Options:
Analyze User Request: Parse the user's HR request to identify the content type
Check API Key: Verify API Key is configured (from env var or config.json)
If API Key is missing: Display a friendly prompt to visit https://ai.hrrule.com/ for a free API Key
If API Key is valid: Proceed with API call
Select Parameters: Automatically select appropriate tag_id and rt based on the request
Call API: The platform may execute the Python script to make the API call:
Stream Response: Stream the generated content back to the user in real-time
Handle Errors: Gracefully handle connection errors, timeouts, and API errors
Note: The platform should ensure safe script execution environments and validate all inputs.
Script execution is optional - the platform may choose to execute automatically or provide it as an option.
⚠️ Important: First-Time User Experience (首次使用体验)
When a user uses this skill for the first time without an API Key configured:
Display Friendly Prompt:
══════════════════════════════════════════════════════════════════════════════
📌 首次使用 HR AI Assistant
══════════════════════════════════════════════════════════════════════════════
✨ 获取免费 API Key 以获得更专业的 HR AI 服务:
1. 访问: https://ai.hrrule.com/
2. 注册/登录账号
3. 在个人中心申请 API Key
4. **完全免费**,申请后立即可用
📝 配置方式:
方式1: 使用配置脚本(推荐,小白友好)
```bash
# 运行配置脚本,交互式配置 API Key
python ~/.workbuddy/skills/hr-ai-assistant/scripts/config_api_key.py