plugins/tools/cortex/skills/cortex-cron/SKILL.md
注册 cortex 周期任务 (lint/fold/dashboard) 到 launchd/cron/GHA; dry-run + 确认; 支持 uninstall。仅显式触发。
npx skillsauth add lazygophers/ccplugin cortex-cronInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
把 cortex 维护脚本注册到系统级定时器, 走 claude --bare -p 编程式调用。
~/Library/LaunchAgents/dev.lazygophers.cortex.<job>.plist~/.config/systemd/user/cortex-<job>.{service,timer}) 或 crontab 行$CI env) → 输出 GHA workflow yaml, 不自动写cron daemon 不继承 shell 环境, 故 snippet 中 PLUGIN_ROOT 必须是绝对路径字符串, 而非 ${PLUGIN_ROOT} 占位。install_cron.sh 按下列优先级解析:
--plugin-root <path> 命令行覆盖$CORTEX_INSTALL_PATH 环境变量~/.claude/plugins/marketplaces/ccplugin-market/plugins/tools/cortex (主, 默认)~/.config/claude/plugins/marketplaces/ccplugin-market/plugins/tools/cortex (XDG 兜底)$CLAUDE_PLUGIN_ROOT (CC 主线注入)源码路径 (
/Users/foo/persons/.../plugins/tools/cortex) 仅适合本地开发, cron 上下文不可达。优先用 marketplace 安装路径。
| Job | 时机 | 命令 (snippet 中已替换为绝对路径) |
|-----|------|------|
| lint | daily 01:00 | <PLUGIN_ROOT>/scripts/cron/lint.sh |
| fold | weekly Sun 02:00 | <PLUGIN_ROOT>/scripts/cron/fold.sh |
| dashboard | weekly Sun 02:30 | <PLUGIN_ROOT>/scripts/cron/dashboard.sh |
其中 <PLUGIN_ROOT> 通常为 ~/.claude/plugins/marketplaces/ccplugin-market/plugins/tools/cortex。
每脚本走 claude --bare --no-session-persistence --settings ~/.claude/settings.glm-4.5-flash.json -p "...", 见 research/01-claude-code-programmatic.md §E。
| 子命令 | 行为 |
|--------|------|
| cortex-cron install [job] | dry-run 显示要写入的 plist/crontab, 调 AskUserQuestion 确认后落盘 |
| cortex-cron status | 列已注册任务 (launchctl list / systemctl --user list-timers / crontab -l 过滤) |
| cortex-cron uninstall [job] | 卸载指定 job 或全部 |
| cortex-cron run <job> | 立即手跑一次 (调试用) |
AskUserQuestion 工具询问: "确认写入此 snippet?" options: 写入 / 取消 / 改时间; 用户选 写入 才落盘。--allowed-tools "Bash Read Glob", 不让 LLM 误改 vault。--fix 类操作不进 cron。scripts/cron/run.sh 提供 flock -n + timeout 600。~/.claude/settings.json。$CI 时只打印 GHA yaml, 不真写。cortex-cron uninstall # 卸载全部 cortex.* 任务
cortex-cron uninstall lint # 仅卸载 lint
$ cortex-cron install lint
[dry-run] launchd plist:
~/Library/LaunchAgents/dev.lazygophers.cortex.lint.plist
schedule: 01:00 daily
command: bash ${PLUGIN_ROOT}/scripts/cron/lint.sh --vault /Users/foo/obsidian
[调 AskUserQuestion: "确认写入此 plist 到 launchd?" → 写入 / 取消 / 改时间]
用户选 "写入":
✓ written. 加载: launchctl load ~/Library/LaunchAgents/dev.lazygophers.cortex.lint.plist
tools
UI/UX 与布局设计——做界面布局/结构/导航/组件/交互的设计决策。触发:做UI/UX/布局/排版/导航/组件/交互/栅格/响应式/图表选型/字体配对。按媒介路由 HTML/Web、原生 App(iOS/Android/桌面)、CLI、TUI。需后端动态系统不适用;配色/主题/色板走姊妹 skill design-color。
tools
主题与配色设计——做颜色搭配/调色板/主题/品牌色阶/暗模式的设计决策。触发:选配色/调色/主题/色板/品牌色/暗模式/对比度/色盲/UI风格。按媒介路由 HTML/Web(CSS变量)、原生App(平台token)、CLI(ANSI)、TUI(真彩/256/16降级)。保证可访问性(对比度/色盲安全)。需后端动态系统不适用;UI/UX 布局/组件/交互走姊妹 skill design-uiux。
tools
跨任意组件(plugin/skill/agent/command)的验证驱动优化循环纪律 skill。当用户要优化某个已有组件却无明确方向、或要防止改了反而更差(自评乐观偏差 / 多维同改归因失效 / 为凑分加废话膨胀)、或要把一套通用「评分→单变量改→改后验证严格更好才留否则回滚→触顶停」的纪律套到任意组件上时使用。管优化过程本身的纪律(validation gate / ratchet / 独立验证 / 触顶停),不评单组件深度(交 skill-dev),不查插件接线(交 plugin-dev)。仅手动 /optimize-any 触发。
data-ai
两层规则记忆 (基于 .skein/spec)。planning 时 recall 召回相关规则、task finish 后 sediment 沉淀学习 + prune 自动精简过期/重复/断链规则。core 常驻硬规 + recall 按需召回, 经判定门自动写盘 (不逐次问用户)。产出 .skein/spec 下 core/recall 规则文件 + index。另支持空仓 bootstrap 播种规则基线、记忆大面积失效 (大重构/换栈) 时 reconstruct 可逆归档后按项目类型分型重建、maintain 手动体检 (超预算/stale/断链/重复/废弃, --apply 自动修复)、auto-fix (Stop hook 写 .pending-fix 标记 → main 派 skein-specer bg 跑 maintain --apply 全自动修, 断链只报告)。