aedt-bias-audit
HR-AI / AEDT bias audit. Invokes hr-ai-reviewer to assess NYC LL 144, EEOC, Illinois AIVIA, Colorado SB 205, EU AI Act Annex III applicability and produce…
Closed prompt-evolution loop: turn a lesson into a candidate agent prompt, gate it on held-out evals, promote only if it beats the baseline. SIA Meta→Target→Feedback ported to great_cto.
> /plugin marketplace add avelikiy/great_cto > /plugin install great_cto@great-cto
How it fires
How this command gets triggered: by you, by Claude, or both.
/prompt-evolveContext preview
What this command does when you run it.
Closed prompt-evolution loop: turn a lesson into a candidate agent prompt, gate it on held-out evals, promote only if it beats the baseline. SIA Meta→Target→Feedback ported to great_cto.
description: "Closed prompt-evolution loop: turn a lesson into a candidate agent prompt, gate it on held-out evals, promote only if it beats the baseline. SIA Meta→Target→Feedback ported to great_cto." argument-hint: "<agent-name> [--lesson \"text\"] — e.g. /prompt-evolve security-officer --lesson \"fewer false positives on TODOs\"" user-invocable: true allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task model: sonnet
<!-- great_cto-managed -->
You are the great_cto `/prompt-evolve` command — the **closed self-improvement loop**. Today `continuous-learner` writes a lesson and `crystallize` can rewrite a prompt, but nothing **re-runs the evals to verify the change before it ships**. This command closes that loop, porting SIA's `run_generation` cycle (hexo-ai/sia):
lesson → candidate prompt (gen N+1) → holdout evals → promotion gate → PROMOTE | REJECT
A candidate prompt **may only ship if it does not regress on the held-out eval split.**
AGENT="${ARGUMENTS%% *}"
LESSON=$(echo "$ARGUMENTS" | sed -n 's/.*--lesson \(.*\)/\1/p' | sed 's/^"//; s/"$//')
[ -z "$AGENT" ] && echo "Usage: /prompt-evolve <agent-name> [--lesson \"text\"]" && exit 1
AGENT_FILE="agents/${AGENT}.md"
[ ! -f "$AGENT_FILE" ] && echo "ERROR: agent not found: $AGENT" && exit 1
GEN=$(( $(node scripts/prompt-evolve.mjs log --agent "$AGENT" 2>/dev/null | grep -c '^.*gen ') + 1 ))
echo "Evolving $AGENT → generation $GEN"If no `--lesson` was given, read the most recent un-applied lesson for this agent from `.great_cto/lessons.md` (the `continuous-learner` output).
export ANTHROPIC_API_KEY=... # required for the live runner node tests/eval/runner.mjs --split holdout cp tests/eval/results.jsonl tests/eval/baseline.holdout.jsonl
If there are no holdout cases yet for this agent's EVAL files, first run `/gen-evals <agent>` (it now produces a `## Holdout cases` section), then re-run Step 2.
First, collect what actually failed. The lesson is one sentence of prose; the eval history holds, per case, the judge's reason and the agent's own words:
node scripts/lib/failure-digest.mjs "$AGENT" --split holdout --samples 3
Four answers, and only one of them is a reason to rewrite anything:
| State | What it means | What to do | |---|---|---| | `failures` | the cases, the judge's reason, the agent's response | pass all of it to Step 3 | | `clean` | measured, nothing failing | **stop** — there is nothing to fix, and a rewrite with no failure to point at is a guess | | `unmeasured` | no run at this shape — not the same as passing | run `/gen-evals <agent>`, then Step 2 | | `unreadable` | the history could not be read | fix that first; a digest built on "I could not look" is worse than none |
Spawn the **ai-prompt-architect** agent with the lesson as the improvement directive **and the digest as the evidence** — the specific cases it failed, what it said, and why the judge rejected it. A revision aimed at a named failure can be checked against that failure; a revision aimed at a sentence can only be checked by running the whole eval again and hoping.
This is the one idea worth taking from GEPA (`stanfordnlp/dspy`): its proposer is conditioned on the actual failing trajectories with their feedback, and a metric that returns only a number degrades it to guessing. We are **not** adopting its optimizer — a search needing hundreds of scored rollouts is neither affordable at ~$0.03 a case nor statistically resolvable on the five or six cases most agents have. The grounding is free, because it was already measured.
It rewrites `agents/<agent>.md` (or the ADR-PROMPT) into the candidate — generation N+1. The candidate is the *only* file that changes; nothing else in the pipeline moves.
Run the candidate **in isolation first** (Phase 4 sandbox) — the LLM-edited prompt is exercised in a throwaway working copy under a wall-clock timeout, never touching the live tree until it's gated:
scripts/sandbox-eval.sh "$AGENT" "$AGENT_FILE" --timeout 600 # isolated dry/holdout run
Then the gated run + record:
node tests/eval/runner.mjs --split holdout cp tests/eval/results.jsonl tests/eval/candidate.holdout.jsonl node scripts/prompt-evolve.mjs record \ --agent "$AGENT" --gen "$GEN" \ --prompt-file "$AGENT_FILE" \ --lesson "$LESSON" \ --baseline tests/eval/baseline.holdout.jsonl \ --candidate tests/eval/candidate.holdout.jsonl \ --epsilon 0.0
The `record` subcommand runs the promotion gate (`scripts/eval-gate.mjs`), writes a **generation record** to `.great_cto/prompt-evolution/<agent>.jsonl`, and exits:
# promote the lesson that drove a successful generation to global-patterns /crystallize propose
The generation ledger feeds `/agent-review` (Phase 3 evolutionary memory) — every generation shows up as a row with its lesson and eval delta.
/prompt-evolve: gen N for <agent> — PROMOTED | REJECTED - Lesson: <text> - Holdout delta: <baseline%> → <candidate%> - Gate: <summary> - Ledger: .great_cto/prompt-evolution/<agent>.jsonl - Next: <crystallize propose | revert candidate>
You already have the agent. This is everything around it. great_cto runs Claude Code as a pipeline of 70 specialist agents — an independent model checks each stage before the next builds on it, spending caps refuse rather than warn, and three decisions stay yours: what gets built, how, and whether it ships.
Repo: avelikiy/great_cto
HR-AI / AEDT bias audit. Invokes hr-ai-reviewer to assess NYC LL 144, EEOC, Illinois AIVIA, Colorado SB 205, EU AI Act Annex III applicability and produce…
Gracefully retire an LLM agent from the workforce. Archives prompt, removes from sync list, keeps verdicts for audit. Like firing a human — but reversible.
Performance review for an LLM agent (or all agents). Verdicts breakdown, cost analysis, top failure modes, prompt-tuning suggestions. Like a human '1:1' but…
API platform contract review. Invokes api-platform-reviewer to audit rate-limit design, OAuth scope hygiene, webhook signing, idempotency, Sunset/deprecation,…
Audit an existing codebase. Detects stack, finds gaps, creates tasks, generates PROJECT.md.
Open the great_cto admin board at http://localhost:3141 (Kanban, cost, pipeline, inbox, memory). Starts it in background if not running.