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

snappy-subagents

Puts several helpers to work in parallel and gathers their results.
personal 2 files

What it does for you

Puts several helpers to work in parallel and gathers their results.

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
stages5

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-subagents/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-subagents/api.ts present
code the skill can run
Reusable code this skill can call when it needs to.
Scripts
state/bin/snappy-subagents/ not present
helper scripts
Optional. Added when a skill has a few commands to run.
Loader
state/skills/snappy-subagents/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 4/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
not present

This skill doesn't fix its own gaps yet.

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
  1. Compose any snappy-subagents UI through the current OpenUI path. Persist as artifact lang_body only when reusable.

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 generator
Drain on return - orchestrator IS the live dra
- After each subagent returns, read its writeback line from
what this step does
- After each subagent returns, read its writeback line from state/log/loader-feedback.log and elevate the rule into the right loader IN-SESSION (don't wait for the cron Stop-hook drain). The next dispatch in the same session benefits - see memory feedback_orchestrator_is_live_drain. - If the subagent claimed [FIXED] but you don't see the file edit, the subagent lied - re-dispatch with a stricter prompt and log a pid-validator [LOGGED] line.
auditor Thing that judges (must be different - see CONSTITUTION
2 auditor
Brief each subagent with a closed PiD
- Every subagent prompt MUST mandate a writeback line before exit. If the loader has a gap, edit this AGENTS.md inline.
what this step does
- Every subagent prompt MUST mandate a writeback line before exit. If the loader has a gap, edit this AGENTS.md inline. git log on the file is the audit trail. No silent return edges - see memory feedback_subagent_prompts_must_close_pid. - Even if the work is fully satisfied with no edits, the subagent must still emit a [FIXED] line confirming proof-of-life - silence trips agi-loop-validator.ts (see cockpit-layout/AGENTS.md Rule on consumer no-op). - Tell the subagent which l
3 data
Log + eval
```typescript

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

snappy-subagents

Launch and coordinate parallel subagents in snappy-os. The PiD chain (verb → agent → loader → skill) only learns when each join writes back - this skill is the prose that tells an orchestrator how to dispatch work, how to keep N concurrent commits from clobbering each other, and how to close the loop with a [FIXED|LOGGED] line so the next dispatch starts sharper. Failure mode prevented: parallel agents that silently overwrite each other's work, or worse, return success without a writeback so the loader stays blind to gaps the agent already discovered.

Observed user requests

These are the prompts that triggered this skill being scaffolded:

  • "/loop 10 minutes make sure you keep launching subagents and keep pushing them lets see if we can achieve homemade AGI"
  • "Ok great please commit and push and then I need you to first tell me ok so all of these subagents that have been working"
  • "Tell me what you think, because it seems to me this makes sense, but I just want to make sure that with this, can we ach"
  • "before you do it can you please look up online first and learn just to make sure we benefit from what others have alread"
  • "this is kind of nuts are you telling me we actually achieved our 'homemade agi'?"

The Steps section below is a first-draft response to this cluster - refine as eval scores accumulate.

Steps

1. Decide the fan-out shape

  • One subagent per independent unit of work. If two tasks touch the

same file, queue them sequentially in one subagent - don't fan out.

  • Prefer the in-session Task tool (Anthropic harness) over headless

claude -p for attended work. Headless is for Stop-hook drains, scheduled cron, or when the parent is about to exit. Both inherit the same memory; the subagent will read this loader on its first prompt.

2. Brief each subagent with a closed PiD

  • Every subagent prompt MUST mandate a writeback line before exit. If the loader has a gap, edit this AGENTS.md inline. git log on the file is the audit trail. No silent return edges - see memory feedback_subagent_prompts_must_close_pid.
  • Even if the work is fully satisfied with no edits, the subagent must

still emit a [FIXED] line confirming proof-of-life - silence trips agi-loop-validator.ts (see cockpit-layout/AGENTS.md Rule on consumer no-op).

  • Tell the subagent which loader is its setpoint (state/skills/<slug>/AGENTS.md)

so a P-fix lands in the right file, not a generic note.

3. Race-safe shared worktree (mandatory when N > 1)

  • NEVER git add -A, git add ., git stash -u, or git commit -a -

they sweep other agents' WIP. Use explicit pathspec on commit: git commit -m "msg" -- <your-paths>. The pathspec on commit closes the TOCTOU window between git add and git commit.

  • After git pull --rebase origin main, re-Read your files before Edit -

the rebase silently rewrites the worktree. If a stash-pop conflict resolved by dropping your work, recover via git checkout stash@{0} -- <files>.

  • Each parallel xcodebuild MUST set -derivedDataPath /tmp/snappy-shell-build-<batch>

to avoid colliding artifacts. Cockpit-layout/AGENTS.md Rule 5 has the full incident catalog; cite it.

4. Drain on return - orchestrator IS the live drain

  • After each subagent returns, read its writeback line from

state/log/loader-feedback.log and elevate the rule into the right loader IN-SESSION (don't wait for the cron Stop-hook drain). The next dispatch in the same session benefits - see memory feedback_orchestrator_is_live_drain.

  • If the subagent claimed [FIXED] but you don't see the file edit,

the subagent lied - re-dispatch with a stricter prompt and log a pid-validator [LOGGED] line.

5. Log + eval

import { score } from "../../lib/eval";
score("snappy-subagents", run_id, {
  score: <1.0 if every subagent wrote back AND no clobber AND every reported FIX is on disk
         | 0.5 if writebacks landed but at least one needed re-dispatch
         | 0.0 if any subagent returned silently OR clobbered another agent's commit>,
  primary_issue: <null | "silent-return" | "clobber" | "lied-fix" | ...>,
});

Eval

Actor: the thing that produces the output (a dispatch model, a CLI, or the state/lib/snappy-subagents.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-subagents - loader

Per-turn rules for fan-out + coordination. Full skill: state/skills/snappy-subagents/SKILL.md (5 Steps: fan-out shape → brief → race-safe → drain on return → log+eval). The PiD chain only learns when each agent writes back.

Critical Rules

  • Compose any snappy-subagents UI through the current OpenUI path. Persist as artifact lang_body only when reusable.
  1. One subagent per independent unit. Same-file work must sequence in ONE subagent. Concurrent same-file = git clobber.
  2. Prefer in-session Task over headless claude -p. Headless: Stop-hook drains, cron, parent exit only. Task: attended loop.
  3. EVERY subagent MUST emit writeback before exit. Even no-ops. Mandatory: echo "[$(date -u +%FT%TZ)] <slug>: <gap or fix> [FIXED|LOGGED]" >> state/log/loader-feedback.log. Silence = hung consumer.
  4. Tell subagent its AGENTS.md setpoint. Specify state/skills/<slug>/AGENTS.md as P-fix target so edits land correctly.
  5. Pathspec commits only. NEVER: -A, -a, -am, -u, stash -u. Use: git commit -m "msg" -- <paths>.
  6. Re-Read files after git pull --rebase. Rebase silently rewrites. Recover dropped work: git checkout stash@{0} -- <files>.
  7. Parallel xcodebuild: -derivedDataPath /tmp/snappy-shell-build-<batch> prevents artifact collisions.
  8. Never claude -p from attended if git active. Auto-regen child can clobber. Defer to Stop-hook.
  9. FORBIDDEN paths in every brief. Subagent brief MUST list files it must NOT touch (e.g. App.tsx, styles.css). Pattern: FORBIDDEN: web/src/App.tsx, web/src/styles.css in heading.
  10. Orchestrator = live drain. Read writeback on return, elevate rules IN-SESSION (not Stop-hook).
  11. Honest [FIXED] claims must match disk. Missing edit = lie. Re-dispatch stricter. Actor ≠ auditor (CONSTITUTION #3).
  12. Subagent model floor: model: "sonnet". Haiku too weak for UI/Swift parity. Sonnet default. Haiku only for trivial data tasks.
  13. screencapture -x captures active screen. Non-attended: activate app first: osascript -e 'tell app "SnappyChat" to activate'.
  14. Concurrent build-app.sh blocks chat-drive tests. Lock builds or accept test contamination.

Commands

| ui model | live composition via compose_inline, persisted as artifact lang_body, reopened with OpenArtifact |

operationcommand
safe-commitgit commit -m "msg" -- <pathspec> (NEVER -a, -am, -A)
safe-stashgit stash push -- <your-paths> (NEVER -u in shared)
recover-stashgit checkout stash@{0} -- <files>
detect-rebase-revertwc -l <files> or git diff <ref> -- <files>
parallel-xcodexcodebuild -derivedDataPath /tmp/snappy-shell-build-<batch> ...
writebackAppend [timestamp] slug: summary. [action_kind=type] to stdout or edit this AGENTS.md inline if gap found
scoreimport { score } from "../../lib/eval"; score("snappy-subagents", run_id, { score, primary_issue });
referencestate/skills/snappy-subagents/SKILL.md
logsstate/log/evals.ndjson (eval) \state/log/loader-feedback.log (writebacks)

Score Convention

outcomescore
Every subagent wrote back AND no clobber AND every [FIXED] claim on disk1.0
Writebacks landed but ≥1 needed re-dispatch0.5
Any subagent silent OR clobbered another commit OR lied [FIXED]0.0

Self-Test

  • [ ] One subagent per independent unit; same-file work sequential?
  • [ ] Prefer in-session Task over headless claude -p?
  • [ ] Every subagent writes writeback, even no-ops?
  • [ ] Tell subagent its AGENTS.md setpoint?
  • [ ] Pathspec commits only (-- <paths>), never -a/-A?
  • [ ] Re-Read files after rebase before Edit?
  • [ ] Parallel xcodebuild: -derivedDataPath /tmp/snappy-shell-build-<batch>?
  • [ ] Never nested claude -p from attended context?
  • [ ] Every brief lists explicit FORBIDDEN paths?
  • [ ] Read writebacks in-session, elevate rules immediately?
  • [ ] Verify [FIXED] claims on disk?
  • [ ] Agent/Task calls: model: "sonnet" (floor) - haiku only for trivial data?
  • [ ] Activate app before screencapture -x in non-attended context?
  • [ ] Concurrent builds locked or test contamination logged?

Found a gap? Edit this file. <!-- footer-injection-point -->

api.ts- the code it can call

#!/usr/bin/env npx tsx
/**
 * state/skills/snappy-subagents/api.ts — sidecar for snappy-subagents.
 *
 * Coordination helper for parallel subagent dispatch. Emits a structured
 * "subagent brief" (JSON) given a list of independent tasks, with each
 * brief carrying the mandatory PiD writeback line. Also provides
 * `validateBrief()` — a shape check that fails CI if a generated brief
 * is missing the writeback contract.
 *
 * CLI:
 *   npx tsx api.ts brief <slug> '<gap-or-fix>'
 *     prints a single subagent prompt brief to stdout (JSON).
 *   npx tsx api.ts validate <file>
 *     reads <file> as text and exits 0 if it includes the writeback
 *     contract, exits 1 with a diagnostic otherwise.
 *
 * The actual orchestration (Task tool fan-out, headless `claude -p`) is
 * not done here — the orchestrator is the calling agent. This file
 * exists to encode the contract the prose describes (writeback, no
 * silent return, race-safe pathspec) into machine-checkable form.
 */

export const SKILL_NAME = "snappy-subagents" as const;

const WRITEBACK_REGEX =
  /loader-feedback\.log/;
const PATHSPEC_HINTS = [
  /git\s+add\s+-A\b/,
  /git\s+add\s+\.\b/,
  /git\s+commit\s+-a\b/,
  /git\s+stash\s+-u\b/,
];

export interface SubagentBrief {
  slug: string;
  loader_path: string;
  gap_or_fix: string;
  pid_writeback_line: string;
  rules: string[];
}

export function brief(slug: string, gapOrFix: string): SubagentBrief {
  return {
    slug,
    loader_path: `state/skills/${slug}/AGENTS.md`,
    gap_or_fix: gapOrFix,
    pid_writeback_line:
      `echo "[$(date -u +%FT%TZ)] ${slug}: ${gapOrFix} [FIXED|LOGGED] action_kind=<kind>" >> state/log/loader-feedback.log`,
    rules: [
      "Read state/skills/" + slug + "/AGENTS.md before any tool call",
      "Edit AGENTS.md inline when you discover a gap (P-fix; action_kind=loader-rewritten)",
      "NEVER use `git add -A`, `git add .`, `git stash -u`, `git commit -a` — pathspec only",
      "Re-Read files after `git pull --rebase` (rebase silently rewrites the worktree)",
      "Emit the PiD writeback line before exit, even on no-op (proof-of-life required)",
    ],
  };
}

export interface ValidateReport {
  ok: boolean;
  has_writeback: boolean;
  banned_pathspec_uses: string[];
}

export function validateBrief(text: string): ValidateReport {
  const hasWriteback = WRITEBACK_REGEX.test(text);
  const banned = PATHSPEC_HINTS.filter((re) => re.test(text)).map((re) =>
    re.source.replace(/\\\\b/g, "").replace(/\\s\+/g, " "),
  );
  return {
    ok: hasWriteback && banned.length === 0,
    has_writeback: hasWriteback,
    banned_pathspec_uses: banned,
  };
}

function isMain(): boolean {
  try {
    return import.meta.url === `file://${process.argv[1]}`;
  } catch {
    return false;
  }
}

if (isMain()) {
  const [cmd, ...rest] = process.argv.slice(2);
  if (cmd === "brief") {
    const slug = rest[0] ?? "<slug>";
    const gap = rest.slice(1).join(" ") || "<gap or fix>";
    console.log(JSON.stringify(brief(slug, gap), null, 2));
    process.exit(0);
  }
  if (cmd === "validate") {
    const file = rest[0];
    if (!file) {
      console.error("usage: api.ts validate <file>");
      process.exit(2);
    }
    const text = require("fs").readFileSync(file, "utf8");
    const report = validateBrief(text);
    console.log(JSON.stringify(report, null, 2));
    process.exit(report.ok ? 0 : 1);
  }
  console.log(
    JSON.stringify(
      {
        skill: SKILL_NAME,
        usage: ["api.ts brief <slug> '<gap>'", "api.ts validate <file>"],
      },
      null,
      2,
    ),
  );
  process.exit(0);
}

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