Rotating Single Target Cron
Overview
Use this skill to build or maintain cron jobs that rotate across a roster of @IDs.
Each run should pick exactly one target, avoid the immediately previous target when alternatives exist, update a state file, and send only one final message.
Workflow
1. Confirm the shape of the job
Default assumptions for this pattern:
- - one recurring cron job
- one message per run
- one selected @ID per run
- fixed roster unless the user asks to edit it
- current chat as delivery target unless the user specifies another destination
- last-picked target stored in a workspace file under INLINECODE0
Ask only for missing essentials:
- - roster of @IDs
- schedule and timezone
- message style or prompt brief
- whether this is a new job or an update to an existing one
2. Prepare state
Create or maintain a plain text state file in the workspace.
Recommended naming:
CODEBLOCK0
State rules:
- - store exactly one line:
@ID or INLINECODE2 - if the file is missing, empty, or contains an ID no longer in the roster, treat it as INLINECODE3
- when migrating an existing job, seed the file from the most recent known target if reliable; otherwise initialize it to INLINECODE4
3. Write a strict cron payload
The scheduled prompt should instruct the runtime to do this sequence:
- 1. read the state file
- determine the previous target
- pick exactly one target from the configured roster
- avoid the previous target whenever another valid choice exists
- overwrite the state file with the newly chosen target
- output only the final chat message
Keep the payload strict about output shape.
Unless the user says otherwise, include these rules:
- - mention the chosen
@ID naturally near the beginning - do not mention the other configured IDs in the same message
- keep the output public-chat safe
- do not add explanations, labels, or meta commentary
4. Create or update the cron job
For a new job:
- - create the state file first
- add the cron job with INLINECODE6
- default delivery to the current chat
- use a short descriptive name tied to the behavior
For an update:
- - patch the existing job in place
- update schedule, roster, payload, and name as needed
- do not create duplicates when the user is clearly editing an existing rotation
5. Test only on request
In active group chats, do not trigger a live run unless the user explicitly asks.
If the user asks to test:
- - warn briefly that the test will post to the chat
- run the cron job immediately
- remember that the state file will advance after the test
6. Handle common edits safely
Common edits:
- - change the time
- change the roster
- swap the writing style or content brief
- switch from multi-target message mode to rotating single-target mode
- change word-count or tone constraints
When converting an older multi-target job into this pattern, initialize or repair the state file so the first rotated run starts cleanly.
Prompt skeleton
Use this as the base structure and replace placeholders with the user's style/content requirements.
CODEBLOCK1
References
Read references/examples.md when you need ready-made prompt patterns for common variants such as heartbreak stories, wake-up copy, teasing posts, or fortune-style rotations.
Checklist
Before finishing, verify:
- - only one active cron job handles this rotation
- schedule matches the user's request
- roster matches the user's request exactly
- state file uses a relative workspace path under INLINECODE8
- prompt forbids repeating the immediately previous target
- prompt forbids mentioning other configured IDs in the same output unless the user explicitly wants that
- delivery target is correct
- live testing happened only if the user requested it
轮换单目标定时任务
概述
使用此技能来构建或维护在@ID名单中轮换的定时任务。每次运行应恰好选择一个目标,在有其他选择时避免选择上一个目标,更新状态文件,并仅发送一条最终消息。
工作流程
1. 确认任务形态
此模式的默认假设:
- - 一个重复执行的定时任务
- 每次运行一条消息
- 每次运行选择一个@ID
- 除非用户要求编辑,否则名单固定
- 除非用户指定其他目标,否则当前聊天为投递目标
- 上次选择的目标存储在memory/下的工作区文件中
仅询问缺失的必要信息:
- - @ID名单
- 执行计划与时区
- 消息风格或提示摘要
- 这是新任务还是对现有任务的更新
2. 准备状态
在工作区中创建或维护一个纯文本状态文件。
推荐命名:
text
memory/<任务标识>-last-target.txt
状态规则:
- - 仅存储一行:@ID或none
- 如果文件缺失、为空或包含名单中不存在的ID,则视为none
- 迁移现有任务时,如果可靠,从最近已知目标填充文件;否则初始化为none
3. 编写严格的定时任务负载
定时提示应指示运行时执行以下序列:
- 1. 读取状态文件
- 确定上一个目标
- 从配置的名单中恰好选择一个目标
- 当有其他有效选择时,避免选择上一个目标
- 用新选择的目标覆盖状态文件
- 仅输出最终聊天消息
保持负载对输出格式的严格要求。
除非用户另有说明,包含以下规则:
- - 在消息开头附近自然地提及所选@ID
- 在同一消息中不提及名单中的其他ID
- 保持输出适合公共聊天
- 不添加解释、标签或元评论
4. 创建或更新定时任务
对于新任务:
- - 先创建状态文件
- 使用sessionTarget=isolated添加定时任务
- 默认投递到当前聊天
- 使用与行为相关的简短描述性名称
对于更新:
- - 就地修改现有任务
- 根据需要更新计划、名单、负载和名称
- 当用户明显在编辑现有轮换时,不创建重复任务
5. 仅在请求时测试
在活跃的群聊中,除非用户明确要求,否则不触发实时运行。
如果用户要求测试:
- - 简要警告测试将发布到聊天中
- 立即运行定时任务
- 记住状态文件将在测试后更新
6. 安全处理常见编辑
常见编辑:
- - 更改时间
- 更改名单
- 更换写作风格或内容摘要
- 从多目标消息模式切换到轮换单目标模式
- 更改字数或语气限制
将旧的多目标任务转换为此模式时,初始化或修复状态文件,使首次轮换运行干净启动。
提示模板
以此为基础结构,将占位符替换为用户风格/内容要求。
text
每天在(<时区>)向当前聊天发送恰好一条消息。
名单:<@id列表>
状态文件:memory/<任务标识>-last-target.txt
你必须严格遵守以下规则:
- 1. 在生成任何内容之前,读取状态文件。如果文件不存在、为空或包含名单中不存在的ID,则将上一个目标视为none。
- 从名单中随机选择恰好一人作为本次运行的唯一目标。
- 当存在任何其他有效选项时,绝不选择与上次相同的目标。
- 选择目标后,立即用该目标的@ID覆盖状态文件。
- 在最终输出中不提及名单中的任何其他ID。
- 仅输出最终聊天消息。不添加解释、标题、标签或评论。
- 在消息开头附近自然地提及所选@ID。
- 严格遵守以下内容要求:
<内容摘要和风格约束>
参考资料
当你需要常见变体的现成提示模式时,请阅读references/examples.md,例如心碎故事、早安文案、调侃帖子或运势类轮换。
检查清单
完成前确认:
- - 只有一个活跃的定时任务处理此轮换
- 计划与用户请求匹配
- 名单与用户请求完全匹配
- 状态文件使用memory/下的相对工作区路径
- 提示禁止重复上一个目标
- 除非用户明确要求,否则提示禁止在同一输出中提及名单中的其他ID
- 投递目标正确
- 仅当用户请求时才进行实时测试