OR Key
drop another .md file to compare - side-by-side diff against chat-recall

chat-recall

Brings an earlier conversation back so you can pick up where you left off.
personal 2 files 3 recent evals

What it does for you

Brings an earlier conversation back so you can pick up where you left off.

What it produces

A recent result, so you can see the kind of work it returns.

loading…

How to get it

These run inside the Snappy workspace. Want this working in your business? I set skills like this up with you, in one focused week.

Work with me
For developers how this skill is built, graded, and how it runs

at a glance- the short version

eval modeauto-shape

what's inside - the parts that make up a skill 3/4 present

A skill is just a few plain-text files. Only the main one is required. The rest are optional, added as the work needs them. This is what the skill is made of; how it runs is just below.

The skill
state/skills/chat-recall/SKILL.md present
the skill itself, in plain text
The main file. It says what the skill is and lays out the steps in plain English.
Code
state/lib/chat-recall.ts present
code the skill can run
Reusable code this skill can call when it needs to.
Scripts
state/bin/chat-recall/ not present
helper scripts
Optional. Added when a skill has a few commands to run.
Loader
state/skills/chat-recall/AGENTS.md present
what the AI loads on the fly
Loaded automatically the moment this skill is needed. Kept short on purpose.

how it runs - the shared frame every skill uses 3/5 present

Every skill runs the same way. One part does the work, a separate part checks it, and a short loader hands the AI exactly what it needs for the job. Anything this skill doesn't use shows a one-line note saying why, on purpose, not by accident.

makes the work The worker
not present

No work step here. This is probably a skill that reads or coordinates, not one that produces something.

checks the work The reviewer
inferred
shape gate an automatic check
The check is an automatic pass or fail on the shape of the result, run separately from the work itself.
frame
learns Self-correction
present
fixes itself learns from gaps
When a run hits a gap, the skill gets edited on the spot [FIXED] or queued for a bigger rewrite [LOGGED], so it keeps getting better.
tidies up Background fixes
present
queued for rewrite runs in the background
Bigger fixes that can't be made on the spot get queued and rewritten in the background later.
remembers Run history
present
state/log/evals.ndjson auto-shape runs
Every run is written down here, so the next time this skill is used it already knows how the last runs went.
Critical rules the things this skill must not get wrong
No must-not-break rules called out for this skill. Anything important lives in the writeup below.

what it has learned - fixes written back in over time sample

When a run hits something this skill didn't handle, the fix gets written back into the skill so it doesn't happen again. FIXED means it was corrected on the spot. LOGGED means it's queued for a bigger rewrite. Either way, the skill gets a little better and never makes the same mistake twice.

  1. Loading feedback rows…

SKILL.md- the skill, written out in plain English

chat-recall

Re-load a previous chat thread into the snappy-chat surface. Given a threadId, the server fetches the stored message history and replays it into the React store so the thread is visible and scrollable.

What it's for

  • Context continuity. Resume an earlier conversation where you left off, with all rendered cards intact.
  • QA regression. Re-open a known thread to verify that a card still renders correctly after a UI change.
  • Handoff. Pass a threadId to another agent so it can pick up an in-progress thread.

When NOT to use it

  • New conversations. Use chat-drive to push fresh intent into a new thread.
  • Exporting history. Use agent-recap or direct reads of state/log/dispatch-chat.ndjson. This skill renders history in-surface, not for export.

Steps

  1. Obtain the threadId from state/log/dispatch-chat.ndjson or from the sidebar thread list.
  2. POST to /chat-recall on the head-screen server:
   curl -XPOST 127.0.0.1:3147/chat-recall \
     -H "Content-Type: application/json" \
     -d '{"threadId":"<uuid>"}'
  1. The server looks up the thread in state/log/dispatch-chat.ndjson, constructs the message array, and pushes a THREAD_RESTORE SSE event.
  2. React rehydrates the store from the restored messages.
  3. Audit by screenshot.

Eval

Kind: auto-shape. Frontmatter + AGENTS.md presence passes the gate. Behavioral test pending the /chat-recall endpoint being wired in state/bin/head-screen/server.ts.

Files

  • state/bin/head-screen/server.ts - owns /chat-recall (pending wire-up).
  • state/log/dispatch-chat.ndjson - thread history source.
  • state/skills/chat-recall/SKILL.md - this file.

AGENTS.md- what the AI loads when this skill comes up

chat-recall - loader

Per-turn rules. Full reference: state/skills/chat-recall/SKILL.md.

Critical Rules

  1. threadId is a UUID. Look it up in state/log/dispatch-chat.ndjson (jq -r '.threadId' state/log/dispatch-chat.ndjson | sort -u) or from the sidebar thread list in the running app.
  2. Thread history is in dispatch-chat.ndjson. The server replays rows matching the threadId. If the file is empty or the ID is absent, recall returns an empty thread - not an error.
  3. Endpoint may not be wired yet. If /chat-recall returns 404, the endpoint hasn't been added to server.ts. Use the sidebar's thread picker (if available) or agent-recap for programmatic history access.
  4. Head-screen server must be alive. Pre-flight: curl -s 127.0.0.1:3147/healthz.
  5. Audit by screenshot. The restore event is fire-and-forget from the server side. Verify the thread appeared via state/lib/desktop.ts capture-screen.

Commands

| ui dashboard | state/skills/chat-recall/resources/ui.openui |

operationcommand
recall threadcurl -XPOST 127.0.0.1:3147/chat-recall -H "Content-Type: application/json" -d '{"threadId":"<uuid>"}'
find thread IDs`jq -r '.threadId' state/log/dispatch-chat.ndjson \sort -u \tail -20`
preflightcurl -s 127.0.0.1:3147/healthz
screenshotnpx tsx state/lib/desktop.ts capture-screen /tmp/chat-recall-verify.png
serverbash state/bin/head-screen/launch.sh (idempotent)
history accessstate/log/dispatch-chat.ndjson (raw ndjson, one row per dispatch event)

Self-Test

  • [ ] Know the threadId before calling.
  • [ ] Verify the ID exists in dispatch-chat.ndjson before the POST.
  • [ ] Audit by screenshot, not return code.

Self-correcting loader (PID feedback)

echo "[$(date -u +%FT%TZ)] chat-recall: <what was missing or fixed> [FIXED|LOGGED] action_kind=skill-ran" >> state/log/loader-feedback.log

OpenUI Resource

  • Skill-owned OpenUI Lang resource: state/skills/chat-recall/resources/ui.openui. Read it before rendering or editing this skill's generated component surface.
  • Treat this resource as a first-class artifact of the skill, not a generic chat response. Improve it when the skill's user-facing output needs to become richer.
  • System resources compose OpenUI primitives and inherit SnappyChat tokens. Use ui_contract: branded in SKILL.md only for deliberate platform or client visuals.

api.ts- the code it can call

#!/usr/bin/env npx tsx
// snappy-os/api.ts
// chat-recall: summarize recent activity (threads, evals, commits) for "what did we work on" queries.
// Usage: npx tsx state/lib/chat-recall.ts [--days 7] [--limit 10]
// Returns JSON: {threads, evals, commits}

import { existsSync, readdirSync, readFileSync, statSync } from "fs";
import { join } from "path";
import { execSync } from "child_process";
import { homedir } from "os";

// Use env var or default to ~/projects/snappy-os
const SNAPPY_OS_ROOT = process.env.SNAPPY_OS_ROOT || join(homedir(), "projects", "snappy-os");
const THREADS_DIR = join(SNAPPY_OS_ROOT, "state", "log", "threads");
const EVALS_FILE = join(SNAPPY_OS_ROOT, "state", "log", "evals.ndjson");

interface ThreadSummary {
  id: string;
  title: string;
  lastMessage?: string;
  ts: string;
}

interface EvalSummary {
  skill: string;
  score: number;
  ts: string;
  notes?: string;
}

interface CommitSummary {
  sha: string;
  msg: string;
  ts: string;
  repo: string;
}

interface RecallDigest {
  threads: ThreadSummary[];
  evals: EvalSummary[];
  commits: CommitSummary[];
}

export async function getRecallDigest(days: number = 7, limit: number = 10): Promise<RecallDigest> {
  const digest: RecallDigest = {
    threads: [],
    evals: [],
    commits: [],
  };

  // Calculate cutoff timestamp
  const now = new Date();
  const cutoff = new Date(now.getTime() - days * 24 * 60 * 60 * 1000);
  const cutoffIso = cutoff.toISOString();

  // 1. Fetch recent threads
  try {
    if (existsSync(THREADS_DIR)) {
      const files = readdirSync(THREADS_DIR)
        .filter((f) => f.endsWith(".json"))
        .map((f) => ({
          name: f,
          path: join(THREADS_DIR, f),
          mtime: statSync(join(THREADS_DIR, f)).mtime.getTime(),
        }))
        .sort((a, b) => b.mtime - a.mtime)
        .slice(0, limit);

      for (const file of files) {
        try {
          const content = readFileSync(file.path, "utf-8");
          const thread = JSON.parse(content);
          const ts = thread.lastMessageAt || thread.createdAt || "";
          if (ts >= cutoffIso) {
            // Extract preview from last message or title
            let preview = thread.title || "";
            if (thread.messages && thread.messages.length > 0) {
              const lastMsg = thread.messages[thread.messages.length - 1];
              if (lastMsg.content && typeof lastMsg.content === "string") {
                preview = lastMsg.content.slice(0, 80).replace(/\n/g, " ");
              }
            }
            digest.threads.push({
              id: thread.id,
              title: thread.title || "Untitled",
              lastMessage: preview || undefined,
              ts,
            });
          }
        } catch {
          // Skip malformed thread files
        }
      }
    }
  } catch (e) {
    // Silently fail thread fetch
  }

  // 2. Fetch recent evals
  try {
    if (existsSync(EVALS_FILE)) {
      const lines = readFileSync(EVALS_FILE, "utf-8").split("\n").filter((l) => l.trim());
      const evals: EvalSummary[] = [];
      let parsed = 0;
      let matched = 0;

      for (const line of lines) {
        try {
          const row = JSON.parse(line);
          parsed++;
          const ts = row.ts || "";
          // Eval rows are recent if they have a valid ts and fall within the window
          if (ts && ts >= cutoffIso) {
            matched++;
            evals.push({
              skill: row.verb || "unknown",
              score: typeof row.score === "number" ? row.score : 0,
              ts,
              notes: row.notes || row.primary_issue || undefined,
            });
          }
        } catch {
          // Skip malformed eval rows
        }
      }

      // Sort by timestamp desc, take top N
      digest.evals = evals.sort((a, b) => new Date(b.ts).getTime() - new Date(a.ts).getTime()).slice(0, limit);
    }
  } catch (e) {
    // Silently fail eval fetch
  }

  // 3. Fetch recent commits (cross-repo: snappy-os + snappy-chat)
  try {
    const repos = [SNAPPY_OS_ROOT, join(SNAPPY_OS_ROOT, "..", "snappy-chat")];

    for (const repoPath of repos) {
      if (!existsSync(repoPath)) continue;

      try {
        const repoName = repoPath.endsWith("snappy-chat") ? "snappy-chat" : "snappy-os";
        // git log --since with ISO timestamp
        const raw = execSync(
          `git -C "${repoPath}" log --oneline --since="${cutoffIso}" --max-count=${limit}`,
          {
            encoding: "utf-8",
            timeout: 3000,
            stdio: ["pipe", "pipe", "ignore"],
          }
        );

        const lines = raw.trim().split("\n").filter((l) => l.trim());
        for (const line of lines) {
          const match = line.match(/^([a-f0-9]+)\s+(.+)$/);
          if (match) {
            const sha = match[1].slice(0, 7);
            const msg = match[2];

            // Get commit timestamp
            try {
              const tsRaw = execSync(`git -C "${repoPath}" log --format=%ai -1 ${match[1]}`, {
                encoding: "utf-8",
                timeout: 1000,
                stdio: ["pipe", "pipe", "ignore"],
              }).trim();
              digest.commits.push({
                sha,
                msg,
                ts: new Date(tsRaw).toISOString(),
                repo: repoName,
              });
            } catch {
              // Skip if can't get timestamp
            }
          }
        }
      } catch {
        // Skip if git log fails for this repo
      }
    }

    // Sort commits by timestamp desc, take top N
    digest.commits = digest.commits
      .sort((a, b) => new Date(b.ts).getTime() - new Date(a.ts).getTime())
      .slice(0, limit);
  } catch (e) {
    // Silently fail commit fetch
  }

  return digest;
}

// CLI entry
if (import.meta.url === `file://${process.argv[1]}`) {
  const daysStr = process.argv[2] || "7";
  const days = parseInt(daysStr, 10) || 7;

  getRecallDigest(days, 10)
    .then((digest) => {
      console.log(JSON.stringify(digest, null, 2));
    })
    .catch((err) => {
      console.error("Error:", err.message);
      process.exit(1);
    });
}

export type { RecallDigest, ThreadSummary, EvalSummary, CommitSummary };

scripts- helper scripts it can run

prose-only skill - no sidecar under state/bin/ yet. Steps, if any, are described in SKILL.md.

how we check it- the checks, plus the last 3 runs

rubric auto-shape no rubric declared
recent mean 1.00 · 3 runs actor/auditor: unverifiable
deps none declared
timestamp verb score primary_issue artifact
2026-05-01 09:19Z - 1.00 - -
2026-05-01 09:19Z - 1.00 - -
2026-05-01 09:19Z - 1.00 - -