v1.0.1: 合同到期智能预警与续聘辅助 - 初版骨架

基于匠厂 skill-template 主仓 v1.0.108 派生的业务技能。

核心业务:
- 每日凌晨定时扫描全校教职工合同电子台账
- 距到期日 90 / 60 / 30 天分级预警(黄 / 橙 / 红)
- 自动生成个人版《续聘准备任务书》与单位版《本月到期人员清单》
- 30 天红色预警自动抄送分管校领导

输出形态:
- 个人版 HTML 任务书 + 单位版 PDF 清单 + 三级预警通知

预期提效:因合同逾期未续签导致的劳动纠纷降为 0;人事处年终集中突击签合同的工作量减少 60%。

业务行生命周期:可续聘 → 预警中(黄 / 橙 / 红)→ 已续签 / 已驳回 / 已过期

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
2026-09-14 12:19:11 +08:00
commit e2b45d690e
21 changed files with 1502 additions and 0 deletions

119
assets/actions.json Normal file
View File

@@ -0,0 +1,119 @@
{
"schemaVersion": 1,
"skill": "alert-contract-expiring-hr",
"actions": [
{
"id": "health",
"label": "运行检查",
"description": "检查技能运行环境、人事系统 API 连通性、考核数据接口可用性。",
"placements": ["skill-detail", "agent"],
"executionProfile": "sync",
"entrypoint": {
"type": "cli",
"command": "health",
"args": []
}
},
{
"id": "version",
"label": "查看版本",
"description": "返回技能版本和机器标识。",
"placements": ["skill-detail"],
"executionProfile": "sync",
"entrypoint": {
"type": "cli",
"command": "version",
"args": []
}
},
{
"id": "config-path",
"label": "查看配置位置",
"description": "返回技能配置文件位置。",
"placements": ["skill-detail"],
"executionProfile": "sync",
"entrypoint": {
"type": "cli",
"command": "config-path",
"args": []
}
},
{
"id": "scan-expiring-contracts",
"label": "扫描即将到期合同",
"description": "扫描全校教职工合同电子台账,对距到期日 90/60/30 天的合同分别给出黄/橙/红三级预警,并自动生成个人任务书与单位清单。",
"placements": ["cron", "agent", "toolbar"],
"executionProfile": "async",
"bind": {
"tables": ["合同台账"]
},
"entrypoint": {
"type": "cli",
"command": "scan-expiring-contracts",
"args": ["--thresholds", "90,60,30"]
}
},
{
"id": "generate-renewal-task",
"label": "生成续聘任务书",
"description": "为指定合同对应的教师生成个人版《续聘准备任务书》(HTML + 通知推送),含近三年业绩摘要、AI 续聘建议、所需材料清单。",
"placements": ["row", "agent"],
"executionProfile": "sync",
"bind": {
"tables": ["合同台账"],
"selectionMode": "required",
"labelColumn": "教职工姓名"
},
"entrypoint": {
"type": "cli",
"command": "generate-renewal-task",
"args": ["--contract-id", "{row.合同ID}"]
}
},
{
"id": "dispatch-task-notice",
"label": "下发续聘任务通知单",
"description": "按二级单位或按月份生成单位版《本月合同到期人员清单及续聘建议》并推送给人事秘书。",
"placements": ["batch", "agent"],
"executionProfile": "sync",
"bind": {
"tables": ["合同台账", "预警记录"],
"selectionMode": "optional"
},
"entrypoint": {
"type": "cli",
"command": "dispatch-task-notice",
"args": ["--unit-id", "{form.unit_id}", "--month", "{form.month}"]
}
},
{
"id": "mark-contract-renewed",
"label": "标记合同已续签",
"description": "将指定合同标记为已续签(须上传续签材料),并自动解除预警。",
"placements": ["row"],
"executionProfile": "sync",
"bind": {
"tables": ["合同台账"],
"selectionMode": "required",
"labelColumn": "教职工姓名"
},
"entrypoint": {
"type": "cli",
"command": "mark-contract-renewed",
"args": ["--contract-id", "{row.合同ID}", "--material-id", "{form.material_id}"]
}
},
{
"id": "render-html",
"label": "在浏览器中打开续聘任务书",
"description": "渲染已生成的个人版《续聘准备任务书》HTML 页面,宿主 iframe 预览。",
"placements": ["skill-detail", "agent"],
"executionProfile": "sync",
"entrypoint": {
"type": "cli",
"command": "render-html",
"args": ["--task-id", "{form.task_id}"]
}
}
]
}

View File

@@ -0,0 +1,118 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<title>{{TITLE}}</title>
<style>
/* 数据管理 iframe 预览布局基线 */
html, body {
margin: 0;
padding: 16px;
font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
color: #1f2329;
background: #fafbfc;
line-height: 1.6;
}
.report { max-width: 100%; }
.header {
padding: 20px;
background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
color: #fff;
border-radius: 8px;
margin-bottom: 16px;
}
.header h1 { margin: 0 0 8px; font-size: 22px; }
.header .meta { color: #dbeafe; font-size: 13px; }
.info-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 12px;
margin-bottom: 16px;
}
.info-card {
padding: 12px 16px;
background: #fff;
border: 1px solid #e5e6eb;
border-radius: 8px;
}
.info-card .label { color: #8c959f; font-size: 12px; }
.info-card .value { font-size: 16px; font-weight: 600; margin-top: 4px; word-break: break-word; }
.section {
padding: 16px 20px;
background: #fff;
border: 1px solid #e5e6eb;
border-radius: 8px;
margin-bottom: 16px;
}
.section h2 { margin: 0 0 12px; font-size: 16px; color: #1e3a8a; }
.summary-text { white-space: pre-wrap; color: #4e5969; }
.ai-suggestion {
padding: 14px 18px;
border-left: 4px solid #3b82f6;
background: #eff6ff;
border-radius: 4px;
color: #1e40af;
}
.ai-suggestion.renew { border-left-color: #059669; background: #ecfdf5; color: #065f46; }
.ai-suggestion.observe { border-left-color: #d97706; background: #fffbeb; color: #92400e; }
.ai-suggestion.non-renew { border-left-color: #c53030; background: #fef2f2; color: #991b1b; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
padding: 8px 0;
border-bottom: 1px solid #f0f1f3;
display: flex;
align-items: center;
gap: 8px;
}
.checklist li:last-child { border-bottom: 0; }
.checklist .box {
width: 16px; height: 16px;
border: 1px solid #cbd5e1;
border-radius: 3px;
flex-shrink: 0;
}
.footer { margin-top: 16px; color: #8c959f; font-size: 12px; text-align: right; }
</style>
</head>
<body>
<div class="report">
<div class="header">
<h1>{{TITLE}}</h1>
<div class="meta">任务编号:{{TASK_ID}} · 生成时间:{{GENERATED_AT}}</div>
</div>
<div class="info-grid">
<div class="info-card"><div class="label">教职工姓名</div><div class="value">{{TEACHER_NAME}}</div></div>
<div class="info-card"><div class="label">工号</div><div class="value">{{EMPLOYEE_ID}}</div></div>
<div class="info-card"><div class="label">所在单位</div><div class="value">{{UNIT_NAME}}</div></div>
<div class="info-card"><div class="label">聘任岗位</div><div class="value">{{POSITION}}</div></div>
<div class="info-card"><div class="label">合同类型</div><div class="value">{{CONTRACT_TYPE}}</div></div>
<div class="info-card"><div class="label">合同起止</div><div class="value">{{CONTRACT_START}} ~ {{CONTRACT_END}}</div></div>
<div class="info-card"><div class="label">距到期日</div><div class="value">{{DAYS_TO_EXPIRE}} 天</div></div>
<div class="info-card"><div class="label">预警等级</div><div class="value">{{ALERT_LEVEL}}</div></div>
</div>
<div class="section">
<h2>近三年工作业绩摘要</h2>
<div class="summary-text">{{PERFORMANCE_SUMMARY}}</div>
</div>
<div class="section">
<h2>AI 续聘建议</h2>
<div class="ai-suggestion {{SUGGESTION_CLASS}}">
<strong>{{SUGGESTION_LABEL}}</strong><br />
{{SUGGESTION_REASON}}
</div>
</div>
<div class="section">
<h2>所需材料清单(请于 {{DEADLINE}} 前备齐)</h2>
<ul class="checklist">
{{CHECKLIST_BODY}}
</ul>
</div>
<div class="footer">本任务书由「合同到期智能预警与续聘辅助」技能自动生成 · 最终续聘决定权归人事处</div>
</div>
</body>
</html>