feat(skills): add skill-local safe_mode and resource classification #161

Open
opened 2026-11-09 16:21:35 +00:00 by CoreRasurae · 0 comments
Member

Metadata

  • Commit Message: feat(skills): add skill-local safe_mode and resource classification
  • Branch: feature/m1-skill-safe-mode-resource-classification

Background and context

ADR-2034 D-8 and D-9 extend the Skill Package Schema. The current
cleveractors.agents.skill_schema module validates the original fields and a
generic resources mapping but knows nothing about a skill-local safety switch
or about the standard directory classes. Without this foundation the loader and
the skill tool cannot enforce the new policy.

Current behavior

  • Skill has no safe_mode field.
  • SkillValidator accepts any well-formed relative resource path and does not
    classify it.
  • SkillLoader stores only a flat path-to-resource mapping.
  • Existing skill packages without the new field must remain valid and keep
    their Package ID.

Expected behavior

  • Add an optional top-level boolean safe_mode with default true.
  • A non-boolean safe_mode raises the existing registry ValidationError.
  • Absence is the canonical representation of true; safe_mode: false is
    retained through validation and is part of the content-addressed identity.
  • Classify every resource path by its first POSIX segment (case-sensitive):
    references/, assets/, scripts/, non-standard top-level directory, or
    root-level file.
  • Expose the classification through the validated value objects and the loaded
    skill catalogue so the skill tool can enforce D-8/D-10 without re-parsing
    paths.
  • No script execution or other privileged behaviour is added by this issue.

Acceptance criteria

  • A skill document omitting safe_mode validates with effective safe_mode: true and an unchanged Package ID.
  • A skill document with safe_mode: false validates and produces a different
    Package ID from the same document without the field.
  • A skill document with a non-boolean safe_mode fails validation.
  • references/REFERENCE.md classifies as reference, assets/logo.png as asset,
    scripts/run.py as script, fixtures/sample.pdf as non-standard, and
    LICENSE.txt as root file.
  • Directory classification is case-sensitive: Scripts/run.py is non-standard.
  • Existing skill-resolution, schema, and loader tests remain green.
  • New Behave scenarios cover the field and every class; a Robot integration
    scenario verifies the loaded catalogue exposes the class and safety state.
  • Coverage remains >= 97% via nox -s coverage_report.

Supporting information

  • ADR-2034 D-2 (schema), D-3 (identity), D-8 (taxonomy), D-9 (safe_mode)
  • Agent Skills specification: https://agentskills.io/specification
  • Modules: cleveractors.agents.skill_schema, cleveractors.agents.skills
  • Existing tests: features/agent_skills.feature,
    features/steps/agent_skills_steps.py, robot/agent_skills.robot

Subtasks

  • Add safe_mode to Skill and SkillValidator with canonical absence
  • Add resource-path classification value objects/helpers
  • Carry classification and safe_mode through SkillLoader's catalogue
  • Tests (Behave): add scenarios for safe_mode validation and each resource class
  • Tests (Robot): verify the loaded catalogue exposes class and safety state
  • 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 skill-local safe_mode and resource classification` - **Branch**: `feature/m1-skill-safe-mode-resource-classification` ## Background and context ADR-2034 D-8 and D-9 extend the Skill Package Schema. The current `cleveractors.agents.skill_schema` module validates the original fields and a generic `resources` mapping but knows nothing about a skill-local safety switch or about the standard directory classes. Without this foundation the loader and the skill tool cannot enforce the new policy. ## Current behavior - `Skill` has no `safe_mode` field. - `SkillValidator` accepts any well-formed relative resource path and does not classify it. - `SkillLoader` stores only a flat path-to-resource mapping. - Existing skill packages without the new field must remain valid and keep their Package ID. ## Expected behavior - Add an optional top-level boolean `safe_mode` with default `true`. - A non-boolean `safe_mode` raises the existing registry `ValidationError`. - Absence is the canonical representation of `true`; `safe_mode: false` is retained through validation and is part of the content-addressed identity. - Classify every resource path by its first POSIX segment (case-sensitive): `references/`, `assets/`, `scripts/`, non-standard top-level directory, or root-level file. - Expose the classification through the validated value objects and the loaded skill catalogue so the skill tool can enforce D-8/D-10 without re-parsing paths. - No script execution or other privileged behaviour is added by this issue. ## Acceptance criteria - A skill document omitting `safe_mode` validates with effective `safe_mode: true` and an unchanged Package ID. - A skill document with `safe_mode: false` validates and produces a different Package ID from the same document without the field. - A skill document with a non-boolean `safe_mode` fails validation. - `references/REFERENCE.md` classifies as reference, `assets/logo.png` as asset, `scripts/run.py` as script, `fixtures/sample.pdf` as non-standard, and `LICENSE.txt` as root file. - Directory classification is case-sensitive: `Scripts/run.py` is non-standard. - Existing skill-resolution, schema, and loader tests remain green. - New Behave scenarios cover the field and every class; a Robot integration scenario verifies the loaded catalogue exposes the class and safety state. - Coverage remains >= 97% via `nox -s coverage_report`. ## Supporting information - ADR-2034 D-2 (schema), D-3 (identity), D-8 (taxonomy), D-9 (`safe_mode`) - Agent Skills specification: https://agentskills.io/specification - Modules: `cleveractors.agents.skill_schema`, `cleveractors.agents.skills` - Existing tests: `features/agent_skills.feature`, `features/steps/agent_skills_steps.py`, `robot/agent_skills.robot` ## Subtasks - [ ] Add `safe_mode` to `Skill` and `SkillValidator` with canonical absence - [ ] Add resource-path classification value objects/helpers - [ ] Carry classification and `safe_mode` through `SkillLoader`'s catalogue - [ ] Tests (Behave): add scenarios for `safe_mode` validation and each resource class - [ ] Tests (Robot): verify the loaded catalogue exposes class and safety state - [ ] 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-09 16:21:35 +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#161
No description provided.