Create Skill • AI Agent SDK

create_skill: Create a new skill with the given content.

create_skill

Method

</div>

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

Create a new skill with the given content.

Signature

python
def create_skill(name: str, content: str, category: str, agent_created: bool, propose: Optional[bool], base_dir: Optional[str]) -> dict

Parameters

ParamField str

Skill name (must be valid identifier)

ParamField str

Skill instructions/content for SKILL.md

ParamField str

Optional skill category

ParamField bool

Provenance flag marking the skill as agent-authored. Defaults to True since skills created via this API originate from the agent’s self-improvement loop. Lifecycle curator plugins only ever touch agent-created skills.

ParamField Optional[bool]

If True, stage the mutation for human approval instead of writing to disk. Defaults to the manager’s `write_approval policy (safe-by-default). Pass propose=False` to write directly in trusted/local contexts.

ParamField Optional[str]

Internal override for the destination skills directory. Used when applying an approved proposal so the skill lands in the directory it was staged from, independent of the approving process’s cwd. When None, the destination is resolved via :meth:_skills_base_dir.

Returns

ResponseField dict

Dict with success status and skill info

Uses

  • expanduser
  • Path
  • base_path.mkdir
  • skill_path.mkdir
  • add_skill
  • logger.info

Used By

Source

View on GitHub

praisonaiagents/skills/manager.py at line 635


Related Documentation