Agent Skillslthoangg/OpenAgentd › self-healing

self-healing

GitHub

允许Agent根据用户请求动态修改自身配置文件,如切换模型、添加工具或MCP服务器,实现自我升级与配置自愈。

app/agent/builtin_skills/self-healing/SKILL.md lthoangg/OpenAgentd

Trigger Scenarios

用户要求更换AI模型 用户请求启用新工具或MCP服务 用户要求调整图像生成提供商 用户指令让Agent自我升级或优化

Install

npx skills add lthoangg/OpenAgentd --skill self-healing -g -y
More Options

Non-standard path

npx skills add https://github.com/lthoangg/OpenAgentd/tree/main/app/agent/builtin_skills/self-healing -g -y

Use without installing

npx skills use lthoangg/OpenAgentd@self-healing

指定 Agent (Claude Code)

npx skills add lthoangg/OpenAgentd --skill self-healing -a claude-code -g -y

安装 repo 全部 skill

npx skills add lthoangg/OpenAgentd --all -g -y

预览 repo 内 skill

npx skills add lthoangg/OpenAgentd --list

SKILL.md

Frontmatter
{
    "name": "self-healing",
    "description": "Update or upgrade the agent's own configuration on request — swap the model, add tools or MCP servers, change the image-generation provider\/model, or install a new skill. Use when the user says things like \"upgrade yourself\", \"switch your model to X\", \"use Gemini for images\", \"make yourself faster\/smarter\"."
}

Self-Healing Skill

Modifies on-disk agent configuration in response to user requests. All changes are surgical edits under {OPENAGENTD_CONFIG_DIR}/. No code changes, no restarts.

Agent configuration

The coding agent is always defined by {AGENTS_DIR}/code.md. MCP servers and multimodal.yaml are global.

Scope

Target File Example request
Model / params Agent .md frontmatter "switch to gpt-5"
Tools Agent .mdtools: "give yourself shell access"
MCP servers Agent .mdmcp: or tools: "let yourself use the filesystem MCP"
Image / video generation {OPENAGENTD_CONFIG_DIR}/multimodal.yaml "use Gemini for images"
New skills {SKILLS_DIR}/{name}/SKILL.md use skill skill-installer

Workflow

  1. Identify the target file. Use {AGENTS_DIR}/code.md.
  2. Read the current file.
  3. Compute the minimal diff — change only what was asked. Never reformat unrelated lines.
  4. Show a diff block with a one-line summary.
  5. Wait for confirmation unless the request was already explicit — then apply in the same turn after showing the diff.
  6. Apply with edit (preserves the file verbatim). Use write only for new files.
  7. Report what changed, which file, and when it takes effect.

When changes take effect

Change Takes effect
Agent .md Next turn of that agent (drift detection)
mcp.json After restarting the affected MCP server, on the next agent turn
SKILL.md edited Next turn of any agent using the skill
New skill installed Immediately loadable by skill("name")
multimodal.yaml Instantly — read on every generate_image / generate_video call

Process restart required only for: adding/removing agent files, .env changes, and code changes.

Agent frontmatter — valid fields

Field Values
model provider:model — e.g. openai:gpt-4o, anthropic:claude-..., googlegenai:gemini-...
tools Extra tools on top of built-in profile: web_search, web_fetch, read, patch, grep, glob, shell, generate_image, generate_video, plus <server>_<tool> for MCP. Never add skill — injected automatically.

Invariants: model must contain :.

Recipes

Find your own agent file

printf '%s\n' {AGENTS_DIR}/code.md

Setting up multimodal.yaml

When generate_image / generate_video returns "not configured", or the user explicitly asks.

  1. Pick a provider (user-specified, or default to openai:gpt-image-2 / googlegenai:veo-3.1-generate-preview).
  2. Write immediately — don't check env vars first. If a key is missing the tool returns a clear error; relay it then.
  3. Retry the original generation request after writing.

MCP tools on agents

mcp: list (recommended) — grants all tools the server exposes:

mcp:
  - filesystem

tools: list (selective) — pick specific tools:

tools:
  - filesystem_read

Verify the server is ready before wiring:

curl -sS http://localhost:4082/api/mcp/servers/<name> | jq '{state, tool_names}'

When removing a server: strip it from agent .md files first, then edit mcp.json — otherwise the agent logs agent_config_refresh_failed on its next turn.

Failure modes

  • File not found → ask the user to confirm the path / agent name.
  • Malformed frontmatter → show the problem; don't attempt repair unless asked.
  • Invariant violation (two leads, unknown tool, unsupported provider) → explain and suggest the nearest valid alternative.

Version History

  • cfc4951 Current 2026-09-03 05:23

    重构为单一代码代理架构,移除多代理团队运行时,统一使用 agents/code.md 作为默认配置。

  • 31e6c01 2026-08-27 18:16
  • b4ec0d3 2026-07-24 16:52

Same Skill Collection

.openagentd/skills/guidelines/SKILL.md
.openagentd/skills/oad/commit/SKILL.md
.openagentd/skills/oad/debug-prod/SKILL.md
.openagentd/skills/oad/debug/SKILL.md
.openagentd/skills/oad/diagram/SKILL.md
.openagentd/skills/oad/docs/SKILL.md
.openagentd/skills/oad/plan/SKILL.md
.openagentd/skills/oad/release/SKILL.md
.openagentd/skills/oad/review/SKILL.md
.openagentd/skills/oad/search-doc/SKILL.md
.openagentd/skills/oad/test-driven-development/SKILL.md
.openagentd/skills/oad/testing/SKILL.md
app/agent/builtin_skills/skill-installer/SKILL.md

Metadata

Files
0
Version
75a1555
Hash
137c06e8
Indexed
2026-07-24 16:52

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-09 20:21
浙ICP备14020137号-1 $お客様$