pynydus.api.skill_format¶
Agent Skills format: SKILL.md parse / render.
Implements the agentskills.io directory convention:
skills/
Each SKILL.md has YAML front-matter (between --- fences) followed by a
Markdown body. The frontmatter fields follow the Agent Skills spec:
name (required) Slug-style identifier, max 64 chars
description (required) Human-readable summary
version (optional) SemVer string, defaults to "1.0"
license (optional) SPDX identifier
compatibility (optional) List of compatible runtimes
allowed-tools (optional) List of permitted tool names
metadata (optional) Arbitrary key-value pairs
Non-spec fields (e.g. agent_type, tags) are stored inside the
metadata map so the frontmatter remains spec-compliant.
Module Contents¶
Classes¶
Spec-compliant representation of a single Agent Skill (agentskills.io). |
Functions¶
Parse a SKILL.md string into |
|
Serialize |
|
Convert a display name to a filesystem-safe slug. |
Data¶
API¶
- class pynydus.api.skill_format.AgentSkill(/, **data: typing.Any)[source]¶
Bases:
pydantic.BaseModelSpec-compliant representation of a single Agent Skill (agentskills.io).
Initialization
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.selfis explicitly positional-only to allowselfas a field name.
- pynydus.api.skill_format._FRONTMATTER_RE¶
‘compile(…)’
- pynydus.api.skill_format.parse_skill_md(text: str) pynydus.api.skill_format.AgentSkill[source]¶
Parse a SKILL.md string into
AgentSkill.Args: text: Full file contents. optional YAML front-matter (
---fences) then Markdown body. Spec fields are parsed. unknown keys go intometadata.Returns: Parsed skill model.
Raises: ValueError: If there is no name and no body.
- pynydus.api.skill_format.render_skill_md(skill: pynydus.api.skill_format.AgentSkill) str[source]¶
Serialize
AgentSkillto spec-compliant SKILL.md text.Args: skill: Parsed or constructed skill model.
Returns: Front-matter plus body string.
Note: Only spec keys are top-level YAML fields. extra data stays under
metadata.
- pynydus.api.skill_format._SLUG_RE¶
‘compile(…)’
- pynydus.api.skill_format._CONSECUTIVE_HYPHENS¶
‘compile(…)’