Skill Plugin Model

Smarter API PluginData Skill Connection Manifest Constants.

Smarter API Manifest - Plugin.spec.

class smarter.apps.plugin.manifest.models.skill_plugin.spec.SAMSkillPluginSpec(*, selector: SAMPluginCommonSpecSelector, prompt: SAMPluginCommonSpecPrompt, skillData: SkillData)[source]

Bases: SAMPluginCommonSpec

Smarter API SkillData Connection Manifest SkillConnection.spec.

class_identifier: ClassVar[str] = 'SkillPlugin.spec'
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

skillData: SkillData
class smarter.apps.plugin.manifest.models.skill_plugin.spec.SkillData(*, name: str, description: str, license: str | None = None, allowedTools: list[str] | None = None, instructions: ~typing.Annotated[str, ~annotated_types.MaxLen(max_length=2048)], resources: list[str] | None = <factory>)[source]

Bases: SmarterBasePydanticModel

Smarter API - generic API Skill data class.

Models a single SKILL.md-format skill as discrete, validated manifest properties: the YAML frontmatter fields (name, description, license, allowed-tools) plus the Markdown instructions body and any bundled resources file references.

to_skill_document() and from_skill_document() provide lossless round-tripping to/from the canonical SKILL.md text representation persisted by PluginDataSkill.skill_document, so a manifest author can author a skill either as structured YAML keys under skillData, or by pasting a raw SKILL.md file’s contents and parsing it with from_skill_document().

allowedTools: list[str] | None
class_identifier: ClassVar[str] = 'SkillPlugin.spec'
description: str
classmethod from_skill_document(skill_document)[source]

Parse a raw SKILL.md document (YAML frontmatter + Markdown body) into a.

validated SkillData instance.

This is the inverse of to_skill_document(), and allows a manifest author to paste an existing SKILL.md file’s contents directly rather than re-authoring it as structured YAML keys.

Parameters:

skill_document (str) – The raw SKILL.md file contents.

Returns:

A validated SkillData instance.

Return type:

SkillData

Raises:

SAMValidationError – If the document has no frontmatter block, the frontmatter is not valid YAML, the frontmatter does not parse to a mapping, or required keys are missing.

instructions: str
license: str | None
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

name: str
resources: list[str] | None
to_skill_document()[source]

Render this SkillData as a canonical SKILL.md document: a YAML frontmatter.

block followed by the Markdown instructions body.

This is the inverse of from_skill_document(), and is the representation persisted to PluginDataSkill.skill_document when the manifest controller materializes this spec into a Django model instance.

Returns:

The rendered SKILL.md text.

Return type:

str

validate_skill_data()[source]

Validate field values beyond what Field()’s declarative constraints already enforce.

Return type:

SkillData

Smarter API Plugin Manifest.

class smarter.apps.plugin.manifest.models.skill_plugin.model.SAMSkillPlugin(*, apiVersion: str, kind: str, metadata: SAMPluginCommonMetadata, spec: SAMSkillPluginSpec, status: SAMPluginCommonStatus | None = None)[source]

Bases: SAMPluginCommon

Smarter API Manifest - Skill Connection Model.

class_identifier: ClassVar[str] = 'SkillPlugin'
model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'from_attributes': True, 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_post_init(context, /)

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Return type:

None

Parameters:
  • self – The BaseModel instance.

  • context – The context.

spec: SAMSkillPluginSpec