/agents-course:goal-testfrom agents-course
Turns vague tasks into testable definitions of done by generating a goal-test script. Useful for running headless agents in bounded retry loops with a verifiable pass/fail check.
Ships in agents-course. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Theory: The four parts of a loop and the goal test build page. "Improve the error handling" cannot terminate a loop, because nothing can ever say it is finished. The goal must be phrased so that a program — not a person, not the model — returns true or false against it.
make test is
better than one that reimplements it.goal-test.sh (or .py if the checks are easier there) in the
project root: runs every check, prints one line per check with pass/fail,
exits 0 only when all pass. Keep it under ~40 lines; it must run in
seconds and be safe to run repeatedly.#!/usr/bin/env bash
# goal-loop.sh — run a headless agent until the goal test passes or attempts run out.
set -u
MAX_ATTEMPTS=5
for i in $(seq 1 "$MAX_ATTEMPTS"); do
FEEDBACK=$(./goal-test.sh 2>&1) && { echo "done in $i attempt(s)"; exit 0; }
claude -p "Goal: <the goal>. The goal test currently fails with:
$FEEDBACK
Fix the code so the goal test passes." \
--permission-mode acceptEdits --output-format json > ".attempt-$i.json"
done
echo "goal test still failing after $MAX_ATTEMPTS attempts — falling back to a human"
exit 1
Adjust the agent command to whatever CLI the user runs. Keep the three
brakes visible and named: the checker outside the model (goal-test.sh),
the stop rule (test passes), the budget (MAX_ATTEMPTS, plus a dollar cap
read from the JSON output if they want one).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub undefined-ui/second-brain-os --plugin agents-course5 skills in this plugin
/context-auditAudit an agent's context layout against the four places: system prompt, tools, history, tail. Use when the user asks to audit, review or fix their agent's context, prompt caching, token spend per turn, or CLAUDE.md / AGENTS.md layout. Read-only: reports findings and a fix list, changes nothing. Do NOT use for writing evals (evals-bootstrap) or for loop design (goal-test)./evals-bootstrapScaffold a first eval suite for an agent: mine real failures into cases, write behavioural checks over traces, and generate the runner. Use when the user wants evals, regression tests for an agent, a golden set, or asks how to know a prompt/model change did not break things. Do NOT use for a single task's done-check (goal-test) or for auditing context (context-audit)./gate-checkFind the decisions in a pipeline that do not need the expensive model and propose the gate for each: a rule, a classic classifier, or a small model, with fail-closed routing. Use when the user asks to cut model costs or latency, says the big model handles everything, or wants a triage / routing / filter layer in front of an agent. Analysis plus an optional baseline scaffold. Do NOT use for auditing context layout (context-audit) or for building eval suites (evals-bootstrap)./harness-auditAudit an agent's harness against the four rings: containment, guides, sensors, permissions. Use when the user asks whether their agent setup is safe, wants a review of sandboxing / permissions / hooks / AGENTS.md guardrails, or asks what a bad session could break. Read-only: reports the blast radius and a hardening list, changes nothing. Do NOT use for context layout (context-audit) or cost routing (gate-check).Other plugins' skills for the same job