du-dum
정보
du-dum 스킬은 자율 에이전트에서 지속적이고 저렴한 관찰과 가끔 발생하는 고비용 의사결정을 분리하기 위해 이중 클럭 아키텍처를 구현합니다. 빠른 클럭은 데이터를 요약 정보로 수집하고, 느린 클럭은 대기 중인 작업이 발견될 때만 (LLM 호출과 같은) 고비용 작업을 트리거합니다. 이 패턴은 대부분의 관찰 주기에서 행동이 필요하지 않은 에이전트 루프에서 비용과 성능을 최적화하는 데 이상적입니다.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/du-dumClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Du-Dum: Batch-Then-Act Pattern
Split observe/act → 2 clocks diff freq. Fast (analysis) = cheap → writes digest. Slow (action) = reads digest → acts if pending. Digest empty → exit immediate. Zero cost idle.
Name = heartbeat: du-dum. First beat (du) observes. Second (dum) acts. Mostly only first fires.
Use When
- Autonomous agent budget → observe often, act rare
- Heartbeat calls LLM every tick → waste
- Observe cheap (API read, file parse, log scan), act expensive (LLM, write, notify)
- Decoupled fail → observe fails → last digest still valid
- Cron agent → analysis + action = separate jobs
In
- Required: Data sources fast clock observes (APIs, files, logs, feeds)
- Required: Action slow clock takes when pending
- Optional: Fast interval (default: 4h)
- Optional: Slow interval (default: 1/day)
- Optional: Daily cost ceiling
- Optional: Digest format (md, JSON, YAML)
Do
Step 1: Identify 2 Clocks
Split work → observe (cheap, freq) vs act (exp, rare).
- List every op
- Classify → observe (reads → summary) or act (LLM/write/msg)
- Verify split: observe ≈0 marginal, act = expensive
- Assign freq: fast catches events, slow meets response-time
| Clock | Cost | Freq | Example |
|---|---|---|---|
| Fast (analysis) | Cheap: API read, parse, no LLM | 4-6x/day | GitHub notifs, RSS, logs |
| Slow (action) | Exp: LLM, write | 1x/day | Compose reply, dashboard, alert |
→ Clean split. Every op on 1 clock. Fast = no LLM. Slow = no gather.
If err: op needs both → split. Fast collects raw → digest. Slow summarizes. Digest = boundary.
Step 2: Design Digest Format
Digest = low-bandwidth msg between clocks. Compact, human-readable, parseable.
- Define path + format (md recommended)
- Header: timestamp + source meta
- "Pending" section → items needing action
- "Status" section → current state
- Clear empty indicator (
pending: none)
Example:
# Digest — 2026-03-22T06:30:00Z
## Pending
- PR #42 needs review response (opened 2h ago, author requested feedback)
- Issue #99 has new comment from maintainer (action: reply)
## Status
- Last analyzed: 2026-03-22T06:30:00Z
- Sources checked: github-notifications, rss-feed, error-log
- Items scanned: 14
- Items pending: 2
Empty:
# Digest — 2026-03-22T06:30:00Z
## Pending
(none)
## Status
- Last analyzed: 2026-03-22T06:30:00Z
- Sources checked: github-notifications, rss-feed, error-log
- Items scanned: 8
- Items pending: 0
→ Template w/ clear pending/empty. Slow clock decides by single check.
If err: digest >50 lines → too much raw. Move details to data file, digest = summary + pointers.
Step 3: Fast Clock (Analysis)
Observation scripts on fast schedule.
- 1 script per source (indep failures)
- Each reads, extracts, appends/rewrites digest
- File lock / atomic write → no partial digest
- Log run (ts, items, errs) → separate log
- Never LLM / write beyond digest
# Pseudocode: analyze-notifications.sh
fetch_notifications()
filter_actionable(notifications)
format_as_digest_entries(filtered)
atomic_write(digest_path, entries)
log("analyzed {count} notifications, {pending} actionable")
Cron:
# Fast clock: analyze every 4 hours
30 */4 * * * /path/to/analyze-notifications.sh >> /var/log/analysis.log 2>&1
0 6 * * * /path/to/analyze-pr-status.sh >> /var/log/analysis.log 2>&1
→ Analysis scripts update digest. Indep → 1 fails, others continue.
If err: source down → log + keep prev entries. Never clear on source fail → stale > missing.
Step 4: Slow Clock (Action)
Reads digest, decides act.
- Read digest (Step 0)
- Pending empty/"none" → exit immediate w/ log
- Items pending → exp op (LLM, compose)
- After act → clear/archive processed entries
- Log run (items, cost, duration)
# Pseudocode: heartbeat.sh (the slow clock)
digest = read_file(digest_path)
if digest.pending is empty:
log("heartbeat: nothing pending, exiting")
exit(0)
# Only reaches here if work exists
response = call_llm(digest.pending, system_prompt)
execute_actions(response)
archive_digest(digest_path)
log("heartbeat: processed {count} items, cost: {tokens} tokens")
Cron:
# Slow clock: act once per day at 7am
0 7 * * * /path/to/heartbeat.sh >> /var/log/heartbeat.log 2>&1
→ Script exits <1s idle. Active → processes + clears.
If err: LLM fails → no clear. Items retry next cycle. Consider retry counter → no infinite retry.
Step 5: Idle Detection
Savings = idle detect. Distinguish "nothing"/"something" min overhead.
- Idle check = single fast op (file read + str check)
- Verify idle path: 0 ext calls (no API/LLM/net)
- Measure duration <1s
- Log idle differently from active
# Minimal idle check
if grep -q "^(none)$" "$DIGEST_PATH" || grep -q "pending: 0" "$DIGEST_PATH"; then
echo "$(date -u +%FT%TZ) heartbeat: idle" >> "$LOG_PATH"
exit 0
fi
→ Idle = 1 file read + str match. No net, no spawn.
If err: unreliable check (false pos = missed work, false neg = waste LLM) → simplify digest. Single bool field (has_pending: true/false) most reliable.
Step 6: Validate Cost Model
Calculate → confirm savings.
- Fast runs/day:
fast_runs = 24 / fast_interval_hours - Slow runs/day: typ 1
- Observe cost:
fast_runs * cost_per_analysis_run(~$0 no LLM) - Act cost:
active_days_fraction * cost_per_action_run - Idle cost:
(1 - active_days_fraction) * cost_per_idle_check(~$0) - Compare w/ original
| Architecture | Daily (active) | Daily (idle) | Monthly (80% idle) |
|---|---|---|---|
| Single loop (LLM every 30min) | $13.74/37h | $13.74/37h | ~$400 |
| Du-dum (6 analyses + 1 action) | $0.30 | $0.00 | ~$6 |
→ Model shows ≥10x cheaper on idle days.
If err: no savings → (a) fast too freq, (b) fast has hidden LLM, (c) rarely idle. Du-dum wants high idle ratio. Always active → simpler polling.
Check
- Fast/slow split clean → no LLM in fast path
- Digest has clear empty indicator
- Idle detect <1s, 0 ext calls
- Fast fail → no digest corrupt (stale preserved)
- Slow fail → no clear pending (retry next)
- Cost model ≥10x savings idle days
- Both clocks log runs
- Digest bounded (archive/clear after process)
Traps
- Digest unbounded: Append no clear → growing log. Always clear/archive after act.
- Fast too fast: Analysis every 5min, events daily → wastes API/IO. Match freq to event rate.
- Slow too slow: Once/day but need same-hour → too slow. Increase freq or urgent shortcut.
- LLM in fast: Breaks cost model. Audit fast scripts → 0 LLM. Defer summary to slow.
- Coupled fast scripts: 1 depends on another → cascade fail. Keep indep → own source, own section.
- Silent idle log: No log → can't distinguish "running idle" vs "crashed". Always log idle.
- Clear digest on analysis fail: Source down → no empty write. Slow would skip actual pending. Preserve last good.
→
manage-token-budget— cost framework du-dum makes practical; du-dum = pattern, budget = accountingcircuit-breaker-pattern— failure case (tools breaking); du-dum = normal case (nothing to do). Together: du-dum idle, circuit-breaker failobserve— methodology for fast clock; du-dum structures when observes become actionable via digestforage-resources— strategic explore layer; du-dum = execution rhythmcoordinate-reasoning— stigmergic signaling; digest = stigmergy (indirect coord via env artifact)
GitHub 저장소
연관 스킬
content-collections
메타이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.
polymarket
메타이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.
creating-opencode-plugins
메타이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.
sglang
메타SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.
