Skills whose source body exceeds Codex's 8 KB cap and have no references/.
(report: Report)
| 311 | |
| 312 | |
| 313 | def 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 | |
| 333 | def check_marketplace_consistency(report: Report) -> None: |