重开仓库内容:改推五个技能(browser-harness / humanizer / humanizer-zh / product-planning / session-mechanism)
按授权清空原有内容后重新提交(原 oil-ui-pro 一并移出,可从历史恢复)。 browser-harness 剔除 .venv 等运行环境;根 .gitignore 补记 .venv/ 与 node_modules/。
This commit is contained in:
1 parent
9a152a1952
commit
777f7fe5d0
240 files changed
+52518
-4409
No files matched your search
@@ -0,0 +1,35 @@
|
||||
from importlib import resources
|
||||
|
||||
|
||||
def _frontmatter(text: str) -> str:
|
||||
assert text.startswith("---\n")
|
||||
end = text.find("\n---\n", 4)
|
||||
assert end != -1
|
||||
return text[4:end]
|
||||
|
||||
|
||||
def test_packaged_skill_frontmatter_is_valid_simple_yaml():
|
||||
text = resources.files("browser_harness").joinpath("SKILL.md").read_text()
|
||||
metadata = {}
|
||||
|
||||
for line in _frontmatter(text).splitlines():
|
||||
key, separator, value = line.partition(":")
|
||||
assert separator == ":", line
|
||||
assert key in {"name", "description"}
|
||||
assert key.strip() == key
|
||||
value = value.strip()
|
||||
assert value, key
|
||||
|
||||
if value[0] in {"'", '"'}:
|
||||
assert value[-1] == value[0], line
|
||||
parsed = value[1:-1]
|
||||
else:
|
||||
parsed = value
|
||||
assert ": " not in parsed, line
|
||||
|
||||
metadata[key] = parsed
|
||||
|
||||
assert metadata == {
|
||||
"name": "browser-harness",
|
||||
"description": "Always use browser-harness for any web interaction: automation, scraping, testing, or site/app work.",
|
||||
}
|
||||
Reference in new issue
Block a user