proactive-loop
Skill396 starsChanged 6 months agoMITView on GitHub
Start Sutando's autonomous proactive loop. Monitors tasks, runs health checks, and builds missing capabilities on a recurring schedule.
In this repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-activitySkill
- agent-registrySkill
- agent-room-opsSkill
- answer-formatSkill
- audio-transcribeSkill
- bee-actionsSkill
- bot2bot-postSkill
- call-diagnosticsSkill
- claude-codexSkill
- claude-geminiSkill
- claude-piSkill
- claude-routerSkill
- collaboration-intelligenceSkill
- connect-appsSkill
- context-dropSkill
- context-reconstructSkill
- db-browserSkill
- deal-finderSkill
- doc-ingestSkill
- electron-overlay-dimmingSkill
- email-findSkill
- engine-conflict-resolveSkill
- gemini-ttsSkill
- image-generationSkill
- import-claude-contextSkill
- local-workspace-serverSkill
- macos-toolsSkill
- macos-useSkill
- make-viral-videoSkill
- marketplaceSkill
- media-transcriptSkill
- meeting-prepSkill
- meeting-schedulerSkill
- mention-gateSkill
- model-switchSkill
- morning-briefingSkill
- ms365-connectSkill
- observeSkill
- obsidian-vaultSkill
- openai-ttsSkill
- open-sutando-refSkill
- overlay-appsSkill
- phone-conversationSkill
- pr-shepherd-contractSkill
- quota-trackerSkill
- regression-searchSkill
- relaySkill
- releaseSkill
- report-feedbackSkill
- review-preflightSkill
- room-collabSkill
- schedule-cronsSkill
- screen-companionSkill
- screen-recordSkill
- self-diagnoseSkill
- self-upgradeSkill
- session-recapSkill
- skill-usage-reportSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 0 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 23
If CronList already shows a main-loop / /proactive-loop job, run the per-pass body directly — never add a second loop driver.
- Very specific: line 52
When this core consumes a task itself, move $WORKSPACE/tasks/<id>.txt to $WORKSPACE/tasks/archive/<id>.txt after writing its result.
- Very specific: line 59
Questions: Read <workspace>/hosts/<host>/pending-questions.md.
- Very specific: line 74
Build log: Read $WORKSPACE/build_log.md.
- Very specific: line 77
Write the pick into the status step.
- Very specific: line 111
Not running with no trees → Monitor bash src/watch-tasks-stream.sh persistent.
- Very specific: line 116
Discord: Check the channels in reference_discord_channels.md.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Proactive Loop
One pass = the numbered steps below, in order. Each step is a command, its exit codes, and what to
do per code. The reasoning, measurements and incidents behind every step live in
docs/proactive-loop-rationale.md under the same step
number; read it when a step surprises you, never per pass. A rule belongs here only as a command a
mechanism enforces; prose lessons go to the rationale doc (tests/proactive-loop-skill-budget.test.py
caps this file and refuses date stamps in it).
Usage: /proactive-loop [interval] (default 10m).
On activation
/schedule-crons— registers the session crons and stamps them.- Task watcher via the
Monitortool:command: 'bash src/watch-tasks-stream.sh',persistent: true,description: 'Streaming task watcher'. EachTASK_FILE: <name>line is one task to Read and process. Windows has noMonitortool:src/startup.ps1ownssrc/task-dispatcher.ps1; do not start another watcher. - If
CronListalready shows amain-loop//proactive-loopjob, run the per-pass body directly — never add a second loop driver.
Per pass
WORKSPACE="$(bash scripts/sutando-config.sh workspace)" once; quote every "$WORKSPACE/..." path.
- Status.
bash scripts/core-status.sh running "<what the owner is waiting on>"; rewrite on every pivot;bash scripts/core-status.sh idleat the end. Never>the JSON yourself. 0.5. Quota tier (Claude core):python3 $CLAUDE_CONFIG_DIR/skills/quota-tracker/scripts/read-quota.py | python3 skills/proactive-loop/scripts/quota-tier.py→TIER <FULL|MEDIUM|LIGHT|MINIMAL> (bound by …). Thenpython3 skills/proactive-loop/scripts/claude-quota-cadence.py --json→ ifeffective_crondiffers from the/proactive-loopjob inCronList: capture the old job id,CronCreatethe new job withprompt: "/proactive-loop"andcron: <effective_cron>, confirm it inCronList. ThenCronDeletethe old id and confirm exactly one/proactive-loopjob remains. If create or confirmation fails, keep the old job and stop loudly. Codex core:python3 skills/proactive-loop/scripts/codex-quota-gate.py --json. Tier caps step 6's depth (LIGHT/MINIMAL: no self-development); it never skips owner tasks, health or the log. 0.7. Reconstruct. Invoke thecontext-reconstructskill (a Skill-tool call, not a mention). It reads<workspace>/hosts/<host>/current-track.mdfirst, then the live thread (python3 src/discord-read.py <channel> --serving <channel>when serving a task,--operatorotherwise), pending questions, relay, build log. Trust the record over recall; maintaincurrent-track.md. - Tasks. Process every file in
$WORKSPACE/tasks/;access_tier: team|other→ the sandboxed path. Group a thread with[deduped: task-<latest>], staged under its FINAL name and gated into place —results/is claimed by a poller in under a second, and the checker reads the source id from the BASENAME, so a generic temp name makes it pass everything:S="$WORKSPACE/state/dedup-staging/<file>"thenpython3 skills/proactive-loop/scripts/check-dedup-targets.py "$S" && mv -f "$S" "$WORKSPACE/results/<file>"(0 clean · 1 the dedup delivers nothing · 2 cannot answer). All-notice groups use[no-send]on each. Marker semantics belong tosrc/result_markers.py; never re-implement them. When this core consumes a task itself, move$WORKSPACE/tasks/<id>.txtto$WORKSPACE/tasks/archive/<id>.txtafter writing its result; bridges and the Windows dispatcher archive their own claims. Before idle:python3 scripts/unanswered-tasks.py --workspace "$WORKSPACE" && bash scripts/core-status.sh idle(1 = a task got no result, so idle does not run). 1.5. Connect waits.python3 skills/connect-apps/scripts/connectors.py rearmrestarts the waiter of any pending connector wait that lost it; idempotent, and a failure never blocks the pass. - Questions. Read
<workspace>/hosts/<host>/pending-questions.md; surface viaresults/question-<ts>.txtwhen voice is connected, plus a macOS notification. - Health.
python3 src/health-check.py; fix with--fixwhat it can. A warn is a pointer into the record: before investigating,grep -in "<entity from the warn TEXT>" "$H/pending-questions.md" "$H/current-track.md"withH="$WORKSPACE/hosts/$(bash scripts/sutando-config.sh host-label)"; a zero means try another token, thengrep -n '^## ' "$H"/*.mdbefore concluding absence. Extend a hit; never re-file it. 3.45. Duplicate issue gate, chained so a refusal cannot be skipped:python3 skills/proactive-loop/scripts/gh-duplicate-check.py --repo <owner/name> --title "<title>" && gh issue create --repo <owner/name> --title "..." --body-file <f>(0 no candidate · 1 do not file, candidates named · 2 cannot answer). 3.5. Policy.python3 skills/proactive-loop/scripts/self-development-enabled.py→disabledskips 4–8, 10, 11. Owner-requested tasks, pending questions, health/service recovery and the watcher remain active. Manual/proactive-loopinvocation does not override the policy. 3.6. Tool suites.python3 skills/proactive-loop/scripts/tool-suites-check.py --workspace "$WORKSPACE" --repo "$PWD"(0 pass · 1 a suite failed · 2 cannot answer). Extra suites are declared in$WORKSPACE/hosts/<host>/tool-suites-extra.json. It passes no argv to a suite. - Build log. Read
$WORKSPACE/build_log.md; do not rebuild what works. - Pick the highest-ROI unblocked item: owner tasks and blockers, then peer
opinion-requested/review-requestedclaims in #bot2bot, then voice reliability, then regressions, then the menu. Write the pick into the statusstep. - Act. A blocked primary is a cue to switch lanes, never to idle. Before pivoting from the owner's
latest ask, read
state/last-owner-activity.jsonand announce the pivot in the bot-to-bot channel perPERSONAL_CLAUDE.md. Skip this step only for: MINIMAL tier; owner active in the last ~5 min;state/presenter-mode.sentinel(bash scripts/presenter-mode.sh);state/loop-paused-until.sentinel;python3 src/shutdown.py checkexiting 0 (finish in hand, write idle, do not relaunch). 6.5. Idle surface. Record the pass:python3 skills/proactive-loop/scripts/idle-surface-hash.py --state "$WORKSPACE/state/idle-streak.json" --pass-outcome substantive|noop. The held set is edited only throughpython3 skills/proactive-loop/scripts/idle-held.py --state "$WORKSPACE/state/idle-streak.json" --remove <id> --reason "<why>" --add <id>:<gate> --note <owner/repo#n>(no whole-list interface; a removal needs a reason); audit notes with--audit-notes "$PWD"and retire merged items. Compute:idle-held.py … | idle-surface-hash.py --state …→post <hash>orquiet <hash>. Onpost: send ONE FYI line to the owner's primary channel, THEN re-run the same pipe with--writeonidle-held.pyAND--commitonidle-surface-hash.py— each flag belongs to its own side, and--commitalone leaves added holds, removal reasons and notes unpersisted, so the next pass re-posts the stale hold. Never commit before the send; never build the list from recall.quiet+ owner active in the last ~30 min → still drop a one-line activity signal. 6.7. Failure closure. Every reported failure ends with the mechanism that prevents its recurrence, linked, or the sentence "no mechanism exists, because X". A filed lesson is not a third option. - Build log write. Append with
O_APPENDand a random marker; assertcount(MARK) == 1by reading the file back. Never read-modify-replace. Then decide whether arelay/relay-<ts>.mdnote is owed (a PR event, a resolved question, a lifted or new blocker, a judgment) — most passes owe none. 7.5. Memory index, chained so a refusal cannot be skipped:python3 skills/proactive-loop/scripts/memory-index-budget.py --adding "<row>" && <append the row>(0 safe · 1 refuse, casualty named · 2 cannot answer). On refusal free room FIRST and check the row is still reachable from its hub before removing it; which rows go is the owner's call. - Ask. Insert the question ABOVE the
# Resolveddivider of the per-hostpending-questions.md, placed by importance (only the top 5 render anywhere), and assert with the reader:python3 -c "…src/check-pending-questions.py…get_waiting_questions()"— count went up, title matches, position ≤VISIBLE_PREFIX. macOS notification;results/question-<ts>.txtwhen voice is connected. Then pivot; never block. - Watcher. Act only on the
task-watcherprobe from step 3. Stop pids only when the probe presents owned and ownerless as two separately labelled groups; one undifferentiated list means change nothing. Not running with no trees →Monitorbash src/watch-tasks-stream.shpersistent. A missing sentinel is UNKNOWN, not dead; never hand-roll a process check. 9.5. PR thread gate, chained so a refusal cannot be skipped:python3 skills/proactive-loop/scripts/pr-monologue-check.py <PR url|number --repo owner/name> --me <your-login> && gh pr comment <number> --repo <owner/name> --body-file <f>(0 safe · 1 refuse, run and span named · 2 cannot answer). On refuse, re-solicit through a stand. - Discord. Check the channels in
reference_discord_channels.md; forward actionable public items to the dev channel. #bot2bot tags:claim:blocked:done:ping:nack:opinion-requested:. First PR opened wins a claim. Bots never merge. Three unresolved round-trips → both positions topending-questions.md, proceed with the cheaper-to-reverse option. - Heartbeat. Substantive pass + #bot2bot configured + other bot active →
done: <one line>via thebot2bot-postskill. Never fall back toresults/proactive-*.txt. Never writecontextual-chips.json.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

