patch • AI Agent SDK

patch: Patch an existing skill using find-replace.

patch

Method

</div>

This is a method of the SkillMutatorProtocol class in the protocols module.

Patch an existing skill using find-replace.

Signature

python
def patch(name: str, old_string: str, new_string: str, file_path: Optional[str], replace_all: bool, propose: bool) -> str

Parameters

ParamField str

Skill name to modify

ParamField str

Text to find and replace

ParamField str

Replacement text

ParamField Optional[str]

Optional specific file within skill (defaults to SKILL.md)

ParamField bool

Replace all occurrences vs first only

ParamField bool

If True, stage for approval; if False, apply directly

Returns

ResponseField str

Status message describing the action taken

Source

View on GitHub

praisonaiagents/skills/protocols.py at line 89