Skip to content

Extract duplicated SkillBase helpers #43

Description

@cassieemb

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

  • the duplicated blocks are gone
  • skill outputs unchanged
  • rake test green

Verify

rake test; diff emitted SWML for an example using each touched skill before/after.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions