> ## 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.

# Render Skill Body • AI Agent SDK

> render_skill_body: Render a SKILL.md body with placeholders substituted.

# render\_skill\_body

<div className="flex items-center gap-2">
  <Badge color="teal">Function</Badge>
</div>

> This function is defined in the [**substitution**](../modules/substitution) module.

Render a SKILL.md body with placeholders substituted.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def render_skill_body(body: str, raw_args: str, skill_dir: Optional[str], session_id: Optional[str]) -> str
```

## Parameters

<ParamField query="body" type="str" required={true}>
  The markdown body (post-frontmatter) of a SKILL.md file.
</ParamField>

<ParamField query="raw_args" type="str" required={false} default="''">
  The raw argument string after the skill name (e.g. when a user types `/deploy staging prod`, `raw_args="staging prod"`).
</ParamField>

<ParamField query="skill_dir" type="Optional[str]" required={false}>
  Absolute path to the skill's directory.
</ParamField>

<ParamField query="session_id" type="Optional[str]" required={false}>
  Current session identifier for logging/correlation.
</ParamField>

### Returns

<ResponseField name="Returns" type="str">
  Rendered body ready to feed to the LLM.
</ResponseField>

## Uses

* `_INDEXED_ARG_RE.search`
* `_SHORT_ARG_RE.search`
* `m.group`
* `_INDEXED_ARG_RE.sub`
* `_SHORT_ARG_RE.sub`
* `out.rstrip`

## Used By

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

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/skills/substitution.py#L37">
  `praisonaiagents/skills/substitution.py` at line 37
</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>
