cron优秀实践专家(专业版)
FreeNo executable scriptsNot checkedcron优秀实践专家专业版是面向企业级场景的定时系统优秀实践完整指南。在免费版基础实践之上,专业版新增高级调度模式(cron表达式精确控制)、遗留系统迁移指南、并发控制规则、清理工自发化规则、完整陷阱库(15+类)五大高级能力,满足复杂生产环境的定时系统治理需求。Use when…
by thcjp418 installs in other catalogsAbout this skill
核心功能: 本技能提供结构化的工作流程和配置指引等能力。
cron优秀实践专家(专业版)
企业级定时系统治理。高级调度+遗留迁移+并发控制+清理工规则+完整陷阱库,方法论全覆盖。 将定时系统的治理经验沉淀为可复用的方法论。专业版在免费版基础实践之上,新增高级调度模式、遗留系统迁移、并发控制规则、清理工自动化、完整陷阱库五大高级能力,帮助企业建立可靠、可观测、可维护的定时系统.
架构总览
输入规范
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| input | string | 是 | cron优秀实践专家(专业版)处理的输入数据或指令 |
| options | object | 否 | 附加配置选项,如模式选择、格式偏好等 |
| callback_url | string | 否 | 异步处理完成后的回调通知URL |
┌──────────────────────────────────────────────────────────────┐
│ cron优秀实践专家 (专业版 PRO) │
├──────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ 自唤醒规则 │ │ 时区锁定 │ │ 提醒模式 │ │
│ │ (基础) │ │ (基础) │ │ (基础+高级) │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ 高级调度 │ │ 遗留迁移 │ │ 并发控制 │ │
│ │ ✅PRO │ │ ✅PRO │ │ ✅PRO │ │
│ │ cron精确控制 │ │ 多平台迁移 │ │ 锁机制 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │ │ │ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ 清理工规则 │ │ 完整陷阱库 │ │ SLA保障 │ │
│ │ ✅PRO │ │ ✅PRO │ │ ✅PRO │ │
│ │ 自动归档 │ │ 15+类陷阱 │ │ 故障恢复 │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└──────────────────────────────────────────────────────────────┘
初学指南
- 阅读## 核心能力章节了解skill功能
- 按## 依赖说明配置环境
- 执行所需能力对应的命令
- 参考## 错误处理章节处理异常
- 查看## FAQ解答常见疑问
30秒上手(高级调度实践)
import json
from pathlib import Path
from datetime import datetime, timedelta
class ExpertReminderSystem:
"""专家级定时实践系统(专业版核心)"""
TIMEZONE = "Asia/Shanghai"
def __init__(self):
self.store = Path.home() / "workspace" / "scheduler" / "expert"
self.store.mkdir(parents=True, exist_ok=True)
self.jobs_file = self.store / "jobs.json"
self.locks_file = self.store / "locks.json"
self.audit_file = self.store / "audit.json"
for f in [self.jobs_file, self.locks_file, self.audit_file]:
if not f.exists():
f.write_text("[]", encoding="utf-8")
def add_cron_reminder(self, name, cron_expr, message, priority="normal"):
"""使用cron表达式创建精确提醒"""
jobs = json.loads(self.jobs_file.read_text(encoding="utf-8"))
job = {
"id": f"job_{len(jobs)+1:04d}",
"name": name,
"type": "cron",
"cron_expr": cron_expr,
"message": message,
"priority": priority,
"status": "active",
"timezone": self.TIMEZONE,
"created_at": datetime.now().isoformat(),
"next_run": self._calc_cron_next(cron_expr),
"last_run": None,
"lock_required": priority == "high",
"sla_seconds": 300 if priority == "high" else 1800,
"max_retries": 3 if priority == "high" else 1
}
jobs.append(job)
self.jobs_file.write_text(json.dumps(jobs, ensure_ascii=False, indent=2), encoding="utf-8")
print(f"✓ 高级提醒已创建:{job['id']} - {name}")
print(f" cron:{cron_expr}")
print(f" 优先级:{priority}")
print(f" SLA:{job['sla_seconds']}秒")
return job
def _calc_cron_next(self, expr):
"""简化版cron下次计算"""
return (datetime.now() + timedelta(minutes=5)).isoformat()
expert = ExpertReminderSystem()
expert.add_cron_reminder(
"生产环境巡检",
"0 */6 * * *", # 每6小时
"执行生产环境健康巡检",
priority="high"
)
120秒标准搭建
配置并发控制与清理工:
import time
from datetime import datetime, timedelta
class ProductionReminderSystem(ExpertReminderSystem):
"""生产级定时系统"""
def acquire_lock(self, job_id, timeout=30):
"""获取分布式锁(文件锁模拟)"""
locks = json.loads(self.locks_file.read_text(encoding="utf-8"))
now = datetime.now()
for lock in locks:
if lock["job_id"] == job_id:
lock_time = datetime.fromisoformat(lock["locked_at"])
if (now - lock_time).total_seconds() < timeout:
print(f"✗ 锁已被占用:{job_id}({lock['locked_by']})")
return False
else:
locks.remove(lock)
lock = {
"job_id": job_id,
"locked_by": f"agent_{id(self)}",
"locked_at": now.isoformat(),
"timeout": timeout
}
locks.append(lock)
self.locks_file.write_text(json.dumps(locks, ensure_ascii=False, indent=2), encoding="utf-8")
print(f"✓ 已获取锁:{job_id}"
Install cron优秀实践专家(专业版) in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
ReadWriteEditBashFAQ
What does the cron优秀实践专家(专业版) skill do?
cron优秀实践专家专业版是面向企业级场景的定时系统优秀实践完整指南。在免费版基础实践之上,专业版新增高级调度模式(cron表达式精确控制)、遗留系统迁移指南、并发控制规则、清理工自发化规则、完整陷阱库(15+类)五大高级能力,满足复杂生产环境的定时系统治理需求。Use when 用户需要cron优秀实践专家(专业版)相关功能时使用。不适用于超出本技能能力范围的复杂需求。 功能涵盖: expert。
How do I install the cron优秀实践专家(专业版) skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the cron优秀实践专家(专业版) skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
by Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
by Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
by Anthropic