> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# patch • AI Agent SDK

> patch: Patch an existing skill using find-replace.

# patch

<div className="flex items-center gap-2">
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**SkillMutatorProtocol**](../classes/SkillMutatorProtocol) class in the [**protocols**](../modules/protocols) module.

Patch an existing skill using find-replace.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def patch(name: str, old_string: str, new_string: str, file_path: Optional[str], replace_all: bool, propose: bool) -> str
```

## Parameters

<ParamField query="name" type="str" required={true}>
  Skill name to modify
</ParamField>

<ParamField query="old_string" type="str" required={true}>
  Text to find and replace
</ParamField>

<ParamField query="new_string" type="str" required={true}>
  Replacement text
</ParamField>

<ParamField query="file_path" type="Optional[str]" required={false}>
  Optional specific file within skill (defaults to SKILL.md)
</ParamField>

<ParamField query="replace_all" type="bool" required={false} default="False">
  Replace all occurrences vs first only
</ParamField>

<ParamField query="propose" type="bool" required={false} default="True">
  If True, stage for approval; if False, apply directly
</ParamField>

### Returns

<ResponseField name="Returns" type="str">
  Status message describing the action taken
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/skills/protocols.py#L89">
  `praisonaiagents/skills/protocols.py` at line 89
</Card>
