#5018
WIP: feat(skills): support explicit context loading
Problem
nanobot already exposes a skill_names input on ContextBuilder, but the value was ignored when building the system prompt. As a result, direct callers could not preload explicitly requested skills; only always: true skills were injected automatically, while ordinary skills remained in the progressive-loading summary.
Prompt construction also repeatedly read and parsed the same SKILL.md frontmatter, and the generated skill summary embedded machine-specific absolute paths. That added avoidable filesystem/YAML work and made the system prompt less stable across workspaces.
Current approach
- validate explicitly supplied
skill_names, rejecting missing, disabled, or unavailable skills - merge requested skills with
always: trueskills, inject their full content under# Active Skills, and remove them from the remaining skill summary - cache parsed
SKILL.mdcontent and metadata by file modification time and size, invalidating the entry when the file changes - return defensive copies of cached metadata so callers cannot mutate the cached value
- use stable
skills/<name>/SKILL.mdpaths in progressive-loading summaries instead of host-specific absolute paths
Validation
221 passedacross skill loading, context, prompt-cache, command, filesystem, subagent, and WebUI route testsruff check nanobot/agent/skills.py nanobot/agent/context.py tests/agent/test_skills_loader.py tests/agent/test_context_builder.pygit diff --check origin/main...HEAD
Activity
2This pull request is a draft
Merging is unavailable until it is marked ready for review.