Add --relaxed CLI option to ease description-length and frontmatter-key checks when packing skills #171

Closed
opened 2026-11-18 21:51:50 +00:00 by CoreRasurae · 0 comments
Member

Metadata

  • Commit Message: feat(skills): add --relaxed flag to ease skill packaging checks
  • Branch: feature/m1-skill-packer-relaxed-mode

Background and context

ADR-2034 D-3/D-6 define the SkillDirectoryPacker / pack_skill_directory
packing rules (#165) and their CLI front end utils/pack_skill.py. Packing
validates the assembled mapping through SkillValidator, which enforces a
1024-character maximum on description (_MAX_DESCRIPTION_LENGTH in
cleveractors.agents.skill_schema), and SkillDirectoryPacker._schema_fields
rejects any SKILL.md frontmatter key outside the fixed
_ALLOWED_FRONTMATTER_FIELDS set in cleveractors.agents.skill_packer.

Both checks are correct defaults for publishable packages, but they block
authors during iteration: a draft skill with a longer description, or one
still carrying an extra client-specific frontmatter key before it is moved
under metadata, cannot be packed at all today, even just to inspect the
resulting mapping or Package ID locally.

Current behavior

  • python utils/pack_skill.py <dir> fails with a SkillPackingError /
    ValidationError when description exceeds 1024 characters.
  • python utils/pack_skill.py <dir> fails with a SkillPackingError when
    SKILL.md frontmatter contains any key outside the allowed set.
  • There is no way to opt out of either check; both are always enforced.

Expected behavior

  • Add a --relaxed flag to utils/pack_skill.py (argparse, store_true,
    default off).
  • When --relaxed is given, and only then:
    • The 1024-character maximum length check on description is not enforced.
    • Unknown/unsupported SKILL.md frontmatter keys are tolerated instead of
      raising SkillPackingError; they are passed through rather than
      dropped silently.
  • Every other check is unaffected by --relaxed: the minimum 1 character
    length on description, the reserved-field check (skill, instructions,
    resources), name pattern/length, compatibility length,
    allowed-tools/allowed_tools conflict detection, safe_mode type
    checking, resource path validation, and the directory-name-matches-skill-
    name check all remain exactly as strict as today.
  • Without --relaxed, CLI behavior is byte-for-byte unchanged from today.

Acceptance criteria

  • python utils/pack_skill.py <dir> (no flag) with a >1024-character
    description still fails exactly as today.
  • python utils/pack_skill.py <dir> --relaxed with a >1024-character
    description succeeds and packs the mapping.
  • python utils/pack_skill.py <dir> (no flag) with an unsupported
    frontmatter key still fails exactly as today.
  • python utils/pack_skill.py <dir> --relaxed with an unsupported
    frontmatter key succeeds and the key is present in the packed mapping.
  • --relaxed with a description shorter than 1 character still fails.
  • --relaxed with a reserved field (skill, instructions, or resources)
    declared in frontmatter still fails.
  • --relaxed has no effect on any other validation rule (name, resource
    paths, safe_mode type, compatibility length, allowed-tools conflict).
  • --relaxed combined with --check and with --output both work exactly
    like today, modulo the two relaxed checks.
  • New Behave scenarios cover: relaxed description length, relaxed unknown
    frontmatter key, and confirmation that every other rejection still fires
    under --relaxed.
  • Coverage remains >= 97% via nox -s coverage_report.

Supporting information

  • ADR-2034 D-3, D-6
  • Modules: cleveractors.agents.skill_packer.SkillDirectoryPacker,
    cleveractors.agents.skill_schema.SkillValidator, utils/pack_skill.py
  • Related: #165 (pack_skill_directory implementation), parent Epic #160

Subtasks

  • Add --relaxed argument to utils/pack_skill.py
  • Thread a relaxed flag through SkillDirectoryPacker.pack to
    SkillDirectoryPacker._schema_fields, tolerating unknown frontmatter
    keys only when set
  • Thread the same flag into SkillValidator.validate, skipping the
    description maximum-length check only when set
  • Update docs/guides/skill-packages.md CLI section with --relaxed
  • Tests (Behave): relaxed description length, relaxed unknown
    frontmatter key, unaffected checks still enforced under --relaxed
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line matches the Commit Message in
    Metadata exactly.
  • The commit is pushed to the branch matching Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged.
## Metadata - **Commit Message**: `feat(skills): add --relaxed flag to ease skill packaging checks` - **Branch**: `feature/m1-skill-packer-relaxed-mode` ## Background and context ADR-2034 D-3/D-6 define the `SkillDirectoryPacker` / `pack_skill_directory` packing rules (#165) and their CLI front end `utils/pack_skill.py`. Packing validates the assembled mapping through `SkillValidator`, which enforces a 1024-character maximum on `description` (`_MAX_DESCRIPTION_LENGTH` in `cleveractors.agents.skill_schema`), and `SkillDirectoryPacker._schema_fields` rejects any `SKILL.md` frontmatter key outside the fixed `_ALLOWED_FRONTMATTER_FIELDS` set in `cleveractors.agents.skill_packer`. Both checks are correct defaults for publishable packages, but they block authors during iteration: a draft skill with a longer description, or one still carrying an extra client-specific frontmatter key before it is moved under `metadata`, cannot be packed at all today, even just to inspect the resulting mapping or Package ID locally. ## Current behavior - `python utils/pack_skill.py <dir>` fails with a `SkillPackingError` / `ValidationError` when `description` exceeds 1024 characters. - `python utils/pack_skill.py <dir>` fails with a `SkillPackingError` when `SKILL.md` frontmatter contains any key outside the allowed set. - There is no way to opt out of either check; both are always enforced. ## Expected behavior - Add a `--relaxed` flag to `utils/pack_skill.py` (`argparse`, `store_true`, default off). - When `--relaxed` is given, and only then: - The 1024-character maximum length check on `description` is not enforced. - Unknown/unsupported `SKILL.md` frontmatter keys are tolerated instead of raising `SkillPackingError`; they are passed through rather than dropped silently. - Every other check is unaffected by `--relaxed`: the minimum 1 character length on `description`, the reserved-field check (`skill`, `instructions`, `resources`), name pattern/length, `compatibility` length, `allowed-tools`/`allowed_tools` conflict detection, `safe_mode` type checking, resource path validation, and the directory-name-matches-skill- name check all remain exactly as strict as today. - Without `--relaxed`, CLI behavior is byte-for-byte unchanged from today. ## Acceptance criteria - `python utils/pack_skill.py <dir>` (no flag) with a >1024-character `description` still fails exactly as today. - `python utils/pack_skill.py <dir> --relaxed` with a >1024-character `description` succeeds and packs the mapping. - `python utils/pack_skill.py <dir>` (no flag) with an unsupported frontmatter key still fails exactly as today. - `python utils/pack_skill.py <dir> --relaxed` with an unsupported frontmatter key succeeds and the key is present in the packed mapping. - `--relaxed` with a `description` shorter than 1 character still fails. - `--relaxed` with a reserved field (`skill`, `instructions`, or `resources`) declared in frontmatter still fails. - `--relaxed` has no effect on any other validation rule (name, resource paths, `safe_mode` type, `compatibility` length, `allowed-tools` conflict). - `--relaxed` combined with `--check` and with `--output` both work exactly like today, modulo the two relaxed checks. - New Behave scenarios cover: relaxed description length, relaxed unknown frontmatter key, and confirmation that every other rejection still fires under `--relaxed`. - Coverage remains >= 97% via `nox -s coverage_report`. ## Supporting information - ADR-2034 D-3, D-6 - Modules: `cleveractors.agents.skill_packer.SkillDirectoryPacker`, `cleveractors.agents.skill_schema.SkillValidator`, `utils/pack_skill.py` - Related: #165 (`pack_skill_directory` implementation), parent Epic #160 ## Subtasks - [ ] Add `--relaxed` argument to `utils/pack_skill.py` - [ ] Thread a relaxed flag through `SkillDirectoryPacker.pack` to `SkillDirectoryPacker._schema_fields`, tolerating unknown frontmatter keys only when set - [ ] Thread the same flag into `SkillValidator.validate`, skipping the `description` maximum-length check only when set - [ ] Update `docs/guides/skill-packages.md` CLI section with `--relaxed` - [ ] Tests (Behave): relaxed description length, relaxed unknown frontmatter key, unaffected checks still enforced under `--relaxed` - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the first line matches the Commit Message in Metadata exactly. - The commit is pushed to the branch matching Branch in Metadata exactly. - The commit is submitted as a pull request to `master`, reviewed, and merged.
CoreRasurae added this to the v2.1.0 milestone 2026-11-18 21:51:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveractors-core#171
No description provided.