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_managetool 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]
/skillsexposes 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.mdreferences/templates/scripts/assets/
Module Targets¶
backend/agent/g_agent/skills/store.pybackend/agent/g_agent/skills/validator.pybackend/agent/g_agent/skills/manager.pybackend/agent/g_agent/agent/tools/skills.pybackend/agent/tests/test_skill_store.pybackend/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.pyhermes-agent-ref/tools/skills_tool.pyhermes-agent-ref/agent/skill_commands.pyhermes-agent-ref/agent/skill_preprocessing.py
Agent Handoff¶
Current G-Agent State¶
agent/skills.pyalready loads skills into context.- Built-in skills live under
backend/agent/g_agent/skills/. - Custom workspace skills are mentioned by
ContextBuilderasworkspace/skills/{skill-name}/SKILL.md. skills/store.py,skills/validator.py,skills/manager.py, andagent/tools/skills.pynow provide the first management slice./learn applyand/learn rollbacknow provide owner-reviewed activation and rollback for skill candidates.- Draft patching now rolls back automatically when validation fails.
/skillsexposes 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¶
- Add skill validator.
- Required frontmatter:
name,description. - Max SKILL.md size.
- Allowed subdirs:
references,templates,scripts,assets. - No path traversal.
- Add draft store.
- Draft skills are not loaded by
SkillsLoader. - Store status metadata.
- Add patch operation.
- Use exact string replacement first.
- Atomic writes.
- Rollback on validation failure.
- Add activate/disable.
- Activation requires owner command or accepted learning candidate.
- Add skill tool.
skills_list,skill_view,skill_manageor 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
SkillsLoaderin first PR.
First PR Boundary¶
Validator + draft store + tests. Lifecycle commands come next.