castia-optimizer

Guides Foundry agent optimization runs, baseline configs, and native MCP tool preservation with Castia.

Updated Sep 8, 2026
One-click install
npx skills add https://github.com/sethjuarez/castia --skill castia-optimizer-sethjuarez
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: castia-optimizer
Source: https://github.com/sethjuarez/castia/tree/main/plugins/foundry-agent-starter-kit/skills/castia-optimizer
Command: npx skills add https://github.com/sethjuarez/castia --skill castia-optimizer-sethjuarez

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running Foundry agent optimization jobs involves billable submissions, baseline configuration drift, and the risk of breaking native MCP tool execution. This Skill records the constraints and command semantics to check before invoking Castia optimizer commands, so candidates are applied and deployed correctly. ## Core Features & Use Cases - Optimizer command semantics: Distinguishes free offline operations (optimize --check, optimize run --dry-run) from billable job submission, status polling, cancellation, and candidate application. - Baseline configuration guidance: Defines the canonical .agent_configs/baseline/ metadata shape, pure tool provider requirements, and load_agent_config anchoring rules. - Native MCP preservation: Shows how to keep upstream tool names like web and search_query, pass tokens at request time via Model.respond_with_tools, and avoid replacing remote schemas with local wrappers. - Use Case: Before submitting a billable optimize run job against a deployed Responses-only agent, use this Skill to verify the dry-run preview, confirm the wire contract, and plan the azd deployment handoff after applying a candidate. ## Quick Start Ask the assistant to review the constraints for running a Castia optimizer dry-run against my Foundry agent's baseline configuration before submitting a billable job.

Frequently Asked Questions about castia-optimizer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a Foundry agent optimization job with Castia?▼

Run `python -m castia optimize run --dry-run` first for a free offline payload preview, then `optimize run` to submit the billable job. Inspect the preview's prompt, tools, evaluators, dataset, and candidate cap before authorizing submission.

Which Castia optimizer commands are free versus billable?▼

`optimize --check`, `optimize`, and `optimize run --dry-run` are free offline operations. `optimize run` submits a billable job, while `status`, `apply`, and `cancel` interact with existing remote jobs without creating new ones.

How do I preserve native MCP tool execution during optimization?▼

Use upstream tool names from `tools/list` such as `web` and `search_query`, and rebuild the tool spec at request time with a fresh token passed through `Model.respond_with_tools`. Tool guidance only changes `server_description`; it must not replace the remote schema or wrap it in a local function.

Does optimize apply deploy the candidate to my hosted agent?▼

No, `optimize apply` only fetches a candidate and writes local config files. You must set OPTIMIZATION_LOCAL_DIR and OPTIMIZATION_CANDIDATE_ID in the service environment and use the reviewed azd workflow for deployment.

What baseline files does the Castia optimizer require?▼

The project needs `eval.yaml` and `.agent_configs/baseline/` with metadata specifying model, instruction_file, tool_file, and tools_file. The tool provider must be pure, acquiring no credentials and calling no remote services.

Why does my optimizer run fail on a multi-protocol agent?▼

The optimizer requires a deployed Responses-only agent. Use `app.responses_only()` to create a sibling app with the same Responses handler and declared tools, then deploy it separately before submitting optimization jobs.