roast-ai 0.3.1 → 0.4.1

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 (216) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +2 -2
  3. data/.gitignore +1 -0
  4. data/CHANGELOG.md +85 -0
  5. data/CLAUDE.md +106 -9
  6. data/Gemfile +4 -1
  7. data/Gemfile.lock +70 -16
  8. data/README.md +159 -8
  9. data/bin/console +1 -0
  10. data/bin/roast +1 -1
  11. data/claude-swarm.yml +210 -0
  12. data/docs/AGENT_STEPS.md +288 -0
  13. data/docs/VALIDATION.md +178 -0
  14. data/examples/agent_continue/add_documentation/prompt.md +5 -0
  15. data/examples/agent_continue/add_error_handling/prompt.md +5 -0
  16. data/examples/agent_continue/analyze_codebase/prompt.md +7 -0
  17. data/examples/agent_continue/combined_workflow.yml +24 -0
  18. data/examples/agent_continue/continue_adding_features/prompt.md +4 -0
  19. data/examples/agent_continue/create_integration_tests/prompt.md +3 -0
  20. data/examples/agent_continue/document_with_context/prompt.md +5 -0
  21. data/examples/agent_continue/explore_api/prompt.md +6 -0
  22. data/examples/agent_continue/implement_client/prompt.md +6 -0
  23. data/examples/agent_continue/inline_workflow.yml +20 -0
  24. data/examples/agent_continue/refactor_code/prompt.md +2 -0
  25. data/examples/agent_continue/verify_changes/prompt.md +6 -0
  26. data/examples/agent_continue/workflow.yml +27 -0
  27. data/examples/agent_workflow/README.md +75 -0
  28. data/examples/agent_workflow/apply_refactorings/prompt.md +22 -0
  29. data/examples/agent_workflow/identify_code_smells/prompt.md +15 -0
  30. data/examples/agent_workflow/summarize_improvements/prompt.md +18 -0
  31. data/examples/agent_workflow/workflow.png +0 -0
  32. data/examples/agent_workflow/workflow.yml +16 -0
  33. data/examples/api_workflow/workflow.png +0 -0
  34. data/examples/apply_diff_demo/README.md +58 -0
  35. data/examples/apply_diff_demo/apply_simple_change/prompt.md +13 -0
  36. data/examples/apply_diff_demo/create_sample_file/prompt.md +11 -0
  37. data/examples/apply_diff_demo/workflow.yml +24 -0
  38. data/examples/available_tools_demo/README.md +42 -0
  39. data/examples/available_tools_demo/analyze_files/prompt.md +6 -0
  40. data/examples/available_tools_demo/explore_directory/prompt.md +6 -0
  41. data/examples/available_tools_demo/workflow.png +0 -0
  42. data/examples/available_tools_demo/workflow.yml +32 -0
  43. data/examples/available_tools_demo/write_summary/prompt.md +6 -0
  44. data/examples/bash_prototyping/api_testing.png +0 -0
  45. data/examples/bash_prototyping/system_analysis.png +0 -0
  46. data/examples/case_when/detect_language/prompt.md +2 -2
  47. data/examples/case_when/workflow.png +0 -0
  48. data/examples/cmd/basic_workflow.png +0 -0
  49. data/examples/cmd/dev_workflow.png +0 -0
  50. data/examples/cmd/explorer_workflow.png +0 -0
  51. data/examples/conditional/simple_workflow.png +0 -0
  52. data/examples/conditional/workflow.png +0 -0
  53. data/examples/context_management_demo/README.md +43 -0
  54. data/examples/context_management_demo/workflow.yml +42 -0
  55. data/examples/direct_coerce_syntax/workflow.png +0 -0
  56. data/examples/dot_notation/workflow.png +0 -0
  57. data/examples/exit_on_error/workflow.png +0 -0
  58. data/examples/grading/run_coverage.rb +0 -2
  59. data/examples/grading/workflow.png +0 -0
  60. data/examples/interpolation/workflow.png +0 -0
  61. data/examples/interpolation/workflow.yml +1 -1
  62. data/examples/iteration/analyze_complexity/prompt.md +2 -2
  63. data/examples/iteration/generate_recommendations/prompt.md +2 -2
  64. data/examples/iteration/implement_fix/prompt.md +2 -2
  65. data/examples/iteration/prioritize_issues/prompt.md +1 -1
  66. data/examples/iteration/prompts/analyze_file.md +2 -2
  67. data/examples/iteration/prompts/generate_summary.md +1 -1
  68. data/examples/iteration/prompts/update_report.md +3 -3
  69. data/examples/iteration/prompts/write_report.md +3 -3
  70. data/examples/iteration/read_file/prompt.md +2 -2
  71. data/examples/iteration/select_next_issue/prompt.md +2 -2
  72. data/examples/iteration/update_fix_count/prompt.md +4 -4
  73. data/examples/iteration/verify_fix/prompt.md +3 -3
  74. data/examples/iteration/workflow.png +0 -0
  75. data/examples/json_handling/workflow.png +0 -0
  76. data/examples/mcp/README.md +3 -3
  77. data/examples/mcp/analyze_changes/prompt.md +1 -1
  78. data/examples/mcp/database_workflow.png +0 -0
  79. data/examples/mcp/database_workflow.yml +1 -1
  80. data/examples/mcp/env_demo/workflow.png +0 -0
  81. data/examples/mcp/fetch_pr_context/prompt.md +1 -1
  82. data/examples/mcp/filesystem_demo/workflow.png +0 -0
  83. data/examples/mcp/github_workflow.png +0 -0
  84. data/examples/mcp/github_workflow.yml +1 -1
  85. data/examples/mcp/multi_mcp_workflow.png +0 -0
  86. data/examples/mcp/post_review/prompt.md +1 -1
  87. data/examples/mcp/workflow.png +0 -0
  88. data/examples/no_model_fallback/README.md +17 -0
  89. data/examples/no_model_fallback/analyze_file/prompt.md +1 -0
  90. data/examples/no_model_fallback/analyze_patterns/prompt.md +27 -0
  91. data/examples/no_model_fallback/generate_report_for_md/prompt.md +10 -0
  92. data/examples/no_model_fallback/generate_report_for_rb/prompt.md +3 -0
  93. data/examples/no_model_fallback/sample.rb +42 -0
  94. data/examples/no_model_fallback/workflow.yml +19 -0
  95. data/examples/openrouter_example/workflow.png +0 -0
  96. data/examples/pre_post_processing/analyze_test_file/prompt.md +1 -1
  97. data/examples/pre_post_processing/improve_test_coverage/prompt.md +1 -1
  98. data/examples/pre_post_processing/optimize_test_performance/prompt.md +1 -1
  99. data/examples/pre_post_processing/post_processing/aggregate_metrics/prompt.md +2 -2
  100. data/examples/pre_post_processing/post_processing/generate_summary_report/prompt.md +1 -1
  101. data/examples/pre_post_processing/pre_processing/setup_test_environment/prompt.md +1 -1
  102. data/examples/pre_post_processing/validate_changes/prompt.md +2 -2
  103. data/examples/pre_post_processing/workflow.png +0 -0
  104. data/examples/rspec_to_minitest/workflow.png +0 -0
  105. data/examples/shared_config/example_with_shared_config/workflow.png +0 -0
  106. data/examples/shared_config/shared.png +0 -0
  107. data/examples/single_target_prepost/workflow.png +0 -0
  108. data/examples/smart_coercion_defaults/workflow.png +0 -0
  109. data/examples/step_configuration/workflow.png +0 -0
  110. data/examples/swarm_example.yml +25 -0
  111. data/examples/tool_config_example/workflow.png +0 -0
  112. data/examples/user_input/README.md +90 -0
  113. data/examples/user_input/funny_name/create_backstory/prompt.md +10 -0
  114. data/examples/user_input/funny_name/workflow.png +0 -0
  115. data/examples/user_input/funny_name/workflow.yml +26 -0
  116. data/examples/user_input/generate_summary/prompt.md +11 -0
  117. data/examples/user_input/simple_input_demo/workflow.png +0 -0
  118. data/examples/user_input/simple_input_demo/workflow.yml +35 -0
  119. data/examples/user_input/survey_workflow.png +0 -0
  120. data/examples/user_input/survey_workflow.yml +71 -0
  121. data/examples/user_input/welcome_message/prompt.md +3 -0
  122. data/examples/user_input/workflow.png +0 -0
  123. data/examples/user_input/workflow.yml +73 -0
  124. data/examples/workflow_generator/create_workflow_files/prompt.md +1 -1
  125. data/examples/workflow_generator/workflow.png +0 -0
  126. data/lib/roast/errors.rb +6 -4
  127. data/lib/roast/helpers/function_caching_interceptor.rb +0 -2
  128. data/lib/roast/helpers/logger.rb +12 -35
  129. data/lib/roast/helpers/minitest_coverage_runner.rb +0 -1
  130. data/lib/roast/helpers/prompt_loader.rb +0 -2
  131. data/lib/roast/helpers/timeout_handler.rb +91 -0
  132. data/lib/roast/resources/api_resource.rb +0 -4
  133. data/lib/roast/resources/url_resource.rb +0 -3
  134. data/lib/roast/resources.rb +0 -8
  135. data/lib/roast/services/context_threshold_checker.rb +42 -0
  136. data/lib/roast/services/token_counting_service.rb +44 -0
  137. data/lib/roast/tools/apply_diff.rb +128 -0
  138. data/lib/roast/tools/ask_user.rb +0 -2
  139. data/lib/roast/tools/bash.rb +12 -9
  140. data/lib/roast/tools/cmd.rb +29 -12
  141. data/lib/roast/tools/coding_agent.rb +65 -17
  142. data/lib/roast/tools/context_summarizer.rb +108 -0
  143. data/lib/roast/tools/grep.rb +0 -3
  144. data/lib/roast/tools/helpers/coding_agent_message_formatter.rb +1 -4
  145. data/lib/roast/tools/read_file.rb +0 -2
  146. data/lib/roast/tools/search_file.rb +0 -2
  147. data/lib/roast/tools/swarm.rb +124 -0
  148. data/lib/roast/tools/update_files.rb +0 -4
  149. data/lib/roast/tools/write_file.rb +0 -3
  150. data/lib/roast/tools.rb +0 -13
  151. data/lib/roast/value_objects/step_name.rb +14 -3
  152. data/lib/roast/value_objects/workflow_path.rb +0 -2
  153. data/lib/roast/value_objects.rb +4 -4
  154. data/lib/roast/version.rb +1 -1
  155. data/lib/roast/workflow/agent_step.rb +33 -0
  156. data/lib/roast/workflow/api_configuration.rb +0 -4
  157. data/lib/roast/workflow/base_iteration_step.rb +3 -6
  158. data/lib/roast/workflow/base_step.rb +54 -28
  159. data/lib/roast/workflow/base_workflow.rb +43 -23
  160. data/lib/roast/workflow/case_executor.rb +0 -1
  161. data/lib/roast/workflow/case_step.rb +0 -4
  162. data/lib/roast/workflow/command_executor.rb +0 -2
  163. data/lib/roast/workflow/conditional_executor.rb +0 -1
  164. data/lib/roast/workflow/conditional_step.rb +0 -4
  165. data/lib/roast/workflow/configuration.rb +5 -67
  166. data/lib/roast/workflow/configuration_loader.rb +63 -3
  167. data/lib/roast/workflow/configuration_parser.rb +1 -7
  168. data/lib/roast/workflow/context_manager.rb +89 -0
  169. data/lib/roast/workflow/dot_access_hash.rb +16 -1
  170. data/lib/roast/workflow/each_step.rb +1 -1
  171. data/lib/roast/workflow/error_handler.rb +0 -3
  172. data/lib/roast/workflow/expression_evaluator.rb +0 -3
  173. data/lib/roast/workflow/file_state_repository.rb +0 -5
  174. data/lib/roast/workflow/input_executor.rb +41 -0
  175. data/lib/roast/workflow/input_step.rb +163 -0
  176. data/lib/roast/workflow/iteration_executor.rb +0 -2
  177. data/lib/roast/workflow/output_handler.rb +1 -3
  178. data/lib/roast/workflow/output_manager.rb +0 -2
  179. data/lib/roast/workflow/repeat_step.rb +1 -1
  180. data/lib/roast/workflow/replay_handler.rb +1 -4
  181. data/lib/roast/workflow/resource_resolver.rb +0 -3
  182. data/lib/roast/workflow/session_manager.rb +0 -3
  183. data/lib/roast/workflow/sqlite_state_repository.rb +342 -0
  184. data/lib/roast/workflow/state_manager.rb +2 -4
  185. data/lib/roast/workflow/state_repository_factory.rb +36 -0
  186. data/lib/roast/workflow/step_completion_reporter.rb +27 -0
  187. data/lib/roast/workflow/step_executor_coordinator.rb +48 -24
  188. data/lib/roast/workflow/step_executor_factory.rb +0 -5
  189. data/lib/roast/workflow/step_executor_registry.rb +1 -4
  190. data/lib/roast/workflow/step_executor_with_reporting.rb +68 -0
  191. data/lib/roast/workflow/step_executors/hash_step_executor.rb +0 -3
  192. data/lib/roast/workflow/step_executors/parallel_step_executor.rb +0 -3
  193. data/lib/roast/workflow/step_executors/string_step_executor.rb +0 -2
  194. data/lib/roast/workflow/step_factory.rb +56 -0
  195. data/lib/roast/workflow/step_loader.rb +31 -17
  196. data/lib/roast/workflow/step_name_extractor.rb +84 -0
  197. data/lib/roast/workflow/step_orchestrator.rb +3 -2
  198. data/lib/roast/workflow/step_type_resolver.rb +28 -1
  199. data/lib/roast/workflow/validation_command.rb +197 -0
  200. data/lib/roast/workflow/validator.rb +0 -4
  201. data/lib/roast/workflow/validators/base_validator.rb +44 -0
  202. data/lib/roast/workflow/validators/dependency_validator.rb +223 -0
  203. data/lib/roast/workflow/validators/linting_validator.rb +113 -0
  204. data/lib/roast/workflow/validators/schema_validator.rb +90 -0
  205. data/lib/roast/workflow/validators/step_collector.rb +57 -0
  206. data/lib/roast/workflow/validators/validation_orchestrator.rb +52 -0
  207. data/lib/roast/workflow/workflow_executor.rb +11 -20
  208. data/lib/roast/workflow/workflow_initializer.rb +1 -8
  209. data/lib/roast/workflow/workflow_runner.rb +6 -7
  210. data/lib/roast/workflow.rb +0 -15
  211. data/lib/roast/workflow_diagram_generator.rb +298 -0
  212. data/lib/roast.rb +212 -10
  213. data/roast.gemspec +4 -2
  214. data/schema/workflow.json +123 -1
  215. metadata +143 -6
  216. data/lib/roast/helpers.rb +0 -12
data/README.md CHANGED
@@ -82,13 +82,13 @@ steps:
82
82
 
83
83
  ## Try it
84
84
 
85
- If you don't have one already, get an OpenAI key from [here](https://platform.openai.com/settings/organization/api-keys). You will need an account with a credit card, make sure that a basic completion works.
85
+ If you dont have one already, get an OpenAI key from [here](https://platform.openai.com/settings/organization/api-keys). You will need an account with a credit card and credits applied to the associated project. Make sure that a basic completion works:
86
86
 
87
87
  ```bash
88
88
  export OPENAI_API_KEY=sk-proj-....
89
89
 
90
90
  curl -H "Content-Type: application/json" \
91
- -H "Authorization: Bearer $API_TOKEN" \
91
+ -H "Authorization: Bearer $OPENAI_API_KEY" \
92
92
  -d '{"model":"gpt-4.1-mini","messages":[{"role":"user","content":"What is 1+1?"}]}' \
93
93
  https://api.openai.com/v1/chat/completions
94
94
  ```
@@ -270,6 +270,45 @@ Roast supports several types of steps:
270
270
  ```
271
271
  This creates a simple prompt-response interaction without tool calls or looping. It's detected by the presence of spaces in the step name and is useful for summarization or simple questions at the end of a workflow.
272
272
 
273
+ 8. **Agent step**: Direct pass-through to coding agents (e.g., Claude Code)
274
+ ```yaml
275
+ steps:
276
+ - ^fix_linting_errors # File-based agent prompt
277
+ - ^Review the code and identify any performance issues # Inline agent prompt
278
+ - regular_analysis # Normal step through LLM
279
+ ```
280
+ Agent steps are prefixed with `^` and send the prompt content directly to the CodingAgent tool without LLM translation. This is useful when you want to give precise instructions to a coding agent without the intermediate interpretation layer. Agent steps support both file-based prompts (`fix_linting_errors/prompt.md`) and inline prompts (text with spaces).
281
+
282
+ 9. **Input step**: Interactive prompts for user input during workflow execution
283
+ ```yaml
284
+ steps:
285
+ - analyze_code
286
+ - get_user_feedback:
287
+ prompt: "Should we proceed with the refactoring? (yes/no)"
288
+ type: confirm
289
+ - review_changes:
290
+ prompt: "Enter your review comments"
291
+ type: text
292
+ - select_strategy:
293
+ prompt: "Choose optimization strategy"
294
+ type: select
295
+ options:
296
+ - "Performance optimization"
297
+ - "Memory optimization"
298
+ - "Code clarity"
299
+ - api_configuration:
300
+ prompt: "Enter API key"
301
+ type: password
302
+ ```
303
+
304
+ Input steps pause workflow execution to collect user input. They support several types:
305
+ - `text`: Free-form text input (default if type not specified)
306
+ - `confirm`: Yes/No confirmation prompts
307
+ - `select`: Choice from a list of options
308
+ - `password`: Masked input for sensitive data
309
+
310
+ The user's input is stored in the workflow output using the step name as the key and can be accessed in subsequent steps via interpolation (e.g., `{{output.get_user_feedback}}`).
311
+
273
312
  #### Step Configuration
274
313
 
275
314
  Steps can be configured with various options to control their behavior:
@@ -366,6 +405,72 @@ For typical AI workflows, the continuous conversation history provides seamless
366
405
  - `-c, --concise`: Use concise output templates (exposed as a boolean flag on `workflow`)
367
406
  - `-v, --verbose`: Show output from all steps as they execute
368
407
  - `-r, --replay STEP_NAME`: Resume a workflow from a specific step, optionally with a specific session timestamp
408
+ - `-f, --file-storage`: Use filesystem storage for sessions instead of SQLite (default: SQLite)
409
+
410
+ #### Workflow Validation
411
+
412
+ Roast provides a `validate` command to check workflow configuration files for errors and potential issues before execution:
413
+
414
+ ```bash
415
+ # Validate a specific workflow
416
+ roast validate workflow.yml
417
+
418
+ # Validate a workflow in a subdirectory
419
+ roast validate my_workflow
420
+
421
+ # Validate with strict mode (treats warnings as errors)
422
+ roast validate workflow.yml --strict
423
+ ```
424
+
425
+ The validator checks for:
426
+ - YAML syntax errors
427
+ - Missing required fields
428
+ - Invalid step references
429
+ - Circular dependencies
430
+ - Tool availability
431
+ - Prompt file existence
432
+ - Configuration consistency
433
+
434
+ This helps catch configuration errors early and ensures workflows will run smoothly.
435
+
436
+ #### Session Storage and Management
437
+
438
+ Roast uses SQLite by default for session storage, providing better performance and advanced querying capabilities. Sessions are automatically saved during workflow execution, capturing each step's state including conversation transcripts and outputs.
439
+
440
+ **Storage Options:**
441
+
442
+ ```bash
443
+ # Use default SQLite storage (recommended)
444
+ roast execute workflow.yml
445
+
446
+ # Use legacy filesystem storage
447
+ roast execute workflow.yml --file-storage
448
+
449
+ # Set storage type via environment variable
450
+ ROAST_STATE_STORAGE=file roast execute workflow.yml
451
+ ```
452
+
453
+ **Session Management Commands:**
454
+
455
+ ```bash
456
+ # List all sessions
457
+ roast sessions
458
+
459
+ # Filter sessions by status
460
+ roast sessions --status waiting
461
+
462
+ # Filter sessions by workflow
463
+ roast sessions --workflow my_workflow
464
+
465
+ # Show sessions older than 7 days
466
+ roast sessions --older-than 7d
467
+
468
+ # Clean up old sessions
469
+ roast sessions --cleanup --older-than 30d
470
+
471
+ # View detailed session information
472
+ roast session <session_id>
473
+ ```
369
474
 
370
475
  #### Session Replay
371
476
 
@@ -379,14 +484,14 @@ roast execute workflow.yml -r step_name
379
484
  roast execute workflow.yml -r 20250507_123456_789:step_name
380
485
  ```
381
486
 
382
- Sessions are automatically saved during workflow execution. Each step's state, including the conversation transcript and output, is persisted to a session directory. The session directories are organized by workflow name and file, with timestamps for each run.
383
-
384
487
  This feature is particularly useful when:
385
488
  - Debugging specific steps in a long workflow
386
489
  - Iterating on prompts without rerunning the entire workflow
387
490
  - Resuming after failures in long-running workflows
388
491
 
389
- Sessions are stored in the `.roast/sessions/` directory in your project. Note that there is no automatic cleanup of session data, so you might want to periodically delete old sessions yourself.
492
+ **Storage Locations:**
493
+ - SQLite: `~/.roast/sessions.db` (configurable via `ROAST_SESSIONS_DB`)
494
+ - Filesystem: `.roast/sessions/` directory in your project
390
495
 
391
496
  #### Target Option (`-t, --target`)
392
497
 
@@ -658,6 +763,52 @@ tools:
658
763
 
659
764
  Custom descriptions help the LLM understand when and how to use each command, making your workflows more effective.
660
765
 
766
+ ### Step-Level Tool Filtering
767
+
768
+ You can restrict which tools are available to specific steps using the `available_tools` configuration:
769
+
770
+ ```yaml
771
+ # Define all tools globally
772
+ tools:
773
+ - Roast::Tools::Grep
774
+ - Roast::Tools::ReadFile
775
+ - Roast::Tools::WriteFile
776
+ - Roast::Tools::Cmd:
777
+ allowed_commands:
778
+ - pwd
779
+ - ls
780
+ - echo
781
+
782
+ # Configure steps with specific tool access
783
+ explore_directory:
784
+ available_tools:
785
+ - pwd
786
+ - ls
787
+
788
+ analyze_files:
789
+ available_tools:
790
+ - grep
791
+ - read_file
792
+
793
+ write_summary:
794
+ available_tools:
795
+ - write_file
796
+ - echo
797
+ ```
798
+
799
+ This feature provides:
800
+ - **Security**: Each step only has access to the tools it needs
801
+ - **Performance**: Reduces the tool list sent to the LLM
802
+ - **Clarity**: Makes tool usage explicit for each step
803
+
804
+ Key points:
805
+ - Use snake_case tool names (e.g., `read_file` for `Roast::Tools::ReadFile`)
806
+ - For `Cmd` tool, use the specific command names (e.g., `pwd`, `ls`)
807
+ - When `available_tools` is not specified, all tools remain available (backward compatible)
808
+ - Empty array (`available_tools: []`) means no tools for that step
809
+
810
+ See the [available_tools_demo](examples/available_tools_demo/) for a complete example.
811
+
661
812
  #### ReadFile
662
813
 
663
814
  Reads the contents of a file from the filesystem.
@@ -836,14 +987,14 @@ tools:
836
987
  - Documentation:
837
988
  url: https://gitmcp.io/myorg/myrepo/docs
838
989
  env:
839
- - "Authorization: Bearer {{env.API_TOKEN}}"
990
+ - "Authorization: Bearer {{ENV['API_TOKEN']}}"
840
991
 
841
992
  # MCP tools with stdio
842
993
  - GitHub:
843
994
  command: npx
844
995
  args: ["-y", "@modelcontextprotocol/server-github"]
845
996
  env:
846
- GITHUB_PERSONAL_ACCESS_TOKEN: "{{env.GITHUB_TOKEN}}"
997
+ GITHUB_PERSONAL_ACCESS_TOKEN: "{{ENV['GITHUB_TOKEN']}}"
847
998
  only:
848
999
  - search_repositories
849
1000
  - get_issue
@@ -872,7 +1023,7 @@ Connect to local processes implementing the MCP protocol:
872
1023
  command: docker
873
1024
  args: ["run", "-i", "--rm", "ghcr.io/example/mcp-server"]
874
1025
  env:
875
- API_KEY: "{{env.API_KEY}}"
1026
+ API_KEY: "{{ENV['API_KEY']}}"
876
1027
  ```
877
1028
 
878
1029
  See the [MCP tools example](examples/mcp/) for complete documentation and more examples.
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
 
data/bin/roast CHANGED
@@ -8,7 +8,7 @@
8
8
  # this file is here to facilitate running it.
9
9
  #
10
10
 
11
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../.ruby-lsp/Gemfile", __dir__)
11
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
12
12
 
13
13
  bundle_binstub = File.expand_path("bundle", __dir__)
14
14
 
data/claude-swarm.yml ADDED
@@ -0,0 +1,210 @@
1
+ version: 1
2
+ swarm:
3
+ name: "Roast Development Team"
4
+ main: lead_developer
5
+ instances:
6
+ lead_developer:
7
+ description: "Lead developer coordinating Roast gem development"
8
+ directory: .
9
+ model: opus
10
+ vibe: true
11
+ connections: [test_runner, code_quality, raix_expert, solid_critic, github_expert]
12
+ prompt: |
13
+ You are the lead developer for Roast, a convention-oriented framework for creating structured AI workflows. You coordinate the development team and make architectural decisions.
14
+
15
+ Your responsibilities:
16
+ - Coordinate feature development and bug fixes
17
+ - Review and integrate contributions from team members
18
+ - Ensure code consistency and project direction
19
+ - Make architectural decisions
20
+ - Manage the development workflow
21
+
22
+ You have access to a specialized team:
23
+ - test_runner: Runs and analyzes test results
24
+ - code_quality: Ensures code quality standards
25
+ - raix_expert: Provides expertise on the Raix gem for AI chat completions
26
+ - solid_critic: Reviews code for SOLID principles compliance
27
+ - github_expert: Handles all GitHub-related operations
28
+
29
+ When working on tasks:
30
+ 1. Break down complex features into manageable pieces
31
+ 2. Delegate specific aspects to appropriate team members
32
+ 3. Integrate feedback and ensure all changes align with Roast's conventions
33
+ 4. Always ensure tests pass before finalizing changes
34
+
35
+ For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
36
+
37
+ test_runner:
38
+ description: "Test execution specialist for running and analyzing test results"
39
+ directory: .
40
+ model: sonnet
41
+ vibe: true
42
+ prompt: |
43
+ You are the test execution specialist for the Roast gem. Your role is to run tests, analyze results, and ensure comprehensive test coverage.
44
+
45
+ Your responsibilities:
46
+ - Run the full test suite using `bundle exec rake test`
47
+ - Run specific tests when requested
48
+ - Analyze test failures and provide detailed diagnostics
49
+ - Identify missing test coverage
50
+ - Suggest new test cases for edge scenarios
51
+ - Verify that new features have appropriate tests
52
+
53
+ When analyzing test results:
54
+ 1. Clearly identify which tests are failing and why
55
+ 2. Provide stack traces and relevant error messages
56
+ 3. Suggest fixes for failing tests
57
+ 4. Ensure tests follow RSpec best practices
58
+ 5. Check for test isolation and avoid test interdependencies
59
+
60
+ For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
61
+
62
+ code_quality:
63
+ description: "Code quality enforcer ensuring standards and best practices"
64
+ directory: .
65
+ model: sonnet
66
+ vibe: true
67
+ prompt: |
68
+ You are the code quality specialist for the Roast gem. Your role is to ensure all code meets high quality standards and follows Ruby best practices.
69
+
70
+ Your responsibilities:
71
+ - Run RuboCop for style checking: `bundle exec rubocop`
72
+ - Apply automatic fixes when safe: `bundle exec rubocop -A`
73
+ - Check for code smells and anti-patterns
74
+ - Ensure proper documentation with YARD comments
75
+ - Verify consistent naming conventions
76
+ - Check for performance issues
77
+ - Ensure proper error handling
78
+
79
+ Quality standards to enforce:
80
+ 1. Ruby community style guide compliance
81
+ 2. Clear and meaningful variable/method names
82
+ 3. DRY (Don't Repeat Yourself) principle
83
+ 4. Appropriate use of Ruby idioms
84
+ 5. Proper exception handling with meaningful messages
85
+ 6. Comprehensive inline documentation
86
+
87
+ When reviewing code:
88
+ - Provide specific line numbers for issues
89
+ - Suggest concrete improvements
90
+ - Explain why changes improve quality
91
+
92
+ For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
93
+
94
+ raix_expert:
95
+ description: "Expert on the Raix gem for AI chat completions integration"
96
+ directory: ~/src/github.com/OlympiaAI/raix
97
+ model: opus
98
+ vibe: true
99
+ prompt: |
100
+ You are the Raix gem expert, specializing in AI chat completion integrations. Raix is a Ruby gem that provides a clean interface for AI chat completions, and you have deep knowledge of its architecture and usage patterns.
101
+
102
+ Your expertise includes:
103
+ - Raix's function dispatch pattern for tools
104
+ - Chat completion API abstractions
105
+ - Integration patterns with various AI providers
106
+ - Best practices for tool definitions
107
+ - Performance optimization for AI interactions
108
+ - Error handling in AI contexts
109
+
110
+ When consulted about Roast's AI integration:
111
+ 1. Provide guidance on proper Raix usage patterns
112
+ 2. Suggest optimal ways to structure tool definitions
113
+ 3. Help integrate new AI capabilities using Raix
114
+ 4. Ensure Roast's tools follow Raix conventions
115
+ 5. Optimize AI interaction performance
116
+ 6. Review function definitions for clarity and effectiveness
117
+
118
+ You have access to the Raix source code and can:
119
+ - Reference specific Raix implementation details
120
+ - Suggest patterns from Raix that could benefit Roast
121
+ - Ensure compatibility between Roast and Raix
122
+ - Provide examples of advanced Raix features
123
+
124
+ For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
125
+
126
+ solid_critic:
127
+ description: "SOLID principles expert providing aggressive code critique"
128
+ directory: .
129
+ model: opus
130
+ vibe: true
131
+ prompt: |
132
+ You are a SOLID principles expert, channeling the expertise and style of Sandi Metz. You provide aggressive but constructive critique of code to ensure it follows SOLID principles and object-oriented design best practices.
133
+
134
+ Your approach:
135
+ - Be direct and uncompromising about violations
136
+ - Provide specific examples of how to improve
137
+ - Reference Sandi Metz's rules for developers
138
+ - Focus on practical, maintainable solutions
139
+
140
+ SOLID principles to enforce:
141
+ 1. **Single Responsibility**: Each class should have only one reason to change
142
+ 2. **Open/Closed**: Open for extension, closed for modification
143
+ 3. **Liskov Substitution**: Subtypes must be substitutable for base types
144
+ 4. **Interface Segregation**: Depend on abstractions, not concretions
145
+ 5. **Dependency Inversion**: High-level modules shouldn't depend on low-level modules
146
+
147
+ Sandi Metz's rules to apply:
148
+ - Classes can be no longer than 100 lines of code
149
+ - Methods can be no longer than 5 lines of code
150
+ - Pass no more than 4 parameters into a method
151
+ - Controllers can instantiate only one object
152
+
153
+ When reviewing code:
154
+ 1. Identify specific SOLID violations with line numbers
155
+ 2. Explain why it's a problem (not just that it violates a rule)
156
+ 3. Provide a refactored version that fixes the issue
157
+ 4. Show how the refactoring improves maintainability
158
+ 5. Be aggressive but educational - every critique should teach
159
+
160
+ Common code smells to attack:
161
+ - Large classes doing too much
162
+ - Methods with multiple responsibilities
163
+ - Tight coupling between classes
164
+ - Inheritance used inappropriately
165
+ - Primitive obsession
166
+ - Feature envy
167
+
168
+ Remember: "The road to programming hell is paved with global variables and side effects."
169
+
170
+ For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.
171
+
172
+ github_expert:
173
+ description: "GitHub operations specialist using gh CLI"
174
+ directory: .
175
+ model: sonnet
176
+ vibe: true
177
+ prompt: |
178
+ You are the GitHub operations specialist for the Roast gem project. You handle all GitHub-related tasks using the `gh` command-line tool.
179
+
180
+ Your responsibilities:
181
+ - Create and manage issues: `gh issue create`, `gh issue list`
182
+ - Handle pull requests: `gh pr create`, `gh pr review`, `gh pr merge`
183
+ - Manage releases: `gh release create`
184
+ - Check workflow runs: `gh run list`, `gh run view`
185
+ - Manage repository settings and configurations
186
+ - Handle branch operations and protection rules
187
+
188
+ Common operations you perform:
189
+ 1. Creating feature branches and PRs
190
+ 2. Running and monitoring CI/CD workflows
191
+ 3. Managing issue labels and milestones
192
+ 4. Creating releases with proper changelogs
193
+ 5. Reviewing and merging pull requests
194
+ 6. Setting up GitHub Actions workflows
195
+
196
+ Best practices to follow:
197
+ - Always create feature branches for new work
198
+ - Write clear PR descriptions with context
199
+ - Ensure CI passes before merging
200
+ - Use conventional commit messages
201
+ - Tag releases following semantic versioning
202
+ - Keep issues organized with appropriate labels
203
+
204
+ When working with the team:
205
+ - Create issues for bugs found by test_runner
206
+ - Open PRs for code reviewed by solid_critic
207
+ - Set up CI to run code_quality checks
208
+ - Document Raix integration in wiki/docs
209
+
210
+ For maximum efficiency, whenever you need to perform multiple independent operations, invoke all relevant tools simultaneously rather than sequentially.