Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cli-config.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ skills:
# Every N tool-calling iterations, remind the model to consider saving a skill.
# Set to 0 to disable.
creation_nudge_interval: 15
creation_nudge_category: "" # Default category for agent-created skills (empty = agent decides)

# External skill directories — share skills across tools/agents without
# copying them into ~/.hermes/skills/. Each path is expanded (~ and ${VAR})
Expand Down
11 changes: 11 additions & 0 deletions run_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1776,9 +1776,11 @@ def __init__(

# Skills config: nudge interval for skill creation reminders
self._skill_nudge_interval = 10
self._skill_nudge_category = ""
try:
skills_config = _agent_cfg.get("skills", {})
self._skill_nudge_interval = int(skills_config.get("creation_nudge_interval", 10))
self._skill_nudge_category = str(skills_config.get("creation_nudge_category", ""))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To avoid repeating the default value, you can use the already initialized instance variable self._skill_nudge_category as the default in the get() call. This makes the code more DRY. For consistency, you could apply the same pattern to _skill_nudge_interval in the line above.

Suggested change
self._skill_nudge_category = str(skills_config.get("creation_nudge_category", ""))
self._skill_nudge_category = str(skills_config.get("creation_nudge_category", self._skill_nudge_category))

except Exception:
pass

Expand Down Expand Up @@ -3547,6 +3549,15 @@ def _spawn_background_review(
else:
prompt = self._SKILL_REVIEW_PROMPT

# Inject default category directive when configured
if review_skills and self._skill_nudge_category:
prompt += (
f"\n\nIMPORTANT: When creating NEW skills (action 4), "
f"always use category='{self._skill_nudge_category}'. "
f"Only use a different category if the skill clearly belongs "
f"to an existing one already in the library."
)

def _run_review():
import contextlib
# Install a non-interactive approval callback on this worker
Expand Down
Loading