MCPcopy
hub / github.com/wshobson/agents / check_codex_skill_caps

Function check_codex_skill_caps

tools/doc_gardener.py:313–330  ·  view source on GitHub ↗

Skills whose source body exceeds Codex's 8 KB cap and have no references/.

(report: Report)

Source from the content-addressed store, hash-verified

311
312
313def check_codex_skill_caps(report: Report) -> None:
314 """Skills whose source body exceeds Codex's 8 KB cap and have no references/."""
315 if not PLUGINS_DIR.is_dir():
316 return
317 for skill_md in PLUGINS_DIR.glob("*/skills/*/SKILL.md"):
318 content = skill_md.read_text(encoding="utf-8")
319 fm, body = parse_frontmatter(content)
320 body_bytes = len(body.encode("utf-8"))
321 if body_bytes > CODEX_SKILL_CAP_BYTES:
322 refs = skill_md.parent / "references"
323 if not refs.is_dir():
324 report.add(
325 kind="SKILL_OVER_CODEX_CAP",
326 severity="warning",
327 path=skill_md,
328 message=f"body is {body_bytes} bytes (Codex hard cap: {CODEX_SKILL_CAP_BYTES})",
329 fix="Move detail sections into `references/details.md` and leave SKILL.md as navigation.",
330 )
331
332
333def check_marketplace_consistency(report: Report) -> None:

Calls 2

parse_frontmatterFunction · 0.90
addMethod · 0.45