Patch Skill • AI Agent SDK

patch_skill: Apply a patch to a skill using fuzzy find-and-replace.

patch_skill

Method

</div>

This is a method of the SkillManager class in the manager module.

Apply a patch to a skill using fuzzy find-and-replace.

Signature

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

Parameters

ParamField str

Skill name to patch

ParamField str

String to find and replace

ParamField str

Replacement string

ParamField str

Optional relative path within skill (defaults to SKILL.md)

ParamField bool

Replace all occurrences

ParamField Optional[bool]

If True, stage the mutation for human approval instead of writing to disk. Defaults to the manager’s `write_approval policy. Pass propose=False` to apply directly.

Returns

ResponseField dict

Dict with success status

Uses

  • get_skill
  • Path
  • relative_path.is_absolute
  • resolve
  • target_file.relative_to
  • target_file.exists
  • f.read
  • activate

Used By

Source

View on GitHub

praisonaiagents/skills/manager.py at line 793


Related Documentation