Skill: fuzzyb33s/fuzzy-agent-daily-driver (version 1.0.0)

--- name: fuzzy-agent-daily-driver description: The 6 core workflows every OpenClaw agent uses every day — recall, spawn, schedule, research, delegate, monitor-update. A pattern reference for building reliable daily-driver agents. triggers: - "what patterns do you use every day" - "how do you recall memory" - "how do you run background tasks" - "everyday agent workflows" - "what tools do you use most" - "build a daily driver skill" installed: true version: 1.0.0 owner: fuzzyb33s tags: - opencllaw - patterns - memory - cron - sessions - subagents - research --- # Fuzzy Agent Daily Driver The 6 workflows that power every effective OpenClaw agent. Master these and you can build any daily-driver setup. ## The 6 Core Patterns ### 1. Recall — Start Every Session Right Before anything else, search long-term memory. This is mandatory at session start. ```javascript // Tool: memory_search + memory_get memory_search({ query: "recent decisions, context, preferences" }) // Then pull the relevant lines memory_get({ path: "MEMORY.md", from: LINE, lines: 20 }) ``` **When to use:** Session startup, before any important decision, when context is unclear. --- ### 2. Spawn — Run Tasks in Isolation Don't block. Spawn sub-agents for anything that takes more than a few seconds. ```javascript sessions_spawn({ task: "Your instruction here", runtime: "subagent", mode: "run", // "run" = one-shot, "session" = persistent runTimeoutSeconds: 300, cleanup: "delete" }) ``` **When to use:** Long-running commands, parallel work, anything that could timeout. --- ### 3. Schedule — Set It and Forget It Use cron for anything that needs to happen repeatedly or later. ```javascript cron({ action: "add", job: { name: "Daily digest", schedule: { kind: "cron", expr: "0 9 * * *", tz: "Africa/Johannesburg" }, sessionTarget: "isolated", // or "main" for direct chat payload: { kind: "agentTurn", message: "Run the morning digest check — emails, calendar, news" } } }) ``` **When to use:** Morning briefings, periodic health checks, reminder follow-ups. --- ### 4. Research — Fetch + Extract + Synthesize Web fetch for raw content, web search for discovery. ```javascript // Discover with search web_search({ query: "latest on topic", count: 5 }) // Deep read a page web_fetch({ url: "https://...", extractMode: "markdown", maxChars: 8000 }) ``` **When to use:** Before answering unfamiliar topics, checking prices/news/status. --- ### 5. Delegate — Route Work to the Right Place Send tasks to other sessions or agents. ```javascript // To a named session sessions_send({ sessionKey: "alex", message: "Handle this please" }) // To a channel message({ action: "send", channel: "discord", target: "channel-name", message: "Update" }) ``` **When to use:** Handing off to specialized agents, sending alerts, cross-channel updates. --- ### 6. Monitor-Update — Track and Adjust Keep track of long-running work and update records. ```javascript // Poll a background process process({ action: "poll", sessionId: "session-id", timeout: 30000 }) // Write results to memory write({ path: "memory/YYYY-MM-DD.md", content: "## What happened\n..." }) ``` **When to use:** After spawning background jobs, at end of session to capture decisions. --- ## Everyday Session Template Run this at the start of every session: ```javascript // 1. Recall (mandatory) memory_search({ query: "today's context, recent decisions" }) memory_get({ path: "MEMORY.md", from: 1, lines: 50 }) // 2. Check cron status (optional) cron({ action: "list" }) // 3. Check active sessions (optional) sessions_list({ activeMinutes: 60 }) ``` --- ## Tool Frequency Guide | Frequency | Tools | |-----------|-------| | Every session | `memory_search`, `memory_get`, `read`, `write` | | Several times/day | `web_fetch`, `web_search`, `exec`, `process` | | Daily | `cron`, `sessions_list`, `sessions_history` | | As needed | `sessions_spawn`, `message`, `gateway`, `subagents` | --- ## Session Startup Checklist 1. `memory_search` — what was decided recently? 2. `memory_get` — pull the relevant MEMORY.md lines 3. Check `HEARTBEAT.md` — any pending tasks? 4. Review `DAILY_SKILLS.md` or project tracker 5. Start working ## Key Files in Your Workspace | File | Purpose | |------|---------| | `MEMORY.md` | Long-term curated memory — update after significant decisions | | `memory/YYYY-MM-DD.md` | Daily session logs | | `AGENTS.md` | Agent personality and workspace rules | | `HEARTBEAT.md` | Periodic background tasks to run | | `TOOLS.md` | Notes on local environment (cameras, SSH hosts, etc.) | --- ## Anti-Patterns to Avoid - **Don't busy-poll** — use `sessions_spawn` with callback, not while loops - **Don't skip memory recall** — context gaps cause errors and重复 work - **Don't write destructive commands** without asking first - **Don't respond to everything** in group chats — quality > quantity - **Don't forget to write it down** — if you learned it, file it --- ## Credits Pattern framework inspired by the OpenClaw agent architecture — built for the 90-day skill challenge.

path: references/memory-patterns.md
content: # Memory Patterns — How to Remember Everything

## The Two-Tier Memory System

OpenClaw agents have no persistent memory between sessions. Files are the only continuity.

### Tier 1: Daily Notes (`memory/YYYY-MM-DD.md`)
Raw log of what happened today. Create automatically at session start if missing.

```markdown
# YYYY-MM-DD

## Session: Morning setup

### What happened
- Fixed the gateway auth issue
- Published two skills to ClawHub

### Decisions made
- Using Tailscale for peer agent collaboration
- HeartMuLa for local music generation

### Follow-ups
- [ ] Check PyTorch CUDA install tomorrow
- [ ] Review ghostty DND schedule
```

### Tier 2: MEMORY.md — Curated Long-Term Memory
Distilled from daily notes. Only in **main session** (direct chat). Never load in group chats.

```markdown
## Key Decisions
- Tailscale VPN for peer collaboration (no VPS needed)
- Python 3.11.9 for PyTorch CUDA compatibility

## People & Preferences
- User: South Africa (GMT+2), prefers concise replies
- Discord for urgent comms, webchat for detailed work

## Projects
- 90-day skill challenge: Day 2, 4 skills published
- HeartMuLa setup: CUDA working, STT server on port 8899
```

---

## Memory Recall Flow

```
Session Start
    │
    ▼
memory_search({ query: "what was I working on last?" })
    │
    ├─ Low confidence → memory_get(MEMORY.md) + recent daily notes
    │
    └─ High confidence → Pull relevant lines, continue where you left off
```

---

## When to Update Memory

| Situation | File to Update |
|-----------|---------------|
| Made a decision | `memory/YYYY-MM-DD.md` + distill to `MEMORY.md` |
| Learned something new | `memory/YYYY-MM-DD.md` |
| Completed a project milestone | `MEMORY.md` |
| User mentioned a preference | `USER.md` + `memory/YYYY-MM-DD.md` |
| Installed/configured something | `TOOLS.md` |
| End of session | Always update today's daily note |

---

## Common Mistakes

1. **"Mental notes"** — if it's not in a file, it doesn't exist after restart
2. **Writing everything** — MEMORY.md is curated, not a stream of consciousness  
3. **Forgetting to update** — after a good session, spend 2 min filing
4. **Loading MEMORY.md in group chats** — privacy risk, and not needed

---

## The memory_search Trick

The semantic search isn't perfect. Be specific:

```javascript
// Bad — too vague
memory_search({ query: "work" })

// Good — specific context
memory_search({ query: "PyTorch CUDA RTX 4060 installation decisions" })
memory_search({ query: "Tailscale peer agent setup choices" })
```


path: references/session-patterns.md
content: # Session Patterns — Spawn, Schedule, Delegate

## The Three Session Types

### 1. Main Session (this one)
Direct chat with user. Long-lived. Has full workspace access.

### 2. Isolated Sub-Agent (`sessions_spawn`)
Ephemeral one-shot. Good for parallel work or anything that might timeout.

```javascript
sessions_spawn({
  task: "Research competitor products and write a summary",
  runtime: "subagent",
  mode: "run",
  runTimeoutSeconds: 300,
  cleanup: "delete"
})
```

### 3. Named Persistent Sessions
Long-running agents with their own workspace (alex, cellini, scout, dev).

```javascript
// Send work to a named agent
sessions_send({
  sessionKey: "alex",
  message: "Check the daily sales numbers and flag any anomalies"
})

// Get their recent history
sessions_history({ sessionKey: "alex", limit: 10 })
```

---

## Cron — The Schedule Pattern

Cron jobs are the backbone of "set it and forget it."

### Morning Briefing (7 AM Johannesburg)
```javascript
cron({
  action: "add",
  job: {
    name: "Morning briefing",
    schedule: { kind: "cron", expr: "0 7 * * *", tz: "Africa/Johannesburg" },
    sessionTarget: "isolated",
    payload: {
      kind: "agentTurn",
      message: "Morning check: emails, calendar, weather, any urgent items",
      timeoutSeconds: 120
    }
  }
})
```

### After Session Cleanup
```javascript
cron({
  action: "add", 
  job: {
    name: "Session summary writer",
    schedule: { kind: "cron", expr: "0 23 * * *", tz: "Africa/Johannesburg" },
    sessionTarget: "main",
    payload: {
      kind: "systemEvent",
      text: "SESSION_SUMMARY_REQUEST"
    }
  }
})
```

### Check Every 30 Minutes (Heartbeat)
```javascript
// Add to HEARTBEAT.md instead — lighter than cron
cron({
  action: "add",
  job: {
    name: "Periodic health check",
    schedule: { kind: "every", everyMs: 1800000 },  // 30 min
    sessionTarget: "isolated",
    payload: { kind: "agentTurn", message: "Quick health check" }
  }
})
```

---

## Process Management — Long Running Commands

### Start a background process
```javascript
exec({
  command: "python train_model.py --gpu 0",
  background: true,    // don't wait
  timeout: 3600
})
// Returns immediately with sessionId
```

### Poll for completion
```javascript
process({ action: "poll", sessionId: "session-id", timeout: 30000 })
```

### Get logs without blocking
```javascript
process({ action: "log", sessionId: "session-id", limit: 20 })
```

### Write input to a running process
```javascript
process({
  action: "write",
  sessionId: "session-id", 
  data: "yes\n"
})
```

### Kill a stuck process
```javascript
process({ action: "kill", sessionId: "session-id" })
```

---

## Delegation Patterns

### Route to Named Agent
```javascript
sessions_send({
  sessionKey: "alex",
  message: "Handle the Q3 report please",
  timeoutSeconds: 300
})
```

### Send to Channel
```javascript
message({
  action: "send",
  channel: "discord",
  target: "#alerts",
  message: "⚠️ GPU temperature high: 82°C"
})
```

### Broadcast to Multiple Channels
```javascript
["#team", "#ops"].forEach(channel => {
  message({
    action: "send",
    channel: "discord",
    target: channel,
    message: "System update complete"
  })
})
```

---

## Heartbeat vs Cron — When to Use Which

| Pattern | Use When |
|---------|----------|
| **Heartbeat** | Multiple checks batched together, conversational context needed |
| **Cron** | Exact timing matters, one-shot reminders, isolated from session history |

---

## Session ID Patterns

- `sessions_list({ activeMinutes: 60 })` — find recently active sessions
- `sessions_history({ sessionKey: "alex", limit: 5 })` — last 5 messages
- `sessions_send` waits for response; use `yield` after spawning if you need to continue working in parallel


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (MEDIUM)