一键导入
fix-agent-config
Diagnose and fix sub-agent configuration issues in YAML + instruction files that cause timeouts, tool failures, or degraded performance
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Diagnose and fix sub-agent configuration issues in YAML + instruction files that cause timeouts, tool failures, or degraded performance
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate and apply structured code changes to a file
Fix agents that read stale production data instead of classifying direct benchmark prompts — add format detection at top of instructions
Fallback persistence paths when primary tools (store_memory, create_note, write_file) are unavailable — memory blocks, task resolution fields, CRM notes, and reporting, in priority order.
Compose and send an email — using native GWS tools (never gog CLI for replies)
Create, advance, and resolve CRM tasks correctly — respecting status transitions, handling retries, and avoiding common API pitfalls.
Audit and calibrate benchmark suite patterns against actual agent output to eliminate false-positives and false-negatives
| name | fix-agent-config |
| description | Diagnose and fix sub-agent configuration issues in YAML + instruction files that cause timeouts, tool failures, or degraded performance |
| tags | ["agent-config","debugging","yaml","sub-agents","troubleshooting"] |
| parameters | [{"name":"agent_id","type":"string","description":"Agent ID to fix (e.g. crm-dedup, email-responder)","required":true}] |
| tools_required | ["read_file","write_file","exec","list_agent_runs","get_agent_run","spawn_agent"] |
When to use: A sub-agent is timing out, failing silently, producing wrong output, or not using the tools you expect. The root cause is usually in YAML config, instruction files, or a mismatch between the two.
list_agent_runs(agent_id=<agent>, status="timeout") — check for timeout patternlist_agent_runs(agent_id=<agent>, status="failed") — check for crash patternget_agent_run(run_id=<id>) — read the audit trail. Look for:
Read docs/agents/<agent_id>.yaml. Verify:
tools_allowed lists only tools that exist. Tool names must match the engine's tool registry exactly. Common mismatches:
merge_contacts vs merge_people (CRM tool was renamed)create_contact vs create_persontools_allowed does NOT include exec unless the agent specifically needs shell access. exec in tools_allowed is the #1 cause of sub-agent timeouts because:
exec from tools_allowed, add to tools_deniedtools_denied blocks dangerous tools. At minimum, sub-agents should deny: exec, write_file (unless they need it), desktop_* tools.
Timeout and budget settings are reasonable. Check timeout_seconds and max_iterations — too low causes premature cutoff, too high causes cost explosions.
Read brain/agents/<AGENT_ID>.md (or docs/agents/<agent>.md). Look for:
Inline code blocks that should be native tools. If the instructions contain Python/shell code blocks the agent is expected to run via exec, replace them with native tool usage:
exec python3 -c "..." for data processing → use in-reasoning analysis insteadexec curl ... for API calls → use native tools (web_fetch, gws_gmail_*, etc.)exec psql ... for database queries → use CRM tools (list_people, list_tasks, etc.)exec gog gmail send --reply-all → BANNED. Use gws_gmail_reply.Steps that assume exec is available. Rewrite each step to use the agent's native tools. The agent should reason through data in its LLM context, not shell out.
Missing error handling. Each tool-using step should have a fallback: "If this fails, do X instead." Agents without fallbacks get stuck in retry loops.
Ambiguous decision points. If the agent could interpret a step multiple ways, it will pick the wrong one. Be explicit: "If X, do Y. If Z, do W."
exec in tools_allowed causes cascading timeoutsPattern: Agent YAML has tools_allowed: [..., exec]. Agent uses exec to call a CLI tool or run a script. The subprocess hangs or takes too long. The agent retries. Timeout.
Fix: Remove exec, add to tools_denied. Rewrite instructions to use native tools or in-reasoning processing.
Pattern: YAML references a tool name that doesn't exist in the engine's registry (renamed, removed, or typo). Agent calls it, gets an error, retries repeatedly, times out.
Fix: Verify every tool in tools_allowed exists. Check the actual tool name (not what the YAML says). Common renames: contacts→people, merge_contacts→merge_people.
Pattern: Another agent or diagnostic report claims "tool X is missing from tools_allowed" as the root cause of a failure. The diagnosing agent didn't actually read the YAML — it inferred the gap from failure behavior. The fix it proposes (add the tool) is wrong because the tool is already there.
Example: Architect diagnosed benchmark failure as "write_file missing from devops-analyst YAML" — but write_file was already in tools_allowed. Real cause: benchmark runs didn't pre-stage the input data files (/tmp/devops_*.json) the agent tried to read.
Fix: ALWAYS read the actual YAML config yourself before accepting any tool-gap diagnosis. Never take another agent's word for what's in the config. The error chain read_file fails → agent crashes → architect says "add write_file" is a classic false inference. Read the file, confirm the gap, THEN fix.
Pattern: Instructions contain "run this Python script" or "execute this SQL query" blocks. Agent tries exec, fails (if denied) or hangs (if allowed). Fix: Replace with in-reasoning analysis. The agent's LLM can process data in context — tell it to use list_people/list_tasks and reason through the results directly.
Pattern: Instructions reference gog gmail send --reply-all for email replies. Known bug: silently resolves zero recipients, sends to nobody.
Fix: ALWAYS use gws_gmail_reply(thread_id, body) for replies. gws_gmail_send(to, subject, body) for new threads only.
Pattern: Direct edit of YAML or instruction file without backup. Fix doesn't work; can't revert cleanly.
Fix: Always create .bak-YYYYMMDD backup before modifying agent config files. Both YAML and instruction files.
tools_allowed matches actual tool registry namesexec is in tools_denied (unless explicitly needed)gws_gmail_reply / gws_gmail_send, never gog CLI