Files
agent-skills/skills/humanizer/scripts/validate-package.py
T
naps62 9023ed3ef9 chore: update vendored skills and record provenance
humanizer 2.2.0 -> 2.9.1 (blader/humanizer, MIT): adds a Voice
Calibration section and a passive-voice pattern, reworks negative
parallelisms and em dashes. Version moved to metadata.version upstream.

impeccable 3.6.0 -> 4.0.4 (pbakaus/impeccable, Apache-2.0): the repo
tags the skill and the npm CLI separately, so 3.6.0 was a real release
and npm's 3.5.0 was never the comparison. Adds native-platform reference
briefs.

Each now carries an UPSTREAM file; bin/check-vendored.sh reports drift.
2026-08-01 14:25:26 +00:00

62 lines
1.9 KiB
Python
Executable File

#!/usr/bin/env python3
"""Validate Humanizer's portable package surfaces without external dependencies."""
from __future__ import annotations
import json
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
SKILL = (ROOT / "SKILL.md").read_text()
README = (ROOT / "README.md").read_text()
PLUGIN = json.loads((ROOT / ".claude-plugin" / "plugin.json").read_text())
def require(match: re.Match[str] | None, message: str) -> re.Match[str]:
if match is None:
raise SystemExit(message)
return match
frontmatter = require(
re.match(r"\A---\n(.*?)\n---\n", SKILL, re.DOTALL),
"SKILL.md must start with YAML frontmatter",
).group(1)
for nonportable_key in ("compatibility:", "allowed-tools:"):
if re.search(rf"(?m)^{re.escape(nonportable_key)}", frontmatter):
raise SystemExit(f"Remove nonportable frontmatter key: {nonportable_key[:-1]}")
skill_version = require(
re.search(r'(?m)^\s+version:\s*["\']([^"\']+)["\']\s*$', frontmatter),
"SKILL.md metadata.version is missing",
).group(1)
readme_version = require(
re.search(r"(?m)^- \*\*([0-9]+\.[0-9]+\.[0-9]+)\*\*", README),
"README version history is missing",
).group(1)
versions = {skill_version, readme_version, str(PLUGIN.get("version", ""))}
if len(versions) != 1:
raise SystemExit(f"Version mismatch: {sorted(versions)}")
pattern_numbers = [
int(number)
for number in re.findall(r"(?m)^### ([0-9]+)\. ", SKILL)
]
if pattern_numbers != list(range(1, 34)):
raise SystemExit(f"Expected patterns 1-33, found {pattern_numbers}")
readme_numbers = {
int(number) for number in re.findall(r"(?m)^\| ([0-9]+) \|", README)
}
if readme_numbers != set(range(1, 34)):
raise SystemExit("README pattern table must contain patterns 1-33")
if len(SKILL.splitlines()) > 500:
raise SystemExit("SKILL.md exceeds the 500-line portability budget")
print(f"Humanizer package v{skill_version} is valid")