[codex] Improve skill compatibility packaging#66
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new built-in hermes policy pack to audit Hermes migration surfaces, adds support for packaging skills targeting openai-hosted environments, and updates associated documentation, test fixtures, and validation scripts. The review feedback suggests enhancing JSON metadata parsing in validate-skill.py to prevent potential AttributeErrors when keys are explicitly set to null, and removing redundant skill patterns from the hermes policy pack configuration in lucid.py to avoid duplicate filesystem globbing.
| def validate_lucid_openclaw_runtime_metadata(fields: dict[str, str]) -> None: | ||
| raw = fields.get("metadata") | ||
| if raw is None: | ||
| fail("Lucid SKILL.md must declare OpenClaw runtime metadata") | ||
| metadata = json.loads(raw) | ||
| requires = metadata.get("openclaw", {}).get("requires", {}) |
There was a problem hiding this comment.
Using .get("openclaw", {}) can still return None if the "openclaw" key is explicitly set to null in the JSON metadata. This would cause a subsequent .get("requires", {}) call to raise an AttributeError. Use a safer fallback pattern like metadata.get("openclaw") or {} to ensure it always resolves to a dictionary.
| def validate_lucid_openclaw_runtime_metadata(fields: dict[str, str]) -> None: | |
| raw = fields.get("metadata") | |
| if raw is None: | |
| fail("Lucid SKILL.md must declare OpenClaw runtime metadata") | |
| metadata = json.loads(raw) | |
| requires = metadata.get("openclaw", {}).get("requires", {}) | |
| def validate_lucid_openclaw_runtime_metadata(fields: dict[str, str]) -> None: | |
| raw = fields.get("metadata") | |
| if raw is None: | |
| fail("Lucid SKILL.md must declare OpenClaw runtime metadata") | |
| metadata = json.loads(raw) | |
| openclaw = metadata.get("openclaw") or {} | |
| requires = openclaw.get("requires") or {} |
| skill=[ | ||
| ".hermes/skills/*/SKILL.md", | ||
| ".hermes/skills/*/references/**/*.md", | ||
| "skills/*/SKILL.md", | ||
| "skills/*/references/**/*.md", | ||
| ], |
There was a problem hiding this comment.
The patterns "skills/*/SKILL.md" and "skills/*/references/**/*.md" are already included in DEFAULT_CONFIG["surfaces"]["skill"]. Since surface_overlay concatenates the default list with the provided list, including them here results in duplicate patterns. This causes redundant filesystem globbing. You can safely remove them from the hermes pack's skill list.
skill=[
".hermes/skills/*/SKILL.md",
".hermes/skills/*/references/**/*.md",
],7e98af7 to
b8bf749
Compare
Summary
lucid/top-level folder.Validation
python scripts/validate-skill.pypython scripts/validate-no-dangerous-io.pypython scripts/validate-evals.pypython scripts/validate-docs.pypython scripts/validate-package-skill.pypython skills/lucid/scripts/lucid.py verify --root . --strictStrict verify passed with
ok: trueanddebt_score: 0.