Render Skill Body • AI Agent SDK

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

render_skill_body

Function

</div>

This function is defined in the substitution module.

Render a SKILL.md body with placeholders substituted.

Signature

python
def render_skill_body(body: str, raw_args: str, skill_dir: Optional[str], session_id: Optional[str]) -> str

Parameters

ParamField str

The markdown body (post-frontmatter) of a SKILL.md file.

ParamField str

The raw argument string after the skill name (e.g. when a user types `/deploy staging prod, raw_args="staging prod"`).

ParamField Optional[str]

Absolute path to the skill’s directory.

ParamField Optional[str]

Current session identifier for logging/correlation.

Returns

ResponseField str

Rendered body ready to feed to the LLM.

Uses

  • _INDEXED_ARG_RE.search
  • _SHORT_ARG_RE.search
  • m.group
  • _INDEXED_ARG_RE.sub
  • _SHORT_ARG_RE.sub
  • out.rstrip

Used By

Source

View on GitHub

praisonaiagents/skills/substitution.py at line 37


Related Documentation