cron-scheduler
하는 일
이 스킬은 일일 보고서나 주간 점검 같은 반복 작업을 계획합니다. 작업 사이에 간격을 두고, 조용한 시간을 지키며, 각 결과를 날짜가 붙은 보고서로 저장합니다.
사용하는 경우
- ✓일일 보고서처럼 반복 작업을 일정에 따라 실행하고 싶을 때.
- ✓조용한 시간 동안 알림이 오지 않게 하고 싶을 때.
- ✓예약 작업이 여러 개여서 서로 겹치지 않게 하고 싶을 때.
스킬 링크
https://github.com/garrytan/gbrain/blob/master/plugin/skills/cron-scheduler/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“매일 아침 오전 7시에 일일 보고서를 예약해 주고, 밤에는 조용한 시간 동안 메시지를 보류해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 일정에 다른 작업과 겹치는 부분이 없는지 확인하고, 필요하면 빈 시간대를 제안합니다. 각 작업은 짧은 지시 파일을 실행하고, 결과는 시간 기록이 붙은 보고서로 저장됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Cron Scheduler
Convention: See
skills/conventions/test-before-bulk.md— test every cron job on 3-5 items first.
Contract
This skill guarantees:
- Schedule staggering: max 1 job per 5-minute slot, no collisions
- Quiet hours gating: timezone-aware, with user-awake override
- Thin job prompts: jobs say "Read skills/X/SKILL.md and run it" (no inline 3000-word prompts)
- Idempotency: jobs can run twice without duplicate side effects
- Results saved as reports:
reports/{job-name}/{YYYY-MM-DD-HHMM}.md - One entry point: every job, workspace script and hook calls gbrain through
one wrapper that sets
GBRAIN_HOMEand keeps stderr and the exit code (the wrapper)
Phases
- Define job. Name, schedule (cron expression), skill to run, timeout.
- Validate schedule. Check no collision with existing jobs (5-minute offset rule).
- Slots: :05, :10, :15, :20, :25, :30, :35, :40, :45, :50
- If collision detected, suggest the next available slot
- Check quiet hours. Default: 11 PM - 8 AM local time.
- Override: user-awake flag (if user is active, quiet hours suspended)
- During quiet hours: save output to held queue
- Morning contact releases the backlog
- Register with host scheduler. OpenClaw cron, Railway cron, crontab, or process manager. Each registered entry should execute via Minions, not
agentTurn. Seeskills/conventions/cron-via-minions.mdfor the rewrite pattern (PGLite uses--follow, Postgres uses fire-and-forget +--idempotency-keyon the cycle slot). GBrain's v0.11.0 migration auto-rewrites entries for built-in handlers; host-specific handlers need a code-level registration perdocs/guides/plugin-handlers.md. - Write thin prompt. Job prompt is one line: "Read skills/{name}/SKILL.md and run it."
- Call gbrain through the wrapper. Cron runs with another
HOMEand environment than your shell, so a baregbrain(orbun run src/cli.ts) can find no database (every lookup silently empty) or act as a second host (refresh_not_owner). Registergbrain-run <args>, the wrapper in cron-schedule.md: it setsGBRAIN_HOME(neverHOME), loads the brain's env file and runs the installed binary. Log stderr to a file, check the exit code, keep hook output off stdout, and give each call a timeout of at least 10 s. The lines below writegbrain-run; doctor prints the bare command.gbrain doctor --only cron_gbrain_homewarns about any crontab line or script that runssrc/cli.tsdirectly or calls gbrain without the brain'sGBRAIN_HOME.
Idempotency Requirement
Every cron job MUST be idempotent:
- Running the same job twice produces the same result (no duplicate pages, no duplicate timeline entries)
- Use checkpoint state files to track progress and resume interrupted runs
- Check for existing output before creating new output
Output Format
Job configuration saved. Report: "Job '{name}' scheduled at {cron expression}. Next run: {time}."
Multi-source brains: use sync --all, not per-source entries
When the brain has 2+ active sources (anything gbrain sources list shows
with a non-null local_path that isn't archived), use one consolidated
cron line instead of N per-source entries.
Preferred (multi-source):
*/5 * * * * gbrain-run sync --all --parallel 4 --workers 4 --skip-failed >> /tmp/gbrain-cron.log 2>&1
This replaces N per-source lines AND auto-picks-up future sources without
a crontab edit. Concurrency budget: parallel × workers × 2 ≈ 32
connections during the wave (each per-file worker opens its own
2-connection pool). Stay under your Postgres max_connections setting.
Avoid (legacy): separate gbrain sync --source default and
gbrain sync --source zion-brain entries staggered by 5 minutes. They
require manual deconfliction every time a new source is added, and a
slow source can race a fast source on the legacy global gbrain-sync
lock (v0.40.3.0+ uses per-source gbrain-sync:<sourceId> locks but the
per-source cron pattern doesn't benefit from the parallelism that
--all --parallel actually delivers).
gbrain doctor surfaces the recommended line as a sync_consolidation
check whenever it detects 2+ active sources. Paste-ready from there.
Managed br
자주 묻는 질문
조용한 시간은 무엇인가요?
기본적으로 내 현지 시간으로 밤 11시부터 아침 8시까지이며, 그 동안의 결과는 아침까지 기다립니다.
조용한 시간을 무시할 수 있나요?
네. 내가 활동 중이면 조용한 시간 설정이 일시 중단됩니다.
작업이 두 번 실행되어 문제가 생기나요?
작업은 두 번 실행되어도 중복된 결과가 생기지 않도록 설계되어 있습니다.
상세 정보
작성자의 원본 설명
Schedule management with staggering, quiet hours, and wake-up override. Validates schedules, prevents collisions, and gates delivery during quiet hours.
repo: garrytan/gbrain
인기도
- GitHub 스타
- 31k
- 순위
- #9297
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
gbrain
31k에이전트가 공유 회사 지식 브레인에서 사람, 프로젝트, 결정에 관한 사실을 검색하고, 지속적인 메모를 저장하도록 돕습니다.
brain-ingest-gate
31k새 콘텐츠를 지식 브레인에 추가하기 전에 기존 내용과 비교해 중복을 막고, 고유 명칭을 먼저 확인합니다.
brain-link-discipline
31k에이전트가 브레인 페이지를 보고할 때 같은 메시지에 각 페이지의 작동하는 링크를 포함해, 바로 열어 볼 수 있게 합니다.
brain-ops
31k지식 브레인의 기본 루틴을 제공합니다. 먼저 기존 맥락을 확인하고, 메모는 출처와 함께 저장하며, 관련 페이지를 연결합니다.