roast-ai 0.4.7 → 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 (250) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/Rakefile +2 -0
  4. data/examples/README.md +9 -0
  5. data/examples/available_tools_demo/workflow.yml +1 -1
  6. data/examples/basic_prompt_workflow/workflow.md +1 -0
  7. data/examples/basic_prompt_workflow/workflow.yml +14 -0
  8. data/lib/roast/version.rb +1 -1
  9. data/lib/roast/workflow/base_step.rb +2 -3
  10. data/lib/roast/workflow/step_loader.rb +2 -7
  11. data/lib/roast.rb +6 -1
  12. metadata +4 -239
  13. data/CHANGELOG.md +0 -369
  14. data/examples/agent_continue/add_documentation/prompt.md +0 -5
  15. data/examples/agent_continue/add_error_handling/prompt.md +0 -5
  16. data/examples/agent_continue/analyze_codebase/prompt.md +0 -7
  17. data/examples/agent_continue/combined_workflow.yml +0 -24
  18. data/examples/agent_continue/continue_adding_features/prompt.md +0 -4
  19. data/examples/agent_continue/create_integration_tests/prompt.md +0 -3
  20. data/examples/agent_continue/document_with_context/prompt.md +0 -5
  21. data/examples/agent_continue/explore_api/prompt.md +0 -6
  22. data/examples/agent_continue/implement_client/prompt.md +0 -6
  23. data/examples/agent_continue/inline_workflow.yml +0 -20
  24. data/examples/agent_continue/refactor_code/prompt.md +0 -2
  25. data/examples/agent_continue/verify_changes/prompt.md +0 -6
  26. data/examples/agent_continue/workflow.yml +0 -27
  27. data/examples/agent_workflow/README.md +0 -75
  28. data/examples/agent_workflow/apply_refactorings/prompt.md +0 -22
  29. data/examples/agent_workflow/identify_code_smells/prompt.md +0 -15
  30. data/examples/agent_workflow/summarize_improvements/prompt.md +0 -18
  31. data/examples/agent_workflow/workflow.png +0 -0
  32. data/examples/agent_workflow/workflow.yml +0 -16
  33. data/examples/api_workflow/README.md +0 -85
  34. data/examples/api_workflow/fetch_api_data/prompt.md +0 -10
  35. data/examples/api_workflow/generate_report/prompt.md +0 -10
  36. data/examples/api_workflow/prompt.md +0 -10
  37. data/examples/api_workflow/transform_data/prompt.md +0 -10
  38. data/examples/api_workflow/workflow.png +0 -0
  39. data/examples/api_workflow/workflow.yml +0 -30
  40. data/examples/apply_diff_demo/README.md +0 -58
  41. data/examples/apply_diff_demo/apply_simple_change/prompt.md +0 -13
  42. data/examples/apply_diff_demo/create_sample_file/prompt.md +0 -11
  43. data/examples/apply_diff_demo/workflow.yml +0 -24
  44. data/examples/available_tools_demo/workflow.png +0 -0
  45. data/examples/bash_prototyping/README.md +0 -53
  46. data/examples/bash_prototyping/analyze_network/prompt.md +0 -13
  47. data/examples/bash_prototyping/analyze_system/prompt.md +0 -11
  48. data/examples/bash_prototyping/api_testing.png +0 -0
  49. data/examples/bash_prototyping/api_testing.yml +0 -14
  50. data/examples/bash_prototyping/check_processes/prompt.md +0 -11
  51. data/examples/bash_prototyping/generate_report/prompt.md +0 -16
  52. data/examples/bash_prototyping/process_json_response/prompt.md +0 -24
  53. data/examples/bash_prototyping/system_analysis.png +0 -0
  54. data/examples/bash_prototyping/system_analysis.yml +0 -14
  55. data/examples/bash_prototyping/test_public_api/prompt.md +0 -22
  56. data/examples/case_when/README.md +0 -58
  57. data/examples/case_when/detect_language/prompt.md +0 -16
  58. data/examples/case_when/workflow.png +0 -0
  59. data/examples/case_when/workflow.yml +0 -58
  60. data/examples/cmd/README.md +0 -99
  61. data/examples/cmd/analyze_project/prompt.md +0 -57
  62. data/examples/cmd/basic_demo/prompt.md +0 -48
  63. data/examples/cmd/basic_workflow.png +0 -0
  64. data/examples/cmd/basic_workflow.yml +0 -16
  65. data/examples/cmd/check_repository/prompt.md +0 -57
  66. data/examples/cmd/create_and_verify/prompt.md +0 -56
  67. data/examples/cmd/dev_workflow.png +0 -0
  68. data/examples/cmd/dev_workflow.yml +0 -26
  69. data/examples/cmd/explore_project/prompt.md +0 -67
  70. data/examples/cmd/explorer_workflow.png +0 -0
  71. data/examples/cmd/explorer_workflow.yml +0 -21
  72. data/examples/cmd/smart_tool_selection/prompt.md +0 -99
  73. data/examples/coding_agent_with_model.yml +0 -20
  74. data/examples/coding_agent_with_retries.yml +0 -30
  75. data/examples/conditional/README.md +0 -161
  76. data/examples/conditional/check_condition/prompt.md +0 -1
  77. data/examples/conditional/simple_workflow.png +0 -0
  78. data/examples/conditional/simple_workflow.yml +0 -15
  79. data/examples/conditional/workflow.png +0 -0
  80. data/examples/conditional/workflow.yml +0 -23
  81. data/examples/context_management_demo/README.md +0 -43
  82. data/examples/context_management_demo/workflow.yml +0 -42
  83. data/examples/direct_coerce_syntax/README.md +0 -32
  84. data/examples/direct_coerce_syntax/workflow.png +0 -0
  85. data/examples/direct_coerce_syntax/workflow.yml +0 -36
  86. data/examples/dot_notation/README.md +0 -37
  87. data/examples/dot_notation/workflow.png +0 -0
  88. data/examples/dot_notation/workflow.yml +0 -44
  89. data/examples/exit_on_error/README.md +0 -50
  90. data/examples/exit_on_error/analyze_lint_output/prompt.md +0 -9
  91. data/examples/exit_on_error/apply_fixes/prompt.md +0 -2
  92. data/examples/exit_on_error/workflow.png +0 -0
  93. data/examples/exit_on_error/workflow.yml +0 -19
  94. data/examples/grading/README.md +0 -71
  95. data/examples/grading/analyze_coverage/prompt.md +0 -52
  96. data/examples/grading/calculate_final_grade.rb +0 -67
  97. data/examples/grading/format_result.rb +0 -64
  98. data/examples/grading/generate_grades/prompt.md +0 -105
  99. data/examples/grading/generate_recommendations/output.txt +0 -17
  100. data/examples/grading/generate_recommendations/prompt.md +0 -60
  101. data/examples/grading/js_test_runner +0 -31
  102. data/examples/grading/rb_test_runner +0 -19
  103. data/examples/grading/read_dependencies/prompt.md +0 -16
  104. data/examples/grading/run_coverage.rb +0 -54
  105. data/examples/grading/verify_mocks_and_stubs/prompt.md +0 -12
  106. data/examples/grading/verify_test_helpers/prompt.md +0 -53
  107. data/examples/grading/workflow.md +0 -8
  108. data/examples/grading/workflow.png +0 -0
  109. data/examples/grading/workflow.rb.md +0 -6
  110. data/examples/grading/workflow.ts+tsx.md +0 -6
  111. data/examples/grading/workflow.yml +0 -41
  112. data/examples/instrumentation.rb +0 -76
  113. data/examples/interpolation/README.md +0 -50
  114. data/examples/interpolation/analyze_file/prompt.md +0 -1
  115. data/examples/interpolation/analyze_patterns/prompt.md +0 -27
  116. data/examples/interpolation/generate_report_for_js/prompt.md +0 -3
  117. data/examples/interpolation/generate_report_for_rb/prompt.md +0 -3
  118. data/examples/interpolation/sample.js +0 -48
  119. data/examples/interpolation/sample.rb +0 -42
  120. data/examples/interpolation/workflow.md +0 -1
  121. data/examples/interpolation/workflow.png +0 -0
  122. data/examples/interpolation/workflow.yml +0 -21
  123. data/examples/iteration/IMPLEMENTATION.md +0 -88
  124. data/examples/iteration/README.md +0 -68
  125. data/examples/iteration/analyze_complexity/prompt.md +0 -22
  126. data/examples/iteration/generate_recommendations/prompt.md +0 -21
  127. data/examples/iteration/generate_report/prompt.md +0 -129
  128. data/examples/iteration/implement_fix/prompt.md +0 -25
  129. data/examples/iteration/prioritize_issues/prompt.md +0 -24
  130. data/examples/iteration/prompts/analyze_file.md +0 -28
  131. data/examples/iteration/prompts/generate_summary.md +0 -24
  132. data/examples/iteration/prompts/update_report.md +0 -29
  133. data/examples/iteration/prompts/write_report.md +0 -22
  134. data/examples/iteration/read_file/prompt.md +0 -9
  135. data/examples/iteration/select_next_issue/prompt.md +0 -25
  136. data/examples/iteration/simple_workflow.md +0 -39
  137. data/examples/iteration/simple_workflow.yml +0 -58
  138. data/examples/iteration/update_fix_count/prompt.md +0 -26
  139. data/examples/iteration/verify_fix/prompt.md +0 -29
  140. data/examples/iteration/workflow.png +0 -0
  141. data/examples/iteration/workflow.yml +0 -42
  142. data/examples/json_handling/README.md +0 -32
  143. data/examples/json_handling/workflow.png +0 -0
  144. data/examples/json_handling/workflow.yml +0 -52
  145. data/examples/mcp/README.md +0 -223
  146. data/examples/mcp/analyze_changes/prompt.md +0 -8
  147. data/examples/mcp/analyze_issues/prompt.md +0 -4
  148. data/examples/mcp/analyze_schema/prompt.md +0 -4
  149. data/examples/mcp/check_data_quality/prompt.md +0 -5
  150. data/examples/mcp/check_documentation/prompt.md +0 -4
  151. data/examples/mcp/create_recommendations/prompt.md +0 -5
  152. data/examples/mcp/database_workflow.png +0 -0
  153. data/examples/mcp/database_workflow.yml +0 -29
  154. data/examples/mcp/env_demo/workflow.png +0 -0
  155. data/examples/mcp/env_demo/workflow.yml +0 -34
  156. data/examples/mcp/fetch_pr_context/prompt.md +0 -4
  157. data/examples/mcp/filesystem_demo/create_test_file/prompt.md +0 -2
  158. data/examples/mcp/filesystem_demo/list_files/prompt.md +0 -6
  159. data/examples/mcp/filesystem_demo/read_with_mcp/prompt.md +0 -7
  160. data/examples/mcp/filesystem_demo/workflow.png +0 -0
  161. data/examples/mcp/filesystem_demo/workflow.yml +0 -38
  162. data/examples/mcp/generate_insights/prompt.md +0 -4
  163. data/examples/mcp/generate_report/prompt.md +0 -6
  164. data/examples/mcp/generate_review/prompt.md +0 -16
  165. data/examples/mcp/github_workflow.png +0 -0
  166. data/examples/mcp/github_workflow.yml +0 -32
  167. data/examples/mcp/multi_mcp_workflow.png +0 -0
  168. data/examples/mcp/multi_mcp_workflow.yml +0 -58
  169. data/examples/mcp/post_review/prompt.md +0 -3
  170. data/examples/mcp/save_report/prompt.md +0 -6
  171. data/examples/mcp/search_issues/prompt.md +0 -2
  172. data/examples/mcp/summarize/prompt.md +0 -1
  173. data/examples/mcp/test_filesystem/prompt.md +0 -6
  174. data/examples/mcp/test_github/prompt.md +0 -8
  175. data/examples/mcp/test_read/prompt.md +0 -1
  176. data/examples/mcp/workflow.png +0 -0
  177. data/examples/mcp/workflow.yml +0 -35
  178. data/examples/no_model_fallback/README.md +0 -17
  179. data/examples/no_model_fallback/analyze_file/prompt.md +0 -1
  180. data/examples/no_model_fallback/analyze_patterns/prompt.md +0 -27
  181. data/examples/no_model_fallback/generate_report_for_md/prompt.md +0 -10
  182. data/examples/no_model_fallback/generate_report_for_rb/prompt.md +0 -3
  183. data/examples/no_model_fallback/sample.rb +0 -42
  184. data/examples/no_model_fallback/workflow.yml +0 -19
  185. data/examples/openrouter_example/README.md +0 -48
  186. data/examples/openrouter_example/analyze_input/prompt.md +0 -16
  187. data/examples/openrouter_example/generate_response/prompt.md +0 -9
  188. data/examples/openrouter_example/workflow.png +0 -0
  189. data/examples/openrouter_example/workflow.yml +0 -12
  190. data/examples/pre_post_processing/README.md +0 -111
  191. data/examples/pre_post_processing/analyze_test_file/prompt.md +0 -23
  192. data/examples/pre_post_processing/improve_test_coverage/prompt.md +0 -17
  193. data/examples/pre_post_processing/optimize_test_performance/prompt.md +0 -25
  194. data/examples/pre_post_processing/post_processing/aggregate_metrics/prompt.md +0 -31
  195. data/examples/pre_post_processing/post_processing/cleanup_environment/prompt.md +0 -28
  196. data/examples/pre_post_processing/post_processing/generate_summary_report/prompt.md +0 -32
  197. data/examples/pre_post_processing/post_processing/output.txt +0 -24
  198. data/examples/pre_post_processing/pre_processing/gather_baseline_metrics/prompt.md +0 -26
  199. data/examples/pre_post_processing/pre_processing/setup_test_environment/prompt.md +0 -11
  200. data/examples/pre_post_processing/validate_changes/prompt.md +0 -24
  201. data/examples/pre_post_processing/workflow.png +0 -0
  202. data/examples/pre_post_processing/workflow.yml +0 -21
  203. data/examples/retry/workflow.yml +0 -23
  204. data/examples/rspec_to_minitest/README.md +0 -68
  205. data/examples/rspec_to_minitest/analyze_spec/prompt.md +0 -30
  206. data/examples/rspec_to_minitest/create_minitest/prompt.md +0 -33
  207. data/examples/rspec_to_minitest/run_and_improve/prompt.md +0 -35
  208. data/examples/rspec_to_minitest/workflow.md +0 -10
  209. data/examples/rspec_to_minitest/workflow.png +0 -0
  210. data/examples/rspec_to_minitest/workflow.yml +0 -40
  211. data/examples/shared_config/README.md +0 -52
  212. data/examples/shared_config/example_with_shared_config/workflow.png +0 -0
  213. data/examples/shared_config/example_with_shared_config/workflow.yml +0 -6
  214. data/examples/shared_config/shared.png +0 -0
  215. data/examples/shared_config/shared.yml +0 -7
  216. data/examples/single_target_prepost/README.md +0 -36
  217. data/examples/single_target_prepost/post_processing/output.txt +0 -27
  218. data/examples/single_target_prepost/pre_processing/gather_dependencies/prompt.md +0 -11
  219. data/examples/single_target_prepost/workflow.png +0 -0
  220. data/examples/single_target_prepost/workflow.yml +0 -20
  221. data/examples/smart_coercion_defaults/README.md +0 -65
  222. data/examples/smart_coercion_defaults/workflow.png +0 -0
  223. data/examples/smart_coercion_defaults/workflow.yml +0 -44
  224. data/examples/step_configuration/README.md +0 -84
  225. data/examples/step_configuration/workflow.png +0 -0
  226. data/examples/step_configuration/workflow.yml +0 -57
  227. data/examples/swarm_example.yml +0 -25
  228. data/examples/tool_config_example/README.md +0 -109
  229. data/examples/tool_config_example/example_step/prompt.md +0 -42
  230. data/examples/tool_config_example/workflow.png +0 -0
  231. data/examples/tool_config_example/workflow.yml +0 -17
  232. data/examples/user_input/README.md +0 -90
  233. data/examples/user_input/funny_name/create_backstory/prompt.md +0 -10
  234. data/examples/user_input/funny_name/workflow.png +0 -0
  235. data/examples/user_input/funny_name/workflow.yml +0 -25
  236. data/examples/user_input/generate_summary/prompt.md +0 -11
  237. data/examples/user_input/simple_input_demo/workflow.png +0 -0
  238. data/examples/user_input/simple_input_demo/workflow.yml +0 -35
  239. data/examples/user_input/survey_workflow.png +0 -0
  240. data/examples/user_input/survey_workflow.yml +0 -71
  241. data/examples/user_input/welcome_message/prompt.md +0 -3
  242. data/examples/user_input/workflow.png +0 -0
  243. data/examples/user_input/workflow.yml +0 -73
  244. data/examples/workflow_generator/README.md +0 -27
  245. data/examples/workflow_generator/analyze_user_request/prompt.md +0 -34
  246. data/examples/workflow_generator/create_workflow_files/prompt.md +0 -32
  247. data/examples/workflow_generator/get_user_input/prompt.md +0 -14
  248. data/examples/workflow_generator/info_from_roast.rb +0 -22
  249. data/examples/workflow_generator/workflow.png +0 -0
  250. data/examples/workflow_generator/workflow.yml +0 -34
@@ -1,25 +0,0 @@
1
- # Optimize Test Performance
2
-
3
- Optimize the performance of <%= file %> by:
4
-
5
- 1. **Reduce Setup Overhead**:
6
- - Move expensive operations out of individual test setup
7
- - Use shared fixtures where appropriate
8
- - Lazy-load test data only when needed
9
-
10
- 2. **Optimize Database Operations**:
11
- - Use transactions for test isolation instead of truncation
12
- - Minimize database queries in tests
13
- - Use in-memory databases where possible
14
-
15
- 3. **Improve Test Isolation**:
16
- - Remove unnecessary dependencies between tests
17
- - Clean up resources properly to avoid test pollution
18
- - Use proper test doubles instead of hitting external services
19
-
20
- 4. **Parallelize When Possible**:
21
- - Identify tests that can run in parallel
22
- - Remove shared state that prevents parallelization
23
- - Group related tests for better cache utilization
24
-
25
- Generate the optimized test code and provide before/after performance metrics estimates.
@@ -1,31 +0,0 @@
1
- # Aggregate Metrics
2
-
3
- Aggregate all the metrics collected during the workflow execution:
4
-
5
- Available data:
6
- - Pre-processing baseline metrics: <%= pre_processing.gather_baseline_metrics %>
7
- - Results from all processed test files: <%= output.targets %>
8
-
9
- Please calculate and provide:
10
-
11
- 1. **Overall Coverage Improvement**:
12
- - Total coverage before and after
13
- - Percentage improvement
14
- - Files with biggest improvements
15
-
16
- 2. **Performance Gains**:
17
- - Total execution time saved
18
- - Average performance improvement per file
19
- - Files with best optimization results
20
-
21
- 3. **Test Quality Metrics**:
22
- - Number of new tests added
23
- - Number of tests optimized
24
- - Reduction in flaky/brittle tests
25
-
26
- 4. **Summary Statistics**:
27
- - Total files processed
28
- - Success rate
29
- - Any files that had issues
30
-
31
- Output a comprehensive metrics summary that can be used in the final report.
@@ -1,28 +0,0 @@
1
- # Cleanup Environment
2
-
3
- Perform post-optimization cleanup tasks:
4
-
5
- 1. **Commit Changes**: Create a commit with all the test improvements
6
- - Use a descriptive commit message summarizing the optimization results
7
- - Include key metrics in the commit description
8
-
9
- 2. **Update Documentation**:
10
- - Update test documentation if structure changed significantly
11
- - Add notes about any new test helpers or patterns introduced
12
-
13
- 3. **Clean Temporary Files**:
14
- - Remove any temporary files created during optimization
15
- - Clear test caches that were used for benchmarking
16
-
17
- 4. **Final Verification**:
18
- - Run the full test suite one more time to ensure everything works
19
- - Verify CI/CD pipelines will work with the changes
20
-
21
- 5. **Create PR Description**:
22
- - Generate a pull request description template with:
23
- - Summary of changes
24
- - Key metrics improvements
25
- - Any breaking changes or considerations
26
- - Review checklist
27
-
28
- Output a summary of cleanup actions performed and any final notes for the team.
@@ -1,32 +0,0 @@
1
- # Generate Summary Report
2
-
3
- Generate a comprehensive test optimization report based on all the collected data:
4
-
5
- ## Test Suite Optimization Report
6
-
7
- ### Executive Summary
8
- Provide a high-level overview of the optimization results, key achievements, and any issues encountered.
9
-
10
- ### Metrics Summary
11
- Include the aggregated metrics from the previous step:
12
- <%= aggregate_metrics %>
13
-
14
- ### Detailed Results by File
15
- For each processed test file, include:
16
- - File name and path
17
- - Coverage improvement
18
- - Performance improvement
19
- - Number of tests added/modified
20
- - Key changes made
21
-
22
- ### Recommendations
23
- Based on the optimization results, provide:
24
- 1. Further optimization opportunities
25
- 2. Best practices observed that should be adopted project-wide
26
- 3. Common patterns that could be extracted into shared utilities
27
- 4. Testing strategy improvements
28
-
29
- ### Next Steps
30
- Suggest follow-up actions to maintain and build upon these improvements.
31
-
32
- Format the report in Markdown for easy sharing and include visual indicators (✅ ❌ ⚠️) for quick scanning.
@@ -1,24 +0,0 @@
1
- === Test Optimization Summary Report ===
2
- Generated at: <%= Time.now.strftime("%Y-%m-%d %H:%M:%S") %>
3
-
4
- ## Baseline Metrics
5
- <%= pre_processing.gather_baseline_metrics %>
6
-
7
- ## Files Processed
8
- Total files: <%= targets.size %>
9
-
10
- <% targets.each do |file, target| %>
11
- ### <%= file %>
12
- Analysis: <%= target.output.analyze_test_file %>
13
- Coverage improvements: <%= target.output.improve_test_coverage %>
14
- Performance optimizations: <%= target.output.optimize_test_performance %>
15
- <% end %>
16
-
17
- ## Post-Processing Results
18
- ### Aggregated Metrics
19
- <%= output.aggregate_metrics %>
20
-
21
- ### Summary Report
22
- <%= output.generate_summary_report %>
23
-
24
- === End of Report ===
@@ -1,26 +0,0 @@
1
- # Gather Baseline Metrics
2
-
3
- Analyze the current test suite and gather baseline metrics for comparison. Please provide:
4
-
5
- 1. Total number of test files to be processed
6
- 2. Current overall test coverage percentage
7
- 3. Average test execution time across all files
8
- 4. Number of tests by type (unit, integration, system)
9
- 5. Any test files that are particularly slow (> 5 seconds)
10
-
11
- Store these metrics in the workflow state for later comparison in post-processing.
12
-
13
- Output format:
14
- ```json
15
- {
16
- "total_test_files": 0,
17
- "overall_coverage": 0.0,
18
- "average_execution_time": 0.0,
19
- "test_counts": {
20
- "unit": 0,
21
- "integration": 0,
22
- "system": 0
23
- },
24
- "slow_tests": []
25
- }
26
- ```
@@ -1,11 +0,0 @@
1
- # Setup Test Environment
2
-
3
- Prepare the test environment for optimization. Please:
4
-
5
- 1. Ensure all test dependencies are installed
6
- 2. Create a backup branch for safety: `test-optimization-backup-<%= timestamp %>`
7
- 3. Set up any necessary test databases or fixtures
8
- 4. Configure test parallelization settings if available
9
- 5. Clear any test caches that might affect benchmarking
10
-
11
- Return a summary of the setup steps completed and any warnings or issues encountered.
@@ -1,24 +0,0 @@
1
- # Validate Changes
2
-
3
- Validate the changes made to <%= file %>:
4
-
5
- 1. **Run the updated tests** and ensure they all pass
6
- 2. **Check coverage metrics** to verify improvements
7
- 3. **Measure execution time** to confirm performance gains
8
- 4. **Verify no regressions** were introduced
9
- 5. **Ensure code style** follows project conventions
10
-
11
- Store the validation results in the workflow state:
12
- ```json
13
- {
14
- "file": "<%= file %>",
15
- "tests_passed": true,
16
- "coverage_before": 0.0,
17
- "coverage_after": 0.0,
18
- "execution_time_before": 0.0,
19
- "execution_time_after": 0.0,
20
- "issues_found": []
21
- }
22
- ```
23
-
24
- If any issues are found, provide recommendations for fixing them.
@@ -1,21 +0,0 @@
1
- name: test_optimization
2
- model: gpt-4o
3
- target: "test/**/*_test.rb"
4
-
5
- # Pre-processing steps run once before any test files are processed
6
- pre_processing:
7
- - gather_baseline_metrics
8
- - setup_test_environment
9
-
10
- # Main workflow steps run for each test file
11
- steps:
12
- - analyze_test_file
13
- - improve_test_coverage
14
- - optimize_test_performance
15
- - validate_changes
16
-
17
- # Post-processing steps run once after all test files have been processed
18
- post_processing:
19
- - aggregate_metrics
20
- - generate_summary_report
21
- - cleanup_environment
@@ -1,23 +0,0 @@
1
- description: Demonstrate retry functionality for steps
2
-
3
- # This example shows how to configure steps to automatically retry on failure
4
- # The 'retries' parameter specifies how many times to retry a failing step
5
-
6
- steps:
7
- - check_network: "$(curl -f -s -o /dev/null -w '%{http_code}' https://httpstat.us/500)"
8
- - process_data: "Process important data that might fail transiently"
9
- - flaky_command: "$(./flaky_script.sh)"
10
-
11
- # Configuration for each step
12
- check_network:
13
- retries: 3 # Will retry up to 3 times if it fails
14
- exit_on_error: true # Will exit workflow if all retries fail
15
-
16
- process_data:
17
- model: gpt-4o-mini
18
- retries: 2 # Will retry up to 2 times
19
-
20
- # Command with retries but won't exit on error after all retries fail
21
- flaky_command:
22
- retries: 5
23
- exit_on_error: false # Continue workflow even after all retries fail
@@ -1,68 +0,0 @@
1
- # RSpec to Minitest Migration Workflow
2
-
3
- This workflow demonstrates how to automate the migration of RSpec tests to their Minitest equivalents, following a structured approach to ensure proper test coverage and functionality.
4
-
5
- ## Workflow Overview
6
-
7
- The workflow consists of three main steps:
8
-
9
- 1. **Analyze Spec**: Understand the purpose and structure of the RSpec test, including its dependencies and testing patterns.
10
- 2. **Create Minitest**: Generate a new Minitest file with equivalent test coverage and assertions.
11
- 3. **Run and Improve**: Execute the Minitest file and iteratively improve it until all tests pass.
12
-
13
- ## Prerequisites
14
-
15
- - Ruby environment with both RSpec and Minitest gems installed
16
- - Access to the original codebase being tested
17
- - Ability to run tests in the target environment
18
-
19
- ## Usage
20
-
21
- To use this workflow:
22
-
23
- 1. Configure the target pattern in `workflow.yml` to match the RSpec files you want to convert (or pass in via CLI --target option):
24
- ```yaml
25
- target: "path/to/specs/**/*_spec.rb"
26
- ```
27
-
28
- 2. Run the workflow with:
29
- ```
30
- roast execute examples/rspec_to_minitest/workflow.yml
31
- ```
32
-
33
- 3. Review the generated Minitest files and ensure they're correctly placed in your test directory.
34
-
35
- ## Implementation Details
36
-
37
- The workflow leverages the following tools:
38
-
39
- - Standard file operations (read/write)
40
- - Code search capabilities to find related files
41
- - Command execution to run tests
42
- - CodingAgent for iterative improvements using AI-powered coding assistance
43
-
44
- ## Required Tool: CodingAgent
45
-
46
- This workflow introduces a new tool called `CodingAgent` which leverages Claude Code to perform code-related tasks:
47
-
48
- 1. Running tests
49
- 2. Analyzing errors and failures
50
- 3. Making iterative improvements to code
51
-
52
- The CodingAgent tool is implemented in `lib/roast/tools/coding_agent.rb`.
53
-
54
- ## Conversion Mappings
55
-
56
- The workflow handles these common RSpec to Minitest conversions:
57
-
58
- | RSpec Feature | Minitest Equivalent |
59
- |---------------|---------------------|
60
- | `describe/context` | Test class |
61
- | `it` blocks | `test_*` methods |
62
- | `before/after` | `setup/teardown` methods |
63
- | `let/let!` | Instance variables or helper methods |
64
- | `expect(x).to eq(y)` | `assert_equal y, x` |
65
- | `expect(x).to be_truthy` | `assert x` |
66
- | `expect(x).to be_falsey` | `refute x` |
67
- | `expect { ... }.to raise_error` | `assert_raises { ... }` |
68
- | Mocks/doubles | Minitest mocking or Mocha |
@@ -1,30 +0,0 @@
1
- In this first step, try to understand the purpose and dependencies of the spec we will be migrating.
2
-
3
- 1. Read the provided RSpec file carefully to understand:
4
- - The purpose of the test suite
5
- - The subject under test (SUT)
6
- - Test structure and organization
7
- - Dependencies and fixtures used
8
- - Mocks, stubs, and doubles
9
-
10
- 2. Use your tools to search for the SUT implementation and any other important dependent files so that they will be in the context for future steps in this process.
11
- - Dependencies include fixtures
12
- - Note that test/fixtures already has quite a bit of fixture files present
13
- - If any fixtures are missing, copy them over when you write the new test file later
14
-
15
- 3. Identify RSpec-specific features being used, such as:
16
- - describe/context blocks
17
- - before/after hooks
18
- - let and let! declarations
19
- - expect(...).to syntax and matchers
20
- - shared examples/contexts
21
- - metadata and tags
22
-
23
- 4. Provide a summary of your analysis, including:
24
- - Purpose of the test suite
25
- - Main subject under test
26
- - Key dependencies
27
- - Testing patterns used
28
- - Any potentially challenging aspects for Minitest conversion
29
-
30
- This analysis will guide the next steps of creating an equivalent Minitest implementation.
@@ -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