Download src/agentcade/skill.py from left0ver/WatcherRobot-com.left0ver.agentcade: direct link, hf CLI and curl.
- Browser
- Download file 653 Bytes
-
https://huggingface.co/spaces/left0ver/WatcherRobot-com.left0ver.agentcade/resolve/main/src/agentcade/skill.py
- Command line
-
hf download hf://spaces/left0ver/WatcherRobot-com.left0ver.agentcade/src/agentcade/skill.py
-
curl -L -o skill.py https://huggingface.co/spaces/left0ver/WatcherRobot-com.left0ver.agentcade/resolve/main/src/agentcade/skill.py
653 Bytes
| from dataclasses import dataclass | |
| from pathlib import Path | |
| import yaml | |
| from agentcade.protocol import GameDescriptor | |
| class Skill: | |
| descriptor: GameDescriptor | |
| instructions: str | |
| def load(cls, path: Path) -> "Skill": | |
| text = path.read_text(encoding="utf-8") | |
| header, separator, body = text.removeprefix("---\n").partition("\n---\n") | |
| if not text.startswith("---\n") or not separator or not body.strip(): | |
| raise ValueError(f"SKILL.md 需要 frontmatter 和流程正文:{path}") | |
| return cls(GameDescriptor.model_validate(yaml.safe_load(header)), body.strip()) | |