Skip to content

skill

Class info

Classes

Name Children Inherits
Skill
llmling_agent.skills.skill
A Claude Code Skill with metadata and lazy-loaded instructions.

    🛈 DocStrings

    Claude Code Skill.

    Skill dataclass

    A Claude Code Skill with metadata and lazy-loaded instructions.

    Source code in src/llmling_agent/skills/skill.py
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    @dataclass
    class Skill:
        """A Claude Code Skill with metadata and lazy-loaded instructions."""
    
        name: str
        description: str
        skill_path: UPath
        instructions: str | None = None
    
        def load_instructions(self) -> str:
            """Lazy load full instructions from SKILL.md."""
            if self.instructions is None:
                skill_file = self.skill_path / "SKILL.md"
                if skill_file.exists():
                    content = skill_file.read_text(encoding="utf-8")
                    # Split on first --- after frontmatter
                    parts = content.split("---", 2)
                    if len(parts) >= 3:  # noqa: PLR2004
                        self.instructions = parts[2].strip()
                    else:
                        self.instructions = ""
                else:
                    self.instructions = ""
            return self.instructions
    

    load_instructions

    load_instructions() -> str
    

    Lazy load full instructions from SKILL.md.

    Source code in src/llmling_agent/skills/skill.py
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    def load_instructions(self) -> str:
        """Lazy load full instructions from SKILL.md."""
        if self.instructions is None:
            skill_file = self.skill_path / "SKILL.md"
            if skill_file.exists():
                content = skill_file.read_text(encoding="utf-8")
                # Split on first --- after frontmatter
                parts = content.split("---", 2)
                if len(parts) >= 3:  # noqa: PLR2004
                    self.instructions = parts[2].strip()
                else:
                    self.instructions = ""
            else:
                self.instructions = ""
        return self.instructions