pynydus.api.skill_format

Agent Skills format: SKILL.md parse / render.

Implements the agentskills.io directory convention: skills//SKILL.md

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

AgentSkill

Spec-compliant representation of a single Agent Skill (agentskills.io).

Functions

parse_skill_md

Parse a SKILL.md string into AgentSkill.

render_skill_md

Serialize AgentSkill to spec-compliant SKILL.md text.

skill_slug

Convert a display name to a filesystem-safe slug.

Data

API

class pynydus.api.skill_format.AgentSkill(/, **data: typing.Any)[source]

Bases: pydantic.BaseModel

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

self is explicitly positional-only to allow self as a field name.

name: str

None

description: str = <Multiline-String>
version: str

‘1.0’

license: str = <Multiline-String>
compatibility: list[str]

‘Field(…)’

allowed_tools: list[str]

‘Field(…)’

metadata: dict[str, Any]

‘Field(…)’

body: str = <Multiline-String>

Markdown body: the main skill content (instructions, code, etc.).

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 into metadata.

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 AgentSkill to 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(…)’

pynydus.api.skill_format.skill_slug(name: str) str[source]

Convert a display name to a filesystem-safe slug.

Args: name: Human-readable skill name.

Returns: Lowercase slug (max 64 chars, no repeated or edge hyphens).

Examples: >>> skill_slug(“My Cool Skill!”) ‘my-cool-skill’