Summary
Several builtins duplicate the same boilerplate.
Where
skills/builtin/web_search.rb, datasphere.rb, weather_api.rb, wikipedia_search.rb (the *_BASE_URL env-override + trailing-slash-strip block, and @api_key && !@api_key.empty?-style guards); weather_api.rb hand-rolls a tool hash that joke.rb builds via DataMap.
Directive
Add helpers on SkillBase — e.g. resolved_base_url(env_var:, default:), a blank-check helper, and a prompt-section builder — and use them across the builtins; switch weather_api to DataMap.
Guardrails
Keep each skill's emitted tool/SWML output unchanged.
Acceptance
Verify
rake test; diff emitted SWML for an example using each touched skill before/after.
Summary
Several builtins duplicate the same boilerplate.
Where
skills/builtin/web_search.rb,datasphere.rb,weather_api.rb,wikipedia_search.rb(the*_BASE_URLenv-override + trailing-slash-strip block, and@api_key && !@api_key.empty?-style guards);weather_api.rbhand-rolls a tool hash thatjoke.rbbuilds viaDataMap.Directive
Add helpers on
SkillBase— e.g.resolved_base_url(env_var:, default:), a blank-check helper, and a prompt-section builder — and use them across the builtins; switchweather_apitoDataMap.Guardrails
Keep each skill's emitted tool/SWML output unchanged.
Acceptance
rake testgreenVerify
rake test; diff emitted SWML for an example using each touched skill before/after.