diff --git a/tools/skill_manager_tool.py b/tools/skill_manager_tool.py index eaf30dd41a..debea52642 100644 --- a/tools/skill_manager_tool.py +++ b/tools/skill_manager_tool.py @@ -374,6 +374,23 @@ def _background_review_write_guard( f"skill '{name}'." ), } + # Manually authored skills (created_by != "agent") are off-limits + # to autonomous curation. This prevents the LLM consolidation pass + # from archiving skills the user placed manually (e.g. via URL + # install or direct SKILL.md authoring), which lack the + # `created_by: "agent"` marker. + usage_data = skill_usage.load_usage() + usage_rec = usage_data.get(name) + if isinstance(usage_rec, dict) and not skill_usage._is_curator_managed_record(usage_rec): + return { + "success": False, + "error": ( + f"Refusing background curator {action} for skill " + f"'{name}': the skill records show it is not agent-created " + f"(created_by={usage_rec.get('created_by')!r}). Manually authored " + f"skills are off-limits to autonomous curation." + ), + } except Exception: logger.debug("owned skill guard lookup failed for %s", name, exc_info=True) return None