一键导入
modify-subagent
Edit an existing subagent file by replacing specific code snippets. Supports both workspace files and saved skills.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Edit an existing subagent file by replacing specific code snippets. Supports both workspace files and saved skills.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create a new Python subagent file in the workspace. After creating, use run_subagent to test it (NOT use_saved_subagent).
Complete the task with a final answer and save reusable subagents as skills. Use this when you have successfully solved the question.
List all previously saved subagent skills. Use this to check if a suitable subagent already exists before creating a new one.
Run a subagent - either a newly created one from workspace or a saved subagent from previous sessions.
View the source code of a saved subagent skill. Use this to understand how an existing subagent works before reusing or adapting it.
**Problem Category**: Audio file transcription using OpenAI Whisper
| name | modify_subagent |
| description | Edit an existing subagent file by replacing specific code snippets. Supports both workspace files and saved skills. |
Edit an existing subagent file by replacing specific code snippets. Supports two modes:
skill_name to modify a previously saved skill. The skill's code is copied to workspace and modified there.After modifying, use run_subagent to test — it will automatically run the modified version.
<action>modify_subagent</action>
<params>
{
"filename": "subagent.py",
"old_content": "exact code to replace",
"new_content": "new code"
}
</params>
<action>modify_subagent</action>
<params>
{
"skill_name": "web_searcher",
"old_content": "exact code to replace",
"new_content": "new code"
}
</params>
You can also specify filename to target a specific file within the saved skill (defaults to the skill's entry_file):
<action>modify_subagent</action>
<params>
{
"skill_name": "web_searcher",
"filename": "helper.py",
"old_content": "exact code to replace",
"new_content": "new code"
}
</params>
| Parameter | Type | Default | Description |
|---|---|---|---|
| filename | str | entry_file or "subagent.py" | Name of the file to modify. When used with skill_name, defaults to the skill's entry_file. |
| skill_name | str | "" | (Optional) Name of a saved skill to modify. |
| old_content | str | required | Exact code snippet to find and replace |
| new_content | str | required | New code to replace with |
On success:
{
"success": True,
"path": "/path/to/file.py",
"message": "Subagent code modified."
}
On failure:
{
"success": False,
"error": "old_content not found in file..."
}
old_content must be an exact match of text in the source filerun_subagent to test the changes — it will run the modified versionrun_subagent with the same skill_name to testmodify_subagent on a saved skill when the skill itself has problems — e.g. it contains hardcoded values, lacks generality, has bugs, or otherwise cannot be reused as-is. If the saved skill is fine but you simply want to borrow ideas or patterns from it for a similar but different task, you should view_subagent_code to study its code, then use create_subagent to build a new one. Do NOT modify a working, general-purpose skill just to adapt it to a different task.modify_subagent vs. supersedes in finish: These serve different purposes:
modify_subagent with skill_name: For small, surgical fixes (bug fixes, selector updates, minor logic changes). The skill name and file name stay the same. Changes are saved back to the original skill directory at finish time.create_subagent (new file) + supersedes in finish: For major rewrites where the architecture, approach, or file name changes significantly. This creates a new skill and removes the old one. Use this when modify_subagent would require replacing most of the code.