Shared skill-merge helper with override (name-collision) debug logging.
Both skill discovery paths — the CLI skills list loader
(deepagents_code.skills.load) and the runtime agent loader
(deepagents_code.plugins.adapters.skills_middleware.PluginSkillsMiddleware) —
merge skills from multiple sources by precedence, last-one-wins, keyed on skill
name. A higher-precedence skill replaces a lower-precedence skill with the same
name. That override behavior is intentional; this helper leaves it unchanged and
makes each replacement observable in debug logs.
Merge one skill into merged by name, last-one-wins.
Emits one DEBUG log whenever a skill replaces an already-merged skill with
the same name, recording the skill name plus the previous and replacement
source paths and labels so the winning definition is unambiguous. Nothing is
logged when there is no collision.
Callers must iterate sources in ascending precedence order so the replacing skill is always the higher-precedence one.