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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yaml +3 -1
- data/.gitignore +7 -0
- data/.rubocop.yml +14 -0
- data/Gemfile +2 -1
- data/Gemfile.lock +9 -1
- data/Rakefile +16 -4
- data/examples/README.md +9 -0
- data/examples/available_tools_demo/workflow.yml +2 -2
- data/examples/basic_prompt_workflow/workflow.md +1 -0
- data/examples/basic_prompt_workflow/workflow.yml +14 -0
- data/lib/roast/dsl/executor.rb +2 -1
- data/lib/roast/helpers/cmd_runner.rb +199 -0
- data/lib/roast/initializers.rb +1 -1
- data/lib/roast/tools/apply_diff.rb +1 -1
- data/lib/roast/tools/bash.rb +4 -4
- data/lib/roast/tools/cmd.rb +3 -5
- data/lib/roast/tools/coding_agent.rb +1 -1
- data/lib/roast/tools/grep.rb +6 -2
- data/lib/roast/tools/read_file.rb +2 -1
- data/lib/roast/tools/swarm.rb +2 -7
- data/lib/roast/tools.rb +10 -1
- data/lib/roast/version.rb +1 -1
- data/lib/roast/workflow/base_step.rb +2 -3
- data/lib/roast/workflow/command_executor.rb +3 -3
- data/lib/roast/workflow/resource_resolver.rb +1 -1
- data/lib/roast/workflow/shell_script_step.rb +1 -1
- data/lib/roast/workflow/step_loader.rb +2 -7
- data/lib/roast.rb +7 -1
- data/rubocop/cop/roast/use_cmd_runner.rb +93 -0
- data/rubocop/cop/roast.rb +4 -0
- data/sorbet/rbi/gems/docile@1.4.1.rbi +377 -0
- data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +233 -2
- data/sorbet/rbi/gems/racc@1.8.1.rbi +6 -4
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +396 -2
- data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3788 -2
- data/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi +7747 -2
- data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
- data/sorbet/rbi/gems/rubocop@1.77.0.rbi +62813 -2
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1311 -2
- data/sorbet/rbi/gems/simplecov-html@0.13.2.rbi +225 -0
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2259 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +9 -0
- data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +125 -2
- data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +244 -2
- data/sorbet/tapioca/require.rb +2 -1
- metadata +12 -240
- data/CHANGELOG.md +0 -364
- data/examples/agent_continue/add_documentation/prompt.md +0 -5
- data/examples/agent_continue/add_error_handling/prompt.md +0 -5
- data/examples/agent_continue/analyze_codebase/prompt.md +0 -7
- data/examples/agent_continue/combined_workflow.yml +0 -24
- data/examples/agent_continue/continue_adding_features/prompt.md +0 -4
- data/examples/agent_continue/create_integration_tests/prompt.md +0 -3
- data/examples/agent_continue/document_with_context/prompt.md +0 -5
- data/examples/agent_continue/explore_api/prompt.md +0 -6
- data/examples/agent_continue/implement_client/prompt.md +0 -6
- data/examples/agent_continue/inline_workflow.yml +0 -20
- data/examples/agent_continue/refactor_code/prompt.md +0 -2
- data/examples/agent_continue/verify_changes/prompt.md +0 -6
- data/examples/agent_continue/workflow.yml +0 -27
- data/examples/agent_workflow/README.md +0 -75
- data/examples/agent_workflow/apply_refactorings/prompt.md +0 -22
- data/examples/agent_workflow/identify_code_smells/prompt.md +0 -15
- data/examples/agent_workflow/summarize_improvements/prompt.md +0 -18
- data/examples/agent_workflow/workflow.png +0 -0
- data/examples/agent_workflow/workflow.yml +0 -16
- data/examples/api_workflow/README.md +0 -85
- data/examples/api_workflow/fetch_api_data/prompt.md +0 -10
- data/examples/api_workflow/generate_report/prompt.md +0 -10
- data/examples/api_workflow/prompt.md +0 -10
- data/examples/api_workflow/transform_data/prompt.md +0 -10
- data/examples/api_workflow/workflow.png +0 -0
- data/examples/api_workflow/workflow.yml +0 -30
- data/examples/apply_diff_demo/README.md +0 -58
- data/examples/apply_diff_demo/apply_simple_change/prompt.md +0 -13
- data/examples/apply_diff_demo/create_sample_file/prompt.md +0 -11
- data/examples/apply_diff_demo/workflow.yml +0 -24
- data/examples/available_tools_demo/workflow.png +0 -0
- data/examples/bash_prototyping/README.md +0 -53
- data/examples/bash_prototyping/analyze_network/prompt.md +0 -13
- data/examples/bash_prototyping/analyze_system/prompt.md +0 -11
- data/examples/bash_prototyping/api_testing.png +0 -0
- data/examples/bash_prototyping/api_testing.yml +0 -14
- data/examples/bash_prototyping/check_processes/prompt.md +0 -11
- data/examples/bash_prototyping/generate_report/prompt.md +0 -16
- data/examples/bash_prototyping/process_json_response/prompt.md +0 -24
- data/examples/bash_prototyping/system_analysis.png +0 -0
- data/examples/bash_prototyping/system_analysis.yml +0 -14
- data/examples/bash_prototyping/test_public_api/prompt.md +0 -22
- data/examples/case_when/README.md +0 -58
- data/examples/case_when/detect_language/prompt.md +0 -16
- data/examples/case_when/workflow.png +0 -0
- data/examples/case_when/workflow.yml +0 -58
- data/examples/cmd/README.md +0 -99
- data/examples/cmd/analyze_project/prompt.md +0 -57
- data/examples/cmd/basic_demo/prompt.md +0 -48
- data/examples/cmd/basic_workflow.png +0 -0
- data/examples/cmd/basic_workflow.yml +0 -17
- data/examples/cmd/check_repository/prompt.md +0 -57
- data/examples/cmd/create_and_verify/prompt.md +0 -56
- data/examples/cmd/dev_workflow.png +0 -0
- data/examples/cmd/dev_workflow.yml +0 -26
- data/examples/cmd/explore_project/prompt.md +0 -67
- data/examples/cmd/explorer_workflow.png +0 -0
- data/examples/cmd/explorer_workflow.yml +0 -21
- data/examples/cmd/smart_tool_selection/prompt.md +0 -99
- data/examples/coding_agent_with_model.yml +0 -20
- data/examples/coding_agent_with_retries.yml +0 -30
- data/examples/conditional/README.md +0 -161
- data/examples/conditional/check_condition/prompt.md +0 -1
- data/examples/conditional/simple_workflow.png +0 -0
- data/examples/conditional/simple_workflow.yml +0 -15
- data/examples/conditional/workflow.png +0 -0
- data/examples/conditional/workflow.yml +0 -23
- data/examples/context_management_demo/README.md +0 -43
- data/examples/context_management_demo/workflow.yml +0 -42
- data/examples/direct_coerce_syntax/README.md +0 -32
- data/examples/direct_coerce_syntax/workflow.png +0 -0
- data/examples/direct_coerce_syntax/workflow.yml +0 -36
- data/examples/dot_notation/README.md +0 -37
- data/examples/dot_notation/workflow.png +0 -0
- data/examples/dot_notation/workflow.yml +0 -44
- data/examples/exit_on_error/README.md +0 -50
- data/examples/exit_on_error/analyze_lint_output/prompt.md +0 -9
- data/examples/exit_on_error/apply_fixes/prompt.md +0 -2
- data/examples/exit_on_error/workflow.png +0 -0
- data/examples/exit_on_error/workflow.yml +0 -19
- data/examples/grading/README.md +0 -71
- data/examples/grading/analyze_coverage/prompt.md +0 -52
- data/examples/grading/calculate_final_grade.rb +0 -67
- data/examples/grading/format_result.rb +0 -64
- data/examples/grading/generate_grades/prompt.md +0 -105
- data/examples/grading/generate_recommendations/output.txt +0 -17
- data/examples/grading/generate_recommendations/prompt.md +0 -60
- data/examples/grading/js_test_runner +0 -31
- data/examples/grading/rb_test_runner +0 -19
- data/examples/grading/read_dependencies/prompt.md +0 -16
- data/examples/grading/run_coverage.rb +0 -54
- data/examples/grading/verify_mocks_and_stubs/prompt.md +0 -12
- data/examples/grading/verify_test_helpers/prompt.md +0 -53
- data/examples/grading/workflow.md +0 -8
- data/examples/grading/workflow.png +0 -0
- data/examples/grading/workflow.rb.md +0 -6
- data/examples/grading/workflow.ts+tsx.md +0 -6
- data/examples/grading/workflow.yml +0 -41
- data/examples/instrumentation.rb +0 -76
- data/examples/interpolation/README.md +0 -50
- data/examples/interpolation/analyze_file/prompt.md +0 -1
- data/examples/interpolation/analyze_patterns/prompt.md +0 -27
- data/examples/interpolation/generate_report_for_js/prompt.md +0 -3
- data/examples/interpolation/generate_report_for_rb/prompt.md +0 -3
- data/examples/interpolation/sample.js +0 -48
- data/examples/interpolation/sample.rb +0 -42
- data/examples/interpolation/workflow.md +0 -1
- data/examples/interpolation/workflow.png +0 -0
- data/examples/interpolation/workflow.yml +0 -21
- data/examples/iteration/IMPLEMENTATION.md +0 -88
- data/examples/iteration/README.md +0 -68
- data/examples/iteration/analyze_complexity/prompt.md +0 -22
- data/examples/iteration/generate_recommendations/prompt.md +0 -21
- data/examples/iteration/generate_report/prompt.md +0 -129
- data/examples/iteration/implement_fix/prompt.md +0 -25
- data/examples/iteration/prioritize_issues/prompt.md +0 -24
- data/examples/iteration/prompts/analyze_file.md +0 -28
- data/examples/iteration/prompts/generate_summary.md +0 -24
- data/examples/iteration/prompts/update_report.md +0 -29
- data/examples/iteration/prompts/write_report.md +0 -22
- data/examples/iteration/read_file/prompt.md +0 -9
- data/examples/iteration/select_next_issue/prompt.md +0 -25
- data/examples/iteration/simple_workflow.md +0 -39
- data/examples/iteration/simple_workflow.yml +0 -58
- data/examples/iteration/update_fix_count/prompt.md +0 -26
- data/examples/iteration/verify_fix/prompt.md +0 -29
- data/examples/iteration/workflow.png +0 -0
- data/examples/iteration/workflow.yml +0 -42
- data/examples/json_handling/README.md +0 -32
- data/examples/json_handling/workflow.png +0 -0
- data/examples/json_handling/workflow.yml +0 -52
- data/examples/mcp/README.md +0 -223
- data/examples/mcp/analyze_changes/prompt.md +0 -8
- data/examples/mcp/analyze_issues/prompt.md +0 -4
- data/examples/mcp/analyze_schema/prompt.md +0 -4
- data/examples/mcp/check_data_quality/prompt.md +0 -5
- data/examples/mcp/check_documentation/prompt.md +0 -4
- data/examples/mcp/create_recommendations/prompt.md +0 -5
- data/examples/mcp/database_workflow.png +0 -0
- data/examples/mcp/database_workflow.yml +0 -29
- data/examples/mcp/env_demo/workflow.png +0 -0
- data/examples/mcp/env_demo/workflow.yml +0 -34
- data/examples/mcp/fetch_pr_context/prompt.md +0 -4
- data/examples/mcp/filesystem_demo/create_test_file/prompt.md +0 -2
- data/examples/mcp/filesystem_demo/list_files/prompt.md +0 -6
- data/examples/mcp/filesystem_demo/read_with_mcp/prompt.md +0 -7
- data/examples/mcp/filesystem_demo/workflow.png +0 -0
- data/examples/mcp/filesystem_demo/workflow.yml +0 -38
- data/examples/mcp/generate_insights/prompt.md +0 -4
- data/examples/mcp/generate_report/prompt.md +0 -6
- data/examples/mcp/generate_review/prompt.md +0 -16
- data/examples/mcp/github_workflow.png +0 -0
- data/examples/mcp/github_workflow.yml +0 -32
- data/examples/mcp/multi_mcp_workflow.png +0 -0
- data/examples/mcp/multi_mcp_workflow.yml +0 -58
- data/examples/mcp/post_review/prompt.md +0 -3
- data/examples/mcp/save_report/prompt.md +0 -6
- data/examples/mcp/search_issues/prompt.md +0 -2
- data/examples/mcp/summarize/prompt.md +0 -1
- data/examples/mcp/test_filesystem/prompt.md +0 -6
- data/examples/mcp/test_github/prompt.md +0 -8
- data/examples/mcp/test_read/prompt.md +0 -1
- data/examples/mcp/workflow.png +0 -0
- data/examples/mcp/workflow.yml +0 -35
- data/examples/no_model_fallback/README.md +0 -17
- data/examples/no_model_fallback/analyze_file/prompt.md +0 -1
- data/examples/no_model_fallback/analyze_patterns/prompt.md +0 -27
- data/examples/no_model_fallback/generate_report_for_md/prompt.md +0 -10
- data/examples/no_model_fallback/generate_report_for_rb/prompt.md +0 -3
- data/examples/no_model_fallback/sample.rb +0 -42
- data/examples/no_model_fallback/workflow.yml +0 -19
- data/examples/openrouter_example/README.md +0 -48
- data/examples/openrouter_example/analyze_input/prompt.md +0 -16
- data/examples/openrouter_example/generate_response/prompt.md +0 -9
- data/examples/openrouter_example/workflow.png +0 -0
- data/examples/openrouter_example/workflow.yml +0 -12
- data/examples/pre_post_processing/README.md +0 -111
- data/examples/pre_post_processing/analyze_test_file/prompt.md +0 -23
- data/examples/pre_post_processing/improve_test_coverage/prompt.md +0 -17
- data/examples/pre_post_processing/optimize_test_performance/prompt.md +0 -25
- data/examples/pre_post_processing/post_processing/aggregate_metrics/prompt.md +0 -31
- data/examples/pre_post_processing/post_processing/cleanup_environment/prompt.md +0 -28
- data/examples/pre_post_processing/post_processing/generate_summary_report/prompt.md +0 -32
- data/examples/pre_post_processing/post_processing/output.txt +0 -24
- data/examples/pre_post_processing/pre_processing/gather_baseline_metrics/prompt.md +0 -26
- data/examples/pre_post_processing/pre_processing/setup_test_environment/prompt.md +0 -11
- data/examples/pre_post_processing/validate_changes/prompt.md +0 -24
- data/examples/pre_post_processing/workflow.png +0 -0
- data/examples/pre_post_processing/workflow.yml +0 -21
- data/examples/retry/workflow.yml +0 -23
- data/examples/rspec_to_minitest/README.md +0 -68
- data/examples/rspec_to_minitest/analyze_spec/prompt.md +0 -30
- data/examples/rspec_to_minitest/create_minitest/prompt.md +0 -33
- data/examples/rspec_to_minitest/run_and_improve/prompt.md +0 -35
- data/examples/rspec_to_minitest/workflow.md +0 -10
- data/examples/rspec_to_minitest/workflow.png +0 -0
- data/examples/rspec_to_minitest/workflow.yml +0 -40
- data/examples/shared_config/README.md +0 -52
- data/examples/shared_config/example_with_shared_config/workflow.png +0 -0
- data/examples/shared_config/example_with_shared_config/workflow.yml +0 -6
- data/examples/shared_config/shared.png +0 -0
- data/examples/shared_config/shared.yml +0 -7
- data/examples/single_target_prepost/README.md +0 -36
- data/examples/single_target_prepost/post_processing/output.txt +0 -27
- data/examples/single_target_prepost/pre_processing/gather_dependencies/prompt.md +0 -11
- data/examples/single_target_prepost/workflow.png +0 -0
- data/examples/single_target_prepost/workflow.yml +0 -20
- data/examples/smart_coercion_defaults/README.md +0 -65
- data/examples/smart_coercion_defaults/workflow.png +0 -0
- data/examples/smart_coercion_defaults/workflow.yml +0 -44
- data/examples/step_configuration/README.md +0 -84
- data/examples/step_configuration/workflow.png +0 -0
- data/examples/step_configuration/workflow.yml +0 -57
- data/examples/swarm_example.yml +0 -25
- data/examples/tool_config_example/README.md +0 -109
- data/examples/tool_config_example/example_step/prompt.md +0 -42
- data/examples/tool_config_example/workflow.png +0 -0
- data/examples/tool_config_example/workflow.yml +0 -17
- data/examples/user_input/README.md +0 -90
- data/examples/user_input/funny_name/create_backstory/prompt.md +0 -10
- data/examples/user_input/funny_name/workflow.png +0 -0
- data/examples/user_input/funny_name/workflow.yml +0 -26
- data/examples/user_input/generate_summary/prompt.md +0 -11
- data/examples/user_input/simple_input_demo/workflow.png +0 -0
- data/examples/user_input/simple_input_demo/workflow.yml +0 -35
- data/examples/user_input/survey_workflow.png +0 -0
- data/examples/user_input/survey_workflow.yml +0 -71
- data/examples/user_input/welcome_message/prompt.md +0 -3
- data/examples/user_input/workflow.png +0 -0
- data/examples/user_input/workflow.yml +0 -73
- data/examples/workflow_generator/README.md +0 -27
- data/examples/workflow_generator/analyze_user_request/prompt.md +0 -34
- data/examples/workflow_generator/create_workflow_files/prompt.md +0 -32
- data/examples/workflow_generator/get_user_input/prompt.md +0 -14
- data/examples/workflow_generator/info_from_roast.rb +0 -22
- data/examples/workflow_generator/workflow.png +0 -0
- data/examples/workflow_generator/workflow.yml +0 -34
- data/lib/roast/helpers/timeout_handler.rb +0 -89
@@ -1,67 +0,0 @@
|
|
1
|
-
# Exploring Your Project Structure
|
2
|
-
|
3
|
-
You need to analyze the project structure and provide a comprehensive overview. Gather information about the project layout, documentation, and configuration.
|
4
|
-
|
5
|
-
**IMPORTANT COMMAND SYNTAX:**
|
6
|
-
- The `find` command requires a path: `find . -name "*.md"` (not `find -name "*.md"`)
|
7
|
-
- Use `head` to limit output: `find . -name "*.md" | head -10`
|
8
|
-
- Check files efficiently - don't repeat commands
|
9
|
-
|
10
|
-
Explore the project by:
|
11
|
-
|
12
|
-
1. Identifying your current location: use `pwd`
|
13
|
-
2. Listing all files and directories: use `ls -la`
|
14
|
-
3. Finding documentation files: use `find . -name "*.md" -type f | head -10`
|
15
|
-
4. Examining the README: use `cat README.md | head -20` (if it exists)
|
16
|
-
5. Locating configuration files: use `find . -name "*.yml" -o -name "*.yaml" | grep -E "(config|workflow)" | head -10`
|
17
|
-
|
18
|
-
**EFFICIENCY RULES:**
|
19
|
-
- Run each command ONLY ONCE
|
20
|
-
- If a file doesn't exist, note it and move on
|
21
|
-
- DO NOT retry failed commands
|
22
|
-
|
23
|
-
Based on your exploration, analyze:
|
24
|
-
- Project root location and overall structure
|
25
|
-
- Key directories and their likely purposes
|
26
|
-
- Available documentation
|
27
|
-
- Configuration files present
|
28
|
-
- General project organization
|
29
|
-
|
30
|
-
RESPONSE FORMAT
|
31
|
-
Provide your analysis in JSON format:
|
32
|
-
|
33
|
-
<json>
|
34
|
-
{
|
35
|
-
"project_analysis": {
|
36
|
-
"current_directory": "/path/to/project",
|
37
|
-
"total_items": {
|
38
|
-
"files": 0,
|
39
|
-
"directories": 0,
|
40
|
-
"hidden_items": 0
|
41
|
-
},
|
42
|
-
"documentation": {
|
43
|
-
"readme_found": true,
|
44
|
-
"readme_summary": "Brief summary of README contents",
|
45
|
-
"other_docs": ["list of other .md files found"]
|
46
|
-
},
|
47
|
-
"configuration": {
|
48
|
-
"config_files": ["list of .yml/.yaml configuration files"],
|
49
|
-
"workflow_files": ["list of workflow-related files"]
|
50
|
-
},
|
51
|
-
"project_structure": {
|
52
|
-
"key_directories": [
|
53
|
-
{
|
54
|
-
"name": "src",
|
55
|
-
"purpose": "Source code directory"
|
56
|
-
},
|
57
|
-
{
|
58
|
-
"name": "test",
|
59
|
-
"purpose": "Test files directory"
|
60
|
-
}
|
61
|
-
],
|
62
|
-
"project_type": "Identified project type based on files present"
|
63
|
-
}
|
64
|
-
},
|
65
|
-
"exploration_complete": true
|
66
|
-
}
|
67
|
-
</json>
|
Binary file
|
@@ -1,21 +0,0 @@
|
|
1
|
-
name: Project Explorer
|
2
|
-
model: default
|
3
|
-
|
4
|
-
# Navigate and explore your project using command functions
|
5
|
-
|
6
|
-
tools:
|
7
|
-
- Roast::Tools::Cmd:
|
8
|
-
allowed_commands:
|
9
|
-
- pwd
|
10
|
-
- ls
|
11
|
-
- find
|
12
|
-
- name: cat
|
13
|
-
description: "cat command - display file contents, concatenate files, works with pipes"
|
14
|
-
- name: git
|
15
|
-
description: "git CLI - version control system with subcommands like status, log, branch"
|
16
|
-
- name: grep
|
17
|
-
description: "grep command - search text patterns with options like -E, -r, -i"
|
18
|
-
|
19
|
-
steps:
|
20
|
-
- explore_project
|
21
|
-
- check_repository
|
@@ -1,99 +0,0 @@
|
|
1
|
-
# Intelligent Tool Selection Examples
|
2
|
-
|
3
|
-
You are demonstrating intelligent tool selection by completing various development tasks. Select and use the most appropriate tools based on what each task requires.
|
4
|
-
|
5
|
-
**CRITICAL GUIDELINES:**
|
6
|
-
- When working with JSON data, you MUST use jq to parse it - never return raw JSON
|
7
|
-
- Be efficient - if a command fails, do NOT repeat it
|
8
|
-
- Combine tools with pipes when needed (e.g., `curl -s ... | jq ...`)
|
9
|
-
- Check for files ONLY ONCE - if they don't exist, note it and move on
|
10
|
-
|
11
|
-
Complete the following development tasks:
|
12
|
-
|
13
|
-
## Task 1: API Health Check
|
14
|
-
Check if the GitHub API is accessible and responding properly.
|
15
|
-
- Target: https://api.github.com
|
16
|
-
- Goal: Verify the API returns a successful response (check HTTP status)
|
17
|
-
|
18
|
-
## Task 2: Parse JSON Response
|
19
|
-
Fetch GitHub's public information and extract specific data fields.
|
20
|
-
- Target: https://api.github.com/users/github
|
21
|
-
- Extract: The name and company fields from the JSON response
|
22
|
-
- **REQUIRED**: Use curl to fetch and jq to parse in a single command: `curl -s <url> | jq '<filter>'`
|
23
|
-
|
24
|
-
## Task 3: Check Container Environment
|
25
|
-
Determine if Docker is available and check for running containers.
|
26
|
-
- Try `docker ps` ONCE
|
27
|
-
- If Docker daemon is not running, note this and move on - do NOT retry
|
28
|
-
|
29
|
-
## Task 4: Check for Node.js Project
|
30
|
-
Investigate if this is a Node.js project and examine its dependencies.
|
31
|
-
- Check for package.json ONCE with `ls package.json`
|
32
|
-
- If not found, note this and move on - do NOT retry
|
33
|
-
|
34
|
-
## Task 5: Check Build System
|
35
|
-
Determine if a build system is configured and what targets are available.
|
36
|
-
- Check for Makefile ONCE with `ls Makefile`
|
37
|
-
- If not found, note this and move on - do NOT retry
|
38
|
-
|
39
|
-
**EFFICIENCY REMINDER**: Each file check or failed command should be attempted ONLY ONCE.
|
40
|
-
|
41
|
-
RESPONSE FORMAT
|
42
|
-
Report your findings in JSON format:
|
43
|
-
|
44
|
-
<json>
|
45
|
-
{
|
46
|
-
"tool_selection_demo": {
|
47
|
-
"task_1_api_check": {
|
48
|
-
"tool_selected": "curl",
|
49
|
-
"command_used": "curl -I https://api.github.com",
|
50
|
-
"rationale": "Selected HTTP request tool for API check",
|
51
|
-
"result": {
|
52
|
-
"api_accessible": true,
|
53
|
-
"status_code": 200
|
54
|
-
}
|
55
|
-
},
|
56
|
-
"task_2_json_parsing": {
|
57
|
-
"tools_selected": ["curl", "jq"],
|
58
|
-
"command_used": "curl -s https://api.github.com/users/github | jq '.name, .company'",
|
59
|
-
"rationale": "Combined tools for fetching and parsing JSON",
|
60
|
-
"result": {
|
61
|
-
"data_extracted": true,
|
62
|
-
"fields": {
|
63
|
-
"name": "GitHub",
|
64
|
-
"company": "@github"
|
65
|
-
}
|
66
|
-
}
|
67
|
-
},
|
68
|
-
"task_3_containers": {
|
69
|
-
"tool_selected": "docker",
|
70
|
-
"command_used": "docker ps",
|
71
|
-
"rationale": "Selected container platform tool",
|
72
|
-
"result": {
|
73
|
-
"docker_available": false,
|
74
|
-
"error": "Docker daemon not running",
|
75
|
-
"containers_running": 0
|
76
|
-
}
|
77
|
-
},
|
78
|
-
"task_4_nodejs": {
|
79
|
-
"tool_selected": "ls",
|
80
|
-
"command_used": "ls package.json",
|
81
|
-
"rationale": "Checked for package.json existence",
|
82
|
-
"result": {
|
83
|
-
"is_node_project": false,
|
84
|
-
"package_json_found": false
|
85
|
-
}
|
86
|
-
},
|
87
|
-
"task_5_build": {
|
88
|
-
"tool_selected": "ls",
|
89
|
-
"command_used": "ls Makefile",
|
90
|
-
"rationale": "Checked for Makefile existence",
|
91
|
-
"result": {
|
92
|
-
"makefile_found": false,
|
93
|
-
"targets": []
|
94
|
-
}
|
95
|
-
}
|
96
|
-
},
|
97
|
-
"summary": "Successfully demonstrated intelligent tool selection based on task requirements"
|
98
|
-
}
|
99
|
-
</json>
|
@@ -1,20 +0,0 @@
|
|
1
|
-
name: CodingAgent with Model Configuration
|
2
|
-
description: |
|
3
|
-
Example workflow demonstrating how to configure the CodingAgent tool
|
4
|
-
with specific model options like opus
|
5
|
-
|
6
|
-
tools:
|
7
|
-
- Roast::Tools::CodingAgent:
|
8
|
-
model: opus
|
9
|
-
# You can also add other claude options here:
|
10
|
-
# temperature: 0.7
|
11
|
-
# max_tokens: 1000
|
12
|
-
|
13
|
-
steps:
|
14
|
-
- analyze_code: |
|
15
|
-
Analyze the Ruby code in lib/roast/tools/coding_agent.rb
|
16
|
-
and explain how the CodingAgent tool works.
|
17
|
-
|
18
|
-
- implement_feature: |
|
19
|
-
Create a simple Ruby script that demonstrates using command-line
|
20
|
-
options similar to how CodingAgent builds its commands.
|
@@ -1,30 +0,0 @@
|
|
1
|
-
name: CodingAgent with Retries Configuration
|
2
|
-
description: |
|
3
|
-
Example workflow demonstrating how to configure the CodingAgent tool
|
4
|
-
with automatic retries on failure. The retries option will automatically
|
5
|
-
retry the coding agent if it encounters an error during execution.
|
6
|
-
Note: this is not the same as running the step
|
7
|
-
|
8
|
-
tools:
|
9
|
-
- Roast::Tools::CodingAgent:
|
10
|
-
retries: 2 # Automatically retry up to 2 times on failure
|
11
|
-
|
12
|
-
steps:
|
13
|
-
# This step invokes the coding agent directly using the specified number of retries
|
14
|
-
- ^implement_a_feature: |
|
15
|
-
Create a Ruby script that demonstrates robust error handling.
|
16
|
-
The script should:
|
17
|
-
1. Attempt to read a file that might not exist
|
18
|
-
2. Handle any errors gracefully
|
19
|
-
3. Log the results
|
20
|
-
|
21
|
-
|
22
|
-
# This step invokes the general workflow LLM which can in turn invoke the coding agent.
|
23
|
-
# When the general LLM invokes the coding agent, it will execute with the specified number of retries.
|
24
|
-
- add_tests: |
|
25
|
-
Add test for the feature you just implemented.
|
26
|
-
Run the tests and iterate until they all pass.
|
27
|
-
Use the CodingAgent tool to write the tests.
|
28
|
-
|
29
|
-
add_tests:
|
30
|
-
retries: 4
|
@@ -1,161 +0,0 @@
|
|
1
|
-
# Conditional Execution in Roast Workflows
|
2
|
-
|
3
|
-
This example demonstrates how to use conditional execution (`if` and `unless`) in Roast workflows.
|
4
|
-
|
5
|
-
## Overview
|
6
|
-
|
7
|
-
Conditional execution allows workflows to execute different steps based on runtime conditions. This feature supports:
|
8
|
-
|
9
|
-
- `if` conditions - execute steps when a condition is true
|
10
|
-
- `unless` conditions - execute steps when a condition is false
|
11
|
-
- `then` branches - steps to execute when the condition matches
|
12
|
-
- `else` branches - steps to execute when the condition doesn't match (optional, only for `if`)
|
13
|
-
|
14
|
-
## Syntax
|
15
|
-
|
16
|
-
### If Statement
|
17
|
-
|
18
|
-
```yaml
|
19
|
-
- if: "{{expression}}"
|
20
|
-
then:
|
21
|
-
- step1
|
22
|
-
- step2
|
23
|
-
else:
|
24
|
-
- step3
|
25
|
-
- step4
|
26
|
-
```
|
27
|
-
|
28
|
-
### Unless Statement
|
29
|
-
|
30
|
-
```yaml
|
31
|
-
- unless: "{{expression}}"
|
32
|
-
then:
|
33
|
-
- step1
|
34
|
-
- step2
|
35
|
-
```
|
36
|
-
|
37
|
-
## Condition Types
|
38
|
-
|
39
|
-
Conditions can be:
|
40
|
-
|
41
|
-
1. **Ruby Expressions** - Wrapped in `{{...}}`
|
42
|
-
```yaml
|
43
|
-
- if: "{{output.previous_step.success == true}}"
|
44
|
-
```
|
45
|
-
|
46
|
-
2. **Bash Commands** - Wrapped in `$(...)`
|
47
|
-
```yaml
|
48
|
-
- if: "$(test -f /path/to/file && echo true || echo false)"
|
49
|
-
```
|
50
|
-
|
51
|
-
3. **Step References** - Reference to previous step output
|
52
|
-
```yaml
|
53
|
-
- if: "check_condition" # References a previous step
|
54
|
-
```
|
55
|
-
|
56
|
-
4. **File Checks**
|
57
|
-
```yaml
|
58
|
-
- if: "{{File.exist?('/tmp/myfile.txt')}}"
|
59
|
-
```
|
60
|
-
|
61
|
-
## Examples
|
62
|
-
|
63
|
-
### Basic Example
|
64
|
-
|
65
|
-
```yaml
|
66
|
-
name: Conditional Example
|
67
|
-
tools:
|
68
|
-
- Roast::Tools::Cmd
|
69
|
-
|
70
|
-
steps:
|
71
|
-
- check_status: "echo 'success'"
|
72
|
-
|
73
|
-
- if: "{{output.check_status.strip == 'success'}}"
|
74
|
-
then:
|
75
|
-
- success_action: "echo 'Operation succeeded!'"
|
76
|
-
else:
|
77
|
-
- failure_action: "echo 'Operation failed!'"
|
78
|
-
```
|
79
|
-
|
80
|
-
### Unless Example
|
81
|
-
|
82
|
-
```yaml
|
83
|
-
name: Unless Example
|
84
|
-
tools: []
|
85
|
-
|
86
|
-
steps:
|
87
|
-
- check_file: "test -f /tmp/important.txt && echo exists || echo missing"
|
88
|
-
|
89
|
-
- unless: "{{output.check_file.strip == 'exists'}}"
|
90
|
-
then:
|
91
|
-
- create_file: "touch /tmp/important.txt"
|
92
|
-
- notify: "echo 'Created missing file'"
|
93
|
-
```
|
94
|
-
|
95
|
-
### Nested Conditionals
|
96
|
-
|
97
|
-
```yaml
|
98
|
-
name: Nested Conditionals
|
99
|
-
tools: []
|
100
|
-
|
101
|
-
steps:
|
102
|
-
- outer_check: "echo 'true'"
|
103
|
-
- inner_check: "echo 'false'"
|
104
|
-
|
105
|
-
- if: "{{output.outer_check.strip == 'true'}}"
|
106
|
-
then:
|
107
|
-
- if: "{{output.inner_check.strip == 'true'}}"
|
108
|
-
then:
|
109
|
-
- both_true: "echo 'Both conditions are true'"
|
110
|
-
else:
|
111
|
-
- only_outer: "echo 'Only outer condition is true'"
|
112
|
-
else:
|
113
|
-
- outer_false: "echo 'Outer condition is false'"
|
114
|
-
```
|
115
|
-
|
116
|
-
### Platform-Specific Actions
|
117
|
-
|
118
|
-
```yaml
|
119
|
-
name: Platform Detection
|
120
|
-
tools:
|
121
|
-
- Roast::Tools::Cmd
|
122
|
-
|
123
|
-
steps:
|
124
|
-
- detect_os: "uname -s"
|
125
|
-
|
126
|
-
- if: "{{output.detect_os.strip == 'Darwin'}}"
|
127
|
-
then:
|
128
|
-
- mac_setup: "brew --version || echo 'Homebrew not installed'"
|
129
|
-
else:
|
130
|
-
- if: "{{output.detect_os.strip == 'Linux'}}"
|
131
|
-
then:
|
132
|
-
- linux_setup: "apt-get --version || yum --version"
|
133
|
-
else:
|
134
|
-
- unknown_os: "echo 'Unknown operating system'"
|
135
|
-
```
|
136
|
-
|
137
|
-
## Best Practices
|
138
|
-
|
139
|
-
1. **Use Clear Conditions**: Make your conditions explicit and easy to understand
|
140
|
-
2. **Handle Edge Cases**: Always consider what happens when conditions fail
|
141
|
-
3. **Test Both Branches**: Ensure both `then` and `else` branches work correctly
|
142
|
-
4. **Avoid Deep Nesting**: Keep conditional logic simple and readable
|
143
|
-
5. **Use Unless Sparingly**: `unless` can be less intuitive than `if` with negation
|
144
|
-
|
145
|
-
## Debugging
|
146
|
-
|
147
|
-
To debug conditional execution:
|
148
|
-
|
149
|
-
1. Check the workflow output to see which branch was executed
|
150
|
-
2. Look for keys like `if_condition_name` or `unless_condition_name` in the output
|
151
|
-
3. These keys contain information about the condition evaluation and branch taken
|
152
|
-
|
153
|
-
## Running the Example
|
154
|
-
|
155
|
-
```bash
|
156
|
-
# Run the simple conditional example
|
157
|
-
roast execute examples/conditional/simple_workflow.yml
|
158
|
-
|
159
|
-
# Run the full conditional example (requires API configuration)
|
160
|
-
roast execute examples/conditional/workflow.yml
|
161
|
-
```
|
@@ -1 +0,0 @@
|
|
1
|
-
Check if the OS is macOS or Linux and return true if it's macOS, false otherwise.
|
Binary file
|
@@ -1,15 +0,0 @@
|
|
1
|
-
name: Simple Conditional Test
|
2
|
-
tools: []
|
3
|
-
|
4
|
-
steps:
|
5
|
-
- set_value: "$(echo 'true')"
|
6
|
-
|
7
|
-
- if: "{{output.set_value.strip == 'true'}}"
|
8
|
-
then:
|
9
|
-
- success: "$(echo 'If condition worked!')"
|
10
|
-
else:
|
11
|
-
- failure: "$(echo 'If condition failed!')"
|
12
|
-
|
13
|
-
- unless: "{{output.set_value.strip == 'false'}}"
|
14
|
-
then:
|
15
|
-
- unless_success: "$(echo 'Unless condition worked!')"
|
Binary file
|
@@ -1,23 +0,0 @@
|
|
1
|
-
name: Conditional Execution Example
|
2
|
-
tools:
|
3
|
-
- Roast::Tools::Cmd
|
4
|
-
|
5
|
-
steps:
|
6
|
-
- check_os: "$(uname -s)"
|
7
|
-
|
8
|
-
- if: "{{output.check_os.strip == 'Darwin'}}"
|
9
|
-
then:
|
10
|
-
- mac_message: "$(echo 'Running on macOS!')"
|
11
|
-
- mac_info: "$(sw_vers)"
|
12
|
-
else:
|
13
|
-
- linux_message: "$(echo 'Running on Linux!')"
|
14
|
-
- linux_info: "$(lsb_release -a)"
|
15
|
-
|
16
|
-
- check_file: "$(test -f /tmp/roast_test.txt && echo exists || echo missing)"
|
17
|
-
|
18
|
-
- unless: "{{output.check_file.strip == 'exists'}}"
|
19
|
-
then:
|
20
|
-
- create_file: "$(touch /tmp/roast_test.txt && echo 'File created')"
|
21
|
-
|
22
|
-
- verify_file: "$(ls -la /tmp/roast_test.txt)"
|
23
|
-
- cleanup: "$(rm -f /tmp/roast_test.txt)"
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# Context Management Demo
|
2
|
-
|
3
|
-
This example demonstrates Roast's automatic context management feature, which helps prevent workflow failures when conversation history exceeds the LLM's context window.
|
4
|
-
|
5
|
-
## Features Demonstrated
|
6
|
-
|
7
|
-
1. **Automatic Token Tracking**: Monitors token usage throughout workflow execution
|
8
|
-
2. **Configurable Thresholds**: Set when to trigger warnings or compaction
|
9
|
-
3. **Context Preservation**: Specify critical steps to retain during compaction
|
10
|
-
|
11
|
-
## Configuration
|
12
|
-
|
13
|
-
```yaml
|
14
|
-
context_management:
|
15
|
-
enabled: true # Enable context management
|
16
|
-
strategy: auto # Compaction strategy (auto, summarize, prune, none)
|
17
|
-
threshold: 0.8 # Trigger at 80% of context window
|
18
|
-
max_tokens: 10000 # Override default limit (for demo purposes)
|
19
|
-
retain_steps: # Steps to always keep in full
|
20
|
-
- analyze_requirements
|
21
|
-
- generate_summary
|
22
|
-
```
|
23
|
-
|
24
|
-
## Running the Demo
|
25
|
-
|
26
|
-
```bash
|
27
|
-
roast execute context_management_demo
|
28
|
-
```
|
29
|
-
|
30
|
-
The workflow intentionally generates verbose responses to demonstrate how context management handles large amounts of text without failing.
|
31
|
-
|
32
|
-
## What to Observe
|
33
|
-
|
34
|
-
1. **Token Usage Warnings**: Watch for warnings as the context approaches limits
|
35
|
-
2. **Automatic Handling**: The workflow continues even with large outputs
|
36
|
-
3. **Preserved Context**: Critical steps remain accessible throughout execution
|
37
|
-
|
38
|
-
## Customization
|
39
|
-
|
40
|
-
Try modifying the configuration:
|
41
|
-
- Lower `max_tokens` to trigger compaction sooner
|
42
|
-
- Change `strategy` to test different compaction approaches
|
43
|
-
- Add more steps to `retain_steps` to preserve additional context
|
@@ -1,42 +0,0 @@
|
|
1
|
-
name: Context Management Demo
|
2
|
-
tools:
|
3
|
-
- Roast::Tools::ReadFile
|
4
|
-
- Roast::Tools::WriteFile
|
5
|
-
|
6
|
-
# Context management configuration
|
7
|
-
context_management:
|
8
|
-
enabled: true
|
9
|
-
strategy: auto
|
10
|
-
threshold: 0.8 # Trigger compaction at 80% of context window
|
11
|
-
max_tokens: 10000 # Demo with smaller limit for testing
|
12
|
-
retain_steps:
|
13
|
-
- analyze_requirements
|
14
|
-
- generate_summary
|
15
|
-
|
16
|
-
steps:
|
17
|
-
- analyze_requirements: |
|
18
|
-
Analyze this text and list the key requirements:
|
19
|
-
|
20
|
-
We need a system that can:
|
21
|
-
1. Process customer orders
|
22
|
-
2. Track inventory levels
|
23
|
-
3. Generate reports
|
24
|
-
4. Handle refunds
|
25
|
-
5. Integrate with payment systems
|
26
|
-
|
27
|
-
- expand_details: |
|
28
|
-
For each requirement from the previous step, provide detailed implementation notes,
|
29
|
-
technical considerations, and potential challenges. Be very thorough and verbose
|
30
|
-
to help test the context management system.
|
31
|
-
|
32
|
-
- generate_more_context: |
|
33
|
-
Now describe the database schema needed for this system. Include all tables,
|
34
|
-
relationships, indexes, and data types. Be extremely detailed.
|
35
|
-
|
36
|
-
- add_api_design: |
|
37
|
-
Design a complete REST API for this system. Include all endpoints, request/response
|
38
|
-
formats, authentication, and error handling. Provide examples for each endpoint.
|
39
|
-
|
40
|
-
- generate_summary: |
|
41
|
-
Create a concise executive summary of the system design. Focus on the key decisions
|
42
|
-
and trade-offs made during the design process.
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# Direct Coerce Syntax
|
2
|
-
|
3
|
-
This example demonstrates the simplified syntax for specifying `coerce_to` and other configuration options directly on iteration steps.
|
4
|
-
|
5
|
-
## Direct Syntax
|
6
|
-
|
7
|
-
Configuration options are specified directly on the step:
|
8
|
-
|
9
|
-
```yaml
|
10
|
-
- repeat:
|
11
|
-
until: "condition"
|
12
|
-
coerce_to: boolean
|
13
|
-
print_response: true
|
14
|
-
model: "claude-3-haiku"
|
15
|
-
steps: [...]
|
16
|
-
```
|
17
|
-
|
18
|
-
## Benefits
|
19
|
-
|
20
|
-
1. **Cleaner YAML** - No unnecessary nesting
|
21
|
-
2. **More intuitive** - Configuration options are at the same level as other step properties
|
22
|
-
3. **Consistent** - Matches how other step properties are specified
|
23
|
-
|
24
|
-
## Supported Options
|
25
|
-
|
26
|
-
All step configuration options can be specified directly:
|
27
|
-
- `coerce_to` - Type coercion (boolean, llm_boolean, iterable)
|
28
|
-
- `print_response` - Whether to print LLM responses
|
29
|
-
- `loop` - Auto-loop behavior
|
30
|
-
- `json` - JSON response mode
|
31
|
-
- `params` - Additional parameters
|
32
|
-
- `model` - Model override
|
Binary file
|
@@ -1,36 +0,0 @@
|
|
1
|
-
name: Direct Coerce Syntax Demo
|
2
|
-
description: Demonstrates the simplified coerce_to syntax without config blocks
|
3
|
-
|
4
|
-
steps:
|
5
|
-
# Example 1: Direct coerce_to on repeat
|
6
|
-
- repeat:
|
7
|
-
until: "check_api_ready"
|
8
|
-
coerce_to: boolean # Direct syntax - no config block needed
|
9
|
-
max_iterations: 5
|
10
|
-
steps:
|
11
|
-
- check_api_ready:
|
12
|
-
prompt: "Check if the API endpoint returns a 200 status"
|
13
|
-
- wait: 2
|
14
|
-
|
15
|
-
# Example 2: Direct coerce_to on each
|
16
|
-
- get_data_sources:
|
17
|
-
prompt: "List available data sources, one per line"
|
18
|
-
|
19
|
-
- each: "get_data_sources"
|
20
|
-
as: "source"
|
21
|
-
coerce_to: iterable # Direct syntax
|
22
|
-
steps:
|
23
|
-
- validate_source: "Validating {{source}}..."
|
24
|
-
- process_source:
|
25
|
-
prompt: "Process data from {{source}}"
|
26
|
-
|
27
|
-
# Example 3: Multiple configuration options
|
28
|
-
- repeat:
|
29
|
-
until: "all_tests_pass"
|
30
|
-
coerce_to: llm_boolean # Override default
|
31
|
-
print_response: true # Other options work too
|
32
|
-
max_iterations: 10
|
33
|
-
steps:
|
34
|
-
- run_tests: "$(rake test)"
|
35
|
-
- all_tests_pass:
|
36
|
-
prompt: "Did all tests pass successfully?"
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# Dot Notation Access Example
|
2
|
-
|
3
|
-
This example demonstrates the new dot notation access feature for workflow outputs.
|
4
|
-
|
5
|
-
## Usage
|
6
|
-
|
7
|
-
With the new dot notation feature, you can access output values using Ruby's method syntax instead of hash syntax:
|
8
|
-
|
9
|
-
### Before (hash syntax):
|
10
|
-
```yaml
|
11
|
-
until: "output[:update_fix_count][:fixes_applied] >= 5 || output[:select_next_issue][:no_issues_left] == true"
|
12
|
-
```
|
13
|
-
|
14
|
-
### After (dot notation):
|
15
|
-
```yaml
|
16
|
-
until: "output.update_fix_count.fixes_applied >= 5 || output.select_next_issue.no_issues_left?"
|
17
|
-
```
|
18
|
-
|
19
|
-
### Even cleaner (omitting output prefix):
|
20
|
-
```yaml
|
21
|
-
until: "update_fix_count.fixes_applied >= 5 || select_next_issue.no_issues_left?"
|
22
|
-
```
|
23
|
-
|
24
|
-
## Features
|
25
|
-
|
26
|
-
1. **Nested access**: `output.step_name.nested.value`
|
27
|
-
2. **Boolean predicates**: `output.step_name.is_complete?` returns false for nil/false values
|
28
|
-
3. **Direct access**: Omit the `output.` prefix for cleaner syntax
|
29
|
-
4. **Backward compatible**: Hash syntax still works (`output[:step_name][:value]`)
|
30
|
-
|
31
|
-
## Example Workflow
|
32
|
-
|
33
|
-
See `workflow.yml` for a complete example that demonstrates:
|
34
|
-
- Setting values in output
|
35
|
-
- Using dot notation in conditions
|
36
|
-
- Boolean predicate methods
|
37
|
-
- Nested value access
|
Binary file
|