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,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
@@ -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,25 +0,0 @@
1
- name: funny_name_backstory
2
- description: Create a humorous backstory based on your name
3
-
4
- steps:
5
- # Collect user's name
6
- - input:
7
- prompt: "What's your name?"
8
- name: user_name
9
- required: true
10
-
11
- # Ask for preferences
12
- - input:
13
- prompt: "Pick a genre for your backstory:"
14
- type: choice
15
- options:
16
- - "Epic Fantasy Adventure"
17
- - "Cyberpunk Hacker"
18
- - "Time-Traveling Detective"
19
- - "Intergalactic Pizza Delivery"
20
- - "Victorian-Era Vampire Hunter"
21
- - "Professional Cat Whisperer"
22
- name: genre
23
-
24
- # Generate the backstory
25
- - 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}}"