Compare commits
2
Commits
f83b0add58
...
3285055d80
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3285055d80 | ||
|
|
6d53597dbf |
No files matched your search
@@ -65,7 +65,10 @@ def validate_claude(path: Path) -> None:
|
|||||||
|
|
||||||
|
|
||||||
def validate_rule_skills(package: Path) -> None:
|
def validate_rule_skills(package: Path) -> None:
|
||||||
for path in (package / "skills" / "rules").glob("*/SKILL.md"):
|
paths = sorted((package / "skills").glob("rules-*/SKILL.md"))
|
||||||
|
if not paths:
|
||||||
|
fail(f"{package}: no generated rules-* skills found")
|
||||||
|
for path in paths:
|
||||||
lines = path.read_text(encoding="utf-8-sig").splitlines()
|
lines = path.read_text(encoding="utf-8-sig").splitlines()
|
||||||
if len(lines) < 4 or lines[0] != "---" or lines[3] != "---" or not lines[1].startswith("name: ") or not lines[2].startswith("description: "):
|
if len(lines) < 4 or lines[0] != "---" or lines[3] != "---" or not lines[1].startswith("name: ") or not lines[2].startswith("description: "):
|
||||||
fail(f"{path}: invalid generated skill frontmatter")
|
fail(f"{path}: invalid generated skill frontmatter")
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ def measure_package(package, client):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if client == 'claude':
|
if client == 'claude':
|
||||||
rule_files = (package / 'skills' / 'rules').glob('rules-*/SKILL.md')
|
rule_files = (package / 'skills').glob('rules-*/SKILL.md')
|
||||||
security_rule = package / 'skills' / 'rules' / 'rules-security' / 'SKILL.md'
|
security_rule = package / 'skills' / 'rules-security' / 'SKILL.md'
|
||||||
security_content = security_rule.read_text(encoding='utf-8-sig')
|
security_content = security_rule.read_text(encoding='utf-8-sig')
|
||||||
security_header = re.match(r'\A---\r?\n.*?^---[ \t]*\r?$', security_content, re.MULTILINE | re.DOTALL)
|
security_header = re.match(r'\A---\r?\n.*?^---[ \t]*\r?$', security_content, re.MULTILINE | re.DOTALL)
|
||||||
auto_loaded_rule_bytes = len(security_content[security_header.end():].encode('utf-8')) if security_header else len(security_content.encode('utf-8'))
|
auto_loaded_rule_bytes = len(security_content[security_header.end():].encode('utf-8')) if security_header else len(security_content.encode('utf-8'))
|
||||||
|
|||||||
Reference in new issue
Block a user