执行教务系统查询并直接返回结果。优先按用户原话理解需求,不要把老师、学期、输出样式写死。
这个 skill 的正确分工是:
也就是说,用户应该直接说:
然后由 agent:
不要把 CLI 命令当作对用户的主入口。CLI 只是底层执行接口。
对 agent 而言,脚本应该被当作“执行接口”而不是“交互界面”:
优先用这个 skill 处理以下需求:
exam_all 聚合查询)如果用户只说“查考试安排”,优先用 exam_all。
course_schedule:课程表invigilation:考务安排 / 监考安排exam_course_arrangement:课程考试安排查询exam_info:考试信息查询exam_all:考试相关总查询(聚合考试类入口)查询类型细节见 references/query-types.md。
优先按下面这种方式理解并处理用户请求:
处理原则:
当用户说“添加老师”“录入老师账号”“记住某老师账号密码”时:
若本地还没有学校 URL → 先追问:
https://jwgl.example.edu.cn。”若有多所学校且老师未明确属于哪所学校 → 追问:
缺老师名 → 追问:
缺账号 → 追问:
缺密码 → 追问:
邮箱/手机号 → 明确视为可选项,默认不追问;只有用户主动提到时才保存
老师已存在 → 不直接覆盖,先确认:
保存完成后 → 可补一句:
当用户说“添加学校”“保存学校 URL”“修改学校地址”“删除学校 URL”“设为当前学校”时:
新增学校时缺学校名 → 追问:
新增学校时缺 URL → 追问:
https://jwgl.example.edu.cn。”只给学校 URL,没给登录页 URL → 默认拼成 {base_url}/jsxsd/framework/jsMain.jsp,一般不额外追问
学校已存在 → 不直接覆盖,先确认:
脚本参数兼容
--school 或旧写法 --name--teacher 或旧写法 --name删除学校 URL
设置当前学校
当用户说“删除老师”“删掉某老师信息”时:
缺老师名 → 追问:
老师名明确 → 必须二次确认:
只有得到明确确认(如“是”“确认”“删除”)后才执行
删除后明确告知结果;若影响 current_teacher,也要说明
当用户说“设为当前老师”“默认用某老师”时:
老师名明确 → 直接设置
老师名不明确 → 追问:
若该老师尚未保存账号信息,先提示录入,不要假设存在
当用户发起查询时:
current_school,优先使用当前学校如果已有 current_teacher,优先默认使用当前老师,并可简短说明
如果没有 current_teacher,追问:
2025-2026-2。”区分三种情况:
当用户问“现在有哪些老师”“列出老师账号”时:
推荐格式:
如果为空:
当查到课表时:
推荐格式:
08:00-09:40
如果用户问“今天还有什么课”或“明天课表”,优先只返回对应日期的子集,不把整周都贴出来。
当查到考试相关数据时:
先一句总结:
再按条目列出关键字段,例如:课程名称、考试时间、考场、类别、考生数
若 exam_all 返回多类结果,可按 query_type 分组摘要:
当底层成功返回 count=0 时,不要说“报错”,应明确说:
如果条件可能有问题,可追加:
当底层返回结构化错误或执行失败时:
缺老师账号(例如 MISSING_TEACHER_CREDENTIALS)
老师不存在(例如 TEACHER_NOT_FOUND)
老师已存在(例如 TEACHER_ALREADY_EXISTS)
缺少必要字段(例如 MISSING_REQUIRED_FIELDS / MISSING_TEACHER_NAME)
页面结构 / 系统异常
除非用户明确要求调试细节,否则不要直接把 traceback 或 CLI 原文贴给用户。
在 skill 根目录执行底层脚本时,可使用:
bash
# 可手动初始化环境(首次拉取后)
bash scripts/setup.sh
# 查询执行(首次运行会自动补环境)
bash scripts/run.sh --config config.json --teacher "某老师" --term "2025-2026-2" --query-type exam_all --headless
bash scripts/run.sh --config config.json --teacher "某老师" --term "2025-2026-2" --query-type invigilation --headless
bash scripts/run.sh --config config.json --teacher "某老师" --term "2025-2026-2" --query-type exam_course_arrangement --headless
bash scripts/run.sh --config config.json --teacher "某老师" --term "2025-2026-2" --query-type exam_info --headless
bash scripts/run.sh --config config.json --teacher "某老师" --query-type course_schedule --headless
# 账号管理执行接口
python3 scripts/manage_accounts.py --config config.json list
python3 scripts/manage_accounts.py --config config.json add --teacher "某老师" --username "账号" --password "密码" --set-current
python3 scripts/manage_accounts.py --config config.json update --teacher "某老师" --password "新密码"
python3 scripts/manage_accounts.py --config config.json remove --teacher "某老师"
python3 scripts/manage_accounts.py --config config.json set-current --teacher "某老师"
python3 scripts/manage_accounts.py --config config.json school-list
python3 scripts/manage_accounts.py --config config.json school-add --school "某学校" --base-url "https://jwgl.example.edu.cn" --set-current
python3 scripts/manage_accounts.py --config config.json school-update --school "某学校" --base-url "https://jwgl.example.edu.cn"
python3 scripts/manage_accounts.py --config config.json school-remove --school "某学校"
python3 scripts/manage_accounts.py --config config.json school-set-current --school "某学校"
兼容旧写法(为了减少踩坑):
--school / --name--teacher / --name--username / --user / --account--password / --pass不要假设 scripts/*.sh 在安装后的 skill 目录里保留了可执行位。执行底层 shell 脚本时,优先使用 bash scripts/...。
调试探测脚本已放到 tools/,仅在诊断页面结构时使用,不作为主流程入口。
默认输出 JSON。
返回时:
--debug-dir账号管理的对外入口应是自然语言,例如:
agent 负责:
底层脚本仍保留,便于调试或手动执行:
bash
python3 scripts/manage_accounts.py --config config.json list
python3 scripts/manage_accounts.py --config config.json add
python3 scripts/manage_accounts.py --config config.json update
python3 scripts/manage_accounts.py --config config.json remove
python3 scripts/manage_accounts.py --config config.json set-current
若查询时未找到该老师账号:
config.json 中保存凭据,不要外发references/query-types.md 再调整对应 query config