Class: Aidp::Skills::Wizard::Prompter
- Inherits:
-
Object
- Object
- Aidp::Skills::Wizard::Prompter
- Defined in:
- lib/aidp/skills/wizard/prompter.rb
Overview
Interactive prompter for the skill wizard
Uses TTY::Prompt to gather user input through guided questions.
Instance Attribute Summary collapse
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
Instance Method Summary collapse
-
#gather_responses(template_library, options: {}) ⇒ Hash
Gather all responses for creating a skill.
-
#initialize(prompt: TTY::Prompt.new) ⇒ Prompter
constructor
A new instance of Prompter.
Constructor Details
#initialize(prompt: TTY::Prompt.new) ⇒ Prompter
Returns a new instance of Prompter.
18 19 20 |
# File 'lib/aidp/skills/wizard/prompter.rb', line 18 def initialize(prompt: TTY::Prompt.new) @prompt = prompt end |
Instance Attribute Details
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt.
16 17 18 |
# File 'lib/aidp/skills/wizard/prompter.rb', line 16 def prompt @prompt end |
Instance Method Details
#gather_responses(template_library, options: {}) ⇒ Hash
Gather all responses for creating a skill
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/aidp/skills/wizard/prompter.rb', line 32 def gather_responses(template_library, options: {}) responses = {} # Step 1: Template selection if [:from_template] responses[:base_skill] = template_library.find([:from_template]) unless responses[:base_skill] raise Aidp::Errors::ValidationError, "Template not found: #{options[:from_template]}" end elsif [:clone] responses[:base_skill] = template_library.find([:clone]) unless responses[:base_skill] raise Aidp::Errors::ValidationError, "Skill not found: #{options[:clone]}" end elsif ![:minimal] responses[:base_skill] = prompt_template_selection(template_library) end # Step 2: Identity & Metadata responses.merge!(prompt_identity()) # Step 3: Expertise & Keywords responses.merge!(prompt_expertise) unless [:minimal] # Step 4: When to use responses.merge!(prompt_when_to_use) unless [:minimal] # Step 5: Compatible providers responses[:compatible_providers] = prompt_providers unless [:minimal] # Step 6: Content responses[:content] = prompt_content(responses[:name], responses[:base_skill]) responses end |