OR Key
drop another .md file to compare - side-by-side diff against snappy-task-id

snappy-task-id

Catches the result when a background helper finishes and routes it to you.
personal 2 files

What it does for you

Catches the result when a background helper finishes and routes it to you.

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

actorThing that
auditorThing that judges (must be different - see CONSTITUTION
eval modeauto-shape
categorySystem
stages4

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/snappy-task-id/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/skills/snappy-task-id/api.ts present
code the skill can run
Reusable code this skill can call when it needs to.
Scripts
state/bin/snappy-task-id/ not present
helper scripts
Optional. Added when a skill has a few commands to run.
Loader
state/skills/snappy-task-id/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 5/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
present
Thing that the worker
Does the actual work. Whatever it produces is what gets checked next.
checks the work The reviewer
present
Thing that judges (must be different - see CONSTITUTION the checker
A separate checker grades the work, so the part that made it can't approve its own work.
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…

how the work flows- who makes it, who checks it

actor Thing that
1 control
Scope — no side effects
What to read, what to compute, what to return. This step MUST be runnable
what this step does
What to read, what to compute, what to return. This step MUST be runnable with no apply: true flag and no credentials beyond read-only.
2 generator
Act (only if the gate passes)
The real work. Dispatch, write, post, or compose. Keep this step thin —
what this step does
The real work. Dispatch, write, post, or compose. Keep this step thin — heavy logic belongs in state/lib/snappy-task-id.ts (or state/bin/snappy-task-id/), not inline here.
auditor Thing that judges (must be different - see CONSTITUTION
3 data
Log + eval
```typescript

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

snappy-task-id

Handles <task-notification> XML blocks that Claude Code emits when a background agent completes. Prevents the failure mode where task completion events arrive in the prompt stream but no handler routes the result (tool output, eval row, or dispatcher callback) - they silently disappear.

Observed user requests

These are the prompts that triggered this skill being scaffolded:

  • "<task-notification> <task-id>a4e15e57eed93434b</task-id> <tool-use-id>toolu_01GpBfxaUT5b2wVkLNVz62f8</tool-use-id> <outp"
  • "<task-notification> <task-id>a49be00ffbf91e594</task-id> <tool-use-id>toolu_01MDBr7CNptXiwJtJ3ZEfHQX</tool-use-id> <outp"

Steps

  • Parse the <task-notification> XML block: extract <task-id>, <tool-use-id>, and <output> (or error) fields.
  • Look up the task-id in state/log/dispatch-subagent.ndjson to correlate with the original dispatch that spawned it.
  • If the output contains an eval row (score(...) call output), forward it to state/lib/eval.ts for ingestion.
  • If the output contains a loader-feedback writeback line, append it to state/log/loader-feedback.log.
  • If the task output is an error or empty, log a score("snappy-task-id", run_id, { score: 0.5, primary_issue: "task returned empty/error" }) row so the agi-loop-validator doesn't see a consumer no-op.
  • On success, log score("snappy-task-id", run_id, { score: 1.0 }) and emit a one-line summary of what the completed task produced.
  • Never re-dispatch the same task-id twice - check for duplicate task-id in the ledger first.

Steps (scope-only / apply:false)

1. Scope - no side effects

What to read, what to compute, what to return. This step MUST be runnable with no apply: true flag and no credentials beyond read-only.

2. Gate

Hard-fail any missing required field. Never soft-skip. The gate is the protection against "I thought we checked that."

3. Act (only if the gate passes)

The real work. Dispatch, write, post, or compose. Keep this step thin - heavy logic belongs in state/lib/snappy-task-id.ts (or state/bin/snappy-task-id/), not inline here.

4. Log + eval

import { score } from "../../lib/eval";
score("snappy-task-id", run_id, {
  score: <pass = 1.0 | partial = 0.5 | fail = 0.0>,
  primary_issue: <null | one-line reason>,
});

Eval

Actor: the thing that produces the output (a dispatch model, a CLI, or the state/lib/snappy-task-id.ts library if one exists). Auditor: the thing that judges (must be different - see CONSTITUTION invariant #3). Name both explicitly.

Score convention:

OutcomeScore
Pass on first try1.0
Failed first, auto-fix applied, re-check passed0.5
Still failing or unrecoverable0.0

If you cannot name a deterministic auditor, switch the frontmatter to eval: manual and log to state/log/pending-eval.ndjson - but fight to avoid manual. Manual is the escape hatch that leaks the thesis.

Gotchas

  • List concrete failure modes you hit while building. Examples: "API

returns 200 with empty body"; "round-tripped text has a , artifact where em-dashes used to be"; "cache file is stale after 12h."

  • If a gotcha matches an entry in user memory (see ~/.claude/CLAUDE.md),

cite the memory name so future agents can follow the trail.

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

snappy-task-id - loader

Per-turn rules for handling Claude Code task notifications. Full skill: state/skills/snappy-task-id/SKILL.md.

Critical Rules

  1. Parse <task-notification> XML. Extract <task-id>, <tool-use-id>, <output> (or error). Malformed → score 0.0 immediately.
  2. Correlate task-id with ledger. Look up in state/log/dispatch-subagent.ndjson to find original dispatch context.
  3. Route output correctly. If output contains eval row (score(...) call): forward to state/lib/eval.ts. If output contains loader-feedback line: append to state/log/loader-feedback.log. If error/empty: log score("snappy-task-id", run_id, { score: 0.5, primary_issue: "task returned empty/error" }).
  4. On success: log eval row. score("snappy-task-id", run_id, { score: 1.0 }) + one-line summary.
  5. Guard against duplicates. Check ledger for duplicate task-id; never re-dispatch same task twice.
  6. Malformed XML = fail immediately. Cannot parse <task-notification>? Log raw block to eval with score 0.0, primary_issue: "malformed-xml". Do not attempt partial parsing.

Commands

| ui dashboard | state/skills/snappy-task-id/resources/ui.openui |

operationcommand
parse task-notificationgrep -oP 'task-id>\K[^<]+' <<< "<xml>"
lookup ledgergrep "<task-id>" state/log/dispatch-subagent.ndjson
forward eval rowpass output to state/lib/eval.ts score()
forward writebackecho "[...] slug: details [FIXED]" >> state/log/loader-feedback.log
eval logstate/log/evals.ndjson
dispatch ledgerstate/log/dispatch-subagent.ndjson
writeback logstate/log/loader-feedback.log

Self-Test

  • [ ] Parse <task-notification> XML correctly?
  • [ ] Correlate task-id with dispatch-subagent ledger?
  • [ ] Route eval rows and writebacks to correct sinks?
  • [ ] Write eval row on success/error?
  • [ ] Guard against duplicate task-ids?
  • [ ] Fail immediately on malformed XML?

<!-- kernel-ok: historical attribution for the PID-loader pattern. -->

Self-correcting loader (PID feedback)

This is the rule that makes loaders learn. Ported from snappy-kernel, where it demonstrably worked: the snappy-dom-cartographer skill mapped Skool admin UI once, every later ship-agent inherited the full map for free.

Before you finish, do two things:

1. Fix gaps (P - proportional). MANDATORY. If this loader didn't cover your case - if you had to read another file, run an undocumented command, work around a wrong selector, or discover a quirk - you MUST attempt an Edit to this AGENTS.md before you log.

  • Default action: edit this file. Surgical. Add the missing line, table

row, or code example where it belongs. No restructuring.

  • Only LOGGED is allowed when: the fix needs >10 lines, spans multiple

files, or requires a structural rewrite.

  • "I didn't have time" / "it's minor" / "the next agent will figure it out"

are NOT valid reasons.

  • The goal: the next agent never has to leave the loader.

2. Log the result.

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

Do not skip this. Every agent run must leave the system better than it found it. The loader is the setpoint; you are the sensor; the gap is the error signal; closing the gap is the correction.

OpenUI Resource

  • Skill-owned OpenUI Lang resource: state/skills/snappy-task-id/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
/**
 * state/skills/snappy-task-id/api.ts — sidecar stub for the snappy-task-id skill.
 *
 * This file is created by the scaffolder so a fresh skill folder is
 * structurally valid. Replace the placeholder with the real implementation
 * the moment the skill needs executable logic, OR move the implementation
 * to `state/lib/snappy-task-id.ts` (preferred — the lib path is what
 * `eval: shape` validates against).
 *
 * If this skill has no backing code (prose-only slash command), delete this
 * file and rely on `eval: auto-shape` in SKILL.md.
 */
export const SKILL_NAME = "snappy-task-id" as const;

export function describe(): string {
  return "The task-id skill — purpose TBD.";
}

if ((() => { try { return import.meta.url === `file://${process.argv[1]}`; } catch { return false; } })()) {
  console.log(JSON.stringify({ skill: SKILL_NAME, describe: describe() }, null, 2));
}

scripts- helper scripts it can run

prose-only skill - 1 inline code block live in SKILL.md above (no state/bin/ sidecar yet).

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

rubric auto-shape no rubric declared
recent no runs actor/auditor: unverifiable
deps none declared

no recent runs logged - the eval contract is declared but nothing has been graded yet