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,33 +0,0 @@
1
- You are a Ruby testing expert assisting with migrating RSpec tests to Minitest.
2
-
3
- In this step, you'll create a new Minitest file that replicates the functionality of the analyzed RSpec test.
4
-
5
- ## Your tasks:
6
-
7
- 1. Convert the RSpec test to an equivalent Minitest test, following these guidelines:
8
- - Replace RSpec's `describe`/`context` blocks with Minitest test classes
9
- - Convert `it` blocks to Minitest test methods (prefixed with `test_`)
10
- - Transform `before`/`after` hooks to `setup`/`teardown` methods
11
- - Replace `let`/`let!` declarations with instance variables or helper methods
12
- - Convert `expect(...).to` assertions to Minitest assertions
13
- - Replace RSpec matchers with equivalent Minitest assertions
14
- - Handle mocks and stubs using Minitest's mocking capabilities and Mocha
15
-
16
- 2. Follow Minitest conventions:
17
- - Name the file with `_test.rb` suffix instead of `_spec.rb`
18
- - Create a class that inherits from `ActiveSupport::TestCase`
19
- - Use that class's `test "description of the test` method to declare tests kind of like RSpec does
20
- - Use Minitest's assertion methods (`assert`, `assert_equal`, etc.)
21
- - Implement proper setup and teardown methods as needed
22
-
23
- 3. Pay attention to:
24
- - Maintaining test coverage with equivalent assertions
25
- - Preserving the original test's intent and behavior
26
- - Handling RSpec-specific features appropriately
27
- - Adding necessary require statements for Minitest and dependencies
28
-
29
- 4. Write the complete Minitest file and save it to the appropriate location, replacing `_spec.rb` with `_test.rb` in the filename.
30
-
31
- Your converted Minitest file should maintain at least the same test coverage and intent as the original RSpec test while following Minitest's conventions and patterns.
32
-
33
- IMPORTANT: If you see opportunities to improve the test coverage in the newly written tests, you have my permission to do so. However, note that we should focus on testing behavior, not implementation. Do not test private methods, and never use Ruby tricks to make private methods public. Try to avoid mocking or stubbing anything on the SUT class.
@@ -1,35 +0,0 @@
1
- You are a Ruby testing expert assisting with migrating RSpec tests to Minitest.
2
-
3
- In this final step, you'll use the `cmd` and `coding_agent` tool functions to run the newly created Minitest file and iteratively improve it until all tests pass correctly.
4
-
5
- ## Your tasks:
6
-
7
- 1. Run the converted Minitest file to see if it passes all tests. Use the `cmd` tool function to execute the test using the following syntax:
8
- ```ruby
9
- ruby -Ilib:test path/to/minitest_file.rb
10
- ```
11
-
12
- 2. Analyze any failures or errors that occur during test execution:
13
- - Syntax errors
14
- - Missing dependencies
15
- - Assertion failures
16
- - Test setup/teardown issues
17
- - Unexpected behavior
18
-
19
- 3. For each issue identified, prompt the `coding_agent` tool to make necessary improvements:
20
- - Fix syntax errors
21
- - Correct assertion formats
22
- - Add missing dependencies
23
- - Adjust test setup or teardown
24
- - Modify assertions to match expected behavior
25
-
26
- 4. Run the test again after each set of improvements.
27
-
28
- 5. Continue this iterative process until all tests pass successfully.
29
-
30
- 6. Once all tests pass, provide a summary of:
31
- - Changes made to fix issues
32
- - Any remaining considerations or edge cases
33
- - Confirmation of test coverage compared to original RSpec tests
34
-
35
- Again, your goal is to ensure the Minitest version provides at least the same test coverage and reliability as the original RSpec tests, while following Minitest best practices and conventions.
@@ -1,10 +0,0 @@
1
- You are a Ruby testing expert assisting with migrating RSpec tests to Minitest. Note that all of your responses should be in nicely formatted markdown.
2
-
3
- Here is the spec we're going to be migrating today:
4
-
5
- ```
6
- # <%= file %>
7
- <%= File.read(file) %>
8
- ```
9
-
10
- I have given you powerful tool functions to do this work. The coding_agent is especially powerful and you should delegate complex tasks to it whenever possible.
@@ -1,40 +0,0 @@
1
- # RSpec to Minitest Migration Workflow
2
-
3
- # This workflow demonstrates how to convert RSpec test files to Minitest:
4
- # 1. Analyzes the RSpec test to understand its purpose and dependencies
5
- # 2. Creates a new Minitest file with equivalent assertions and test structure
6
- # 3. Runs the tests and makes improvements until they pass
7
-
8
- name: RSpec to Minitest Migration
9
- model: gpt-4.1
10
-
11
- # Target expects a glob pattern matching RSpec files to be converted
12
- # target: "**/*_spec.rb"
13
-
14
- tools:
15
- - Roast::Tools::ReadFile
16
- - Roast::Tools::WriteFile
17
- - Roast::Tools::Grep
18
- - Roast::Tools::Cmd
19
- - Roast::Tools::CodingAgent
20
-
21
- steps:
22
- - analyze_spec
23
- - create_minitest
24
- - run_and_improve
25
- - rubocop: $(bundle exec rubocop -A)
26
- - Summarize the changes made to the codebase.
27
-
28
- # Configure the steps
29
- analyze_spec:
30
- print_response: false
31
-
32
- create_minitest:
33
- print_response: true
34
-
35
- run_and_improve:
36
- print_response: true
37
-
38
- functions:
39
- grep:
40
- cache: true
@@ -1,52 +0,0 @@
1
- # Shared Configuration Example
2
-
3
- This example demonstrates how to use `shared.yml` to define common configuration anchors that can be referenced across multiple workflow files.
4
-
5
- ## Structure
6
-
7
- ```
8
- ├── shared.yml # Common configuration anchors
9
- └── example_with_shared_config/
10
- └── workflow.yml # Workflow using shared anchors
11
- ```
12
-
13
- ## How it works
14
-
15
- 1. When loading a workflow file, Roast checks if `shared.yml` exists one level above the workflow directory
16
- 2. If found, it loads `shared.yml` first, then the workflow file
17
- 3. This allows YAML anchors defined in `shared.yml` to be referenced in workflow files
18
-
19
- ## Example Usage
20
-
21
- In `shared.yml`:
22
- ```yaml
23
- standard_tools: &standard_tools
24
- - Roast::Tools::Grep
25
- - Roast::Tools::ReadFile
26
- - Roast::Tools::WriteFile
27
- - Roast::Tools::SearchFile
28
-
29
- mirage: &mirage '$(echo "Oh my god. Its a mirage")'
30
- ```
31
-
32
- In your workflow:
33
- ```yaml
34
- name: Example with shared config
35
- tools: *standard_tools # Reference the standard tools from shared.yml
36
-
37
- steps:
38
- - *mirage # Reference a shared step definition
39
- - sabotage: '$(echo "Im tellin yall, its sabotage")'
40
- ```
41
-
42
- ## Running the Example
43
-
44
- ```bash
45
- # Run the workflow that uses shared configuration
46
- roast execute examples/shared_config/example_with_shared_config/workflow.yml
47
- ```
48
-
49
- The workflow will:
50
- 1. Load the shared configuration from `shared.yml`
51
- 2. Apply the referenced tools and steps
52
- 3. Execute the workflow with the merged configuration
@@ -1,6 +0,0 @@
1
- name: Example with shared config
2
- tools: *standard_tools
3
-
4
- steps:
5
- - *mirage
6
- - sabotage: '$(echo "Im tellin yall, its sabotage")'
Binary file
@@ -1,7 +0,0 @@
1
- standard_tools: &standard_tools
2
- - Roast::Tools::Grep
3
- - Roast::Tools::ReadFile
4
- - Roast::Tools::WriteFile
5
- - Roast::Tools::SearchFile
6
-
7
- mirage: &mirage '$(echo "Oh my god. Its a mirage")'
@@ -1,36 +0,0 @@
1
- # Single Target with Pre/Post Processing Example
2
-
3
- This example demonstrates how pre/post processing works with single-target workflows. Even when analyzing just one file, you can use pre-processing to gather context and post-processing to format results.
4
-
5
- ## Features Demonstrated
6
-
7
- 1. **Pre-processing for context gathering** - Analyze dependencies before the main workflow
8
- 2. **Single-target analysis** - Focus on one specific file
9
- 3. **Post-processing with output template** - Custom formatting of the final report
10
-
11
- ## Running the Example
12
-
13
- ```bash
14
- roast workflow.yml
15
- ```
16
-
17
- This will:
18
- 1. Run pre-processing to gather dependencies and context
19
- 2. Analyze the single target file (src/main.rb)
20
- 3. Apply the post-processing template to format the output
21
-
22
- ## Output Template
23
-
24
- The `post_processing/output.txt` template demonstrates how to:
25
- - Access pre-processing results with `<%= pre_processing[:step_name] %>`
26
- - Iterate over target results (even for single targets)
27
- - Include post-processing step outputs
28
- - Format everything into a professional report
29
-
30
- ## Use Cases
31
-
32
- This pattern is ideal for:
33
- - Deep analysis of critical files
34
- - Security audits of specific components
35
- - Performance profiling of key modules
36
- - Generating documentation for important classes
@@ -1,27 +0,0 @@
1
- === Code Analysis Report ===
2
- Generated: <%= Time.now.strftime("%Y-%m-%d %H:%M:%S") %>
3
-
4
- ## Dependencies & Context
5
- <%= pre_processing.gather_dependencies %>
6
-
7
- ## Target File Analysis
8
- <% targets.each do |file, target| %>
9
- File: <%= file %>
10
-
11
- ### Code Quality
12
- <%= target.output.analyze_code_quality %>
13
-
14
- ### Identified Improvements
15
- <%= target.output.identify_improvements %>
16
-
17
- ### Recommendations
18
- <%= target.output.generate_recommendations %>
19
- <% end %>
20
-
21
- ## Summary
22
- <%= output.summarize_findings %>
23
-
24
- ## Action Items
25
- <%= output.create_action_items %>
26
-
27
- === End of Report ===
@@ -1,11 +0,0 @@
1
- # Gather Dependencies
2
-
3
- Analyze the project structure to understand the dependencies and context for <%= file %>.
4
-
5
- Tasks:
6
- 1. List all files that import or depend on the target file
7
- 2. Identify the key modules and classes used
8
- 3. Note any external dependencies or libraries
9
- 4. Summarize the architectural context
10
-
11
- Provide a structured summary that will help with the main analysis.
@@ -1,20 +0,0 @@
1
- name: analyze_codebase
2
- description: Analyze a single codebase with pre/post processing support
3
- model: gpt-4o
4
- target: "src/main.rb"
5
-
6
- # Pre-processing: Gather context before analyzing the main file
7
- pre_processing:
8
- - gather_dependencies
9
- - setup_analysis_tools
10
-
11
- # Main workflow: Analyze the target file
12
- steps:
13
- - analyze_code_quality
14
- - identify_improvements
15
- - generate_recommendations
16
-
17
- # Post-processing: Generate final report
18
- post_processing:
19
- - summarize_findings
20
- - create_action_items
@@ -1,65 +0,0 @@
1
- # Smart Coercion Defaults
2
-
3
- This example demonstrates how Roast applies intelligent defaults for boolean coercion based on the type of expression being evaluated.
4
-
5
- ## Default Coercion Rules
6
-
7
- When a step is used in a boolean context (like `if`, `unless`, or `until` conditions) and no explicit `coerce_to` is specified, Roast applies these smart defaults:
8
-
9
- 1. **Ruby Expressions** (`{{expression}}`) → Regular boolean coercion (`!!value`)
10
- - `nil` and `false` are falsy
11
- - Everything else is truthy (including 0, empty arrays, etc.)
12
-
13
- 2. **Bash Commands** (`$(command)`) → Exit code interpretation
14
- - Exit code 0 = true (success)
15
- - Non-zero exit code = false (failure)
16
-
17
- 3. **Prompt/Step Names** → LLM boolean interpretation
18
- - Analyzes natural language responses for yes/no intent
19
- - "Yes", "True", "Affirmative" → true
20
- - "No", "False", "Negative" → false
21
-
22
- 4. **Non-string Values** → Regular boolean coercion
23
-
24
- ## Examples
25
-
26
- ### Ruby Expression (Regular Boolean)
27
- ```yaml
28
- - repeat:
29
- until: "{{counter >= 5}}" # Uses !! coercion
30
- steps:
31
- - increment: counter
32
- ```
33
-
34
- ### Bash Command (Exit Code)
35
- ```yaml
36
- - repeat:
37
- until: "$(test -f /tmp/done)" # True when file exists (exit 0)
38
- steps:
39
- - wait: 1
40
- ```
41
-
42
- ### Prompt Response (LLM Boolean)
43
- ```yaml
44
- - if: "Should we continue?" # Interprets "Yes, let's continue" as true
45
- then:
46
- - proceed: "Continuing..."
47
- ```
48
-
49
- ## Overriding Defaults
50
-
51
- You can always override the default coercion by specifying `coerce_to` directly in the step:
52
-
53
- ```yaml
54
- - each: "get_items"
55
- as: "item"
56
- coerce_to: iterable # Override default to split into array
57
- steps:
58
- - process: "{{item}}"
59
- ```
60
-
61
- ## Supported Coercion Types
62
-
63
- - `boolean` - Standard Ruby truthiness (!! operator)
64
- - `llm_boolean` - Natural language yes/no interpretation
65
- - `iterable` - Convert to array (splits strings on newlines)
@@ -1,44 +0,0 @@
1
- name: Smart Coercion Defaults Demo
2
- description: Demonstrates how different step types get smart boolean coercion defaults
3
-
4
- steps:
5
- # Example 1: Ruby expressions default to regular boolean coercion
6
- - set_counter:
7
- value: 3
8
-
9
- - repeat:
10
- until: "{{counter >= 5}}" # Ruby expression defaults to boolean
11
- steps:
12
- - increment_counter:
13
- value: "{{counter + 1}}"
14
- - log: "Counter is now {{counter}}"
15
-
16
- # Example 2: Bash commands default to exit code interpretation
17
- - check_file_exists:
18
- repeat:
19
- until: "$(ls /tmp/important_file 2>/dev/null)" # Bash command defaults to exit code
20
- max_iterations: 3
21
- steps:
22
- - create_file: "$(mkdir -p /tmp && touch /tmp/important_file)"
23
- - log: "Waiting for file to exist..."
24
-
25
- # Example 3: Prompt/step names default to LLM boolean interpretation
26
- - ask_user_ready:
27
- prompt: "Are you ready to continue? Please respond yes or no."
28
-
29
- - conditional:
30
- if: "ask_user_ready" # Step name defaults to llm_boolean
31
- then:
32
- - proceed: "Great! Let's continue..."
33
- else:
34
- - wait: "Okay, take your time."
35
-
36
- # Example 4: Explicit coerce_to overrides smart defaults
37
- - get_items:
38
- prompt: "List three fruits, one per line"
39
-
40
- - each: "get_items"
41
- as: "fruit"
42
- coerce_to: iterable # Override default llm_boolean to iterable
43
- steps:
44
- - process_fruit: "Processing {{fruit}}"
@@ -1,84 +0,0 @@
1
- # Step Configuration Example
2
-
3
- This example demonstrates how to configure various step types in Roast workflows, including:
4
- - Inline prompts
5
- - Iterator steps (each/repeat)
6
- - Regular steps
7
-
8
- ## Configuration Options
9
-
10
- All step types support the following configuration options:
11
-
12
- - `model`: The AI model to use (e.g., "gpt-4o", "claude-3-opus")
13
- - `print_response`: Whether to print the response to stdout (true/false)
14
- - `json`: Whether to expect a JSON response (true/false)
15
- - `params`: Additional parameters to pass to the model (e.g., temperature, max_tokens)
16
- - `coerce_to`: How to convert the step result (options: "boolean", "llm_boolean", "iterable")
17
-
18
- ## Configuration Precedence
19
-
20
- 1. **Step-specific configuration** takes highest precedence
21
- 2. **Global configuration** (defined at the workflow level) applies to all steps without specific configuration
22
- 3. **Default values** are used when no configuration is provided
23
-
24
- ## Inline Prompt Configuration
25
-
26
- Inline prompts can be configured in two ways:
27
-
28
- ### As a top-level key:
29
- ```yaml
30
- analyze the code:
31
- model: gpt-4o
32
- print_response: true
33
- ```
34
-
35
- ### Inline in the steps array:
36
- ```yaml
37
- steps:
38
- - suggest improvements:
39
- model: claude-3-opus
40
- params:
41
- temperature: 0.9
42
- ```
43
-
44
- ## Iterator Configuration
45
-
46
- Both `each` and `repeat` steps support configuration:
47
-
48
- ```yaml
49
- each:
50
- each: "{{files}}"
51
- as: file
52
- model: gpt-3.5-turbo
53
- steps:
54
- - process {{file}}
55
-
56
- repeat:
57
- repeat: true
58
- until: "{{done}}"
59
- model: gpt-4o
60
- print_response: true
61
- steps:
62
- - check status
63
- ```
64
-
65
- ## Coercion Types
66
-
67
- The `coerce_to` option allows you to convert step results to specific types:
68
-
69
- - **`boolean`**: Converts any value to true/false (nil, false, empty string → false; everything else → true)
70
- - **`llm_boolean`**: Interprets natural language responses as boolean (e.g., "Yes", "Definitely!" → true; "No", "Not yet" → false)
71
- - **`iterable`**: Ensures the result can be iterated over (splits strings by newlines if needed)
72
-
73
- This is particularly useful when:
74
- - Using steps in conditional contexts (if/unless)
75
- - Using steps as conditions in repeat loops
76
- - Processing step results in each loops
77
-
78
- ## Running the Example
79
-
80
- ```bash
81
- bin/roast examples/step_configuration/workflow.yml
82
- ```
83
-
84
- Note: This example is for demonstration purposes and shows the configuration syntax. You'll need to adapt it to your specific use case with appropriate prompts and logic.
@@ -1,57 +0,0 @@
1
- name: Step Configuration Example
2
- description: Demonstrates how to configure various step types including inline prompts, iterators, and regular steps
3
-
4
- # Global configuration that applies to all steps
5
- model: openai/gpt-4o-mini
6
-
7
- # Configuration for specific steps
8
- summarize the code:
9
- model: claude-3-opus # Override global model
10
- print_response: true # Print the response
11
- json: false # Don't expect JSON response
12
- params:
13
- temperature: 0.7 # Custom temperature
14
-
15
- analyze complexity:
16
- model: gpt-4o
17
- json: true # Expect JSON response
18
- params:
19
- temperature: 0.2 # Lower temperature for more consistent analysis
20
-
21
- # Iterator step configuration
22
- each:
23
- each: "{{files}}"
24
- as: file
25
- model: gpt-3.5-turbo # Use a faster model for iteration
26
- steps:
27
- - process {{file}}
28
-
29
- repeat:
30
- repeat: true
31
- until: "are all tests passing" # This will be evaluated as a step
32
- max_iterations: 5
33
- model: gpt-4o
34
- print_response: true
35
- coerce_to: llm_boolean # Interpret natural language response as boolean
36
- steps:
37
- - run tests
38
- - fix failing tests
39
-
40
- # Step used in boolean context
41
- are all tests passing:
42
- model: gpt-4o
43
- coerce_to: llm_boolean # Convert "Yes, all tests are passing!" to true
44
- params:
45
- temperature: 0.2
46
-
47
- # Steps can mix configured and unconfigured inline prompts
48
- steps:
49
- - list all source files # Uses global configuration
50
- - summarize the code # Uses step-specific configuration
51
- - analyze complexity # Uses step-specific configuration
52
- - suggest improvements: # Step-specific configuration inline
53
- model: claude-3-opus
54
- params:
55
- temperature: 0.9
56
- - each # Iterator with configuration
57
- - repeat # Iterator with configuration
@@ -1,25 +0,0 @@
1
- name: Swarm Example Workflow
2
-
3
- # Example workflow demonstrating Roast's integration with Claude Swarm
4
- # The Swarm tool is available to the LLM, which can choose to use it when appropriate
5
-
6
- tools:
7
- - Roast::Tools::Swarm:
8
- path: ".swarm.yml" # Optional - will use default locations if not specified
9
-
10
- steps:
11
- - orchestrate_refactoring: |
12
- Help me refactor this codebase for better performance. Coordinate multiple
13
- Claude agents using the swarm configuration to:
14
- 1. Analyze the current code structure
15
- 2. Identify performance bottlenecks
16
- 3. Implement optimizations
17
- 4. Ensure backward compatibility
18
-
19
- - specialized_analysis: |
20
- Now use the specialized swarm configuration at ./specialized-swarm.yml to run
21
- a comprehensive code analysis that includes:
22
- - Architecture review
23
- - Security audit
24
- - Documentation generation
25
- - Test coverage analysis