-
Notifications
You must be signed in to change notification settings - Fork 21
62 lines (51 loc) · 2.22 KB
/
Copy pathvalidate.yml
File metadata and controls
62 lines (51 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Validate
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Validate skill data and references
run: |
python3 - <<'PY'
import json
import re
from pathlib import Path
root = Path.cwd()
def load_json(path):
with path.open(encoding="utf-8") as handle:
return json.load(handle)
experience_index = load_json(root / "experience" / "_index.json")
load_json(root / "knowledge-base" / "_index.json")
for item in experience_index["skills"]:
relative_file = Path(item["file"])
assert not relative_file.is_absolute()
assert ".." not in relative_file.parts
content_file = root / "experience" / relative_file
assert content_file.is_file(), content_file
entry_count = len(re.findall(r"^## 🔧 ", content_file.read_text(encoding="utf-8"), re.MULTILINE))
assert item["count"] == entry_count, (item["skillId"], item["count"], entry_count)
skill_text = (root / "SKILL.md").read_text(encoding="utf-8")
assert skill_text.startswith("---\n")
_, frontmatter, _ = skill_text.split("---", 2)
assert re.search(r"^name:\s+auto-skill$", frontmatter, re.MULTILINE)
assert re.search(r"^description:\s+", frontmatter, re.MULTILINE)
assert re.search(r"^license:\s+MIT$", frontmatter, re.MULTILINE)
for forbidden in ("GEMINI.md", "global.mdc", "CLAUDE.md", "instructions.md"):
assert forbidden not in skill_text, forbidden
readme = (root / "README.md").read_text(encoding="utf-8")
for asset in ("assets/auto-skill-flow.webp", "assets/auto-upload-knowlege.webp"):
assert asset in readme
assert (root / asset).is_file(), asset
license_text = (root / "LICENSE").read_text(encoding="utf-8")
assert "MIT License" in license_text
assert "Copyright (c) 2026 Prompt Case" in license_text
print("Validation passed")
PY