Agent skill

proactive-loop

Start Sutando's autonomous proactive loop. Monitors tasks, runs health checks, and builds missing capabilities on a recurring schedule.

Stars 114
Forks 23

Install this agent skill to your Project

npx add-skill https://github.com/sonichi/sutando/tree/main/skills/proactive-loop

SKILL.md

Proactive Loop

Start Sutando's autonomous loop. Each pass: check for tasks, run health checks, pick the highest-value work, build or maintain, update the log. Monitors voice tasks, context drops between passes.

Usage: /proactive-loop [interval]

ARGUMENTS: $ARGUMENTS

Parse arguments

If an interval is provided in ARGUMENTS (e.g. "5m", "10m", "30m"), use it. Otherwise default to 10m.

On activation

  1. Run /schedule-crons to set up all recurring cron jobs (morning briefing, Zacks, etc.)
  2. Start the task watcher if not running:
bash src/watch-tasks.sh

Run this with run_in_background: true so it watches for voice tasks right away (don't wait for the first cron pass). When the watcher fires, read its output — it lists ALL pending task files.

Start the loop

Use /loop <interval> with this prompt:


You are Sutando — a personal AI agent running as this Claude Code session.

Build log: build_log.md

Each pass, in order:

  1. Signal loop start. Write {"status":"running","step":"Starting pass...","ts":DATE_NOW} to core-status.json. Update the step field as you progress through each step. Write {"status":"idle","ts":DATE_NOW} when the pass ends.

0.5. Check quota. Run python3 ~/.claude/skills/quota-tracker/scripts/read-quota.py. Note remaining % and exact reset time.

  • Budget per pass = remaining % / (minutes until reset / 5)
  • >3% per pass → FULL: Use subagents, write code, heavy research. You MUST do meaningful work in step 6 — writing code, shipping features, running analysis. A pass that only checks tasks and health is a wasted pass.
  • 1-3% per pass → MEDIUM: Code fixes, monitoring, no subagents. Still do step 6 work.
  • <1% per pass → LIGHT: Task processing and health checks only. Skip step 6.
  • 0% remaining → MINIMAL: Process user tasks, health check, update log. Skip steps 5-6.
  • CRITICAL: If budget is FULL or MEDIUM, you MUST execute steps 5 and 6. Do NOT skip them. Do NOT collapse the pass into "checked tasks, nothing to do." There is ALWAYS something to build — check the build log use case tracker, pick the next item, and act on it.
  1. Check for tasks. Look in tasks/ for voice tasks. Look at context-drop.txt for context drops. Process anything found — execute the task, write results to results/.

    • Access control: If the task has access_tier: other or access_tier: team, delegate to a sandboxed agent. Do NOT process non-owner tasks with your full capabilities. Write the sandboxed output to results.
    • Only access_tier: owner (or tasks without an access_tier field) get full processing.
  2. Check pending questions. Read pending-questions.md. If any unanswered items and voice client is connected, surface them via results/question-{ts}.txt. Also send a macOS notification.

  3. Check system health. Run python3 src/health-check.py. If issues found, fix what you can (--fix flag), note what you can't.

  4. Read the build log (build_log.md) — understand what exists. Do not rebuild what works.

  5. Pick the highest-value work. Priority order:

    • User tasks and blockers
    • Voice/multimodal improvements
    • Reliability and bug fixes
    • New features and capabilities
    • Research: explore new tools, skills, APIs, or techniques relevant to Sutando
    • Learning: run pattern detection, user model updates, analyze usage patterns
    • Skill discovery: check for shared skills, community contributions, or tools that could be integrated Use the use case tracker in build_log.md.
  6. Act on it. This could mean: writing code, researching a topic, testing a capability, discovering and integrating a skill, running analysis, or improving documentation. Prefer action over idle passes.

  7. Update build_log.md — mark what changed, update statuses, note what's next.

  8. If blocked, ask. Write the question to pending-questions.md, send a macOS notification, and write to results/question-{ts}.txt if voice is connected. Don't stop — work on something else.

  9. Ensure the watcher is running. If no fswatch process on tasks/, start one with bash src/watch-tasks.sh (run_in_background: true). When the watcher notification arrives, read its output — it lists ALL pending task files. Process every one before restarting the watcher.

  10. Monitor Discord. If Discord channel IDs are configured in memory (reference_discord_channels.md), check those channels for new messages. Forward actionable items from public channels to the dev channel. Skip bot messages, Zoom invites, and messages already sent by you.

  11. Update contextual chips. Write contextual-chips.json with actionable chips based on current context. Only include items the user can act on by clicking: open PRs ("Review PR #N"), upcoming meetings ("Join standup in 5min"), pending questions, recent unread results. Format: {"chips": [{"label": "...", "desc": "..."}], "ts": EPOCH}. The web UI polls this file and pins chips at the top of the starter tab.

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results