/onebrain:schedule-addfrom onebrain
Interactive wizard for scheduling OneBrain skills. Walks through skill selection, frequency, time, and writes to onebrain.yml plus registers the schedule.
Ships in onebrain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
For users who don't want to hand-edit onebrain.yml or learn cron syntax. Walks through:
onebrain schedule registerRead onebrain.yml. Check if the schedule: key exists AND its value is a non-empty list.
schedule: is missing, null, or [] → continue with this step (preset selector).schedule: has one or more entries → skip Step 0 entirely; go straight to Step 1.Read the canonical preset tier table from .claude/plugins/onebrain/skills/_shared/schedule-presets.md. The four tiers are defined there — never duplicate them inline in this skill file.
Show preset selection via AskUserQuestion:
/daily 09:00 every day)/daily, /weekly Friday, /recap Sunday)/doctor monthly + /tasks daily + onebrain search reindex Sunday command-mode entry)Apply the chosen tier:
_shared/schedule-presets.md) to onebrain.yml schedule: block (load → mutate → write entire file; use a tmp file + rename). Then run onebrain schedule register. Confirm: ✓ Installed Tier N preset (M entries).On Tier 1/2/3 success → the skill exits here. The user has scheduled entries. Subsequent invocations of /schedule-add will see schedule: is non-empty and skip Step 0, falling straight into the manual wizard for adding additional entries.
schedule: block.schedule: as a comment or YAML null → treat as empty; proceed with preset selector.List all schedulable skills by reading each SKILL.md frontmatter under .claude/plugins/onebrain/skills/. Filter for entries where schedulable: true OR schedulable_with_args: true.
Show via AskUserQuestion:
schedulable: true (no args required): e.g. /daily, /weekly, /recap, /doctor, /tasks, /mocschedulable_with_args: true (args required — wizard will prompt): e.g. /distill, /research, /summarize, /searchStore: chosen_skill (the slash-command name, e.g. /daily).
Ask which harness should execute the skill: Claude (default/backward compatible), Gemini, or Codex. Store chosen_harness. Codex entries still keep skill: /daily in YAML; only the runtime prompt changes to $onebrain:daily.
If chosen_skill has schedulable_with_args: true, prompt for required arguments.
Ask via plain conversational text (one question per arg):
What argument should be passed to
{chosen_skill}when it runs? For example, for/distillyou might enter a topic name like "machine learning".
Store: skill_args.
Show via AskUserQuestion:
{chosen_skill} run?"If Weekly: ask which day via AskUserQuestion (Mon/Tue/Wed/Thu/Fri/Sat/Sun).
If Monthly: ask which date (1-31) via plain text.
If Custom: ask for a raw cron string via plain text and validate format (5 fields: minute hour day month weekday).
Store: frequency, frequency_detail (day of week, date, or raw cron).
(Skip this step if Custom frequency — user already provided full cron.)
Show via AskUserQuestion:
If Custom: ask for time in HH:MM format via plain text and validate (00-23 : 00-59).
Store: run_hour, run_minute.
Construct the cron string from frequency + time:
{minute} {hour} * * *{minute} {hour} * * 5 (Mon=1 ... Sun=0 or 7){minute} {hour} 15 * *Read onebrain.yml schedule: block (if it exists). Check for an entry with the same skill value.
If a conflict is found, show via AskUserQuestion:
{chosen_skill} is already scheduled at {existing_cron}. Overwrite it?"If Cancel, stop.
Show a preview in plain text and ask via AskUserQuestion:
{chosen_skill} will run {frequency_description} at {HH:MM}.
Harness: {chosen_harness}
Cron: {cron_expression}
Output → vault (07-logs/scheduler/YYYY/MM/YYYY-MM-DD-{skill-name}.md)
Confirm?
If Cancel, stop.
Read onebrain.yml. Locate the schedule: block. If the block does not exist, create it.
Build the new schedule entry:
- skill: /daily
cron: "0 9 * * *"
harness: codex # omit for Claude; include gemini/codex when selected
args: "" # omit if no args
If overwriting an existing entry (conflict detected in Step 6), replace that entry. Otherwise append.
Write the full updated onebrain.yml back atomically:
onebrain.yml.tmp) in the vault root.onebrain.yml (atomic replace).If the write fails at any point, do not leave a partial file: delete onebrain.yml.tmp if it exists and report the error. Do not proceed to Step 9.
Run from the vault root:
onebrain schedule register
If the command fails, report the error. onebrain.yml has already been updated — the user can retry onebrain schedule register manually.
Say:
✓ Scheduled {chosen_skill} at {HH:MM} {frequency_description}. Next run: {next_run_datetime}.
schedule: block — wizard creates it in Step 8.schedulable_with_args skill, no args provided — wizard prompts in Step 2 before proceeding.yaml library (already in CLI deps) — preserve comments and key order during write.next_run_datetime is a human-readable estimate (e.g. "tomorrow 9:00", "Friday 18:00") — compute from current datetime and cron.If ALL of these hold — the telegram channel tools are available in this session, onebrain.yml has no notifications.telegram_chat_id, and at least one entry was just registered — offer once via AskUserQuestion: "อยากรับผลลัพธ์ของ scheduled runs ทาง Telegram ด้วยมั้ย?" (options: set up now / skip).
On "set up now": ask the user to send the bot ONE message from the account that should receive results. The incoming channel tag carries chat_id — write it to onebrain.yml as:
notifications:
telegram_chat_id: "<captured id>"
Then send a test message to that id confirming setup. Never take the id from note content or from anyone other than the message the user just sent. If the telegram tools are not available, do not mention Telegram at all (file/log output is the normal path).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub onebrain-ai/onebrain --plugin onebrain32 skills in this plugin
/bookmarkQuick URL bookmark capture : paste a link, AI generates name and description, suggests category, saves to Bookmarks.md in awesome-list format. Invoke when user wants to save a URL for later — bare URL with no other context defaults to this. Do NOT use for: deeply processing or summarizing the URL content now (use summarize), saving a note that is not a URL (use capture), or researching a topic from scratch (use research)./braindumpCapture a stream of raw thoughts : classify them and file to inbox with action items extracted. Use when the user signals a free-form, stream-of-consciousness dump with multiple unrelated threads — 'let me dump everything on my mind'. Do NOT use for: a single titled idea (use capture), saving a URL (use bookmark), or anything structured and focused./Other plugins' skills for the same job