基于 skill-template 脚手架开发,包含: - payroll_config(费率配置,可编辑)+ payslip_snapshots(解析历史,只读)2 张业务表 - 全国默认 + 北上广 4 套费率(社保/公积金/个税起征点/7 级税率表) - 5 个业务 Action:calculate-payslip-simple / calculate-payslip-full / explain-term / view-config / edit-config - 个税累计预扣法计算,支持多月历史累加 - 20 个薪资名词库(社保/公积金/个税/全勤/加班费等) - 完整市场文档(README/TUTORIAL/DEMO/CHANGELOG) - 296 测试全部通过
20 lines
710 B
Python
20 lines
710 B
Python
"""技能配置初始化:.env.example 落盘与用户 .env 缺失项合并。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
|
|
from jiangchang_skill_core import config
|
|
|
|
from util.constants import SKILL_SLUG, SKILL_VERSION
|
|
from util.runtime_paths import get_skill_root
|
|
|
|
|
|
def bootstrap_skill_config() -> str:
|
|
"""确保用户数据目录 .env 存在,并追加 .env.example 中的新配置项。"""
|
|
example_path = os.path.join(get_skill_root(), ".env.example")
|
|
env_path = config.ensure_env_file(SKILL_SLUG, example_path)
|
|
comment = f"{SKILL_SLUG} v{SKILL_VERSION}" if SKILL_VERSION else None
|
|
config.merge_missing_env_keys(example_path, env_path, comment_skill=comment)
|
|
return env_path
|