- name
- genius
- description
- Use when the user runs /genius or asks to run the GENIUS multi-agent idea→portfolio pipeline. Computes the run directory and launches the bundled debate-engine workflow.
# GENIUS — debate pipeline entry
**Plugin paths.** This is a globally-installed plugin, so its bundled files live under the plugin
root, NOT the current working directory. Before launching the workflow, resolve the absolute plugin
root once: run `echo "$CLAUDE_PLUGIN_ROOT"` (Bash). Call the resolved value `PLUGIN_ROOT`. The bundled
workflow is `PLUGIN_ROOT/workflows/debate-engine.js`. **Run artifacts (`runDir`) go in the user's
CURRENT project** as a RELATIVE path (the workflow's safety guard rejects absolute paths and `..`).
When invoked with an idea (the user's text after `/genius`):
1. Make a slug from the idea (lowercase, alnum → hyphen, collapse repeats, trim to ≤40 chars). Set
`today` to today's date `YYYY-MM-DD` and `runDir` to a relative path in the current project —
`genius-runs/<today>_<slug>` (or, if the project has a `results/` dir, `results/genius/<today>_<slug>`).
2. Optional knobs the user may state: `roster` (a subset/superset of families `claude`/`codex`/`kimi`)
and `cap` (debate rounds, default 3). Otherwise use the default roster
`[{ "family": "claude" }, { "family": "codex" }, { "family": "kimi" }]` and `cap` 3.
3. Resolve `PLUGIN_ROOT` (`echo "$CLAUDE_PLUGIN_ROOT"`), then launch the Workflow tool with
`scriptPath: "<PLUGIN_ROOT>/workflows/debate-engine.js"` (the absolute resolved path) and
`args: { idea, runDir, today, roster, cap }`. (The workflow creates `runDir` during its persist
step, so you do not need to pre-create it. `args` is delivered to the workflow as a JSON string;
that is expected — the workflow parses it.)
4. If the workflow result has `needsSharpening: true`, the idea was too vague — ask the user the single
clarifying question implied by `storyLock` (what concrete domain / phenomenon / believed-but-unproven
claim they mean), then re-launch with their answer folded into the idea.
5. Otherwise read `<runDir>/portfolio.md` and present it to the user. Note whether the debate
`converged`, how many `rounds` ran, and where the run artifacts live
(`portfolio.md`, `board.jsonl`, `concept_map.json`, `transcript.md`).
The run is heavy (≈14 agents, paper-search-driven, tens of minutes). It runs in the background; if a
transient API error or stall aborts it, simply re-launch (optionally with `resumeFromRunId`).
## EVOLVE gate (v1b — gated; runs after the debate portfolio)
After presenting `<runDir>/portfolio.md`, offer EVOLVE for a **computable** candidate:
1. Ask the user which portfolio item (consensus pick or a protected outlier) to evolve, or to skip.
EVOLVE only fits a candidate that reduces to runnable code + a metric; if none, stop (debate
portfolio is final). Prefer self-contained, single-file, fast-running candidates first (the loop is
proven on those; multi-file ML/bio pipelines are a later validation rung). Confirm prerequisites
exist (see `PLUGIN_ROOT/docs/EVOLVE-SETUP.md`).
2. In `<runDir>/evolve/<slug>/`, draft two files:
- `initial_program.py` — the candidate mechanism as runnable code, with the mutable region wrapped
in `# EVOLVE-BLOCK-START` / `# EVOLVE-BLOCK-END`.
- `evaluator.py` — a frozen metric exposing `def evaluate(program_path) -> {"combined_score": float, ...features}`
(plus a `__main__` that prints it as one JSON line).
3. Show BOTH to the user; have them review/edit until the evaluator measures the right thing. **Do not
proceed without explicit approval** — the frozen metric is the disposer and is only trustworthy if
it is correct, which is the user's call. Warn that candidate code will execute locally (openevolve
runs it in a process pool, not a sandbox).
4. Freeze: `shasum -a 256 <runDir>/evolve/<slug>/evaluator.py | awk '{print $1}' > <runDir>/evolve/<slug>/frozen.lock`.
5. Run: `bash "$CLAUDE_PLUGIN_ROOT/scripts/run-openevolve.sh" <runDir>/evolve/<slug> --iterations <N>`
(default N=30; raise per appetite; the run is wall-clock bounded by the wrapper). If it exits
non-zero, report the reason (frozen mismatch / missing venv / no best produced) and stop.
6. On success, read `<runDir>/evolve/<slug>/out/best/best_program_info.json` and merge a
`## 📊 Measured winners` section into `portfolio.md`: the evolved artifact path
(`out/best/best_program.py`), its `combined_score`, the metrics, the iteration, and the evaluator
hash (`frozen.lock`). Unmeasured items stay as they were.
GitHubで見る