feat(skills): add --relaxed flag to ease skill packaging checks #177
No reviewers
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#171 Add --relaxed CLI option to ease description-length and frontmatter-key checks when packing skills
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core!177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/m1-skill-packer-relaxed-mode"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
--relaxedflag toutils/pack_skill.pythat eases exactly two checks while iterating on a draft skill: the 1024-character maximum ondescriptionis not enforced, and unsupportedSKILL.mdfrontmatter keys are tolerated and passed through instead of raising. Every other check stays exactly as strict as today.relaxedkeyword argument throughSkillDirectoryPacker.packandSkillValidator.validate, so strict validation remains the unconditional default for every other caller.unpack_skill.py, the same--relaxedflag and the same two relaxed checks are threaded throughSkillDirectoryUnpackeras well. An unsupported top-level field now survives the round trip via a newSkill.extra_fields, populated only under relaxed validation and re-emitted into the writtenSKILL.mdfrontmatter.Test plan
nox -s lint— greennox -s format -- --check— greennox -s typecheck— green (0 errors)nox -s security_scan— green (bandit + semgrep, 0 findings)nox -s dead_code— greennox -s unit_tests— 159 features, 3340 scenarios, 15381 steps passednox -s coverage_report— 97.3% (threshold 96.5%)--relaxed(reserved field,allowed-toolsconflict, minimum description length)Closes #171
PR Review: !177 (Ticket #171)
Verdict: Approve
Single atomic commit matching the ticket's Metadata (message, branch) exactly. The implementation satisfies the ticket's core requirements:
--relaxedeases exactly the two specified checks (description max-length, unknown frontmatter keys), is opt-in and threaded explicitly throughSkillDirectoryPacker.pack,SkillValidator.validate, andSkillDirectoryUnpacker.unpack, while every other caller (agent skill loading viaskills.py:239, thepack_skill_directoryfacade) keeps unconditional strict validation. Reserved-field, allowed-tools-conflict, min-length, name, resource-path, and safe_mode checks all fire before/ independently of the relaxed bypass._RESOLVER_METADATA_KEYSare correctly excluded fromextra_fields, so registry-internal keys never leak intoSKILL.mdand Package ID computation is consistent; the round-trip Package-ID stability scenario passes.to_context_dict()deliberately excludesextra_fields, so unknown draft data cannot leak into LLM context. Docs and CHANGELOG updated. Verified locally: both affected feature files pass (85 scenarios / 317 steps green); full suite and coverage (97.3% ≥ 96.5 configured threshold) green per the PR report. No prior review comments existed; nothing was ruled out-of-scope by the author. Red-tape items (labels etc.) excluded per reviewer instruction.Only minor issues below — none blocks merge, but the two accuracy fixes are cheap and worth doing before merge.
Critical Issues
None
Major Issues
None
Minor Issues
Inaccurate claim that strict unpack "fails" on unsupported top-level fields —
docs/guides/skill-packages.md:350-352andsrc/cleveractors/agents/skill_unpacker.py:257.The new guide text says unsupported top-level fields are written back "instead of raising a validation error" and that "without
--relaxedan over-long description or an unsupported field still fails exactly as before". Empirically false (verified by running the code):SkillValidatorhas no unknown-key rejection, so strict unpack of a package mapping containing e.g.author: acmesucceeds and silently drops the field. Only the over-long description fails strictly. Recommendation: reword to "instead of being silently dropped" and scope the "still fails" sentence to the description-length case only. Same correction in theSkillDirectoryUnpacker.unpackdocstring.Strict-mode error message reworded, contra the ticket's "byte-for-byte unchanged" criterion —
src/cleveractors/agents/skill_schema.py:315-324(_validate_length).Old:
must be 1-1024 characters, got 2000; new:must be at least 1 characters (max: 1024), got 2000. The rewording also changescompatibilityfailures (max 500). The ticket requires: "Without--relaxed, CLI behavior is byte-for-byte unchanged from today" and ">1024-character description still fails exactly as today" — failure/exit code are unchanged, but the stderr text differs, and "at least 1 characters" is grammatically off. Recommendation: keep the exact old wording whenmax_len is not Noneand use the new phrasing only for the no-maximum case. No existing test asserted the old text, so nothing breaks either way.Test gap vs the ticket's explicit acceptance criteria for unaffected checks under
--relaxed—features/skill_directory_packages.feature,features/skill_directory_unpacking.feature.The ticket asks for scenarios confirming that every other rejection still fires under
--relaxed, enumerating name, resource paths, safe_mode type, compatibility length, and allowed-tools conflict. Only three are covered (min description length, reserved field, allowed-tools conflict); invalid name pattern, invalid resource path, non-boolsafe_mode, and over-longcompatibilityare not exercised under--relaxed, and there is no scenario for--relaxedcombined with--check/--output. Structurally these paths cannot be affected by the flag, so risk is nil — but the scenarios are one-liners and would close the acceptance criteria exactly.Nits
src/cleveractors/agents/skill_schema.py:207-209— therelaxeddocstring onSkillValidator.validatementions only the description max-length; under relaxed it also populatesSkill.extra_fields(round-trip data). Worth one sentence.src/cleveractors/agents/skill_unpacker.py:107-110— the comment claims extra fields are "disjoint from every key set above, so this cannot clobber a known field". True for validator-produced Skills, but a directly constructedSkill(extra_fields={"name": ...})would clobber rendered frontmatter becausefields.update()runs last. Consider noting the precondition (or guarding).Summary
A clean, well-scoped feature that implements ticket #171 faithfully and extends it sensibly (unpack-side
--relaxedwithSkill.extra_fieldsround-trip, documented in the PR description). Correctness of the two relaxed checks, preservation of all other checks, strict-by-default for other callers, and Package ID round-trip stability are all verified — by new Behave scenarios and by a local run of the affected feature files. The findings above are documentation/message accuracy and cheap test additions; none affects behavior. Approve.@ -329,0 +349,4 @@`description` is not enforced, and unsupported top-level fields are writtenback into `SKILL.md`'s frontmatter instead of raising a validation error.Every other check is unaffected, and without `--relaxed` an over-longdescription or an unsupported field still fails exactly as before.Minor: inaccurate — verified empirically that strict unpack of a package mapping with an unsupported top-level field (e.g.
author: acme) succeeds and silently drops the field; it does not fail.SkillValidatorhas no unknown-key rejection. Only the over-long description fails strictly. Same inaccuracy in theunpackdocstring (skill_unpacker.py:257). Suggest: "...instead of being silently dropped" and scope the "still fails" claim to the description-length case.@ -286,3 +319,3 @@raise ValidationError(f"Skill reference '{source_reference}' field '{field_name}' "f"must be {min_len}-{max_len} characters, got {len(value)}",f"must be at least {min_len} characters (max: {bound}), "Minor: this rewording changes strict-mode error messages too (description and compatibility), but the ticket requires strict CLI behavior to be "byte-for-byte unchanged" and failures to be "exactly as today". Suggest keeping the old wording when
max_len is not Noneand using the new phrasing only for the no-maximum case. (Also: "at least 1 characters" reads off.)318b0a8bafe9f3aee83b