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,24 +0,0 @@
|
|
1
|
-
description: Example combining both continue and context summary features
|
2
|
-
|
3
|
-
# This example shows how both parameters can work together for complex workflows
|
4
|
-
|
5
|
-
steps:
|
6
|
-
# Initial exploration
|
7
|
-
- explore_api
|
8
|
-
|
9
|
-
# First coding agent task
|
10
|
-
- ^implement_client
|
11
|
-
|
12
|
-
# Continue with context awareness
|
13
|
-
- ^add_error_handling
|
14
|
-
|
15
|
-
# Final implementation with full context
|
16
|
-
- ^create_integration_tests
|
17
|
-
|
18
|
-
add_error_handling:
|
19
|
-
continue: true # Continue working on the same client
|
20
|
-
include_context_summary: true # Include context about what was explored and built
|
21
|
-
|
22
|
-
create_integration_tests:
|
23
|
-
continue: true # Continue in the same session
|
24
|
-
include_context_summary: true # Full context of implementation
|
@@ -1,20 +0,0 @@
|
|
1
|
-
description: Example workflow using inline agent prompts with continuation
|
2
|
-
|
3
|
-
# This example demonstrates using inline agent prompts (direct text after ^)
|
4
|
-
# combined with the new parameters
|
5
|
-
|
6
|
-
steps:
|
7
|
-
# Start with a fresh context
|
8
|
-
- ^Create a simple Ruby class for managing a todo list with add, remove, and list methods
|
9
|
-
|
10
|
-
# Continue from previous session to add more features
|
11
|
-
- ^continue_adding_features
|
12
|
-
|
13
|
-
# Use context summary to understand what was built
|
14
|
-
- ^document_with_context
|
15
|
-
|
16
|
-
continue_adding_features:
|
17
|
-
continue: true # This continues from the previous agent session
|
18
|
-
|
19
|
-
document_with_context:
|
20
|
-
include_context_summary: true # This will include context about previous steps
|
@@ -1,27 +0,0 @@
|
|
1
|
-
description: Example workflow demonstrating agent continuation and context summary features
|
2
|
-
|
3
|
-
# This example shows how to use the new coding agent parameters:
|
4
|
-
# - continue: true - continues from previous agent session
|
5
|
-
# - include_context_summary: true - includes workflow context in the prompt
|
6
|
-
|
7
|
-
target: "**/*.rb"
|
8
|
-
|
9
|
-
steps:
|
10
|
-
# First agent step - starts fresh
|
11
|
-
- ^analyze_codebase
|
12
|
-
|
13
|
-
# Second agent step - continues from previous session
|
14
|
-
- ^refactor_code
|
15
|
-
|
16
|
-
# Third agent step - includes context summary from previous steps
|
17
|
-
- ^add_documentation
|
18
|
-
|
19
|
-
# Final verification step
|
20
|
-
- verify_changes
|
21
|
-
|
22
|
-
# Step configurations
|
23
|
-
refactor_code:
|
24
|
-
continue: true # Continue from the previous agent session
|
25
|
-
|
26
|
-
add_documentation:
|
27
|
-
include_context_summary: true # Include workflow context in the prompt
|
@@ -1,75 +0,0 @@
|
|
1
|
-
# Agent Workflow Example
|
2
|
-
|
3
|
-
This example demonstrates the practical differences between regular steps and agent steps in Roast workflows.
|
4
|
-
|
5
|
-
## What are Agent Steps?
|
6
|
-
|
7
|
-
Agent steps are a special type of step that sends prompts directly to the CodingAgent tool (e.g., Claude Code) without going through the normal LLM translation layer. They're denoted by prefixing the step name with `^`.
|
8
|
-
|
9
|
-
## When to Use Each Type
|
10
|
-
|
11
|
-
### Regular Steps
|
12
|
-
Best for tasks that benefit from LLM interpretation:
|
13
|
-
- Analysis and judgment tasks
|
14
|
-
- Natural language understanding
|
15
|
-
- Flexible responses based on context
|
16
|
-
- Summary and explanation generation
|
17
|
-
|
18
|
-
### Agent Steps
|
19
|
-
Best for tasks requiring precise tool control:
|
20
|
-
- Exact code refactoring operations
|
21
|
-
- Multi-file coordinated changes
|
22
|
-
- Specific tool usage requirements
|
23
|
-
- Performance-critical operations
|
24
|
-
|
25
|
-
## Workflow Structure
|
26
|
-
|
27
|
-
This example demonstrates a code refactoring workflow:
|
28
|
-
|
29
|
-
1. **identify_code_smells** (Regular Step)
|
30
|
-
- Analyzes code to identify issues
|
31
|
-
- Uses LLM judgment to prioritize problems
|
32
|
-
- Provides contextual explanations
|
33
|
-
|
34
|
-
2. **^apply_refactorings** (Agent Step)
|
35
|
-
- Executes precise refactoring operations
|
36
|
-
- Uses specific tools (Read, MultiEdit) directly
|
37
|
-
- Follows exact formatting requirements
|
38
|
-
- No interpretation needed - just execution
|
39
|
-
|
40
|
-
3. **summarize_improvements** (Regular Step)
|
41
|
-
- Reviews all changes made
|
42
|
-
- Generates human-friendly summary
|
43
|
-
- Provides recommendations
|
44
|
-
|
45
|
-
## Running the Workflow
|
46
|
-
|
47
|
-
```bash
|
48
|
-
# Run on all Ruby files in current directory
|
49
|
-
roast execute examples/agent_workflow/workflow.yml
|
50
|
-
|
51
|
-
# Run on specific files
|
52
|
-
roast execute examples/agent_workflow/workflow.yml app/models/*.rb
|
53
|
-
```
|
54
|
-
|
55
|
-
## Key Differences in Practice
|
56
|
-
|
57
|
-
### Regular Step Example
|
58
|
-
The `identify_code_smells` step benefits from LLM interpretation because:
|
59
|
-
- It needs to understand "code smells" in context
|
60
|
-
- It makes subjective judgments about code quality
|
61
|
-
- It prioritizes issues based on impact
|
62
|
-
|
63
|
-
### Agent Step Example
|
64
|
-
The `^apply_refactorings` step works better as an agent step because:
|
65
|
-
- It requires specific tool usage (MultiEdit, not Write)
|
66
|
-
- It needs exact preservation of formatting
|
67
|
-
- It follows precise refactoring patterns
|
68
|
-
- No interpretation is needed - just execution
|
69
|
-
|
70
|
-
## Benefits Demonstrated
|
71
|
-
|
72
|
-
1. **Complementary Strengths**: Regular steps handle analysis and planning, agent steps handle precise execution
|
73
|
-
2. **Better Performance**: Agent steps skip the LLM layer for well-defined tasks
|
74
|
-
3. **Predictable Results**: Agent steps execute exactly as specified
|
75
|
-
4. **Tool Control**: Agent steps can enforce specific tool usage patterns
|
@@ -1,22 +0,0 @@
|
|
1
|
-
Based on the code smells identified in the previous step, apply the following refactorings:
|
2
|
-
|
3
|
-
For each file that needs changes:
|
4
|
-
|
5
|
-
1. Use the Read tool to examine the current implementation
|
6
|
-
2. Use MultiEdit to apply all refactorings in a single operation per file
|
7
|
-
3. Ensure all changes maintain exact formatting and indentation
|
8
|
-
4. Focus on these specific refactorings:
|
9
|
-
- Extract long methods (>15 lines) into smaller, focused methods
|
10
|
-
- Replace magic numbers with named constants
|
11
|
-
- Rename variables/methods that don't clearly express intent
|
12
|
-
- Extract duplicate code into shared methods
|
13
|
-
- Add proper error handling where missing
|
14
|
-
|
15
|
-
Important constraints:
|
16
|
-
- DO NOT change the public API of any class
|
17
|
-
- DO NOT modify test files
|
18
|
-
- DO NOT add comments unless replacing unclear code
|
19
|
-
- Preserve all existing functionality
|
20
|
-
- Use Ruby idioms and conventions
|
21
|
-
|
22
|
-
After each file modification, verify the changes maintain the original behavior.
|
@@ -1,15 +0,0 @@
|
|
1
|
-
Analyze the provided Ruby code and identify potential code smells or areas for improvement. Consider:
|
2
|
-
|
3
|
-
1. Method complexity and length
|
4
|
-
2. Duplicated code patterns
|
5
|
-
3. Poor naming conventions
|
6
|
-
4. Tight coupling between classes
|
7
|
-
5. Missing abstractions or violated SOLID principles
|
8
|
-
6. Performance anti-patterns
|
9
|
-
|
10
|
-
For each issue found, explain:
|
11
|
-
- What the problem is
|
12
|
-
- Why it's problematic
|
13
|
-
- A general approach to fix it
|
14
|
-
|
15
|
-
Focus on the most impactful improvements that would enhance code maintainability and readability.
|
@@ -1,18 +0,0 @@
|
|
1
|
-
Review the refactorings that were applied and provide a comprehensive summary that includes:
|
2
|
-
|
3
|
-
1. **Overview of Changes**
|
4
|
-
- Number of files modified
|
5
|
-
- Types of refactorings applied
|
6
|
-
- Overall impact on code quality
|
7
|
-
|
8
|
-
2. **Key Improvements**
|
9
|
-
- Most significant refactorings and their benefits
|
10
|
-
- Complexity reductions achieved
|
11
|
-
- Readability enhancements
|
12
|
-
|
13
|
-
3. **Recommendations for Future**
|
14
|
-
- Any remaining code smells that require larger architectural changes
|
15
|
-
- Suggested next steps for continued improvement
|
16
|
-
- Areas that would benefit from additional test coverage
|
17
|
-
|
18
|
-
Format the summary in a way that would be useful for a code review or team discussion.
|
Binary file
|
@@ -1,16 +0,0 @@
|
|
1
|
-
description: Example workflow demonstrating agent steps
|
2
|
-
|
3
|
-
# Agent steps send prompts directly to CodingAgent (e.g., Claude Code)
|
4
|
-
# without the intermediate LLM translation layer
|
5
|
-
|
6
|
-
target: "**/*.rb"
|
7
|
-
|
8
|
-
steps:
|
9
|
-
# Regular step - goes through LLM first for analysis and judgment
|
10
|
-
- identify_code_smells
|
11
|
-
|
12
|
-
# Agent step - direct to CodingAgent for precise refactoring
|
13
|
-
- ^apply_refactorings
|
14
|
-
|
15
|
-
# Regular step - verify changes and provide summary
|
16
|
-
- summarize_improvements
|
@@ -1,85 +0,0 @@
|
|
1
|
-
# API Workflow Example
|
2
|
-
|
3
|
-
This example demonstrates a targetless workflow that interacts with APIs rather than operating on specific files.
|
4
|
-
|
5
|
-
## Structure
|
6
|
-
|
7
|
-
The workflow consists of three steps that work together to create a complete API integration process:
|
8
|
-
|
9
|
-
1. `fetch_api_data` - Simulates fetching data from a weather API and returns a structured JSON response
|
10
|
-
2. `transform_data` - Processes the JSON data into a human-readable markdown format
|
11
|
-
3. `generate_report` - Creates a polished report with recommendations based on the weather data
|
12
|
-
|
13
|
-
## Running the Example
|
14
|
-
|
15
|
-
To run this example, you need to have a valid API token. The example is configured to fetch a token using a shell command:
|
16
|
-
|
17
|
-
```yaml
|
18
|
-
# Dynamic API token using shell command
|
19
|
-
api_token: $(print-token --key)
|
20
|
-
```
|
21
|
-
|
22
|
-
You can modify this to use your own token source, such as:
|
23
|
-
|
24
|
-
```yaml
|
25
|
-
# Using an environment variable
|
26
|
-
api_token: $(echo $OPENAI_API_KEY)
|
27
|
-
|
28
|
-
# Or a direct value (not recommended for production)
|
29
|
-
api_token: $(echo "sk-your-actual-token")
|
30
|
-
```
|
31
|
-
|
32
|
-
Then run the workflow:
|
33
|
-
|
34
|
-
```bash
|
35
|
-
# Run the targetless workflow
|
36
|
-
roast execute examples/api_workflow/workflow.yml
|
37
|
-
|
38
|
-
# Save the output to a file
|
39
|
-
roast execute examples/api_workflow/workflow.yml -o weather_report.md
|
40
|
-
```
|
41
|
-
|
42
|
-
## How Targetless Workflows Work
|
43
|
-
|
44
|
-
Targetless workflows operate without a specific target file. This is useful for:
|
45
|
-
|
46
|
-
- API integrations
|
47
|
-
- Content generation
|
48
|
-
- Data analysis
|
49
|
-
- Report creation
|
50
|
-
- Interactive tools
|
51
|
-
|
52
|
-
Unlike file-based workflows that process each target separately, targetless workflows run once and can retrieve their own data sources (like API calls) or generate content from scratch.
|
53
|
-
|
54
|
-
## Workflow Definition
|
55
|
-
|
56
|
-
```yaml
|
57
|
-
name: API Integration Workflow
|
58
|
-
# Default model for all steps
|
59
|
-
model: gpt-4o-mini
|
60
|
-
|
61
|
-
tools:
|
62
|
-
- Roast::Tools::ReadFile
|
63
|
-
- Roast::Tools::Grep
|
64
|
-
- Roast::Tools::WriteFile
|
65
|
-
|
66
|
-
steps:
|
67
|
-
- fetch_api_data
|
68
|
-
- transform_data
|
69
|
-
- generate_report
|
70
|
-
|
71
|
-
# Tool configurations for API calls (no need to specify model here since it uses global model)
|
72
|
-
fetch_api_data:
|
73
|
-
print_response: true
|
74
|
-
```
|
75
|
-
|
76
|
-
## Creating Your Own Targetless Workflows
|
77
|
-
|
78
|
-
To create your own targetless workflow:
|
79
|
-
|
80
|
-
1. Create a workflow YAML file without a `target` parameter
|
81
|
-
2. Define the steps your workflow will execute
|
82
|
-
3. Create prompt files for each step
|
83
|
-
4. Run the workflow with `roast execute your_workflow.yml`
|
84
|
-
|
85
|
-
Your steps can use the workflow's `output` hash to pass data between them, just like in file-based workflows.
|
@@ -1,10 +0,0 @@
|
|
1
|
-
You are an assistant helping with retrieving data from an API source.
|
2
|
-
|
3
|
-
Your task is to simulate fetching data from a weather API using mock data.
|
4
|
-
|
5
|
-
1. Imagine you are retrieving current weather conditions for various cities
|
6
|
-
2. Create a structured JSON response that represents typical weather API data
|
7
|
-
3. The response should include temperature, conditions, wind, and other relevant weather metrics
|
8
|
-
4. Format the response as valid JSON that could be parsed programmatically
|
9
|
-
|
10
|
-
Return only the JSON data without any additional explanation.
|
@@ -1,10 +0,0 @@
|
|
1
|
-
You are an assistant helping to generate a final weather report.
|
2
|
-
|
3
|
-
Based on the transformed data from the previous step, create a polished report that could be sent to stakeholders.
|
4
|
-
|
5
|
-
1. Take the transformed weather data and enhance it with recommendations and insights
|
6
|
-
2. Add relevant suggestions based on the weather conditions (like what to wear, activities that would be appropriate, etc.)
|
7
|
-
3. Include a "forecast overview" section that summarizes the key points
|
8
|
-
4. Format the output as a professional-looking report with proper headings and structure
|
9
|
-
|
10
|
-
The report should be comprehensive yet concise, easy to scan, and provide actionable insights based on the weather data.
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# API Integration Workflow
|
2
|
-
|
3
|
-
This workflow demonstrates how to create an API integration that:
|
4
|
-
1. Fetches data from an external source
|
5
|
-
2. Transforms the data into a usable format
|
6
|
-
3. Generates a report based on the processed data
|
7
|
-
|
8
|
-
The workflow doesn't require a target file because it's designed to work with external APIs and data sources rather than processing specific files.
|
9
|
-
|
10
|
-
You'll be working through a weather data processing example. This is a simulation to demonstrate the workflow pattern - no actual API calls are made.
|
@@ -1,10 +0,0 @@
|
|
1
|
-
You are an assistant helping to transform API data.
|
2
|
-
|
3
|
-
Your task is to process weather data from a JSON format into a more readable summary.
|
4
|
-
|
5
|
-
1. Review the weather data provided in the previous step
|
6
|
-
2. Transform the technical JSON data into a human-readable summary
|
7
|
-
3. Format the output as markdown with appropriate sections and highlights
|
8
|
-
4. Focus on the most relevant information that would be useful to a typical user
|
9
|
-
|
10
|
-
Return a well-formatted markdown summary of the weather data.
|
Binary file
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# API Integration Workflow
|
2
|
-
|
3
|
-
# This workflow demonstrates how to create an API integration that:
|
4
|
-
# 1. Fetches data from an external source
|
5
|
-
# 2. Transforms the data into a usable format
|
6
|
-
# 3. Generates a report based on the processed data
|
7
|
-
|
8
|
-
# The workflow doesn't require a target file because it's designed to work with external APIs and data sources rather than processing specific files.
|
9
|
-
|
10
|
-
# You'll be working through a weather data processing example. This is a simulation to demonstrate the workflow pattern - no actual API calls are made.
|
11
|
-
|
12
|
-
name: API Integration Workflow
|
13
|
-
model: gpt-4o-mini
|
14
|
-
|
15
|
-
tools:
|
16
|
-
- Roast::Tools::ReadFile
|
17
|
-
- Roast::Tools::Grep
|
18
|
-
- Roast::Tools::WriteFile
|
19
|
-
|
20
|
-
# For demonstration purposes only - in production you would use a real token command
|
21
|
-
# api_token: $(echo "demo_token_123456")
|
22
|
-
|
23
|
-
steps:
|
24
|
-
- fetch_api_data
|
25
|
-
- transform_data
|
26
|
-
- generate_report
|
27
|
-
|
28
|
-
# Tool configurations for API calls
|
29
|
-
fetch_api_data:
|
30
|
-
print_response: true
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# Apply Diff Demo
|
2
|
-
|
3
|
-
This example demonstrates the `apply_diff` tool, which shows users a colored diff of proposed changes and applies them only after user confirmation.
|
4
|
-
|
5
|
-
## What this workflow does
|
6
|
-
|
7
|
-
1. **Creates a sample file** - Generates `hello.txt` with simple text content
|
8
|
-
2. **Applies a simple change** - Uses `apply_diff` to modify the greeting and ask for user confirmation
|
9
|
-
|
10
|
-
## Key features demonstrated
|
11
|
-
|
12
|
-
- **Interactive approval** - The `apply_diff` tool shows a clear, colored diff and waits for user confirmation
|
13
|
-
- **Safe modifications** - Changes are only applied when the user explicitly approves them
|
14
|
-
- **Colored visualization** - Diff format shows exactly what will be changed with:
|
15
|
-
- **Red** lines starting with `-` for removed content
|
16
|
-
- **Green** lines starting with `+` for added content
|
17
|
-
- **Cyan** line numbers and context (`@@` lines)
|
18
|
-
- **Bold** diff headers
|
19
|
-
- **Optional descriptions** - You can provide context about why a change is being made
|
20
|
-
|
21
|
-
## Running the workflow
|
22
|
-
|
23
|
-
```bash
|
24
|
-
bin/roast examples/apply_diff_demo/workflow.yml
|
25
|
-
```
|
26
|
-
|
27
|
-
## Expected interaction
|
28
|
-
|
29
|
-
When you run this workflow, you'll see:
|
30
|
-
|
31
|
-
1. The workflow creates a simple `hello.txt` file
|
32
|
-
2. It proposes changing "Hello World!" to "Hello, Apply Diff Demo!"
|
33
|
-
3. It shows you a colored diff of the proposed change:
|
34
|
-
```
|
35
|
-
📝 Proposed change for hello.txt:
|
36
|
-
Description: Update greeting to be more specific to the demo
|
37
|
-
|
38
|
-
diff --git a/hello.txt b/hello.txt
|
39
|
-
index 1234567..abcdefg 100644
|
40
|
-
--- a/hello.txt
|
41
|
-
+++ b/hello.txt
|
42
|
-
@@ -1,3 +1,3 @@
|
43
|
-
-Hello World!
|
44
|
-
+Hello, Apply Diff Demo!
|
45
|
-
This is a demo file.
|
46
|
-
We will modify this file in the next step.
|
47
|
-
```
|
48
|
-
4. It asks for your confirmation: `Apply this change? (y/n)`
|
49
|
-
5. If you say "y", it applies the change; if "n", it cancels
|
50
|
-
6. Finally, it reads the file again to show the result
|
51
|
-
|
52
|
-
## Tools used
|
53
|
-
|
54
|
-
- `Roast::Tools::WriteFile` - Creates the initial sample file
|
55
|
-
- `Roast::Tools::ReadFile` - Reads files to show results
|
56
|
-
- `Roast::Tools::ApplyDiff` - Shows colored diffs and applies changes with user confirmation
|
57
|
-
|
58
|
-
This pattern is useful for any workflow where you want to make targeted changes to files but give users control over what actually gets applied.
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# Apply Simple Change
|
2
|
-
|
3
|
-
Now use the apply_diff function to modify the `hello.txt` file. Let's change the greeting from "Hello World!" to "Hello, Apply Diff Demo!".
|
4
|
-
|
5
|
-
Use the apply_diff function with:
|
6
|
-
- `file_path`: "hello.txt"
|
7
|
-
- `old_content`: "Hello World!"
|
8
|
-
- `new_content`: "Hello, Apply Diff Demo!"
|
9
|
-
- `description`: "Update greeting to be more specific to the demo"
|
10
|
-
|
11
|
-
This will show the user a colored diff of the proposed change and ask for their confirmation before applying it.
|
12
|
-
|
13
|
-
After the change is applied (or declined), read the file again to show the final result.
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# Apply Diff Demo
|
2
|
-
#
|
3
|
-
# This workflow demonstrates the apply_diff tool which shows users a diff
|
4
|
-
# and applies changes based on their confirmation. It's useful for making
|
5
|
-
# targeted changes to files with user approval.
|
6
|
-
|
7
|
-
name: Apply Diff Demo
|
8
|
-
model: gpt-4o-mini
|
9
|
-
|
10
|
-
tools:
|
11
|
-
- Roast::Tools::WriteFile
|
12
|
-
- Roast::Tools::ReadFile
|
13
|
-
- Roast::Tools::ApplyDiff
|
14
|
-
|
15
|
-
steps:
|
16
|
-
- create_sample_file
|
17
|
-
- apply_simple_change
|
18
|
-
|
19
|
-
# Step configurations
|
20
|
-
create_sample_file:
|
21
|
-
print_response: false
|
22
|
-
|
23
|
-
apply_simple_change:
|
24
|
-
print_response: true
|
Binary file
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# Bash Tool Examples
|
2
|
-
|
3
|
-
This directory contains example workflows demonstrating the Bash tool, which provides unrestricted command execution for prototyping scenarios.
|
4
|
-
|
5
|
-
## ⚠️ Security Warning
|
6
|
-
|
7
|
-
The Bash tool executes commands without any restrictions. Only use it in:
|
8
|
-
- Development environments
|
9
|
-
- Trusted contexts
|
10
|
-
- Prototyping scenarios where you explicitly want unrestricted access
|
11
|
-
|
12
|
-
**Never use the Bash tool in production workflows or with untrusted input!**
|
13
|
-
|
14
|
-
## Examples
|
15
|
-
|
16
|
-
### 1. System Analysis Workflow (`system_analysis.yml`)
|
17
|
-
|
18
|
-
Demonstrates using Bash for system inspection and analysis tasks that would be restricted by the Cmd tool.
|
19
|
-
|
20
|
-
### 2. API Testing Workflow (`api_testing.yml`)
|
21
|
-
|
22
|
-
Shows how to use Bash for making API calls with curl and processing responses with jq.
|
23
|
-
|
24
|
-
### 3. DevOps Automation (`devops_workflow.yml`)
|
25
|
-
|
26
|
-
Example of using Bash for DevOps tasks like container management and log analysis.
|
27
|
-
|
28
|
-
## Disabling Warnings
|
29
|
-
|
30
|
-
By default, the Bash tool logs warnings about unrestricted execution. To disable these warnings:
|
31
|
-
|
32
|
-
```bash
|
33
|
-
export ROAST_BASH_WARNINGS=false
|
34
|
-
roast execute workflow.yml
|
35
|
-
```
|
36
|
-
|
37
|
-
## Best Practices
|
38
|
-
|
39
|
-
1. **Use Cmd tool when possible**: If your commands fit within Cmd's allowed list, use it instead
|
40
|
-
2. **Validate inputs**: Always validate any user input before passing to Bash
|
41
|
-
3. **Limit scope**: Use the most restrictive tool that meets your needs
|
42
|
-
4. **Document risks**: Clearly document when and why Bash tool is necessary
|
43
|
-
5. **Environment isolation**: Run Bash workflows in isolated environments when possible
|
44
|
-
|
45
|
-
## Comparison with Cmd Tool
|
46
|
-
|
47
|
-
| Feature | Cmd Tool | Bash Tool |
|
48
|
-
|---------|----------|-----------|
|
49
|
-
| Command restrictions | Yes (configurable) | No |
|
50
|
-
| Default allowed commands | pwd, find, ls, rake, ruby, dev, mkdir | All commands |
|
51
|
-
| Security warnings | No | Yes (can be disabled) |
|
52
|
-
| Recommended for production | Yes | No |
|
53
|
-
| Use case | General automation | Prototyping & development |
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# Analyze Network Configuration
|
2
|
-
|
3
|
-
Use the bash tool to gather network information:
|
4
|
-
|
5
|
-
1. Check network interfaces (ifconfig or ip addr)
|
6
|
-
2. Display routing table (netstat -nr or ip route)
|
7
|
-
3. Check listening ports (netstat -an | grep LISTEN or lsof -i -P | grep LISTEN)
|
8
|
-
4. Test DNS resolution (nslookup example.com or dig example.com)
|
9
|
-
5. Check current network connections
|
10
|
-
|
11
|
-
Provide a summary of the network configuration and any interesting findings.
|
12
|
-
|
13
|
-
Note: Some commands may require different syntax on macOS vs Linux.
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# Analyze System Information
|
2
|
-
|
3
|
-
Use the bash tool to gather system information including:
|
4
|
-
|
5
|
-
1. Operating system details (uname -a)
|
6
|
-
2. Current disk usage (df -h)
|
7
|
-
3. Memory information (if available via free -m on Linux or vm_stat on macOS)
|
8
|
-
4. Current user and groups (whoami, groups)
|
9
|
-
5. Environment variables (env | grep -E "PATH|HOME|USER")
|
10
|
-
|
11
|
-
Gather this information and provide a summary of the system's current state.
|
Binary file
|