/refine-agent:refine-agent [agent-name]from refine-agent
Interactively edits a Lyra agent's persona, voice, passthroughs, and model via conversation. Reads current config, proposes changes, and applies them.
Ships in refine-agent. 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.
Let:
factory agent show)Interactively refine a Lyra agent's profile. Reads current config, proposes targeted
changes, and applies them via factory agent patch.
/refine-agent → prompts for agent name
/refine-agent lyra_default → refine specific agent
∃ $ARGUMENTS ⇒ α = $ARGUMENTS (use directly, skip list step). ¬∃ $ARGUMENTS ⇒ run:
factory agent list
Present choice: "Which agent would you like to refine?" with agent names as bold options.
Verify α exists:
factory agent show {α}
¬∃ α in output ⇒ "Agent '{α}' not found. Run factory agent list to see available agents."
Stop.
Capture full agent config as σ:
factory agent show {α}
Also read system TOML if present (for context, not authoritative):
cat ~/projects/roxabi-factory/src/factory/agents/{α}.toml 2>/dev/null || echo "(no TOML — DB-only agent)"
Soul authoring is DB + blobstore (AgentSoul v1). Do not read ~/.roxabi-vault/personas/ — that path is deprecated. Use factory agent show for soul_document_blob_ref, soul_meta_json, and legacy persona_json fallback.
Present current profile in plain language (¬raw JSON dump):
Agent: {α}
Model: {model}
Backend: {backend}
Soul: {soul_document_blob_ref or "inline persona_json"} — {display_name from soul_meta_json if set}
Voice:
TTS: {voice_json.tts.engine} / voice: {voice_json.tts.voice}
STT: {voice_json.stt.engine}
Passthroughs: {passthrough list or "none"}
Plugins: {enabled plugins or "none"}
Present choice: "What would you like to change?" Options: persona, voice (TTS/STT), passthroughs, model, other field, done.
N = 0. Repeat while operator has not said done/exit/quit:
Listen to operator description of desired change.
Map request → specific AgentRow field(s). Common mappings:
voice_json.tts.voicevoice_json.stt.enginemodelpersona_json (legacy) or dashboard /agents for full soul.md editpassthrough_commands (list)system_promptPropose change with before/after values:
"I'd suggest changing
voice_json.tts.voicefrom'echo'to'nova'for a warmer tone. Confirm? [y/N]"
∃ confirmation (y/yes) ⇒ add to Σ, continue loop. ¬∃ confirmation ⇒ discard, ask what else to change.
N = N + 1.
¬∃ changes after full loop ⇒ skip Step 5, output "No changes applied."
∀ (field, value) in Σ, apply via:
factory agent patch {α} --json '{"{field}": {value}}'
For nested JSON fields (e.g. voice_json), build full replacement object:
factory agent patch {α} --json '{"voice_json": {"tts": {"engine": "kokoro", "voice": "nova"}, "stt": {"engine": "whisper"}}}'
Show applied diff after all patches:
Applied to {α}:
voice_json → {"tts": {"voice": "nova", ...}}
model → claude-haiku-4-5-20251001
Remind operator: "Run factory agent init --force or restart lyra adapters for voice/model
changes to take effect."
Output:
persona_json from DB (¬block on missing ref).factory agent show output.$ARGUMENTS
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub roxabi/roxabi-factory --plugin refine-agent