feat: 初始化高校人事请假考勤技能 (process-leave-attendance-default)
All checks were successful
技能自动化发布 / release (push) Successful in 15s

基于 skill-template 脚手架开发,包含:
- 5 张业务表(教职工、请假政策、考勤日历、请假记录、假期余额)
- 请假核算引擎(扣薪计算、审批层级判定、年假抵扣)
- CLI 入口(import-employees / calculate-leave / render-html)
- HTML 审批与扣薪报告生成
- 示例数据与完整测试套件(295 tests passed)
This commit is contained in:
chenfuqiang
2026-09-07 16:59:24 +08:00
commit ee2a4d9e22
206 changed files with 29510 additions and 0 deletions

150
assets/actions.json Normal file
View File

@@ -0,0 +1,150 @@
{
"schemaVersion": 1,
"skill": "process-leave-attendance-default",
"actions": [
{
"id": "health",
"label": "运行检查",
"description": "检查技能运行环境并返回结构化结果。",
"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": "import-employees",
"label": "导入教职工",
"description": "从输入目录「教职工库」选择 JSON,批量写入或更新教职工信息。",
"placements": ["toolbar", "agent", "skill-detail"],
"executionProfile": "sync",
"interaction": "form",
"bind": { "tables": ["employees"] },
"inputSchema": {
"type": "object",
"required": ["file"],
"properties": {
"file": {
"type": "string",
"title": "教职工库文件",
"description": "请选择 input/教职工库/ 下的 JSON。",
"format": "file",
"display_type": "file",
"pathRoot": "input/教职工库"
}
}
},
"entrypoint": {
"type": "cli",
"command": "import-employees",
"args": ["--file", "{{file}}"]
},
"steps": [{ "when": "afterSuccess", "do": "reloadTable" }]
},
{
"id": "calculate-leave",
"label": "请假核算",
"description": "按学校政策核算请假扣薪、审批层级,并更新考勤与假期余额。",
"placements": ["toolbar", "agent"],
"executionProfile": "sync",
"interaction": "form",
"bind": {
"tables": ["employees"],
"inputMapping": { "employee_id": "$row.$pk" }
},
"inputSchema": {
"type": "object",
"required": ["employee_id", "leave_type", "start_date", "end_date"],
"properties": {
"employee_id": { "type": "number", "title": "教职工编号", "readOnly": true },
"leave_type": {
"type": "string",
"title": "请假类型",
"enum": ["病假", "事假", "婚假", "丧假", "产假", "育假", "长期病假"],
"default": "病假"
},
"start_date": {
"type": "string",
"title": "开始日期",
"format": "date",
"display_type": "date"
},
"end_date": {
"type": "string",
"title": "结束日期",
"format": "date",
"display_type": "date"
},
"has_certificate": {
"type": "boolean",
"title": "是否附证件",
"default": false
},
"certificate_type": {
"type": "string",
"title": "证件类型(可选)",
"description": "如:三甲医院诊断书、结婚证等"
}
}
},
"entrypoint": {
"type": "cli",
"command": "calculate-leave",
"args": [
"--employee-id", "{{employee_id}}",
"--leave-type", "{{leave_type}}",
"--start-date", "{{start_date}}",
"--end-date", "{{end_date}}",
"--has-certificate", "{{has_certificate}}",
"--certificate-type", "{{certificate_type}}"
]
},
"steps": [
{ "when": "afterSuccess", "do": "reloadTable" },
{ "when": "afterSuccess", "do": "refreshCatalog" }
]
},
{
"id": "render-html",
"label": "生成请假报告",
"description": "将指定(或最近一次已完成)请假核算导出为 HTML 报告。",
"placements": ["toolbar", "agent", "skill-detail"],
"executionProfile": "sync",
"interaction": "form",
"bind": {
"tables": ["leave_requests"],
"inputMapping": { "request_id": "$row.$pk" }
},
"inputSchema": {
"type": "object",
"properties": {
"request_id": {
"type": "number",
"title": "请假记录编号(可选)",
"description": "留空则使用最近一次已完成核算。"
}
}
},
"entrypoint": {
"type": "cli",
"command": "render-html",
"args": ["--request-id", "{{request_id}}"]
},
"steps": [{ "when": "afterSuccess", "do": "refreshCatalog" }]
}
]
}