skills-experimental/cron-expression-parser/SKILL.md
Parse and evaluate 5-field cron expressions. Compute next run time, validate expressions, convert to human-readable format. Use when: - Creating or validating cron scheduled tasks - Computing next fire time for a cron expression - Converting cron to human-readable description - Checking if a cron task should fire now Keywords: cron, schedule, next run, cron expression, parse cron, cron validation
npx skillsauth add bianhaifeng789-hue/openclaw-config cron-expression-parserInstall 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.
基于 Claude Code utils/cron.ts 的 5 字段 cron 表达式解析器。
格式: M H DoM Mon DoW
字段: minute(0-59) hour(0-23) day-of-month(1-31) month(1-12) day-of-week(0-6, 0=Sunday)
支持:
* → 所有值
N → 具体值(如 5)
*/N → 步长(如 */5 = 每5个)
N-M → 范围(如 9-17)
N-M/S → 范围+步长(如 0-30/5)
N,M,... → 列表(如 1,3,5)
不支持: L, W, ?, 月份/星期名称别名
时区: 进程本地时区
function parseCronExpression(expr) {
const fields = expr.trim().split(/\s+/)
if (fields.length !== 5) return null
const ranges = [
{ min: 0, max: 59 }, // minute
{ min: 0, max: 23 }, // hour
{ min: 1, max: 31 }, // day-of-month
{ min: 1, max: 12 }, // month
{ min: 0, max: 6 }, // day-of-week (0=Sunday, 7=Sunday alias)
]
const parsed = fields.map((f, i) => expandField(f, ranges[i]))
if (parsed.some(f => f === null)) return null
return {
minute: parsed[0],
hour: parsed[1],
dayOfMonth: parsed[2],
month: parsed[3],
dayOfWeek: parsed[4],
}
}
// 从 fromMs 开始,找下一个匹配时间(精确到分钟)
function computeNextCronRun(expr, fromMs = Date.now()) {
const fields = parseCronExpression(expr)
if (!fields) return null
// 从下一分钟开始搜索(不含当前分钟)
let t = new Date(fromMs)
t.setSeconds(0, 0)
t.setMinutes(t.getMinutes() + 1)
// 最多搜索 4 年(避免无限循环)
const limit = new Date(fromMs)
limit.setFullYear(limit.getFullYear() + 4)
while (t < limit) {
if (
fields.month.includes(t.getMonth() + 1) &&
fields.dayOfMonth.includes(t.getDate()) &&
fields.dayOfWeek.includes(t.getDay()) &&
fields.hour.includes(t.getHours()) &&
fields.minute.includes(t.getMinutes())
) {
return t.getTime()
}
t.setMinutes(t.getMinutes() + 1)
}
return null
}
// 转换为人类可读描述
function cronToHuman(expr) {
const examples = {
'* * * * *': '每分钟',
'*/5 * * * *': '每 5 分钟',
'0 * * * *': '每小时整点',
'0 9 * * *': '每天 09:00',
'0 9 * * 1-5': '工作日 09:00',
'0 9 * * 1': '每周一 09:00',
'0 0 1 * *': '每月 1 日 00:00',
}
return examples[expr] ?? `cron: ${expr}`
}
// 验证并计算下次触发
const expr = '0 9 * * 1-5'
const fields = parseCronExpression(expr)
// → { minute: [0], hour: [9], dayOfMonth: [1..31], month: [1..12], dayOfWeek: [1,2,3,4,5] }
const nextRun = computeNextCronRun(expr, Date.now())
// → 下个工作日 09:00 的时间戳
const human = cronToHuman(expr)
// → "工作日 09:00"
| 表达式 | 含义 |
|--------|------|
| * * * * * | 每分钟 |
| */5 * * * * | 每 5 分钟 |
| 0 * * * * | 每小时 |
| 0 9 * * * | 每天 9 点 |
| 0 9 * * 1-5 | 工作日 9 点 |
| 0 9 * * 1 | 每周一 9 点 |
| 0 0 1 * * | 每月 1 日 |
| 30 14 28 2 * | 2 月 28 日 14:30(一次性用) |
business
IAA 日报飞书输出能力。 支持把固定 CSV 模板一键转换成: - 中文运营结论 - 飞书卡片 JSON - 飞书发送载荷 Use when: - 需要把 IAA 日报直接发到飞书 - 需要从 CSV 一键生成运营日报
data-ai
IAA日报分析模型 功能: - 渠道日报自动分析 - 小时级+日级ROI联动判断 - 按地区输出加量/降量/停投建议 - 按产品类型输出阈值 - 自动识别利润区/观察区/止损区 Use when: - 分析每天投放数据 - 生成运营日报结论 - 判断是否加量/降量/停投 - 对比美加澳/日韩表现 Keywords: - 日报模型, 投放日报, 加量, 降量, 停投, ROI日报, 分地区分析
data-ai
IAA固定日报分析模板 功能: - 固定字段模板(可直接贴每天数据) - 自动输出总盘结论 - 自动输出美加澳/日韩结论 - 自动给出加量/降量/停投建议 - 适配文件修复/清理两类产品 Use when: - 需要固定日报格式 - 每天复盘渠道表现 - 给运营团队出统一结论 Keywords: - 固定模板, 日报模板, ROI模板, IAA日报, 运营模板
development
# HyperlinkPool Pattern Skill HyperlinkPool Pattern - HyperlinkPool class + strings array + stringMap + Index 0 no hyperlink + intern(hyperlink) + get(id) + undefined handling + 5-minute reset + OSC8 hyperlink interning。 ## 功能概述 从Claude Code的ink/screen.ts提取的HyperlinkPool模式,用于OpenClaw的OSC8超链接池管理。 ## 核心机制 ### HyperlinkPool Class ```typescript export class HyperlinkPool { private strings: string[] = [''] // Index 0 = no hyperlink private stringMap = new Map<string, number>() // strings