roast-ai 0.4.6 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +3 -1
  3. data/.gitignore +7 -0
  4. data/.rubocop.yml +14 -0
  5. data/Gemfile +2 -1
  6. data/Gemfile.lock +9 -1
  7. data/Rakefile +16 -4
  8. data/examples/README.md +9 -0
  9. data/examples/available_tools_demo/workflow.yml +2 -2
  10. data/examples/basic_prompt_workflow/workflow.md +1 -0
  11. data/examples/basic_prompt_workflow/workflow.yml +14 -0
  12. data/lib/roast/dsl/executor.rb +2 -1
  13. data/lib/roast/helpers/cmd_runner.rb +199 -0
  14. data/lib/roast/initializers.rb +1 -1
  15. data/lib/roast/tools/apply_diff.rb +1 -1
  16. data/lib/roast/tools/bash.rb +4 -4
  17. data/lib/roast/tools/cmd.rb +3 -5
  18. data/lib/roast/tools/coding_agent.rb +1 -1
  19. data/lib/roast/tools/grep.rb +6 -2
  20. data/lib/roast/tools/read_file.rb +2 -1
  21. data/lib/roast/tools/swarm.rb +2 -7
  22. data/lib/roast/tools.rb +10 -1
  23. data/lib/roast/version.rb +1 -1
  24. data/lib/roast/workflow/base_step.rb +2 -3
  25. data/lib/roast/workflow/command_executor.rb +3 -3
  26. data/lib/roast/workflow/resource_resolver.rb +1 -1
  27. data/lib/roast/workflow/shell_script_step.rb +1 -1
  28. data/lib/roast/workflow/step_loader.rb +2 -7
  29. data/lib/roast.rb +7 -1
  30. data/rubocop/cop/roast/use_cmd_runner.rb +93 -0
  31. data/rubocop/cop/roast.rb +4 -0
  32. data/sorbet/rbi/gems/docile@1.4.1.rbi +377 -0
  33. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +233 -2
  34. data/sorbet/rbi/gems/racc@1.8.1.rbi +6 -4
  35. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +396 -2
  36. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3788 -2
  37. data/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi +7747 -2
  38. data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
  39. data/sorbet/rbi/gems/rubocop@1.77.0.rbi +62813 -2
  40. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1311 -2
  41. data/sorbet/rbi/gems/simplecov-html@0.13.2.rbi +225 -0
  42. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2259 -0
  43. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +9 -0
  44. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +125 -2
  45. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +244 -2
  46. data/sorbet/tapioca/require.rb +2 -1
  47. metadata +12 -240
  48. data/CHANGELOG.md +0 -364
  49. data/examples/agent_continue/add_documentation/prompt.md +0 -5
  50. data/examples/agent_continue/add_error_handling/prompt.md +0 -5
  51. data/examples/agent_continue/analyze_codebase/prompt.md +0 -7
  52. data/examples/agent_continue/combined_workflow.yml +0 -24
  53. data/examples/agent_continue/continue_adding_features/prompt.md +0 -4
  54. data/examples/agent_continue/create_integration_tests/prompt.md +0 -3
  55. data/examples/agent_continue/document_with_context/prompt.md +0 -5
  56. data/examples/agent_continue/explore_api/prompt.md +0 -6
  57. data/examples/agent_continue/implement_client/prompt.md +0 -6
  58. data/examples/agent_continue/inline_workflow.yml +0 -20
  59. data/examples/agent_continue/refactor_code/prompt.md +0 -2
  60. data/examples/agent_continue/verify_changes/prompt.md +0 -6
  61. data/examples/agent_continue/workflow.yml +0 -27
  62. data/examples/agent_workflow/README.md +0 -75
  63. data/examples/agent_workflow/apply_refactorings/prompt.md +0 -22
  64. data/examples/agent_workflow/identify_code_smells/prompt.md +0 -15
  65. data/examples/agent_workflow/summarize_improvements/prompt.md +0 -18
  66. data/examples/agent_workflow/workflow.png +0 -0
  67. data/examples/agent_workflow/workflow.yml +0 -16
  68. data/examples/api_workflow/README.md +0 -85
  69. data/examples/api_workflow/fetch_api_data/prompt.md +0 -10
  70. data/examples/api_workflow/generate_report/prompt.md +0 -10
  71. data/examples/api_workflow/prompt.md +0 -10
  72. data/examples/api_workflow/transform_data/prompt.md +0 -10
  73. data/examples/api_workflow/workflow.png +0 -0
  74. data/examples/api_workflow/workflow.yml +0 -30
  75. data/examples/apply_diff_demo/README.md +0 -58
  76. data/examples/apply_diff_demo/apply_simple_change/prompt.md +0 -13
  77. data/examples/apply_diff_demo/create_sample_file/prompt.md +0 -11
  78. data/examples/apply_diff_demo/workflow.yml +0 -24
  79. data/examples/available_tools_demo/workflow.png +0 -0
  80. data/examples/bash_prototyping/README.md +0 -53
  81. data/examples/bash_prototyping/analyze_network/prompt.md +0 -13
  82. data/examples/bash_prototyping/analyze_system/prompt.md +0 -11
  83. data/examples/bash_prototyping/api_testing.png +0 -0
  84. data/examples/bash_prototyping/api_testing.yml +0 -14
  85. data/examples/bash_prototyping/check_processes/prompt.md +0 -11
  86. data/examples/bash_prototyping/generate_report/prompt.md +0 -16
  87. data/examples/bash_prototyping/process_json_response/prompt.md +0 -24
  88. data/examples/bash_prototyping/system_analysis.png +0 -0
  89. data/examples/bash_prototyping/system_analysis.yml +0 -14
  90. data/examples/bash_prototyping/test_public_api/prompt.md +0 -22
  91. data/examples/case_when/README.md +0 -58
  92. data/examples/case_when/detect_language/prompt.md +0 -16
  93. data/examples/case_when/workflow.png +0 -0
  94. data/examples/case_when/workflow.yml +0 -58
  95. data/examples/cmd/README.md +0 -99
  96. data/examples/cmd/analyze_project/prompt.md +0 -57
  97. data/examples/cmd/basic_demo/prompt.md +0 -48
  98. data/examples/cmd/basic_workflow.png +0 -0
  99. data/examples/cmd/basic_workflow.yml +0 -17
  100. data/examples/cmd/check_repository/prompt.md +0 -57
  101. data/examples/cmd/create_and_verify/prompt.md +0 -56
  102. data/examples/cmd/dev_workflow.png +0 -0
  103. data/examples/cmd/dev_workflow.yml +0 -26
  104. data/examples/cmd/explore_project/prompt.md +0 -67
  105. data/examples/cmd/explorer_workflow.png +0 -0
  106. data/examples/cmd/explorer_workflow.yml +0 -21
  107. data/examples/cmd/smart_tool_selection/prompt.md +0 -99
  108. data/examples/coding_agent_with_model.yml +0 -20
  109. data/examples/coding_agent_with_retries.yml +0 -30
  110. data/examples/conditional/README.md +0 -161
  111. data/examples/conditional/check_condition/prompt.md +0 -1
  112. data/examples/conditional/simple_workflow.png +0 -0
  113. data/examples/conditional/simple_workflow.yml +0 -15
  114. data/examples/conditional/workflow.png +0 -0
  115. data/examples/conditional/workflow.yml +0 -23
  116. data/examples/context_management_demo/README.md +0 -43
  117. data/examples/context_management_demo/workflow.yml +0 -42
  118. data/examples/direct_coerce_syntax/README.md +0 -32
  119. data/examples/direct_coerce_syntax/workflow.png +0 -0
  120. data/examples/direct_coerce_syntax/workflow.yml +0 -36
  121. data/examples/dot_notation/README.md +0 -37
  122. data/examples/dot_notation/workflow.png +0 -0
  123. data/examples/dot_notation/workflow.yml +0 -44
  124. data/examples/exit_on_error/README.md +0 -50
  125. data/examples/exit_on_error/analyze_lint_output/prompt.md +0 -9
  126. data/examples/exit_on_error/apply_fixes/prompt.md +0 -2
  127. data/examples/exit_on_error/workflow.png +0 -0
  128. data/examples/exit_on_error/workflow.yml +0 -19
  129. data/examples/grading/README.md +0 -71
  130. data/examples/grading/analyze_coverage/prompt.md +0 -52
  131. data/examples/grading/calculate_final_grade.rb +0 -67
  132. data/examples/grading/format_result.rb +0 -64
  133. data/examples/grading/generate_grades/prompt.md +0 -105
  134. data/examples/grading/generate_recommendations/output.txt +0 -17
  135. data/examples/grading/generate_recommendations/prompt.md +0 -60
  136. data/examples/grading/js_test_runner +0 -31
  137. data/examples/grading/rb_test_runner +0 -19
  138. data/examples/grading/read_dependencies/prompt.md +0 -16
  139. data/examples/grading/run_coverage.rb +0 -54
  140. data/examples/grading/verify_mocks_and_stubs/prompt.md +0 -12
  141. data/examples/grading/verify_test_helpers/prompt.md +0 -53
  142. data/examples/grading/workflow.md +0 -8
  143. data/examples/grading/workflow.png +0 -0
  144. data/examples/grading/workflow.rb.md +0 -6
  145. data/examples/grading/workflow.ts+tsx.md +0 -6
  146. data/examples/grading/workflow.yml +0 -41
  147. data/examples/instrumentation.rb +0 -76
  148. data/examples/interpolation/README.md +0 -50
  149. data/examples/interpolation/analyze_file/prompt.md +0 -1
  150. data/examples/interpolation/analyze_patterns/prompt.md +0 -27
  151. data/examples/interpolation/generate_report_for_js/prompt.md +0 -3
  152. data/examples/interpolation/generate_report_for_rb/prompt.md +0 -3
  153. data/examples/interpolation/sample.js +0 -48
  154. data/examples/interpolation/sample.rb +0 -42
  155. data/examples/interpolation/workflow.md +0 -1
  156. data/examples/interpolation/workflow.png +0 -0
  157. data/examples/interpolation/workflow.yml +0 -21
  158. data/examples/iteration/IMPLEMENTATION.md +0 -88
  159. data/examples/iteration/README.md +0 -68
  160. data/examples/iteration/analyze_complexity/prompt.md +0 -22
  161. data/examples/iteration/generate_recommendations/prompt.md +0 -21
  162. data/examples/iteration/generate_report/prompt.md +0 -129
  163. data/examples/iteration/implement_fix/prompt.md +0 -25
  164. data/examples/iteration/prioritize_issues/prompt.md +0 -24
  165. data/examples/iteration/prompts/analyze_file.md +0 -28
  166. data/examples/iteration/prompts/generate_summary.md +0 -24
  167. data/examples/iteration/prompts/update_report.md +0 -29
  168. data/examples/iteration/prompts/write_report.md +0 -22
  169. data/examples/iteration/read_file/prompt.md +0 -9
  170. data/examples/iteration/select_next_issue/prompt.md +0 -25
  171. data/examples/iteration/simple_workflow.md +0 -39
  172. data/examples/iteration/simple_workflow.yml +0 -58
  173. data/examples/iteration/update_fix_count/prompt.md +0 -26
  174. data/examples/iteration/verify_fix/prompt.md +0 -29
  175. data/examples/iteration/workflow.png +0 -0
  176. data/examples/iteration/workflow.yml +0 -42
  177. data/examples/json_handling/README.md +0 -32
  178. data/examples/json_handling/workflow.png +0 -0
  179. data/examples/json_handling/workflow.yml +0 -52
  180. data/examples/mcp/README.md +0 -223
  181. data/examples/mcp/analyze_changes/prompt.md +0 -8
  182. data/examples/mcp/analyze_issues/prompt.md +0 -4
  183. data/examples/mcp/analyze_schema/prompt.md +0 -4
  184. data/examples/mcp/check_data_quality/prompt.md +0 -5
  185. data/examples/mcp/check_documentation/prompt.md +0 -4
  186. data/examples/mcp/create_recommendations/prompt.md +0 -5
  187. data/examples/mcp/database_workflow.png +0 -0
  188. data/examples/mcp/database_workflow.yml +0 -29
  189. data/examples/mcp/env_demo/workflow.png +0 -0
  190. data/examples/mcp/env_demo/workflow.yml +0 -34
  191. data/examples/mcp/fetch_pr_context/prompt.md +0 -4
  192. data/examples/mcp/filesystem_demo/create_test_file/prompt.md +0 -2
  193. data/examples/mcp/filesystem_demo/list_files/prompt.md +0 -6
  194. data/examples/mcp/filesystem_demo/read_with_mcp/prompt.md +0 -7
  195. data/examples/mcp/filesystem_demo/workflow.png +0 -0
  196. data/examples/mcp/filesystem_demo/workflow.yml +0 -38
  197. data/examples/mcp/generate_insights/prompt.md +0 -4
  198. data/examples/mcp/generate_report/prompt.md +0 -6
  199. data/examples/mcp/generate_review/prompt.md +0 -16
  200. data/examples/mcp/github_workflow.png +0 -0
  201. data/examples/mcp/github_workflow.yml +0 -32
  202. data/examples/mcp/multi_mcp_workflow.png +0 -0
  203. data/examples/mcp/multi_mcp_workflow.yml +0 -58
  204. data/examples/mcp/post_review/prompt.md +0 -3
  205. data/examples/mcp/save_report/prompt.md +0 -6
  206. data/examples/mcp/search_issues/prompt.md +0 -2
  207. data/examples/mcp/summarize/prompt.md +0 -1
  208. data/examples/mcp/test_filesystem/prompt.md +0 -6
  209. data/examples/mcp/test_github/prompt.md +0 -8
  210. data/examples/mcp/test_read/prompt.md +0 -1
  211. data/examples/mcp/workflow.png +0 -0
  212. data/examples/mcp/workflow.yml +0 -35
  213. data/examples/no_model_fallback/README.md +0 -17
  214. data/examples/no_model_fallback/analyze_file/prompt.md +0 -1
  215. data/examples/no_model_fallback/analyze_patterns/prompt.md +0 -27
  216. data/examples/no_model_fallback/generate_report_for_md/prompt.md +0 -10
  217. data/examples/no_model_fallback/generate_report_for_rb/prompt.md +0 -3
  218. data/examples/no_model_fallback/sample.rb +0 -42
  219. data/examples/no_model_fallback/workflow.yml +0 -19
  220. data/examples/openrouter_example/README.md +0 -48
  221. data/examples/openrouter_example/analyze_input/prompt.md +0 -16
  222. data/examples/openrouter_example/generate_response/prompt.md +0 -9
  223. data/examples/openrouter_example/workflow.png +0 -0
  224. data/examples/openrouter_example/workflow.yml +0 -12
  225. data/examples/pre_post_processing/README.md +0 -111
  226. data/examples/pre_post_processing/analyze_test_file/prompt.md +0 -23
  227. data/examples/pre_post_processing/improve_test_coverage/prompt.md +0 -17
  228. data/examples/pre_post_processing/optimize_test_performance/prompt.md +0 -25
  229. data/examples/pre_post_processing/post_processing/aggregate_metrics/prompt.md +0 -31
  230. data/examples/pre_post_processing/post_processing/cleanup_environment/prompt.md +0 -28
  231. data/examples/pre_post_processing/post_processing/generate_summary_report/prompt.md +0 -32
  232. data/examples/pre_post_processing/post_processing/output.txt +0 -24
  233. data/examples/pre_post_processing/pre_processing/gather_baseline_metrics/prompt.md +0 -26
  234. data/examples/pre_post_processing/pre_processing/setup_test_environment/prompt.md +0 -11
  235. data/examples/pre_post_processing/validate_changes/prompt.md +0 -24
  236. data/examples/pre_post_processing/workflow.png +0 -0
  237. data/examples/pre_post_processing/workflow.yml +0 -21
  238. data/examples/retry/workflow.yml +0 -23
  239. data/examples/rspec_to_minitest/README.md +0 -68
  240. data/examples/rspec_to_minitest/analyze_spec/prompt.md +0 -30
  241. data/examples/rspec_to_minitest/create_minitest/prompt.md +0 -33
  242. data/examples/rspec_to_minitest/run_and_improve/prompt.md +0 -35
  243. data/examples/rspec_to_minitest/workflow.md +0 -10
  244. data/examples/rspec_to_minitest/workflow.png +0 -0
  245. data/examples/rspec_to_minitest/workflow.yml +0 -40
  246. data/examples/shared_config/README.md +0 -52
  247. data/examples/shared_config/example_with_shared_config/workflow.png +0 -0
  248. data/examples/shared_config/example_with_shared_config/workflow.yml +0 -6
  249. data/examples/shared_config/shared.png +0 -0
  250. data/examples/shared_config/shared.yml +0 -7
  251. data/examples/single_target_prepost/README.md +0 -36
  252. data/examples/single_target_prepost/post_processing/output.txt +0 -27
  253. data/examples/single_target_prepost/pre_processing/gather_dependencies/prompt.md +0 -11
  254. data/examples/single_target_prepost/workflow.png +0 -0
  255. data/examples/single_target_prepost/workflow.yml +0 -20
  256. data/examples/smart_coercion_defaults/README.md +0 -65
  257. data/examples/smart_coercion_defaults/workflow.png +0 -0
  258. data/examples/smart_coercion_defaults/workflow.yml +0 -44
  259. data/examples/step_configuration/README.md +0 -84
  260. data/examples/step_configuration/workflow.png +0 -0
  261. data/examples/step_configuration/workflow.yml +0 -57
  262. data/examples/swarm_example.yml +0 -25
  263. data/examples/tool_config_example/README.md +0 -109
  264. data/examples/tool_config_example/example_step/prompt.md +0 -42
  265. data/examples/tool_config_example/workflow.png +0 -0
  266. data/examples/tool_config_example/workflow.yml +0 -17
  267. data/examples/user_input/README.md +0 -90
  268. data/examples/user_input/funny_name/create_backstory/prompt.md +0 -10
  269. data/examples/user_input/funny_name/workflow.png +0 -0
  270. data/examples/user_input/funny_name/workflow.yml +0 -26
  271. data/examples/user_input/generate_summary/prompt.md +0 -11
  272. data/examples/user_input/simple_input_demo/workflow.png +0 -0
  273. data/examples/user_input/simple_input_demo/workflow.yml +0 -35
  274. data/examples/user_input/survey_workflow.png +0 -0
  275. data/examples/user_input/survey_workflow.yml +0 -71
  276. data/examples/user_input/welcome_message/prompt.md +0 -3
  277. data/examples/user_input/workflow.png +0 -0
  278. data/examples/user_input/workflow.yml +0 -73
  279. data/examples/workflow_generator/README.md +0 -27
  280. data/examples/workflow_generator/analyze_user_request/prompt.md +0 -34
  281. data/examples/workflow_generator/create_workflow_files/prompt.md +0 -32
  282. data/examples/workflow_generator/get_user_input/prompt.md +0 -14
  283. data/examples/workflow_generator/info_from_roast.rb +0 -22
  284. data/examples/workflow_generator/workflow.png +0 -0
  285. data/examples/workflow_generator/workflow.yml +0 -34
  286. data/lib/roast/helpers/timeout_handler.rb +0 -89
@@ -1,109 +0,0 @@
1
- # Tool Configuration Example
2
-
3
- This example demonstrates how to configure tools with specific settings in Roast workflows.
4
-
5
- ## Overview
6
-
7
- Starting with this update, Roast supports configuring tools with specific settings directly in the workflow YAML file. This is particularly useful for tools like `Roast::Tools::Cmd` where you might want to restrict which commands can be executed.
8
-
9
- ## Configuration Syntax
10
-
11
- Tools can be configured in two ways:
12
-
13
- ### 1. Simple String Format (No Configuration)
14
- ```yaml
15
- tools:
16
- - Roast::Tools::ReadFile
17
- - Roast::Tools::WriteFile
18
- - Roast::Tools::Grep
19
- ```
20
-
21
- ### 2. Hash Format (With Configuration)
22
- ```yaml
23
- tools:
24
- - Roast::Tools::Cmd:
25
- allowed_commands:
26
- - ls
27
- - pwd
28
- - echo
29
- ```
30
-
31
- ### 3. Mixed Format
32
- You can mix both formats in the same workflow:
33
-
34
- ```yaml
35
- tools:
36
- - Roast::Tools::ReadFile
37
- - Roast::Tools::Cmd:
38
- allowed_commands:
39
- - ls
40
- - pwd
41
- - ruby
42
- - sed
43
- - Roast::Tools::WriteFile
44
- - Roast::Tools::SearchFile
45
- ```
46
-
47
- ## Example: Configuring Allowed Commands
48
-
49
- The `Roast::Tools::Cmd` tool now supports an `allowed_commands` configuration that restricts which commands can be executed:
50
-
51
- ```yaml
52
- tools:
53
- - Roast::Tools::Cmd:
54
- allowed_commands:
55
- - ls
56
- - pwd
57
- - echo
58
- - cat
59
- - ruby
60
- - rake
61
- ```
62
-
63
- ### Enhanced Command Configuration with Descriptions
64
-
65
- You can also provide custom descriptions for commands to help the LLM understand their purpose:
66
-
67
- ```yaml
68
- tools:
69
- - Roast::Tools::Cmd:
70
- allowed_commands:
71
- - ls
72
- - pwd
73
- - name: echo
74
- description: "echo command - output text to stdout, supports > for file redirection"
75
- - name: cat
76
- description: "cat command - display file contents, concatenate files, works with pipes"
77
- ```
78
-
79
- This mixed format allows you to:
80
- - Use simple strings for commands with good default descriptions
81
- - Provide custom descriptions for commands that need more context
82
- - Help the LLM make better decisions about which command to use
83
-
84
- With this configuration:
85
- - ✅ `ls -la` will work
86
- - ✅ `echo "Hello World"` will work
87
- - ❌ `rm file.txt` will be rejected (not in allowed list)
88
- - ❌ `git status` will be rejected (not in allowed list)
89
-
90
- ## Default Behavior
91
-
92
- If no configuration is provided for `Roast::Tools::Cmd`, it uses the default allowed commands:
93
- - pwd
94
- - find
95
- - ls
96
- - rake
97
- - ruby
98
- - dev
99
- - mkdir
100
-
101
- ## Running the Example
102
-
103
- To run this example workflow:
104
-
105
- ```bash
106
- bin/roast execute examples/tool_config_example/workflow.yml
107
- ```
108
-
109
- The workflow will validate the tool configuration by executing various commands and demonstrating which ones are allowed and which are rejected based on the configuration.
@@ -1,42 +0,0 @@
1
- # Tool Configuration Validation
2
-
3
- Execute the following commands using the cmd tool:
4
-
5
- 1. `ls -la`
6
- 2. `pwd`
7
- 3. `echo "Hello from configured commands!"`
8
- 4. `git status`
9
-
10
- RESPONSE FORMAT
11
- You must respond in JSON format within <json> XML tags.
12
-
13
- <json>
14
- {
15
- "commands": [
16
- {
17
- "command": "ls -la",
18
- "exit_status": 0,
19
- "output": "total 208\ndrwxr-xr-x@ 31 user staff...",
20
- "success": true
21
- },
22
- {
23
- "command": "pwd",
24
- "exit_status": 0,
25
- "output": "/Users/user/project",
26
- "success": true
27
- },
28
- {
29
- "command": "echo \"Hello from configured commands!\"",
30
- "exit_status": 0,
31
- "output": "Hello from configured commands!",
32
- "success": true
33
- },
34
- {
35
- "command": "git status",
36
- "exit_status": null,
37
- "output": "Error: Command not allowed. Only commands starting with ls, pwd, echo, cat are permitted.",
38
- "success": false
39
- }
40
- ]
41
- }
42
- </json>
@@ -1,17 +0,0 @@
1
- name: Tool Configuration Example
2
- model: default
3
- tools:
4
- - Roast::Tools::ReadFile
5
- - Roast::Tools::Cmd:
6
- allowed_commands:
7
- - ls
8
- - pwd
9
- - name: echo
10
- description: "echo command - output text to stdout, supports > for file redirection"
11
- - name: cat
12
- description: "cat command - display file contents, concatenate files, works with pipes"
13
- - Roast::Tools::WriteFile
14
-
15
- steps:
16
- - example_step
17
-
@@ -1,90 +0,0 @@
1
- # User Input Example
2
-
3
- This example demonstrates how to use the `input` step type in Roast workflows to collect information from users during workflow execution.
4
-
5
- ## Overview
6
-
7
- The `input` step type allows workflows to:
8
- - Collect text input from users
9
- - Ask yes/no questions (boolean)
10
- - Present multiple choice options
11
- - Securely collect passwords (hidden input)
12
- - Store collected values in workflow state for later use
13
-
14
- ## Running the Example
15
-
16
- ```bash
17
- # Run the interactive deployment workflow
18
- roast execute examples/user_input/workflow.yml
19
-
20
- # Run a simple survey workflow
21
- roast execute examples/user_input/survey_workflow.yml
22
- ```
23
-
24
- ## Input Step Configuration
25
-
26
- ### Basic Text Input
27
- ```yaml
28
- - input:
29
- prompt: "Enter your name:"
30
- name: user_name
31
- ```
32
-
33
- ### Boolean (Yes/No) Input
34
- ```yaml
35
- - input:
36
- prompt: "Do you want to continue?"
37
- type: boolean
38
- default: true
39
- name: should_continue
40
- ```
41
-
42
- ### Choice Selection
43
- ```yaml
44
- - input:
45
- prompt: "Select environment:"
46
- type: choice
47
- options:
48
- - development
49
- - staging
50
- - production
51
- name: environment
52
- ```
53
-
54
- ### Password Input
55
- ```yaml
56
- - input:
57
- prompt: "Enter password:"
58
- type: password
59
- required: true
60
- name: user_password
61
- ```
62
-
63
- ## Configuration Options
64
-
65
- - `prompt` (required): The question or message to display to the user
66
- - `name` (optional): Variable name to store the input value in workflow state
67
- - `type` (optional): Type of input - `text` (default), `boolean`, `choice`, or `password`
68
- - `required` (optional): Whether the input is required (default: false)
69
- - `default` (optional): Default value if user presses enter without input
70
- - `timeout` (optional): Timeout in seconds for user input
71
- - `options` (required for choice type): Array of options for choice selection
72
-
73
- ## Accessing Input Values
74
-
75
- Input values stored with a `name` can be accessed in subsequent steps using interpolation:
76
-
77
- ```yaml
78
- - input:
79
- prompt: "Enter project name:"
80
- name: project_name
81
-
82
- - prompt: "Creating project: #{state.project_name}"
83
- ```
84
-
85
- ## Non-TTY Environments
86
-
87
- When running in non-TTY environments (e.g., CI/CD pipelines), input steps will:
88
- - Use default values if provided
89
- - Fail if required inputs have no default
90
- - Skip optional inputs without defaults
@@ -1,10 +0,0 @@
1
- Create a hilarious and absurd backstory for someone named <%= workflow.output.user_name %> as a <%= workflow.output.genre %>.
2
-
3
- Make it funny, creative, and include:
4
- - A ridiculous origin story
5
- - An absurd special ability or talent related to their name
6
- - A nemesis with an equally silly name
7
- - Their greatest achievement (make it hilariously mundane yet epic)
8
- - A catchphrase that makes no sense
9
-
10
- Keep it fun and family-friendly! Format it as an entertaining narrative.
@@ -1,26 +0,0 @@
1
- name: funny_name_backstory
2
- description: Create a humorous backstory based on your name
3
- model: anthropic:claude-3-5-sonnet
4
-
5
- steps:
6
- # Collect user's name
7
- - input:
8
- prompt: "What's your name?"
9
- name: user_name
10
- required: true
11
-
12
- # Ask for preferences
13
- - input:
14
- prompt: "Pick a genre for your backstory:"
15
- type: choice
16
- options:
17
- - "Epic Fantasy Adventure"
18
- - "Cyberpunk Hacker"
19
- - "Time-Traveling Detective"
20
- - "Intergalactic Pizza Delivery"
21
- - "Victorian-Era Vampire Hunter"
22
- - "Professional Cat Whisperer"
23
- name: genre
24
-
25
- # Generate the backstory
26
- - create_backstory
@@ -1,11 +0,0 @@
1
- Please generate a nicely formatted survey summary based on the following information:
2
-
3
- Survey Participant: <%= workflow.output.developer_name %>
4
- Usage Duration: <%= workflow.output.usage_duration %>
5
- Experience Rating: <%= workflow.output.experience_rating %>
6
- Primary Feature Used: <%= workflow.output.primary_feature %>
7
- Additional Feedback Provided: <%= workflow.output.user_feedback %>
8
- Contact Permission: <%= workflow.output.allow_contact %>
9
- Email (if provided): <%= workflow.output.user_email %>
10
-
11
- Format this as a professional survey summary report with proper headings and thank the participant for their time.
@@ -1,35 +0,0 @@
1
- name: simple_input_demo
2
- description: Simple demonstration of input step functionality
3
- model: gpt-4o
4
-
5
- steps:
6
- # Text input
7
- - input:
8
- prompt: "What's your name?"
9
- name: user_name
10
- required: true
11
-
12
- - input:
13
- prompt: "Are you enjoying Roast?"
14
- type: boolean
15
- default: true
16
- name: enjoying_roast
17
-
18
- - input:
19
- prompt: "What's your favorite programming language?"
20
- type: choice
21
- options:
22
- - Ruby
23
- - Python
24
- - JavaScript
25
- - Go
26
- - Other
27
- name: favorite_language
28
-
29
- - input:
30
- prompt: "Create a secret password (won't be displayed):"
31
- type: password
32
- required: true
33
- name: secret_password
34
-
35
- - "Summarize the following inputs: {{workflow.output}}"
@@ -1,71 +0,0 @@
1
- name: developer_survey
2
- description: Collect developer feedback through an interactive survey
3
- model: anthropic:claude-3-5-sonnet
4
-
5
- steps:
6
- - welcome_message
7
-
8
- # Basic information
9
- - input:
10
- prompt: "What's your name?"
11
- name: developer_name
12
- required: true
13
-
14
- - input:
15
- prompt: "How long have you been using Roast? (e.g., '2 weeks', '3 months')"
16
- name: usage_duration
17
-
18
- # Experience rating
19
- - input:
20
- prompt: "How would you rate your experience with Roast?"
21
- type: choice
22
- options:
23
- - "⭐ Poor"
24
- - "⭐⭐ Below Average"
25
- - "⭐⭐⭐ Average"
26
- - "⭐⭐⭐⭐ Good"
27
- - "⭐⭐⭐⭐⭐ Excellent"
28
- name: experience_rating
29
- required: true
30
-
31
- # Feature usage
32
- - input:
33
- prompt: "Which Roast features do you use most? (select primary feature)"
34
- type: choice
35
- options:
36
- - "AI-powered workflows"
37
- - "File processing and manipulation"
38
- - "Conditional execution (if/case)"
39
- - "Iteration features (each/repeat)"
40
- - "Tool integrations"
41
- - "Other"
42
- name: primary_feature
43
-
44
- # Feedback collection
45
- - input:
46
- prompt: "Would you like to provide additional feedback?"
47
- type: boolean
48
- default: true
49
- name: wants_feedback
50
-
51
- - if: "{{workflow.output.wants_feedback}}"
52
- then:
53
- - input:
54
- prompt: "Please share your feedback (press Enter twice when done):"
55
- name: user_feedback
56
-
57
- - input:
58
- prompt: "May we contact you about your feedback?"
59
- type: boolean
60
- default: false
61
- name: allow_contact
62
-
63
- - if: "{{workflow.output.allow_contact}}"
64
- then:
65
- - input:
66
- prompt: "Please enter your email:"
67
- name: user_email
68
- required: true
69
-
70
- # Generate summary
71
- - generate_summary
@@ -1,3 +0,0 @@
1
- Welcome to the Roast Developer Survey! 🎯
2
-
3
- You don't need to do anything here - just acknowledge this message and we'll proceed with collecting your feedback.
Binary file
@@ -1,73 +0,0 @@
1
- name: interactive_deployment
2
- description: Interactive deployment workflow with user confirmations
3
- model: gpt-4o
4
-
5
- steps:
6
- # Collect deployment information
7
- - input:
8
- prompt: "Which environment do you want to deploy to?"
9
- name: environment
10
- type: choice
11
- options:
12
- - development
13
- - staging
14
- - production
15
- required: true
16
-
17
- - input:
18
- prompt: "Enter the deployment tag/version:"
19
- name: deploy_tag
20
- required: true
21
- default: "latest"
22
-
23
- # Show deployment plan
24
- - bash:
25
- command: |
26
- echo "==================================="
27
- echo " DEPLOYMENT PLAN"
28
- echo "==================================="
29
- echo "Environment: {{workflow.output.environment}}"
30
- echo "Version: {{workflow.output.deploy_tag}}"
31
- echo "Timestamp: {{Date.today}}"
32
- echo "==================================="
33
-
34
- # Confirm deployment
35
- - input:
36
- prompt: "Deploy {{workflow.output.deploy_tag}} to {{workflow.output.environment}}?"
37
- type: boolean
38
- default: false
39
- name: confirm_deploy
40
-
41
- # Execute deployment if confirmed
42
- - if: "{{workflow.output.confirm_deploy}}"
43
- then:
44
- - bash:
45
- command: echo "🚀 Starting deployment to {{workflow.output.environment}}..."
46
-
47
- # Simulate deployment steps
48
- - bash:
49
- command: |
50
- echo "🚀 Deploying version {{workflow.output.deploy_tag}} to {{workflow.output.environment}}"
51
- echo "📦 Pulling Docker image: myapp:{{workflow.output.deploy_tag}}"
52
- sleep 2
53
- echo "🔄 Rolling out to {{workflow.output.environment}} cluster"
54
- sleep 2
55
- echo "✅ Deployment completed successfully!"
56
-
57
- # Post-deployment verification
58
- - input:
59
- prompt: "Run smoke tests?"
60
- type: boolean
61
- default: true
62
- name: run_tests
63
-
64
- - if: "{{workflow.output.run_tests}}"
65
- then:
66
- - bash:
67
- command: |
68
- echo "🧪 Running smoke tests..."
69
- sleep 1
70
- echo "✅ All tests passed!"
71
- else:
72
- - bash:
73
- command: echo "❌ Deployment cancelled by user."
@@ -1,27 +0,0 @@
1
- # Workflow Generator
2
-
3
- This workflow generates new Roast workflows based on user descriptions. It's the engine behind the "New from prompt" option in `roast init`.
4
-
5
- ## How It Works
6
-
7
- The workflow generator takes a user description and workflow name, then:
8
-
9
- 1. **Analyzes the request** - Understands what type of workflow is needed, what steps are required, and what tools should be used
10
- 2. **Generates structure** - Creates a complete workflow configuration including YAML and step prompts
11
- 3. **Creates files** - Writes all the necessary files and directories to disk
12
-
13
- ## Usage
14
-
15
- This workflow is typically invoked automatically by the `roast init` command, but can also be run directly:
16
-
17
- ```bash
18
- # Run the generator workflow
19
- roast execute examples/workflow_generator/workflow.yml
20
- ```
21
-
22
- ## Generated Output
23
-
24
- The workflow creates a new directory with:
25
- - `workflow.yml` - Main workflow configuration
26
- - `step_name/prompt.md` - Individual step prompts
27
- - `README.md` - Documentation for the generated workflow
@@ -1,34 +0,0 @@
1
- You are an assistant that analyzes user requests to understand what kind of workflow they want to create.
2
-
3
- Based on the user input from the previous step:
4
- <%= workflow.output["get_user_input"] %>
5
-
6
- Roast information from previous step:
7
- <%= workflow.output["info_from_roast"] %>
8
-
9
- First, explore existing workflow examples in the examples directory to understand common patterns and structures. Look for ones that may be related to the user's intention.
10
-
11
- Then analyze the user's request and determine:
12
-
13
- 1. **Required Steps**: Break down the workflow into logical steps. Each step should be a discrete task that can be accomplished with an AI prompt.
14
-
15
- 2. **Tools Needed**: What Roast tools will be needed? Base this on the actual tools you read from info provided above.
16
-
17
- 3. **Target Strategy**: Will this workflow:
18
- - Process specific files (needs target configuration)
19
- - Be targetless (works without specific input files)
20
- - Use shell commands to find targets dynamically
21
-
22
- 4. **Model Requirements**: Should this use a specific model, or is the default (gpt-4o-mini) sufficient?
23
-
24
- Respond with a structured analysis in this format:
25
-
26
- ```
27
- STEPS: [list of 3-5 logical steps]
28
- TOOLS: [list of required tools]
29
- TARGET_STRATEGY: [targetless/files/dynamic]
30
- MODEL: [model recommendation]
31
- COMPLEXITY: [simple/moderate/complex]
32
- ```
33
-
34
- Be specific and actionable in your analysis.
@@ -1,32 +0,0 @@
1
- You are an assistant that creates the actual workflow files in the filesystem.
2
-
3
- Based on the user input:
4
- <%= workflow.output["get_user_input"] %>
5
-
6
- And the generated workflow structure from the previous step:
7
- <%= workflow.output["analyze_user_request"] %>
8
-
9
- And info from roast:
10
- <%= workflow.output["info_from_roast"] %>
11
-
12
- Your task is to create all the necessary files and directories for the workflow.
13
-
14
- Extract the workflow name from the user input JSON and create the workflow in the current directory under that folder name.
15
-
16
- Steps to complete:
17
-
18
- 1. **Create the main directory**: Use Cmd to create the "<%= workflow_name %>" directory
19
- 2. **Create step directories**: Create subdirectories for each workflow step
20
- 3. **Create workflow.yml**: Write the main workflow configuration file
21
- 4. **Create step prompt files**: Write each step's prompt.md file
22
- 5. **Create README.md**: Generate a helpful README explaining the workflow
23
-
24
- When writing files, extract the content from the structured response and write each file separately.
25
-
26
- Important notes:
27
- - Make sure all directories exist before writing files to them
28
- - Follow the exact structure specified in the previous step
29
- - Include helpful comments in the workflow.yml file
30
- - Make the README.md informative and include usage instructions
31
-
32
- At the end, confirm that all files have been created by listing the directory structure.
@@ -1,14 +0,0 @@
1
- You need to collect user input for generating a new workflow.
2
-
3
- Step 1: Ask for the workflow description using ask_user tool with prompt: "What should your workflow do?"
4
-
5
- Step 2: Ask for the workflow name using ask_user tool with prompt: "Enter workflow directory name:"
6
-
7
- Step 3: Return the result in JSON format:
8
-
9
- <json>
10
- {
11
- "user_description": "what the user wants the workflow to do",
12
- "workflow_name": "directory_name_provided_by_user"
13
- }
14
- </json>
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class InfoFromRoast < Roast::Workflow::BaseStep
4
- def call
5
- examples_path = File.join(Roast::ROOT, "examples")
6
- tools_path = File.join(Roast::ROOT, "lib", "roast", "tools")
7
-
8
- # Get list of available tools
9
- available_tools = Dir.entries(tools_path)
10
- .select { |file| file.end_with?(".rb") }
11
- .map { |file| file.gsub(".rb", "") }
12
- .reject { |tool| tool == "." || tool == ".." }
13
- .sort
14
-
15
- {
16
- examples_directory: examples_path,
17
- tools_directory: tools_path,
18
- available_tools: available_tools,
19
- message: "Examples directory and available tools provided for analysis step",
20
- }
21
- end
22
- end
@@ -1,34 +0,0 @@
1
- # Workflow Generator
2
- #
3
- # This workflow generates new Roast workflows based on user descriptions.
4
- # It gets user input, analyzes the request, generates an appropriate workflow structure,
5
- # and creates all necessary files in a new directory.
6
-
7
- name: Workflow Generator
8
- model: gpt-4o-mini
9
-
10
- tools:
11
- - Roast::Tools::WriteFile
12
- - Roast::Tools::ReadFile
13
- - Roast::Tools::Cmd
14
- - Roast::Tools::AskUser
15
-
16
- steps:
17
- - get_user_input
18
- - info_from_roast
19
- - analyze_user_request
20
- - create_workflow_files
21
-
22
- # Step configurations
23
- get_user_input:
24
- print_response: false
25
- json: true
26
-
27
- analyze_user_request:
28
- print_response: true
29
-
30
- generate_workflow_structure:
31
- print_response: true
32
-
33
- create_workflow_files:
34
- print_response: false