Class: Tools::RequestFeature
Overview
Creates a GitHub issue via the gh CLI, letting the agent request capabilities it discovers are missing during real work. Every issue is tagged with the label from [github] label in config.toml so the developer can filter agent-originated requests from human ones.
The repository is read from [github] repo in config.toml; when unset, the tool falls back to parsing the origin remote URL.
Class Method Summary collapse
-
.description ⇒ String
Motivational description shown to the LLM.
-
.input_schema ⇒ Hash
JSON Schema for the tool’s input parameters.
-
.tool_name ⇒ String
Tool identifier used in the Anthropic API schema.
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Tools::Base
Class Method Details
.description ⇒ String
Returns motivational description shown to the LLM.
20 21 22 23 |
# File 'lib/tools/request_feature.rb', line 20 def self.description "Don't have the right tool for this task? Request it! " \ "Creates a GitHub issue so the developer knows what you need." end |
.input_schema ⇒ Hash
Returns JSON Schema for the tool’s input parameters.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/tools/request_feature.rb', line 26 def self.input_schema { type: "object", properties: { title: {type: "string", description: "Short, descriptive title for the feature request"}, description: {type: "string", description: "What you need and why — what were you trying to do, and what's missing?"} }, required: %w[title description] } end |
.tool_name ⇒ String
Returns tool identifier used in the Anthropic API schema.
17 |
# File 'lib/tools/request_feature.rb', line 17 def self.tool_name = "request_feature" |
Instance Method Details
#execute(input) ⇒ String, Hash{Symbol => String}
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/tools/request_feature.rb', line 40 def execute(input) title = input["title"].to_s.strip description = input["description"].to_s.strip return {error: "Title cannot be blank"} if title.empty? return {error: "Description cannot be blank"} if description.empty? repo = resolve_repo return repo if repo.is_a?(Hash) run_gh(repo, title, description) end |