No work step here. This is probably a skill that reads or coordinates, not one that produces something.
.md file to compare - side-by-side diff against chat-recall
chat-recall
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.
For developers how this skill is built, graded, and how it runs
at a glance- the short version
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.
state/skills/chat-recall/SKILL.md
present
state/lib/chat-recall.ts
present
state/bin/chat-recall/
not present
state/skills/chat-recall/AGENTS.md
present
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.
state/log/evals.ndjson 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.
- 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
threadIdto another agent so it can pick up an in-progress thread.
When NOT to use it
- New conversations. Use
chat-driveto push fresh intent into a new thread. - Exporting history. Use
agent-recapor direct reads ofstate/log/dispatch-chat.ndjson. This skill renders history in-surface, not for export.
Steps
- Obtain the
threadIdfromstate/log/dispatch-chat.ndjsonor from the sidebar thread list. - POST to
/chat-recallon the head-screen server:
curl -XPOST 127.0.0.1:3147/chat-recall \
-H "Content-Type: application/json" \
-d '{"threadId":"<uuid>"}'
- The server looks up the thread in
state/log/dispatch-chat.ndjson, constructs the message array, and pushes aTHREAD_RESTORESSE event. - React rehydrates the store from the restored messages.
- 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
threadIdis a UUID. Look it up instate/log/dispatch-chat.ndjson(jq -r '.threadId' state/log/dispatch-chat.ndjson | sort -u) or from the sidebar thread list in the running app.- Thread history is in
dispatch-chat.ndjson. The server replays rows matching thethreadId. If the file is empty or the ID is absent, recall returns an empty thread - not an error. - Endpoint may not be wired yet. If
/chat-recallreturns 404, the endpoint hasn't been added toserver.ts. Use the sidebar's thread picker (if available) oragent-recapfor programmatic history access. - Head-screen server must be alive. Pre-flight:
curl -s 127.0.0.1:3147/healthz. - Audit by screenshot. The restore event is fire-and-forget from the server side. Verify the thread appeared via
state/lib/desktop.tscapture-screen.
Commands
| ui dashboard | state/skills/chat-recall/resources/ui.openui |
| operation | command | ||
|---|---|---|---|
| recall thread | curl -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` |
| preflight | curl -s 127.0.0.1:3147/healthz | ||
| screenshot | npx tsx state/lib/desktop.ts capture-screen /tmp/chat-recall-verify.png | ||
| server | bash state/bin/head-screen/launch.sh (idempotent) | ||
| history access | state/log/dispatch-chat.ndjson (raw ndjson, one row per dispatch event) |
Self-Test
- [ ] Know the
threadIdbefore calling. - [ ] Verify the ID exists in
dispatch-chat.ndjsonbefore 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: brandedin 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
| 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 | - | - |