FarmOS Workforce
Employee profiles, time clock, skills tracking, employee requests, and team calendar.
When to Use This
What this skill handles: Time clock (clock in/out), schedules, availability, time-off requests, certifications, employee profiles, overtime tracking, and payroll exports.
Trigger phrases: "I need [day] off", "who's working", "schedule", "clock in/out", "who's clocked in?", "overtime this week?", "any pending time-off requests?", "employee list", "CDL certifications"
What this does NOT handle: Task assignments or work orders (use farmos-tasks), equipment scheduling or maintenance (use farmos-equipment), pay rates or financial compensation questions (restricted to admin only via farmos-finance).
Minimum viable input: Any mention of schedule, availability, time off, or who is working. "I need Friday off" is enough.
Data Completeness
- 1. Always state the count of employees, time entries, or requests returned: "Found 8 active employees" or "12 time entries this pay period."
- Time entry queries are date-bounded — always include
start_date and end_date parameters to get the full picture for the requested period. - If an endpoint fails, report it — don't silently present empty results as "no employees" or "no time entries."
- For payroll exports, verify the date range covers the full pay period before exporting.
Authentication
This skill accesses protected FarmOS endpoints that require a JWT token.
To get a token:
CODEBLOCK0
Role mapping: Check ~/.clawdbot/farmos-users.json for the sender's role.
- - admin/manager: Can see all employee data, hours, payroll info.
- employee: Can only see own profile and time entries. Do NOT use a manager token for employee queries — use the employee token so the API scopes correctly.
API Base
http://100.102.77.110:8006
Integration Endpoints (No Auth)
Employee List (for assignments)
GET /api/integration/employees
Returns: All employees with id, name, role. Use for task assignment dropdowns.
Active Employees
GET /api/integration/employees/active
Returns: Currently active employees only.
Authenticated Endpoints (JWT Required)
Employee Profiles
GET /api/employees — List all employees (manager+)
GET /api/employees/{id} — Employee detail (manager+ or own profile)
GET /api/employees/me — Current user's profile
Time Clock
POST /api/time/clock-in — Clock in (with optional GPS)
POST /api/time/clock-out — Clock out
GET /api/time/status — Current clock status for user
GET /api/time/entries?start
date=2026-02-01&enddate=2026-02-13 — Time entries
Timesheet Approval (Manager)
POST /api/time/entries/{id}/approve — Approve timesheet entry
GET /api/time/export?start
date=2026-02-01&enddate=2026-02-13&format=csv — Payroll export
Employee Requests
POST /api/requests — Submit time off/leave request
GET /api/requests/my — My requests
GET /api/requests/pending — Pending approvals (manager)
POST /api/requests/{id}/approve — Approve
POST /api/requests/{id}/reject — Reject with reason body: {"reason": "..."}
Calendar
GET /api/calendar/events?start=2026-02-01&end=2026-02-28 — Team calendar
Skills & Certifications
GET /api/skills — Skill definitions
GET /api/employees/{id}/skills — Employee's skills and certifications
Usage Notes
- - Time entries include GPS coordinates if the employee clocked in from the field.
- Overtime calculation: hours over 40/week.
- Payroll export generates CSV compatible with common payroll systems.
- Skills have expiry dates — flag any certifications expiring within 30 days.
- NEVER share employee pay rates, hours, or personal info with other employees. Only managers and admins can see team-wide data.
Conversational Schedule Capture
Crew members communicate schedule needs casually. Recognize these patterns and capture them without making it feel like paperwork.
Capture Patterns
| What They Say | What It Is | Action |
|---|
| "I need Thursday afternoon off" | Time-off request | Log time-off, notify manager |
| "I can come in early tomorrow" |
Availability note | Log availability change |
| "I'll be late Monday, doctor appointment" | Schedule note | Log late arrival, note reason |
| "Can I swap shifts with Jake on Friday?" | Shift swap request | Route to Brian/manager for approval |
| "I'm not going to be able to make it Saturday" | Absence notification | Log absence, notify manager |
| "I've got a thing next Wednesday" | Vague time-off | Log it — don't ask what "thing" is |
Bot Behavior
Extract from message:
- - Who (from Slack user identity or name mention)
- When (day, date, time range)
- How long (half day, full day, a few hours)
- Reason (ONLY if volunteered — NEVER ask "what kind of appointment?")
Response pattern:
- - Confirm what you understood: "Got it — flagging Thursday afternoon off for you."
- Tell them it's visible: "Brian will see it in the schedule."
- If unclear timing, ask ONE clarifying question: "Need the whole afternoon or just leaving early?"
- NEVER interrogate about reasons. "Appointment" is sufficient. Period.
Routing:
- - Log to workforce module API (POST /api/requests for time-off, use appropriate endpoint for availability)
- Notify in #farm-workforce channel for visibility
- For swap requests: notify both parties and Brian
Availability Updates
When crew mentions availability changes mid-conversation (not a formal request), still capture it:
- - "I might be able to work this Saturday if you need me" → log as tentative availability
- "My kid has a game Friday evening so I need to leave by 3" → log early departure
- "I can stay late tonight if we need to finish" → log extended availability
FarmOS Workforce
员工档案、考勤打卡、技能追踪、员工请求和团队日历。
使用场景
此技能处理的内容: 考勤打卡(签到/签退)、排班、可用性、请假申请、资质认证、员工档案、加班追踪和工资导出。
触发短语: 我需要休[某天]假、谁在上班、排班、签到/签退、谁已签到?、这周加班情况?、有未处理的请假申请吗?、员工列表、CDL认证
此技能不处理的内容: 任务分配或工单(请使用farmos-tasks)、设备排程或维护(请使用farmos-equipment)、薪资或财务补偿问题(仅限管理员通过farmos-finance处理)。
最小有效输入: 任何提及排班、可用性、请假或谁在上班的内容。我周五需要请假就足够了。
数据完整性
- 1. 始终说明数量 返回的员工、工时记录或请求数量:找到8名在职员工或本薪资周期有12条工时记录。
- 工时查询有日期范围限制 — 始终包含startdate和enddate参数以获取所请求期间的完整信息。
- 如果端点失败,请报告 — 不要默默地将空结果显示为没有员工或没有工时记录。
- 对于工资导出,在导出前确认日期范围覆盖整个薪资周期。
身份验证
此技能访问需要JWT令牌的受保护FarmOS端点。
获取令牌:
bash
TOKEN=$(~/clawd/scripts/farmos-auth.sh manager)
角色映射: 检查~/.clawdbot/farmos-users.json以获取发送者的角色。
- - 管理员/经理: 可以查看所有员工数据、工时、工资信息。
- 员工: 只能查看自己的档案和工时记录。不要对员工查询使用经理令牌 — 使用员工令牌以便API正确限定范围。
API基础地址
http://100.102.77.110:8006
集成端点(无需认证)
员工列表(用于分配)
GET /api/integration/employees
返回:所有员工及其ID、姓名、角色。用于任务分配下拉菜单。
在职员工
GET /api/integration/employees/active
返回:仅当前在职员工。
认证端点(需要JWT)
员工档案
GET /api/employees — 列出所有员工(经理及以上)
GET /api/employees/{id} — 员工详情(经理及以上或本人档案)
GET /api/employees/me — 当前用户的档案
考勤打卡
POST /api/time/clock-in — 签到(可选GPS)
POST /api/time/clock-out — 签退
GET /api/time/status — 用户当前打卡状态
GET /api/time/entries?start
date=2026-02-01&enddate=2026-02-13 — 工时记录
工时审批(经理)
POST /api/time/entries/{id}/approve — 批准工时记录
GET /api/time/export?start
date=2026-02-01&enddate=2026-02-13&format=csv — 工资导出
员工请求
POST /api/requests — 提交请假/休假请求
GET /api/requests/my — 我的请求
GET /api/requests/pending — 待审批请求(经理)
POST /api/requests/{id}/approve — 批准
POST /api/requests/{id}/reject — 拒绝,需附理由:{reason: ...}
日历
GET /api/calendar/events?start=2026-02-01&end=2026-02-28 — 团队日历
技能与认证
GET /api/skills — 技能定义
GET /api/employees/{id}/skills — 员工的技能和认证
使用说明
- - 如果员工从现场签到,工时记录包含GPS坐标。
- 加班计算:每周超过40小时的部分。
- 工资导出生成与常见工资系统兼容的CSV文件。
- 技能有到期日期 — 标记30天内到期的任何认证。
- 切勿与其他员工分享员工的薪资、工时或个人资料。只有经理和管理员可以查看团队范围的数据。
对话式排班信息采集
团队成员以非正式方式表达排班需求。识别这些模式并以不让人感觉像填表格的方式采集信息。
采集模式
| 他们说的话 | 这是什么 | 操作 |
|---|
| 我周四下午需要请假 | 请假请求 | 记录请假,通知经理 |
| 我明天可以早来 |
可用性备注 | 记录可用性变更 |
| 我周一要迟到,有医生预约 | 排班备注 | 记录迟到,注明原因 |
| 我周五可以和Jake换班吗? | 换班请求 | 转给Brian/经理审批 |
| 我周六去不了了 | 缺勤通知 | 记录缺勤,通知经理 |
| 我下周三有点事 | 模糊请假 | 记录下来 — 不要问什么事 |
机器人行为
从消息中提取:
- - 谁(根据Slack用户身份或提及的姓名)
- 何时(天、日期、时间范围)
- 多久(半天、全天、几小时)
- 原因(仅当对方主动提供 — 绝不问什么类型的预约?)
回复模式:
- - 确认你理解的内容:收到 — 已为你标记周四下午请假。
- 告知他们这是可见的:Brian会在排班中看到。
- 如果时间不明确,问一个澄清问题:需要整个下午还是只是早退?
- 绝不追问原因。预约就足够了。句号。
路由:
- - 记录到劳动力模块API(请假用POST /api/requests,可用性用相应端点)
- 在#farm-workforce频道通知以便可见性
- 对于换班请求:通知双方和Brian
可用性更新
当团队成员在对话中提及可用性变更(非正式请求)时,仍然记录下来:
- - 如果你需要,我这周六可能可以上班 → 记录为暂定可用性
- 我孩子周五晚上有比赛,所以我需要3点离开 → 记录早退
- 如果需要完成工作,我今晚可以加班 → 记录延长可用性