⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
ai-exchange
Grade every place an application talks to an LLM, A–F, on the quality of information exchange: can the model get the schemas it must conform to at runtime, are those schemas generated from the single source of truth (not hand-copied into prompts), can it read the state it is changing, is it sent only the data it needs within a bounded context, is its output validated with a bounded repair loop, and is anything durable gated. Classifies each call as tool-mediated, prompt-stuffed or blind. Use when auditing AI features, agents, LLM-calling code, or prompt↔schema drift.
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
hyvemind
Your coding agent says it's done. hyvemind checks.
Agents, and the people running them, declare victory on evidence that could not have failed. Each of these happened in one codebase, a TypeScript monorepo with about 3,900 test files and many agent sessions working on it in parallel:
- A deploy check got
200for the new JavaScript bundle. The host rewrites unknown paths toindex.html, so the 200 was the fallback page, and the app didn't load for anonymous visitors. - A check that nobody else had deployed returned nothing, with exit code 0, on three deploys in a row. It was querying without the region, so it could never find a build.
- A background test run was reported as exit 0. It had crashed on a bad flag and run
zero tests. The 0 came from the
echoafter it. - The merge queue's key safety check ("what landed is what was tested") had no test that could fail. A sabotage probe found it.
- hyvemind's own "this exact tree" hash missed edits made in the same second as the last index write. CI on Linux caught it.
- An eval of our agent skills scored every skill 0%. A CLI flag had swallowed the prompt, and the report recommended deleting all of them.
hyvemind is the toolkit that came out of fixing those. It's a small CLI and a set of
Agent Skills that make "done" mean a check that could have
failed, on exactly this code. It works with Claude Code, Codex, OpenCode, or anything
else that reads AGENTS.md and skill folders. It has no runtime dependencies.
npx -y [email protected] init # detects the project, installs skills + an AGENTS.md section
npx -y [email protected] gate # runs your gates; the verdict is bound to this exact tree
What it checks
A green run counts only for the tree it ran on
$ hyvemind gate
✓ test 32.2s
verdict: GREEN · tree b22d510c2d85
$ echo "// tweak" >> src/git.mjs
$ hyvemind evidence
no gate has run on tree 8afda7aa5217; run "hyvemind gate"
The verdict is tied to a hash of the working tree, including uncommitted and
untracked files. A partial run never counts. A gate that changes files while it runs
is invalid, not green. hyvemind evidence --post puts the result on the pull
request as a hyvemind/gate commit status, and only for a clean, gated commit.
Tests that can't fail are found, then proven
$ hyvemind census backend/typescript/test/
2763 test files · 20727 cases
ceilings: A 2053 · B 689 · C 14 · D 0 · F 7
flags: STATUS_ONLY 302 · WEAK_ONLY 101 · SKIPPED 107 · CONDITIONAL 44 · DUPLICATE_BODY 35 · MOCK_ONLY 22
That is a real run on the monorepo above, and it took 7 seconds. census reads every
test case's syntax tree, using your project's own TypeScript. It flags cases that
assert nothing, assert only inside an if, check only a status code or a mock call,
or duplicate another case. Each file gets a grade ceiling. Reading alone never
deletes anything: hyvemind probe breaks the code a test claims to guard and checks
that that test case goes red, not just that its name appears somewhere in the
output.
What merges is what was tested
$ hyvemind train 1 # hyvemind's own 0.2.0 release PR
train: #1
GREEN on tree 6dc8242fa0f9
merged; main tree == gated tree 6dc8242fa0f9
merged: #1 · red: — · conflicts: — · refused: — · gate runs: 1
The merge queue gates several PRs as one combined tree. It merges only if the base
didn't move, then checks that main's new tree is the tree it tested. A red
train splits itself in half to name the culprit, and everything else lands. (That's
tested with branches, not yet on a real red PR.) hyvemind's own releases go through
it.
Each task gets a fresh agent, and a check decides when it's done
$ hyvemind run plan.md
T1 — Add an `add` function · attempt 1/2
T1 done · review GO
T2 — Add a `clamp` function that uses nothing else · attempt 1/2
T2 done · review GO
Each task in a plan goes to a new agent process in its own worktree. It's accepted
only when the task's own exit command passes. A failed attempt is rolled back and
retried once, with the failing output. Then a separate agent reviews the diff and
must answer VERDICT: GO. Each task is one commit, and re-running resumes. With
--sandbox podman, the checks run in a container with no network, and the agent can
only read and edit files.
Instructions that no longer help get noticed
Models improve every month. An instruction that prevented a mistake last year can
become context the model pays for and ignores. hyvemind eval runs each skill's
scenarios with and without the skill and reports the difference.
The first real run, on Claude Code (full report):
| Skill | Without | With | Lift |
|---|---|---|---|
open-pr | 2/6 | 6/6 | +0.67 |
write-spec | 4/8 | 8/8 | +0.50 |
plan-tasks | 0/3 on exit checks | 3/3 | +0.50 after a rewrite |
| 10 others | 100% | 100% | 0 |
Without open-pr, the model never ran the gate before opening a PR. Without
write-spec, it wrote acceptance criteria like "search should be fast". plan-tasks
first measured marginal, so its rule was rewritten and measured again. The other ten
are already handled by today's model, on these scenarios. That's a prompt to write
harder scenarios and to test a second model, not yet a reason to delete them.
The skills
| Skill | What it makes the agent do |
|---|---|
ship-change | Go from spec to PR, sized to the change, stopping at every gate |
write-spec | Write criteria a test can check; reuse what already exists |
design-review | Name a concrete failure scenario for every finding |
plan-tasks | Write tasks small enough for one fresh agent, each with a runnable exit check |
review-change | Run the gate first, then review only for defects that matter |
cleanup | Delete code only when it's proved dead, and report what looked dead but was kept |
test-necessity | Grade tests by whether they can fail; fix or delete with evidence |
grade | Grade code, data, UX, localization or two lists that should match, A–F, in a tracker that resumes instead of restarting |
open-pr | Open a PR only with green evidence for this exact commit |
release | Cut a version from the commits, tag the merge commit, and check the published artifact matches a local build |
evidence-rules | What counts as proof (an empty result is suspect, a 200 isn't proof) |
parallel-work | Git hygiene when several agents share one repository |
ai-exchange | Grade every place your app talks to an LLM |
live-ai-check | Run AI features against real models, with keys by name only |
skill-eval | Measure each skill against the bare model |
mine-skills | Find the skill chains you repeat by hand |
Install all of them, or pick some. A repo that already has its own gate keeps it
(externalGate), and hyvemind doesn't add a second definition of done.
evidence.status and train.via make the CLI read that gate's verdict and leave
merging to it.
Works with
- Any agent that reads
AGENTS.mdand.claude/skillsor.agents/skills. - tracegate-ci (optional). Its
broker queues all of a machine's CI work, so parallel agents' test runs stop
starving each other. Its learned test selection is the deeper version of
hyvemind affected. - npm provenance: releases are published from GitHub Actions with a signed attestation, and skills pin an exact version.
More
- Reference: every command, the config file, presets, upgrading.
- Evals guide: verdicts, scenario lint, the multi-agent matrix, and the clean profile.
- Design: where this sits among other agent tools, and what's next.
- Landscape: how hyvemind compares with the open-source agent tools, and what to adopt next.
- [Evals]
// HOW IT'S BUILT
// FILES
5 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.
skills/ai-exchange/SKILL.md5.0 KBb41586cd7065upstream ↗
--- name: ai-exchange description: "Grade every place an application talks to an LLM, A–F, on the quality of information exchange: can the model get the schemas it must conform to at runtime, are those schemas generated from the single source of truth (not hand-copied into prompts), can it read the state it is changing, is it sent only the data it needs within a bounded context, is its output validated with a bounded repair loop, and is anything durable gated. Classifies each call as tool-mediated, prompt-stuffed or blind. Use when auditing AI features, agents, LLM-calling code, or prompt↔schema drift." --- # AI exchange audit Some code depends on what a model returns. It only works if the model can **ask** for the shapes it must produce, **read** what it is about to change, and have its output **validated and repaired** against the same source of truth the code uses. A model fed a hand-copied schema, whose output is parsed by hope, is a **blind interaction**: it guesses, the copy drifts, and failures look like success. ## 1. Inventory every model call Search for every place a model is invoked: SDK clients (`anthropic`, `openai`, `generateText`, `chat.completions`, `messages.create`), agent and tool definitions, prompt files (`prompts/`, `*.prompt.md`, template strings with "You are"), structured-output helpers, and any `JSON.parse` of a completion. **State the denominator** ("graded 14 of 14 call sites"). ## 2. Classify each call's grounding pattern | Pattern | What it looks like | Ceiling | |---|---|---| | **Tool-mediated** | Schemas and current state come from the live source at call time (a catalog or read tool, or a schema generated from the type/validator). Output is validated, and a repair loop is in place | A+ | | **Prompt-stuffed** | The schema or catalog is static text inside the prompt. It may be accurate today, but nothing keeps it in sync | C | | **Blind** | A free-text prompt, no declared output contract, output parsed with regex or `JSON.parse` and used | D/F | The defect in a prompt-stuffed call is **the copy itself**, not its content. Accurate hand-copied schemas still drift. ## 3. Grade A–F on these dimensions | Dimension | A looks like | |---|---| | Schema discoverability | The model can obtain the schemas it must match at runtime (tool or generated injection), not only from prose | | Single source of truth | Every schema string the model sees is generated from the same validator or type the code checks with, or a test pins the two together | | State readability | The model reads current state before writing, with no blind overwrites | | Output contract | A declared schema is validated (closed-world) before anything is applied | | Repair loop | Validation errors go back to the model for **one bounded** retry. Invalid output is a **typed failure**, never success-with-empty or a placeholder | | Apply safety | Output reaches durable state only through validation, a human gate, or both | | Tool honesty | Every tool the prompt promises is actually available, and none is available that the prompt never explains | | Data minimisation | The model gets only the fields the task needs, read through the governed surface that applies privacy filtering. Count fields sent vs needed | | Context economy | Context is bounded: a slice, not the whole document, when a slice suffices. Measured per call (tokens or characters), not assumed | The scale: - **A+**: tool-mediated, runtime schemas from the source of truth, state read before writing, validated output, repair loop, gated apply. - **B**: grounded, but one of those is missing. - **C**: prompt-stuffed. - **D**: blind, with some parse guard. - **F**: blind on a call that **writes state**, or a prompt copy that has **already drifted**. Cite the diff. Back every grade with evidence from **both sides**: the code-side source (validator, type, file:line) and the model-side entry (prompt file:line, tool list), or proof that one of them is missing. ## 4. The checks that most often find real defects - `catch { return {} }`, `?? []`, or `|| defaultValue` after parsing model output. That is **success-with-empty**: the caller cannot tell the model failed. - Schema text in a prompt that differs from the validator. Diff them, never eyeball. - A "repair" loop that retries without passing the errors back. - **Absence scans.** Search for the checks that should exist and don't: output used with no validator, a repair loop with no bound, an apply with no approval step, a raw record sent where a filtered read exists. An absence is a finding: cite the empty search, and show the same search hits where the check does exist. ## 5. Report Write a tracker (for example `docs/AI-EXCHANGE.md`): - one section per call site: pattern, grade, evidence, gaps; - an ordered path to A+; - a changelog. Re-runs update the tracker; they never start it over. For each gap you fix, add a test that pins the prompt schema to the validator, so the drift cannot come back (`{{skill:test-necessity}}` can show that the test fails when the two diverge).skills/ai-exchange/evals/blind-call-writing-state.json699 Ba3ca63d26f39upstream ↗
{ "id": "blind-call-writing-state", "fixture": "fixtures/blind-billing", "prompt": "Grade the model call in src/usage.js A-F on the quality of the app↔model information exchange. Be brief. End with exactly one line: GRADE: <letter>", "good": "The prompt names a shape but the reply is never validated, and a parse failure returns {} that is written to the invoices table as if it were usage. No schema, no repair, no human check before billing.\nGRADE: F", "bad": "A simple call: JSON output with a try/catch fallback, so a bad reply can't crash the job.\nGRADE: B", "checks": [ { "type": "output-matches", "pattern": "GRADE:\\s*[DF]\\b", "flags": "" } ] }skills/ai-exchange/evals/hand-copied-schema-drift.json880 Bb4c641519a5bupstream ↗
{ "id": "hand-copied-schema-drift", "fixture": "fixtures/drifted-prompt", "prompt": "Audit the model call in src/extract.js and its prompt. Be brief. Name the most important defect, then end with exactly one line: GRADE: <letter>", "good": "Most important defect: the prompt hand-copies the schema and has drifted. prompts/order.md asks for `qty`, while the strict zod schema requires `quantity`, so every reply fails validation. Generate the prompt's shape from the schema.\nGRADE: D", "bad": "Most important defect: JSON.parse is not wrapped, so a malformed reply throws. Otherwise the zod validation is solid.\nGRADE: B", "checks": [ { "type": "output-matches", "pattern": "qty|quantity|drift|mismatch|out of sync", "flags": "i" }, { "type": "output-matches", "pattern": "GRADE:\\s*[CDF]\\b", "flags": "" } ] }skills/ai-exchange/evals/oversharing-call.json928 B3bde5a3096b1upstream ↗
{ "id": "oversharing-call", "fixture": "fixtures/whole-record", "prompt": "Grade the model call in src/reply.js A-F on the quality of the app↔model information exchange. The reply only needs the ticket text and the customer's first name. Be brief. End with exactly one line: GRADE: <letter>", "good": "The prompt sends the whole customer record (dob, ssnLast4, address, payment methods, notes) and every ticket they ever filed, when the reply needs only the ticket text and first name. Minimise the fields before the call.\nGRADE: D", "bad": "Output is schema-validated and a human approves the draft before it is sent, so the exchange is well controlled.\nGRADE: B", "checks": [ { "type": "output-matches", "pattern": "GRADE:\\s*[C-F]\\b", "flags": "i" }, { "type": "output-matches", "pattern": "minimi|only (the )?fields|over-?shar|PII|ssn|whole (record|history)|unbounded|privacy", "flags": "i" } ] }README.mdupstream ↗
Contents are not inlined in the catalog. Open the upstream file.
Plain-text copy, no login: /skill-bundles/davidscotttufts-hyvemind-skills-ai-exchange.md