Class: Tools::OpenIssue
Overview
Opens a GitHub issue on Anima’s repository via the gh CLI, giving the agent a voice to report bugs, pain points, or ideas. Every issue is tagged with the label from [github] label in config.toml so maintainers can filter agent-originated issues.
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
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 description shown to the LLM.
20 |
# File 'lib/tools/open_issue.rb', line 20 def self.description = "Something broken, missing, or could be better in Anima? Say it here." |
.input_schema ⇒ Hash
Returns JSON Schema for the tool’s input parameters.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tools/open_issue.rb', line 23 def self.input_schema { type: "object", properties: { title: {type: "string"}, description: {type: "string", description: "Use gh-issue skill for guidance."} }, required: %w[title description] } end |
.tool_name ⇒ String
Returns tool identifier used in the Anthropic API schema.
17 |
# File 'lib/tools/open_issue.rb', line 17 def self.tool_name = "open_issue" |
Instance Method Details
#execute(input) ⇒ String, Hash{Symbol => String}
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/tools/open_issue.rb', line 37 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 |