> ## 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 Skill • AI Agent SDK

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

# patch\_skill

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

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

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

## Signature

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

## Parameters

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

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

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

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

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

<ParamField query="propose" type="Optional[bool]" required={false}>
  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.
</ParamField>

### Returns

<ResponseField name="Returns" type="dict">
  Dict with success status
</ResponseField>

## Uses

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

## Used By

* [`SkillManager.patch`](../functions/SkillManager-patch)

## Source

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

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Skills Concept" icon="wand-magic-sparkles" href="/docs/docs/concepts/skills" />

  <Card title="Skills Feature" icon="star" href="/docs/docs/features/skills" />
</CardGroup>
