Skip to content

v0.9: Skills As Procedural Memory [PARTIAL]

Implementation Status

  • [x] Built-in and custom skill stores exist.
  • [x] Draft skill directory exists under workspace state.
  • [x] Skill validator exists.
  • [x] Skill manager and skill_manage tool exist.
  • [x] Owner-reviewed skill candidate apply/edit/rollback exists through /learn.
  • [x] Background learning reviewer can propose draft skill candidates from tool-heavy turns.
  • [x] Focused lifecycle command coverage exists for skill candidate edit, apply, and rollback.
  • [x] Atomic draft patch operation exists with validation rollback.
  • [x] /skills exposes owner-facing list, view, and draft patch commands.

Goal

Make repeated successful workflows become reusable skills.

User Outcome

The character can turn repeated work into a draft skill, explain why it matters, validate it, and ask the owner before activation.

Scope

  • Define G-Agent skill layout.
  • Support list, view, create draft, patch, validate, activate, disable, and rollback.
  • Add validation for frontmatter, size limits, path traversal prevention, allowed supporting-file directories, prompt-injection scan, and optional security scan for scripts.
  • Separate declarative memory from procedural skills.
  • Let background review propose skills after repeated or tool-heavy work.
  • Require owner review before activation.
  • Add skill command invocation once the base lifecycle is stable.

Skill Layout

  • SKILL.md
  • references/
  • templates/
  • scripts/
  • assets/

Module Targets

  • backend/agent/g_agent/skills/store.py
  • backend/agent/g_agent/skills/validator.py
  • backend/agent/g_agent/skills/manager.py
  • backend/agent/g_agent/agent/tools/skills.py
  • backend/agent/tests/test_skill_store.py
  • backend/agent/tests/test_skill_validator.py

Acceptance Criteria

  • [x] Skill drafts are separated from active custom skills.
  • [x] Validation blocks unsafe paths and malformed files.
  • [x] Skill draft patching is atomic with rollback on validation failure.
  • [x] Rollback restores prior state for owner-applied skill candidates.
  • [x] Owner review is required before learning-candidate activation.

References

  • hermes-agent-ref/tools/skill_manager_tool.py
  • hermes-agent-ref/tools/skills_tool.py
  • hermes-agent-ref/agent/skill_commands.py
  • hermes-agent-ref/agent/skill_preprocessing.py

Agent Handoff

Current G-Agent State

  • agent/skills.py already loads skills into context.
  • Built-in skills live under backend/agent/g_agent/skills/.
  • Custom workspace skills are mentioned by ContextBuilder as workspace/skills/{skill-name}/SKILL.md.
  • skills/store.py, skills/validator.py, skills/manager.py, and agent/tools/skills.py now provide the first management slice.
  • /learn apply and /learn rollback now provide owner-reviewed activation and rollback for skill candidates.
  • Draft patching now rolls back automatically when validation fails.
  • /skills exposes list/view/patch-draft for owner inspection and draft edits.
  • Background skill proposal review remains.

Implementation Strategy

Keep skill loading separate from skill management at first.

Recommended shape:

  • skills/store.py: locate builtin and custom skills.
  • skills/validator.py: frontmatter, size, path safety, allowed support dirs.
  • skills/manager.py: draft/patch/activate/disable/rollback operations.
  • agent/tools/skills.py: tool interface after manager is stable.

Implementation Slices

  1. Add skill validator.
  2. Required frontmatter: name, description.
  3. Max SKILL.md size.
  4. Allowed subdirs: references, templates, scripts, assets.
  5. No path traversal.
  6. Add draft store.
  7. Draft skills are not loaded by SkillsLoader.
  8. Store status metadata.
  9. Add patch operation.
  10. Use exact string replacement first.
  11. Atomic writes.
  12. Rollback on validation failure.
  13. Add activate/disable.
  14. Activation requires owner command or accepted learning candidate.
  15. Add skill tool.
  16. skills_list, skill_view, skill_manage or one consolidated tool.

Tests

  • test_skill_validator.py
  • valid skill
  • missing frontmatter
  • invalid YAML
  • oversized content
  • path traversal
  • test_skill_manager.py
  • create draft
  • patch
  • validation rollback
  • activate
  • disable
  • rollback
  • test_skill_commands.py
  • list/view through command surface.
  • test_learning_skill_lifecycle.py
  • owner-reviewed apply/rollback through /learn.
  • draft patch rollback on validation failure.

Guardrails

  • Do not let LLM write executable scripts into active skills without review.
  • Do not load drafts into prompt.
  • Do not allow supporting files outside the skill dir.
  • Do not replace existing SkillsLoader in first PR.

First PR Boundary

Validator + draft store + tests. Lifecycle commands come next.