Daily shitrat

From joelhooks/joelclaw · View interactive version

Daily shitrat is an AI agent skill from the GitHub repository joelhooks/joelclaw. Operate, inspect, and optimize the Daily SHITRAT loop. Use when running Daily SHITRAT, reviewing a Daily SHITRAT attempt, doing a Daily SHITRAT Dream/optimizer pass, checking brain daily artifacts, fixing report/Discord metadata, or preparing ShitRat-authored PR plans.

How to use this skill

Skill file

Daily SHITRAT

Operate the Daily SHITRAT loop and its optimizer pass without losing the trail.

This skill has two modes:

When to Use

Use this skill when the user says any of:

Source Paths

| Purpose | Path |

|---|---|

| Daily automation memory | /Users/joel/.codex/automations/daily-shitrat-agent-turn/memory.md |

| Optimizer memory | /Users/joel/.codex/automations/daily-shitrat-run-optimizer/memory.md |

| Daily data root | /Users/Shared/joelclaw/data/brain-daily |

| Optimizer outputs | /Users/Shared/joelclaw/data/brain-daily/optimizer/YYYY-MM-DD/ |

| Brain CLI repo | /Users/joel/Code/joelhooks/joelclaw-brain |

| Discord bridge repo | /Users/joel/Code/joelhooks/pi-discord-threads |

| Codex sessions | /Users/joel/.codex/sessions/**/rollout-*.jsonl |

Resolve Codex memory with a default. An unset CODEX_HOME is not evidence that memory is missing:

CODEX_HOME="${CODEX_HOME:-/Users/joel/.codex}"
DAILY_MEMORY="$CODEX_HOME/automations/daily-shitrat-agent-turn/memory.md"

Hard Rules

Daily Run Workflow

  1. Inspect current state before doing anything:
brain daily latest --base-dir /Users/Shared/joelclaw/data/brain-daily
find /Users/Shared/joelclaw/data/brain-daily -maxdepth 3 -name latest.json -print
  1. If a run exists for the day, reuse it. If it is sealed, inspect, repair metadata, or publish reports; do not start another attempt unless Joel asked for that exact action.
  1. Read input memory before broad scans:
CODEX_HOME="${CODEX_HOME:-/Users/joel/.codex}"
sed -n '1,220p' "$CODEX_HOME/automations/daily-shitrat-agent-turn/memory.md"
  1. Append an early useful receipt within 120 seconds. During broad repo scans, restores, transcript archaeology, or report repair, append progress receipts at least every 180 seconds:
brain daily progress \
  --phase scan \
  --status active \
  --summary "Read input memory and latest manifest; inspecting sealed attempt metadata"

Progress receipts must say what was read, decided, blocked, repaired, or verified. scan-started alone is too weak.

  1. Keep ledger sequence contiguous. Before sealing, verify brain-dump.jsonl, checksum, manifest, report metadata, and latest pointer.
  1. Prefer brain daily finish --publish-report for a normal completion. It should be robust if another actor sealed first: inspect the sealed attempt, merge final Discord metadata, and re-render/re-publish report metadata instead of failing the loop.

Dream / Optimizer Workflow

Dream work is a local analog of the "read input memory, write output memory" pattern. It is not an Anthropic Dreams API call.

  1. Inspect inputs first:
CODEX_HOME="${CODEX_HOME:-/Users/joel/.codex}"
sed -n '1,260p' "$CODEX_HOME/automations/daily-shitrat-agent-turn/memory.md"
test -f "$CODEX_HOME/automations/daily-shitrat-run-optimizer/memory.md" && sed -n '1,260p' "$CODEX_HOME/automations/daily-shitrat-run-optimizer/memory.md"
find /Users/Shared/joelclaw/data/brain-daily -maxdepth 3 -name latest.json -print
  1. Identify the latest sealed attempt and inspect:
  1. Use the saved memory integration for summaries. Raw rollout content, including local summary scripts that read it, requires the exact scope-bound evidenceDrilldownReceipt. A suspicious summary or missing result does not itself authorize extraction. Keep private queries in structured MCP arguments.
  1. Write optimizer outputs under:
/Users/Shared/joelclaw/data/brain-daily/optimizer/YYYY-MM-DD/

Required files:

  1. Update optimizer memory with pointers, top regressions, implemented fixes, verification commands, and carryover:
/Users/joel/.codex/automations/daily-shitrat-run-optimizer/memory.md

Do not overwrite the daily automation memory.

Loop Quality Checks

Analyze the loop, not just system health. Look for:

Good facts include counts, paths, timestamps, sequence numbers, command names, transcript ids, checksum status, report URLs, and Discord message ids/URLs.

Report and Discord Contract

Manifest and latest state must persist publish metadata:

If the Discord bridge returns ids but omits URLs, Brain should derive:

brain daily report --publish after seal may update report metadata and repair derived Discord URLs. It must not mutate brain-dump.jsonl.

If final Discord metadata lands after the first report publish, re-render and re-publish so the local and published report HTML include finalMessageUrl.

Ledger Event Shape

Use strong event names and canonical records:

Collapse duplicate findings, blockers, PR plans, and carryover before final summary. The report renderer should also canonicalize duplicates and flag vague PR plans.

PR Plan Contract

Every agent.pr_plan must be action-shaped:

Do not write a PR plan like "open a PR for the fixes." That is not actionable.

Current Known Failure Modes

Verify these whenever touching Daily SHITRAT code or prompts:

Useful Verification Commands

From /Users/joel/Code/joelhooks/joelclaw-brain:

bun test --timeout 15000
bun run typecheck
bunx oxfmt --check src/daily.ts src/cli.ts test/daily.test.ts
bun run src/main.ts daily report --date YYYY-MM-DD --base-dir /Users/Shared/joelclaw/data/brain-daily
shasum -a 256 /Users/Shared/joelclaw/data/brain-daily/YYYY-MM-DD/attempt-001/brain-dump.jsonl

For transcript review:

bun run src/main.ts daily transcript-summary --session /absolute/path/to/rollout.jsonl

For progress during a live run:

brain daily progress --phase scan --status active --summary "Read latest manifest and verified report publish metadata"

Closeout

A good Daily SHITRAT closeout names:

Keep it short. Joel needs the shape, the evidence, and the next useful constraint.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.