claude_swarm 1.0.1 → 1.0.2
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/.claude/commands/release.md +1 -1
- data/.claude/hooks/lint-code-files.rb +65 -0
- data/.rubocop.yml +22 -2
- data/CHANGELOG.md +14 -1
- data/CLAUDE.md +1 -1
- data/CONTRIBUTING.md +69 -0
- data/README.md +27 -2
- data/Rakefile +71 -3
- data/analyze_coverage.rb +94 -0
- data/docs/v2/CHANGELOG.swarm_cli.md +43 -0
- data/docs/v2/CHANGELOG.swarm_memory.md +379 -0
- data/docs/v2/CHANGELOG.swarm_sdk.md +362 -0
- data/docs/v2/README.md +308 -0
- data/docs/v2/guides/claude-code-agents.md +262 -0
- data/docs/v2/guides/complete-tutorial.md +3088 -0
- data/docs/v2/guides/getting-started.md +1456 -0
- data/docs/v2/guides/memory-adapters.md +998 -0
- data/docs/v2/guides/plugins.md +816 -0
- data/docs/v2/guides/quick-start-cli.md +1745 -0
- data/docs/v2/guides/rails-integration.md +1902 -0
- data/docs/v2/guides/swarm-memory.md +599 -0
- data/docs/v2/reference/cli.md +729 -0
- data/docs/v2/reference/ruby-dsl.md +2154 -0
- data/docs/v2/reference/yaml.md +1835 -0
- data/docs-team-swarm.yml +2222 -0
- data/examples/learning-assistant/assistant.md +7 -0
- data/examples/learning-assistant/example-memories/concept-example.md +90 -0
- data/examples/learning-assistant/example-memories/experience-example.md +66 -0
- data/examples/learning-assistant/example-memories/fact-example.md +76 -0
- data/examples/learning-assistant/example-memories/memory-index.md +78 -0
- data/examples/learning-assistant/example-memories/skill-example.md +168 -0
- data/examples/learning-assistant/learning_assistant.rb +34 -0
- data/examples/learning-assistant/learning_assistant.yml +20 -0
- data/examples/v2/dsl/01_basic.rb +44 -0
- data/examples/v2/dsl/02_core_parameters.rb +59 -0
- data/examples/v2/dsl/03_capabilities.rb +71 -0
- data/examples/v2/dsl/04_llm_parameters.rb +56 -0
- data/examples/v2/dsl/05_advanced_flags.rb +73 -0
- data/examples/v2/dsl/06_permissions.rb +80 -0
- data/examples/v2/dsl/07_mcp_server.rb +62 -0
- data/examples/v2/dsl/08_swarm_hooks.rb +53 -0
- data/examples/v2/dsl/09_agent_hooks.rb +67 -0
- data/examples/v2/dsl/10_all_agents_hooks.rb +67 -0
- data/examples/v2/dsl/11_delegation.rb +60 -0
- data/examples/v2/dsl/12_complete_integration.rb +137 -0
- data/examples/v2/file_tools_swarm.yml +102 -0
- data/examples/v2/hooks/01_basic_hooks.rb +133 -0
- data/examples/v2/hooks/02_usage_tracking.rb +201 -0
- data/examples/v2/hooks/03_production_monitoring.rb +429 -0
- data/examples/v2/hooks/agent_stop_exit_0.yml +21 -0
- data/examples/v2/hooks/agent_stop_exit_1.yml +21 -0
- data/examples/v2/hooks/agent_stop_exit_2.yml +26 -0
- data/examples/v2/hooks/multiple_hooks_all_pass.yml +37 -0
- data/examples/v2/hooks/multiple_hooks_first_fails.yml +37 -0
- data/examples/v2/hooks/multiple_hooks_second_fails.yml +37 -0
- data/examples/v2/hooks/multiple_hooks_warnings.yml +37 -0
- data/examples/v2/hooks/post_tool_use_exit_0.yml +24 -0
- data/examples/v2/hooks/post_tool_use_exit_1.yml +24 -0
- data/examples/v2/hooks/post_tool_use_exit_2.yml +24 -0
- data/examples/v2/hooks/post_tool_use_multi_matcher_exit_0.yml +26 -0
- data/examples/v2/hooks/post_tool_use_multi_matcher_exit_1.yml +26 -0
- data/examples/v2/hooks/post_tool_use_multi_matcher_exit_2.yml +26 -0
- data/examples/v2/hooks/pre_tool_use_exit_0.yml +24 -0
- data/examples/v2/hooks/pre_tool_use_exit_1.yml +24 -0
- data/examples/v2/hooks/pre_tool_use_exit_2.yml +24 -0
- data/examples/v2/hooks/pre_tool_use_multi_matcher_exit_0.yml +26 -0
- data/examples/v2/hooks/pre_tool_use_multi_matcher_exit_1.yml +26 -0
- data/examples/v2/hooks/pre_tool_use_multi_matcher_exit_2.yml +27 -0
- data/examples/v2/hooks/swarm_summary.sh +44 -0
- data/examples/v2/hooks/user_prompt_exit_0.yml +21 -0
- data/examples/v2/hooks/user_prompt_exit_1.yml +21 -0
- data/examples/v2/hooks/user_prompt_exit_2.yml +21 -0
- data/examples/v2/hooks/validate_bash.rb +59 -0
- data/examples/v2/multi_directory_permissions.yml +221 -0
- data/examples/v2/node_context_demo.rb +127 -0
- data/examples/v2/node_workflow.rb +173 -0
- data/examples/v2/path_resolution_demo.rb +216 -0
- data/examples/v2/simple-swarm-v2.rb +90 -0
- data/examples/v2/simple-swarm-v2.yml +62 -0
- data/examples/v2/swarm.yml +71 -0
- data/examples/v2/swarm_with_hooks.yml +61 -0
- data/examples/v2/swarm_with_hooks_simple.yml +25 -0
- data/examples/v2/think_tool_demo.rb +62 -0
- data/exe/swarm +6 -0
- data/lib/claude_swarm/claude_mcp_server.rb +0 -6
- data/lib/claude_swarm/cli.rb +10 -3
- data/lib/claude_swarm/commands/ps.rb +19 -20
- data/lib/claude_swarm/commands/show.rb +1 -1
- data/lib/claude_swarm/configuration.rb +10 -12
- data/lib/claude_swarm/mcp_generator.rb +10 -1
- data/lib/claude_swarm/orchestrator.rb +73 -49
- data/lib/claude_swarm/system_utils.rb +37 -11
- data/lib/claude_swarm/version.rb +1 -1
- data/lib/claude_swarm/worktree_manager.rb +1 -0
- data/lib/claude_swarm/yaml_loader.rb +22 -0
- data/lib/claude_swarm.rb +6 -2
- data/lib/swarm_cli/cli.rb +201 -0
- data/lib/swarm_cli/command_registry.rb +61 -0
- data/lib/swarm_cli/commands/mcp_serve.rb +130 -0
- data/lib/swarm_cli/commands/mcp_tools.rb +148 -0
- data/lib/swarm_cli/commands/migrate.rb +55 -0
- data/lib/swarm_cli/commands/run.rb +173 -0
- data/lib/swarm_cli/config_loader.rb +97 -0
- data/lib/swarm_cli/formatters/human_formatter.rb +711 -0
- data/lib/swarm_cli/formatters/json_formatter.rb +51 -0
- data/lib/swarm_cli/interactive_repl.rb +918 -0
- data/lib/swarm_cli/mcp_serve_options.rb +44 -0
- data/lib/swarm_cli/mcp_tools_options.rb +59 -0
- data/lib/swarm_cli/migrate_options.rb +54 -0
- data/lib/swarm_cli/migrator.rb +132 -0
- data/lib/swarm_cli/options.rb +151 -0
- data/lib/swarm_cli/ui/components/agent_badge.rb +33 -0
- data/lib/swarm_cli/ui/components/content_block.rb +120 -0
- data/lib/swarm_cli/ui/components/divider.rb +57 -0
- data/lib/swarm_cli/ui/components/panel.rb +62 -0
- data/lib/swarm_cli/ui/components/usage_stats.rb +70 -0
- data/lib/swarm_cli/ui/formatters/cost.rb +49 -0
- data/lib/swarm_cli/ui/formatters/number.rb +58 -0
- data/lib/swarm_cli/ui/formatters/text.rb +77 -0
- data/lib/swarm_cli/ui/formatters/time.rb +73 -0
- data/lib/swarm_cli/ui/icons.rb +59 -0
- data/lib/swarm_cli/ui/renderers/event_renderer.rb +188 -0
- data/lib/swarm_cli/ui/state/agent_color_cache.rb +45 -0
- data/lib/swarm_cli/ui/state/depth_tracker.rb +40 -0
- data/lib/swarm_cli/ui/state/spinner_manager.rb +170 -0
- data/lib/swarm_cli/ui/state/usage_tracker.rb +62 -0
- data/lib/swarm_cli/version.rb +5 -0
- data/lib/swarm_cli.rb +44 -0
- data/lib/swarm_memory/adapters/base.rb +141 -0
- data/lib/swarm_memory/adapters/filesystem_adapter.rb +845 -0
- data/lib/swarm_memory/chat_extension.rb +34 -0
- data/lib/swarm_memory/cli/commands.rb +306 -0
- data/lib/swarm_memory/core/entry.rb +37 -0
- data/lib/swarm_memory/core/frontmatter_parser.rb +108 -0
- data/lib/swarm_memory/core/metadata_extractor.rb +68 -0
- data/lib/swarm_memory/core/path_normalizer.rb +75 -0
- data/lib/swarm_memory/core/semantic_index.rb +244 -0
- data/lib/swarm_memory/core/storage.rb +288 -0
- data/lib/swarm_memory/core/storage_read_tracker.rb +63 -0
- data/lib/swarm_memory/dsl/builder_extension.rb +40 -0
- data/lib/swarm_memory/dsl/memory_config.rb +113 -0
- data/lib/swarm_memory/embeddings/embedder.rb +36 -0
- data/lib/swarm_memory/embeddings/informers_embedder.rb +152 -0
- data/lib/swarm_memory/errors.rb +21 -0
- data/lib/swarm_memory/integration/cli_registration.rb +30 -0
- data/lib/swarm_memory/integration/configuration.rb +43 -0
- data/lib/swarm_memory/integration/registration.rb +31 -0
- data/lib/swarm_memory/integration/sdk_plugin.rb +531 -0
- data/lib/swarm_memory/optimization/analyzer.rb +244 -0
- data/lib/swarm_memory/optimization/defragmenter.rb +863 -0
- data/lib/swarm_memory/prompts/memory.md.erb +109 -0
- data/lib/swarm_memory/prompts/memory_assistant.md.erb +181 -0
- data/lib/swarm_memory/prompts/memory_researcher.md.erb +281 -0
- data/lib/swarm_memory/prompts/memory_retrieval.md.erb +78 -0
- data/lib/swarm_memory/search/semantic_search.rb +112 -0
- data/lib/swarm_memory/search/text_search.rb +42 -0
- data/lib/swarm_memory/search/text_similarity.rb +80 -0
- data/lib/swarm_memory/skills/meta/deep-learning.md +101 -0
- data/lib/swarm_memory/skills/meta/deep-learning.yml +14 -0
- data/lib/swarm_memory/tools/load_skill.rb +313 -0
- data/lib/swarm_memory/tools/memory_defrag.rb +382 -0
- data/lib/swarm_memory/tools/memory_delete.rb +99 -0
- data/lib/swarm_memory/tools/memory_edit.rb +185 -0
- data/lib/swarm_memory/tools/memory_glob.rb +160 -0
- data/lib/swarm_memory/tools/memory_grep.rb +247 -0
- data/lib/swarm_memory/tools/memory_multi_edit.rb +281 -0
- data/lib/swarm_memory/tools/memory_read.rb +123 -0
- data/lib/swarm_memory/tools/memory_write.rb +231 -0
- data/lib/swarm_memory/utils.rb +50 -0
- data/lib/swarm_memory/version.rb +5 -0
- data/lib/swarm_memory.rb +166 -0
- data/lib/swarm_sdk/agent/RETRY_LOGIC.md +127 -0
- data/lib/swarm_sdk/agent/builder.rb +461 -0
- data/lib/swarm_sdk/agent/chat/context_tracker.rb +314 -0
- data/lib/swarm_sdk/agent/chat/hook_integration.rb +372 -0
- data/lib/swarm_sdk/agent/chat/logging_helpers.rb +116 -0
- data/lib/swarm_sdk/agent/chat/system_reminder_injector.rb +152 -0
- data/lib/swarm_sdk/agent/chat.rb +1159 -0
- data/lib/swarm_sdk/agent/context.rb +112 -0
- data/lib/swarm_sdk/agent/context_manager.rb +309 -0
- data/lib/swarm_sdk/agent/definition.rb +556 -0
- data/lib/swarm_sdk/claude_code_agent_adapter.rb +205 -0
- data/lib/swarm_sdk/configuration.rb +296 -0
- data/lib/swarm_sdk/context_compactor/metrics.rb +147 -0
- data/lib/swarm_sdk/context_compactor/token_counter.rb +106 -0
- data/lib/swarm_sdk/context_compactor.rb +340 -0
- data/lib/swarm_sdk/hooks/adapter.rb +359 -0
- data/lib/swarm_sdk/hooks/context.rb +197 -0
- data/lib/swarm_sdk/hooks/definition.rb +80 -0
- data/lib/swarm_sdk/hooks/error.rb +29 -0
- data/lib/swarm_sdk/hooks/executor.rb +146 -0
- data/lib/swarm_sdk/hooks/registry.rb +147 -0
- data/lib/swarm_sdk/hooks/result.rb +150 -0
- data/lib/swarm_sdk/hooks/shell_executor.rb +254 -0
- data/lib/swarm_sdk/hooks/tool_call.rb +35 -0
- data/lib/swarm_sdk/hooks/tool_result.rb +62 -0
- data/lib/swarm_sdk/log_collector.rb +51 -0
- data/lib/swarm_sdk/log_stream.rb +69 -0
- data/lib/swarm_sdk/markdown_parser.rb +75 -0
- data/lib/swarm_sdk/model_aliases.json +5 -0
- data/lib/swarm_sdk/models.json +1 -0
- data/lib/swarm_sdk/models.rb +120 -0
- data/lib/swarm_sdk/node/agent_config.rb +49 -0
- data/lib/swarm_sdk/node/builder.rb +439 -0
- data/lib/swarm_sdk/node/transformer_executor.rb +248 -0
- data/lib/swarm_sdk/node_context.rb +170 -0
- data/lib/swarm_sdk/node_orchestrator.rb +384 -0
- data/lib/swarm_sdk/permissions/config.rb +239 -0
- data/lib/swarm_sdk/permissions/error_formatter.rb +121 -0
- data/lib/swarm_sdk/permissions/path_matcher.rb +35 -0
- data/lib/swarm_sdk/permissions/validator.rb +173 -0
- data/lib/swarm_sdk/permissions_builder.rb +122 -0
- data/lib/swarm_sdk/plugin.rb +147 -0
- data/lib/swarm_sdk/plugin_registry.rb +101 -0
- data/lib/swarm_sdk/prompts/base_system_prompt.md.erb +243 -0
- data/lib/swarm_sdk/providers/openai_with_responses.rb +582 -0
- data/lib/swarm_sdk/result.rb +97 -0
- data/lib/swarm_sdk/swarm/agent_initializer.rb +334 -0
- data/lib/swarm_sdk/swarm/all_agents_builder.rb +140 -0
- data/lib/swarm_sdk/swarm/builder.rb +586 -0
- data/lib/swarm_sdk/swarm/mcp_configurator.rb +151 -0
- data/lib/swarm_sdk/swarm/tool_configurator.rb +419 -0
- data/lib/swarm_sdk/swarm.rb +982 -0
- data/lib/swarm_sdk/tools/bash.rb +274 -0
- data/lib/swarm_sdk/tools/clock.rb +44 -0
- data/lib/swarm_sdk/tools/delegate.rb +164 -0
- data/lib/swarm_sdk/tools/document_converters/base_converter.rb +83 -0
- data/lib/swarm_sdk/tools/document_converters/docx_converter.rb +99 -0
- data/lib/swarm_sdk/tools/document_converters/html_converter.rb +101 -0
- data/lib/swarm_sdk/tools/document_converters/pdf_converter.rb +78 -0
- data/lib/swarm_sdk/tools/document_converters/xlsx_converter.rb +194 -0
- data/lib/swarm_sdk/tools/edit.rb +150 -0
- data/lib/swarm_sdk/tools/glob.rb +158 -0
- data/lib/swarm_sdk/tools/grep.rb +228 -0
- data/lib/swarm_sdk/tools/image_extractors/docx_image_extractor.rb +43 -0
- data/lib/swarm_sdk/tools/image_extractors/pdf_image_extractor.rb +163 -0
- data/lib/swarm_sdk/tools/image_formats/tiff_builder.rb +65 -0
- data/lib/swarm_sdk/tools/multi_edit.rb +232 -0
- data/lib/swarm_sdk/tools/path_resolver.rb +43 -0
- data/lib/swarm_sdk/tools/read.rb +251 -0
- data/lib/swarm_sdk/tools/registry.rb +93 -0
- data/lib/swarm_sdk/tools/scratchpad/scratchpad_list.rb +96 -0
- data/lib/swarm_sdk/tools/scratchpad/scratchpad_read.rb +76 -0
- data/lib/swarm_sdk/tools/scratchpad/scratchpad_write.rb +91 -0
- data/lib/swarm_sdk/tools/stores/read_tracker.rb +61 -0
- data/lib/swarm_sdk/tools/stores/scratchpad_storage.rb +224 -0
- data/lib/swarm_sdk/tools/stores/storage.rb +148 -0
- data/lib/swarm_sdk/tools/stores/todo_manager.rb +65 -0
- data/lib/swarm_sdk/tools/think.rb +95 -0
- data/lib/swarm_sdk/tools/todo_write.rb +216 -0
- data/lib/swarm_sdk/tools/web_fetch.rb +261 -0
- data/lib/swarm_sdk/tools/write.rb +117 -0
- data/lib/swarm_sdk/utils.rb +50 -0
- data/lib/swarm_sdk/version.rb +5 -0
- data/lib/swarm_sdk.rb +157 -0
- data/llm.v2.txt +13407 -0
- data/rubocop/cop/security/no_reflection_methods.rb +47 -0
- data/rubocop/cop/security/no_ruby_llm_logger.rb +32 -0
- data/swarm_cli.gemspec +57 -0
- data/swarm_memory.gemspec +28 -0
- data/swarm_sdk.gemspec +41 -0
- data/team.yml +1 -1
- data/team_full.yml +1875 -0
- data/{team_v2.yml → team_sdk.yml} +121 -52
- metadata +247 -4
- data/EXAMPLES.md +0 -164
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to SwarmSDK will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [2.1.1]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **OpenAI proxy compatibility**: New `openai_use_system_role` configuration
|
|
12
|
+
- Automatically enabled for OpenAI-compatible providers (OpenAI, DeepSeek, Perplexity, Mistral, OpenRouter)
|
|
13
|
+
- Uses standard 'system' role instead of OpenAI's newer 'developer' role
|
|
14
|
+
- Improves compatibility with proxy services that don't support 'developer' role
|
|
15
|
+
- Configured automatically based on provider type
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- **Think tool parameter handling**: Simplified to accept flexible parameters
|
|
19
|
+
- Changed signature from `execute(thoughts:)` to `execute(**kwargs)`
|
|
20
|
+
- Removes strict validation errors for parameter mismatches
|
|
21
|
+
- More flexible for LLM tool calling variations
|
|
22
|
+
- Added reminder in description: "The Think tool takes only one parameter: thoughts"
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- **Nil response error handling**: Better error messages for malformed API responses
|
|
26
|
+
- Detects when provider returns nil response (unparseable API response)
|
|
27
|
+
- Provides detailed error message with provider info, API base, model ID
|
|
28
|
+
- Suggests enabling RubyLLM debug logging to inspect raw API response
|
|
29
|
+
- Prevents cryptic errors when API returns malformed/unparseable responses
|
|
30
|
+
|
|
31
|
+
## [2.1.0] - 2025-10-27
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
- **Think tool for explicit reasoning**: New built-in tool that enables agents to "think out loud"
|
|
35
|
+
- Parameter: `thoughts` - records agent's thinking process as function calls
|
|
36
|
+
- Creates "attention sinks" in conversation history for better reasoning
|
|
37
|
+
- Based on chain-of-thought prompting research
|
|
38
|
+
- Included as a default tool for all agents
|
|
39
|
+
- Usage: `Think(thoughts: "Let me break this down: 1) Read file, 2) Analyze, 3) Implement")`
|
|
40
|
+
|
|
41
|
+
- **disable_default_tools configuration**: Flexible control over which default tools are included
|
|
42
|
+
- Accepts `true` to disable ALL default tools
|
|
43
|
+
- Accepts array to disable specific tools: `[:Think, :TodoWrite]`
|
|
44
|
+
- Works in both Ruby DSL and YAML configurations
|
|
45
|
+
- Example: `disable_default_tools [:Think, :Grep]` keeps other defaults
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
- **Model alias resolution**: Fixed bug where model aliases weren't resolved before being passed to RubyLLM
|
|
49
|
+
- Aliases like `sonnet`, `opus`, `haiku` now properly resolve to full model IDs
|
|
50
|
+
- `sonnet` → `claude-sonnet-4-5-20250929`
|
|
51
|
+
- Works with both Ruby DSL and markdown agent files
|
|
52
|
+
- Prevents "model does not exist" API errors when using aliases
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
- **BREAKING CHANGE: Removed include_default_tools**: Replaced with `disable_default_tools`
|
|
56
|
+
- Migration: `include_default_tools: false` → `disable_default_tools: true`
|
|
57
|
+
- More intuitive API (disable what you don't want vs enable what you do)
|
|
58
|
+
- Updated all documentation and examples
|
|
59
|
+
|
|
60
|
+
## [2.0.8] - 2025-10-27
|
|
61
|
+
- Bump RubyLLM MCP gem and remove monkey patch
|
|
62
|
+
|
|
63
|
+
## [2.0.7] - 2025-10-26
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
|
|
67
|
+
- **Plugin System** - Extensible architecture for decoupling core SDK from extensions
|
|
68
|
+
- `SwarmSDK::Plugin` base class with lifecycle hooks
|
|
69
|
+
- `SwarmSDK::PluginRegistry` for plugin management
|
|
70
|
+
- Plugins provide tools, storage, configuration, and system prompt contributions
|
|
71
|
+
- Lifecycle hooks: `on_agent_initialized`, `on_swarm_started`, `on_swarm_stopped`, `on_user_message`
|
|
72
|
+
- Zero coupling: SwarmSDK has no knowledge of SwarmMemory classes
|
|
73
|
+
- Auto-registration: Plugins register themselves when loaded
|
|
74
|
+
- See new guide: `docs/v2/guides/plugins.md`
|
|
75
|
+
|
|
76
|
+
- **ContextManager** - Intelligent conversation context optimization
|
|
77
|
+
- **Ephemeral System Reminders**: Sent to LLM but not persisted (90% token savings)
|
|
78
|
+
- **Automatic Compression**: Triggers at 60% context usage
|
|
79
|
+
- **Progressive Compression**: Older tool results compressed more aggressively
|
|
80
|
+
- **Smart Re-run Instructions**: Idempotent tools (Read, Grep, Glob) get re-run hints
|
|
81
|
+
- Token savings: 13,800-63,800 tokens per long conversation
|
|
82
|
+
- See documentation: `docs/v2/reference/ruby-dsl.md#context-management`
|
|
83
|
+
|
|
84
|
+
- **Agent Name Tracking** - `Agent::Chat` now tracks `@agent_name`
|
|
85
|
+
- Enables plugin callbacks per agent
|
|
86
|
+
- Used for semantic skill discovery
|
|
87
|
+
- Passed to lifecycle hooks
|
|
88
|
+
|
|
89
|
+
- **Parameter Validation** - Validates required parameters before tool execution
|
|
90
|
+
- Checks all required parameters are present
|
|
91
|
+
- Provides detailed error messages with parameter descriptions
|
|
92
|
+
- Prevents "missing keyword" errors from reaching tools
|
|
93
|
+
- Replaces Ruby's "keyword" terminology with user-friendly "parameter"
|
|
94
|
+
|
|
95
|
+
### Changed
|
|
96
|
+
|
|
97
|
+
- **Tool Registration** - Moved from hardcoded to plugin-based
|
|
98
|
+
- Memory tools no longer hardcoded in ToolConfigurator
|
|
99
|
+
- Plugins provide their own tools via `plugin.tools` and `plugin.create_tool()`
|
|
100
|
+
- `MEMORY_TOOLS` constant removed (now in plugin)
|
|
101
|
+
- ToolConfigurator uses `PluginRegistry.plugin_tool?()` for lookups
|
|
102
|
+
|
|
103
|
+
- **Storage Management** - Generalized for plugins
|
|
104
|
+
- `@memory_storages` → `@plugin_storages` (supports any plugin)
|
|
105
|
+
- Format: `{ plugin_name => { agent_name => storage } }`
|
|
106
|
+
- Plugins create their own storage via `plugin.create_storage()`
|
|
107
|
+
|
|
108
|
+
- **System Prompt Contributions** - Plugin-based
|
|
109
|
+
- `Agent::Definition` collects contributions from all plugins
|
|
110
|
+
- Plugins contribute via `plugin.system_prompt_contribution()`
|
|
111
|
+
- No hardcoded memory prompt rendering in SDK
|
|
112
|
+
|
|
113
|
+
- **Context Warning Thresholds** - Expanded
|
|
114
|
+
- **Was**: [80, 90]
|
|
115
|
+
- **Now**: [60, 80, 90]
|
|
116
|
+
- 60% triggers automatic compression
|
|
117
|
+
- 80%/90% remain as informational warnings
|
|
118
|
+
|
|
119
|
+
### Removed
|
|
120
|
+
|
|
121
|
+
- **Tools::Registry Extension System** - Replaced by plugin system
|
|
122
|
+
- `register_extension()` method removed
|
|
123
|
+
- Extensions no longer checked in `get()`, `exists()`, `available_names()`
|
|
124
|
+
- Use `PluginRegistry` instead for extension tools
|
|
125
|
+
|
|
126
|
+
### Breaking Changes
|
|
127
|
+
|
|
128
|
+
⚠️ **Major breaking changes:**
|
|
129
|
+
|
|
130
|
+
1. **No backward compatibility with old memory integration**
|
|
131
|
+
- Old `Tools::Registry.register_extension()` removed
|
|
132
|
+
- Memory tools MUST use plugin system
|
|
133
|
+
- SwarmMemory updated to use plugin (no migration needed if using latest)
|
|
134
|
+
|
|
135
|
+
2. **Tool creation signature changed**
|
|
136
|
+
- `create_tool_instance()` now accepts `chat:` and `agent_definition:` parameters
|
|
137
|
+
- Needed for plugin tools that require full context
|
|
138
|
+
|
|
139
|
+
3. **AgentInitializer signature changed**
|
|
140
|
+
- Constructor now takes `plugin_storages` instead of `memory_storages`
|
|
141
|
+
- Internal change - doesn't affect public API
|
|
142
|
+
|
|
143
|
+
## [2.0.6]
|
|
144
|
+
|
|
145
|
+
### Fixed
|
|
146
|
+
- **MCP parameter type handling**: Fixed issue with parameter type conversion in ruby_llm-mcp
|
|
147
|
+
- Added monkey patch to remove `to_sym` conversion on MCP parameter types
|
|
148
|
+
|
|
149
|
+
## [2.0.5]
|
|
150
|
+
|
|
151
|
+
### Added
|
|
152
|
+
|
|
153
|
+
- **WebFetch Tool** - Fetch and process web content
|
|
154
|
+
- Fetches URLs and converts HTML to Markdown
|
|
155
|
+
- Optional LLM processing via `SwarmSDK.configure { |c| c.webfetch_provider; c.webfetch_model }`
|
|
156
|
+
- Uses `reverse_markdown` gem if installed, falls back to built-in converter
|
|
157
|
+
- 15-minute caching, redirect detection, comprehensive error handling
|
|
158
|
+
- Default tool (available to all agents)
|
|
159
|
+
|
|
160
|
+
- **HtmlConverter** - HTML to Markdown conversion
|
|
161
|
+
- Conditional gem usage pattern (uses `reverse_markdown` if installed)
|
|
162
|
+
- Built-in fallback for common HTML elements
|
|
163
|
+
- Follows DocumentConverter pattern for consistency
|
|
164
|
+
|
|
165
|
+
- **Memory System** - Per-agent persistent knowledge storage
|
|
166
|
+
- **MemoryStorage class**: Persistent storage to `{directory}/memory.json`
|
|
167
|
+
- **7 Memory tools**: MemoryWrite, MemoryRead, MemoryEdit, MemoryMultiEdit, MemoryGlob, MemoryGrep, MemoryDelete
|
|
168
|
+
- Per-agent isolation (each agent has own memory)
|
|
169
|
+
- Search results ordered by most recent first
|
|
170
|
+
- Configured via `memory { directory }` DSL or `memory:` YAML field
|
|
171
|
+
- Auto-injected memory system prompt from `lib/swarm_sdk/prompts/memory.md.erb`
|
|
172
|
+
- Comprehensive learning protocols and schemas included
|
|
173
|
+
|
|
174
|
+
- **Memory Configuration DSL**
|
|
175
|
+
```ruby
|
|
176
|
+
agent :assistant do
|
|
177
|
+
memory do
|
|
178
|
+
adapter :filesystem # optional, default
|
|
179
|
+
directory ".swarm/assistant-memory" # required
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- **Memory Configuration YAML**
|
|
185
|
+
```yaml
|
|
186
|
+
agents:
|
|
187
|
+
assistant:
|
|
188
|
+
memory:
|
|
189
|
+
adapter: filesystem
|
|
190
|
+
directory: .swarm/assistant-memory
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
- **Scratchpad Configuration DSL** - Enable/disable at swarm level
|
|
194
|
+
```ruby
|
|
195
|
+
SwarmSDK.build do
|
|
196
|
+
use_scratchpad true # or false (default: true)
|
|
197
|
+
end
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
- **Scratchpad Configuration YAML**
|
|
201
|
+
```yaml
|
|
202
|
+
swarm:
|
|
203
|
+
use_scratchpad: true # or false
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
- **Agent Start Events** - New log event after agent initialization
|
|
207
|
+
- Emits `agent_start` with full agent configuration
|
|
208
|
+
- Includes: agent, model, provider, directory, system_prompt, tools, delegates_to, memory_enabled, memory_directory, timestamp
|
|
209
|
+
- Useful for debugging and configuration verification
|
|
210
|
+
|
|
211
|
+
- **SwarmSDK Global Settings** - `SwarmSDK.configure` for global configuration
|
|
212
|
+
- WebFetch settings: `webfetch_provider`, `webfetch_model`, `webfetch_base_url`, `webfetch_max_tokens`
|
|
213
|
+
- Separate from YAML Configuration class (renamed to Settings internally)
|
|
214
|
+
|
|
215
|
+
- **Learning Assistant Example** - Complete example in `examples/learning-assistant/`
|
|
216
|
+
- Agent that learns and builds knowledge over time
|
|
217
|
+
- Memory schema with YAML frontmatter + Markdown
|
|
218
|
+
- Example memory entries (concept, fact, skill, experience)
|
|
219
|
+
- Comprehensive learning protocols and best practices
|
|
220
|
+
|
|
221
|
+
### Changed
|
|
222
|
+
|
|
223
|
+
- **Scratchpad Architecture** - Complete redesign
|
|
224
|
+
- **Was**: Single persistent storage with comprehensive tools (Edit, Glob, Grep, etc.)
|
|
225
|
+
- **Now**: Simplified volatile storage with 3 tools (Write, Read, List)
|
|
226
|
+
- **Purpose**: Temporary work-in-progress sharing between agents
|
|
227
|
+
- **Scope**: Shared across all agents (volatile, in-memory only)
|
|
228
|
+
- **Old comprehensive features** moved to Memory system
|
|
229
|
+
|
|
230
|
+
- **Storage renamed**: `updated_at` instead of `created_at`
|
|
231
|
+
- More accurate since writes update existing entries
|
|
232
|
+
- Affects both MemoryStorage and ScratchpadStorage
|
|
233
|
+
|
|
234
|
+
- **Storage architecture** - Introduced abstract base class
|
|
235
|
+
- `Storage` (abstract base)
|
|
236
|
+
- `MemoryStorage` (persistent, per-agent)
|
|
237
|
+
- `ScratchpadStorage` (volatile, shared)
|
|
238
|
+
- Future-ready for SQLite and FAISS adapters
|
|
239
|
+
|
|
240
|
+
- **Default tools** - Conditional inclusion
|
|
241
|
+
- Core defaults: Read, Grep, Glob, TodoWrite, Think, WebFetch
|
|
242
|
+
- Scratchpad tools: Added if `use_scratchpad true` (default)
|
|
243
|
+
- Memory tools: Added if agent has `memory` configured
|
|
244
|
+
- Enables fine-grained control over tool availability
|
|
245
|
+
|
|
246
|
+
- **Cost Tracking** - Fixed to use SwarmSDK's models.json
|
|
247
|
+
- **Was**: Used `RubyLLM.models.find()` which lacks current model pricing
|
|
248
|
+
- **Now**: Uses `SwarmSDK::Models.find()` with up-to-date pricing
|
|
249
|
+
- Accurate cost calculation for all models in SwarmSDK registry
|
|
250
|
+
|
|
251
|
+
- **Read tracker renamed**: `ScratchpadReadTracker` → `StorageReadTracker`
|
|
252
|
+
- More general name since it's used by both Memory and Scratchpad
|
|
253
|
+
- Consistent with Storage abstraction
|
|
254
|
+
|
|
255
|
+
### Removed
|
|
256
|
+
|
|
257
|
+
- **Old Scratchpad tools** - Moved to Memory system
|
|
258
|
+
- ScratchpadEdit → MemoryEdit
|
|
259
|
+
- ScratchpadMultiEdit → MemoryMultiEdit
|
|
260
|
+
- ScratchpadGlob → MemoryGlob
|
|
261
|
+
- ScratchpadGrep → MemoryGrep
|
|
262
|
+
- ScratchpadDelete → MemoryDelete
|
|
263
|
+
|
|
264
|
+
- **Scratchpad persistence** - Now volatile
|
|
265
|
+
- No longer persists to `.swarm/scratchpad.json`
|
|
266
|
+
- Use Memory system for persistent storage
|
|
267
|
+
|
|
268
|
+
### Breaking Changes
|
|
269
|
+
|
|
270
|
+
⚠️ **Major breaking changes requiring migration:**
|
|
271
|
+
|
|
272
|
+
1. **Scratchpad tools removed**: ScratchpadEdit, ScratchpadMultiEdit, ScratchpadGlob, ScratchpadGrep, ScratchpadDelete
|
|
273
|
+
- **Migration**: Use Memory tools instead for persistent storage needs
|
|
274
|
+
|
|
275
|
+
2. **Scratchpad is now volatile**: Does not persist across sessions
|
|
276
|
+
- **Migration**: Configure `memory` for agents that need persistence
|
|
277
|
+
|
|
278
|
+
3. **Storage field renamed**: `created_at` → `updated_at`
|
|
279
|
+
- **Migration**: Old persisted scratchpad.json files will not load
|
|
280
|
+
|
|
281
|
+
4. **Default tools behavior changed**: Memory and Scratchpad are conditional
|
|
282
|
+
- Scratchpad: Enabled by default via `use_scratchpad true`
|
|
283
|
+
- Memory: Opt-in via `memory` configuration
|
|
284
|
+
- **Migration**: Explicitly configure if needed
|
|
285
|
+
|
|
286
|
+
## [2.0.4]
|
|
287
|
+
|
|
288
|
+
### Added
|
|
289
|
+
- **ScratchpadGlob Tool** - Search scratchpad entries by glob pattern
|
|
290
|
+
- Supports `*` (wildcard), `**` (recursive), and `?` (single char) patterns
|
|
291
|
+
- Returns matching entries with titles and sizes
|
|
292
|
+
- Example: `ScratchpadGlob.execute(pattern: "parallel/*/task_*")`
|
|
293
|
+
- **ScratchpadGrep Tool** - Search scratchpad content by regex pattern
|
|
294
|
+
- Case-sensitive and case-insensitive search options
|
|
295
|
+
- Three output modes: `files_with_matches`, `content` (with line numbers), `count`
|
|
296
|
+
- Example: `ScratchpadGrep.execute(pattern: "error", output_mode: "content")`
|
|
297
|
+
- **ScratchpadRead Line Numbers** - Now returns formatted output with line numbers
|
|
298
|
+
- Uses same format as Read tool: `"line_number→content"`
|
|
299
|
+
- Compatible with Edit/MultiEdit tools for accurate content matching
|
|
300
|
+
- **ScratchpadEdit Tool** - Edit scratchpad entries with exact string replacement
|
|
301
|
+
- Performs exact string replacements in scratchpad content
|
|
302
|
+
- Enforces read-before-edit rule for safety
|
|
303
|
+
- Supports `replace_all` parameter for multiple replacements
|
|
304
|
+
- Preserves entry titles when updating content
|
|
305
|
+
- Example: `ScratchpadEdit.execute(file_path: "report", old_string: "draft", new_string: "final")`
|
|
306
|
+
- **ScratchpadMultiEdit Tool** - Apply multiple edits to a scratchpad entry
|
|
307
|
+
- Sequential edit application (later edits see results of earlier ones)
|
|
308
|
+
- JSON-based edit specification for multiple operations
|
|
309
|
+
- All-or-nothing approach: if any edit fails, no changes are saved
|
|
310
|
+
- Example: `ScratchpadMultiEdit.execute(file_path: "doc", edits_json: '[{"old_string":"foo","new_string":"bar"}]')`
|
|
311
|
+
- **Scratchpad Persistence** - Automatic JSON file persistence
|
|
312
|
+
- All scratchpad data automatically persists to `.swarm/scratchpad.json`
|
|
313
|
+
- Thread-safe write operations with atomic file updates
|
|
314
|
+
- Automatic loading on initialization
|
|
315
|
+
- Graceful error handling for corrupted files
|
|
316
|
+
- Human-readable JSON format with metadata (title, created_at, size)
|
|
317
|
+
|
|
318
|
+
### Changed
|
|
319
|
+
- **Scratchpad Data Location** - Moved from memory-only to persistent storage
|
|
320
|
+
- Data survives swarm restarts
|
|
321
|
+
- Stored in `.swarm/scratchpad.json` (hidden directory)
|
|
322
|
+
- Added to `.gitignore` to prevent committing scratchpad data
|
|
323
|
+
- **Test Infrastructure** - Dependency injection for test isolation
|
|
324
|
+
- Tests use temporary files instead of `.swarm/scratchpad.json`
|
|
325
|
+
- New helper: `create_test_scratchpad()` for isolated test data
|
|
326
|
+
- Automatic cleanup of test files after test runs
|
|
327
|
+
|
|
328
|
+
### Removed
|
|
329
|
+
- **ScratchpadList Tool** - Replaced by more powerful ScratchpadGlob
|
|
330
|
+
- Use `ScratchpadGlob.execute(pattern: "**")` to list all entries
|
|
331
|
+
- Use `ScratchpadGlob.execute(pattern: "prefix/**")` to filter by prefix
|
|
332
|
+
|
|
333
|
+
## [2.0.2] - 2025-10-17
|
|
334
|
+
|
|
335
|
+
### Added
|
|
336
|
+
- **Claude Code Agent File Compatibility** (#141)
|
|
337
|
+
- Automatically detects and converts Claude Code agent markdown files
|
|
338
|
+
- Supports model shortcuts: `sonnet`, `opus`, `haiku` → latest model IDs
|
|
339
|
+
- DSL/YAML overrides: `agent :name, File.read("file.md") do ... end`
|
|
340
|
+
- Model alias system via `model_aliases.json` for easy updates
|
|
341
|
+
- Static model validation using `models.json` (no network calls, no API keys)
|
|
342
|
+
- Improved model suggestions with provider prefix stripping
|
|
343
|
+
|
|
344
|
+
### Changed
|
|
345
|
+
- Model validation now uses SwarmSDK's static registry instead of RubyLLM's dynamic registry
|
|
346
|
+
- All agents now use `assume_model_exists: true` by default (SwarmSDK validates separately)
|
|
347
|
+
- Model suggestions properly handle provider-prefixed queries (e.g., `anthropic:claude-sonnet-4-5`)
|
|
348
|
+
- Environment block (`<env>`) now included in ALL agent system prompts (previously only `coding_agent: true`)
|
|
349
|
+
|
|
350
|
+
## [2.0.1] - 2025-10-17
|
|
351
|
+
|
|
352
|
+
### Fixed
|
|
353
|
+
- Add id to MCP notifications/initialized message (#140)
|
|
354
|
+
|
|
355
|
+
### Removed
|
|
356
|
+
- Removed outdated example files (examples/v2/README-formats.md and examples/v2/mcp.json)
|
|
357
|
+
|
|
358
|
+
## [2.0.0] - 2025-10-17
|
|
359
|
+
|
|
360
|
+
Initial release of SwarmSDK.
|
|
361
|
+
|
|
362
|
+
See https://github.com/parruda/claude-swarm/pull/137
|
data/docs/v2/README.md
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# SwarmSDK & SwarmCLI Documentation
|
|
2
|
+
|
|
3
|
+
**Version 2.0**
|
|
4
|
+
|
|
5
|
+
Welcome to the official documentation for SwarmSDK and SwarmCLI - a Ruby framework for orchestrating multiple AI agents as a collaborative team.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📚 Getting Started
|
|
10
|
+
|
|
11
|
+
**New to SwarmSDK?** Start here:
|
|
12
|
+
|
|
13
|
+
### For SDK Users
|
|
14
|
+
- **[Getting Started with SwarmSDK](guides/getting-started.md)** ⭐ START HERE
|
|
15
|
+
Learn the basics: installation, core concepts, your first swarm (YAML & Ruby DSL)
|
|
16
|
+
|
|
17
|
+
### For CLI Users
|
|
18
|
+
- **[Getting Started with SwarmCLI](guides/quick-start-cli.md)** ⭐ START HERE
|
|
19
|
+
Command-line interface: interactive REPL and automation modes
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 📖 Comprehensive Tutorial
|
|
24
|
+
|
|
25
|
+
**Ready to master SwarmSDK?** This tutorial covers 100% of features:
|
|
26
|
+
|
|
27
|
+
- **[SwarmSDK Complete Tutorial](guides/complete-tutorial.md)**
|
|
28
|
+
In-depth guide covering every single feature with progressive complexity:
|
|
29
|
+
- Part 1: Fundamentals (agents, models, tools)
|
|
30
|
+
- Part 2: Tools & Permissions (all 11 tools, path/command permissions)
|
|
31
|
+
- Part 3: Agent Collaboration (delegation patterns, markdown agents)
|
|
32
|
+
- Part 4: Hooks System (all 12 events, 6 actions)
|
|
33
|
+
- Part 5: Node Workflows (multi-stage pipelines, transformers)
|
|
34
|
+
- Part 6: Advanced Configuration (MCP, providers, context management)
|
|
35
|
+
- Part 7: Production Features (logging, cost tracking, error handling)
|
|
36
|
+
- Part 8: Best Practices (architecture, testing, optimization)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 📚 Reference Documentation
|
|
41
|
+
|
|
42
|
+
**Quick lookups and complete API reference:**
|
|
43
|
+
|
|
44
|
+
### Command-Line Interface
|
|
45
|
+
- **[CLI Reference](reference/cli.md)**
|
|
46
|
+
Complete reference for all swarm commands: `run`, `migrate`, `mcp serve`, `mcp tools`
|
|
47
|
+
|
|
48
|
+
### Ruby DSL API
|
|
49
|
+
- **[Ruby DSL Reference](reference/ruby-dsl.md)**
|
|
50
|
+
Complete programmatic API: `SwarmSDK.build`, agent DSL, permissions DSL, node DSL, hooks
|
|
51
|
+
|
|
52
|
+
### YAML Configuration
|
|
53
|
+
- **[YAML Configuration Reference](reference/yaml.md)**
|
|
54
|
+
Complete YAML structure: agents, tools, permissions, hooks, MCP servers
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 🛠️ Integration Guides
|
|
59
|
+
|
|
60
|
+
### SwarmMemory
|
|
61
|
+
- **[SwarmMemory Guide](guides/swarm-memory.md)** ⭐ NEW
|
|
62
|
+
Persistent agent knowledge storage with semantic search:
|
|
63
|
+
- Installation and setup
|
|
64
|
+
- 4 memory categories (concept, fact, skill, experience)
|
|
65
|
+
- 9 memory tools (MemoryWrite, LoadSkill, etc.)
|
|
66
|
+
- Automatic skill discovery (hybrid semantic + keyword)
|
|
67
|
+
- Relationship discovery and knowledge graphs
|
|
68
|
+
- Performance and troubleshooting
|
|
69
|
+
|
|
70
|
+
### Plugin System
|
|
71
|
+
- **[Plugin System Guide](guides/plugins.md)** ⭐ NEW
|
|
72
|
+
Build extensions for SwarmSDK:
|
|
73
|
+
- Plugin architecture and design principles
|
|
74
|
+
- Writing custom plugins step-by-step
|
|
75
|
+
- Lifecycle hooks (agent init, user messages, etc.)
|
|
76
|
+
- Tool providers and storage management
|
|
77
|
+
- Testing and best practices
|
|
78
|
+
- Real-world example (SwarmMemory plugin)
|
|
79
|
+
|
|
80
|
+
### Memory Adapters
|
|
81
|
+
- **[Memory Adapter Development](guides/memory-adapters.md)** ⭐ NEW
|
|
82
|
+
Build custom storage backends for SwarmMemory:
|
|
83
|
+
- Adapter interface and requirements
|
|
84
|
+
- FilesystemAdapter deep dive
|
|
85
|
+
- Vector database adapters (Qdrant, Milvus)
|
|
86
|
+
- Relational database adapters (PostgreSQL + pgvector)
|
|
87
|
+
- Testing and performance optimization
|
|
88
|
+
|
|
89
|
+
### Rails Integration
|
|
90
|
+
- **[Rails Integration Guide](guides/rails-integration.md)**
|
|
91
|
+
Comprehensive guide for integrating SwarmSDK into Ruby on Rails applications:
|
|
92
|
+
- Background jobs (ActiveJob, Sidekiq)
|
|
93
|
+
- Controller actions (synchronous endpoints)
|
|
94
|
+
- Model enhancements (AI validations, auto-generation)
|
|
95
|
+
- Rake tasks (batch processing, automation)
|
|
96
|
+
- Action Cable (real-time streaming)
|
|
97
|
+
- Testing strategies (RSpec, VCR, mocking)
|
|
98
|
+
- Security considerations
|
|
99
|
+
- Deployment (Docker, monitoring, health checks)
|
|
100
|
+
|
|
101
|
+
### Claude Code Compatibility
|
|
102
|
+
- **[Using Claude Code Agent Files](guides/claude-code-agents.md)**
|
|
103
|
+
Reuse your existing `.claude/agents/*.md` files with SwarmSDK:
|
|
104
|
+
- Automatic format detection and conversion
|
|
105
|
+
- Model shortcut support (`sonnet`, `opus`, `haiku`)
|
|
106
|
+
- Override settings in YAML/DSL
|
|
107
|
+
- Handle tool permissions and hooks differences
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 🎯 Documentation by Feature
|
|
112
|
+
|
|
113
|
+
### Core Features
|
|
114
|
+
- **Agents**: [Getting Started](guides/getting-started.md#core-concepts) | [Tutorial Part 1](guides/complete-tutorial.md#part-1-fundamentals)
|
|
115
|
+
- **Tools**: [Tutorial Part 2](guides/complete-tutorial.md#part-2-tools-and-permissions)
|
|
116
|
+
- **Delegation**: [Tutorial Part 3](guides/complete-tutorial.md#part-3-agent-collaboration)
|
|
117
|
+
- **Hooks**: [Tutorial Part 4](guides/complete-tutorial.md#part-4-hooks-system)
|
|
118
|
+
- **Node Workflows**: [Tutorial Part 5](guides/complete-tutorial.md#part-5-node-workflows)
|
|
119
|
+
|
|
120
|
+
### Configuration
|
|
121
|
+
- **YAML**: [Getting Started](guides/getting-started.md#configuration-formats) | [YAML Reference](reference/yaml.md)
|
|
122
|
+
- **Ruby DSL**: [Getting Started](guides/getting-started.md#configuration-formats) | [Ruby DSL Reference](reference/ruby-dsl.md)
|
|
123
|
+
- **Permissions**: [Tutorial Part 2](guides/complete-tutorial.md#permissions-system) | [YAML Reference](reference/yaml.md#permissions-configuration)
|
|
124
|
+
|
|
125
|
+
### Advanced Features
|
|
126
|
+
- **SwarmMemory**: [SwarmMemory Guide](guides/swarm-memory.md) | [Adapter Guide](guides/memory-adapters.md)
|
|
127
|
+
- **Plugin System**: [Plugin Guide](guides/plugins.md)
|
|
128
|
+
- **Context Management**: [Tutorial Part 6](guides/complete-tutorial.md#context-window-management) | [Ruby DSL Ref](reference/ruby-dsl.md#context-management)
|
|
129
|
+
- **MCP Servers**: [Tutorial Part 6](guides/complete-tutorial.md#mcp-server-integration)
|
|
130
|
+
- **Custom Providers**: [Tutorial Part 6](guides/complete-tutorial.md#custom-providers-and-models)
|
|
131
|
+
- **Rate Limiting**: [Tutorial Part 6](guides/complete-tutorial.md#rate-limiting)
|
|
132
|
+
|
|
133
|
+
### Production
|
|
134
|
+
- **Logging**: [Tutorial Part 7](guides/complete-tutorial.md#structured-logging)
|
|
135
|
+
- **Error Handling**: [Tutorial Part 7](guides/complete-tutorial.md#error-handling-and-recovery)
|
|
136
|
+
- **Testing**: [Tutorial Part 8](guides/complete-tutorial.md#testing-strategies) | [Rails Guide](guides/rails-integration.md#testing-strategies)
|
|
137
|
+
- **Best Practices**: [Tutorial Part 8](guides/complete-tutorial.md#best-practices)
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## 🚀 Quick Links by Role
|
|
142
|
+
|
|
143
|
+
### I want to...
|
|
144
|
+
|
|
145
|
+
**Learn SwarmSDK from scratch**
|
|
146
|
+
→ [Getting Started with SwarmSDK](guides/getting-started.md)
|
|
147
|
+
|
|
148
|
+
**Use the command-line interface**
|
|
149
|
+
→ [Getting Started with SwarmCLI](guides/quick-start-cli.md)
|
|
150
|
+
|
|
151
|
+
**Master all SwarmSDK features**
|
|
152
|
+
→ [Complete Tutorial](guides/complete-tutorial.md)
|
|
153
|
+
|
|
154
|
+
**Integrate with Rails**
|
|
155
|
+
→ [Rails Integration Guide](guides/rails-integration.md)
|
|
156
|
+
|
|
157
|
+
**Look up a specific CLI command**
|
|
158
|
+
→ [CLI Reference](reference/cli.md)
|
|
159
|
+
|
|
160
|
+
**Look up a Ruby DSL method**
|
|
161
|
+
→ [Ruby DSL Reference](reference/ruby-dsl.md)
|
|
162
|
+
|
|
163
|
+
**Look up a YAML configuration option**
|
|
164
|
+
→ [YAML Reference](reference/yaml.md)
|
|
165
|
+
|
|
166
|
+
**Add persistent memory to agents**
|
|
167
|
+
→ [SwarmMemory Guide](guides/swarm-memory.md)
|
|
168
|
+
|
|
169
|
+
**Build a SwarmSDK plugin**
|
|
170
|
+
→ [Plugin System Guide](guides/plugins.md)
|
|
171
|
+
|
|
172
|
+
**Build a custom storage adapter**
|
|
173
|
+
→ [Memory Adapter Guide](guides/memory-adapters.md)
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 📊 Documentation Structure
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
docs/v2/
|
|
181
|
+
├── README.md # This file - documentation index
|
|
182
|
+
│
|
|
183
|
+
├── guides/ # User-facing guides
|
|
184
|
+
│ ├── getting-started.md # SDK quick start (YAML + Ruby DSL)
|
|
185
|
+
│ ├── quick-start-cli.md # CLI quick start
|
|
186
|
+
│ ├── complete-tutorial.md # 100% feature coverage tutorial
|
|
187
|
+
│ ├── swarm-memory.md # SwarmMemory guide ⭐ NEW
|
|
188
|
+
│ ├── plugins.md # Plugin system guide ⭐ NEW
|
|
189
|
+
│ ├── memory-adapters.md # Adapter development ⭐ NEW
|
|
190
|
+
│ ├── rails-integration.md # Rails integration guide
|
|
191
|
+
│ └── claude-code-agents.md # Claude Code compatibility
|
|
192
|
+
│
|
|
193
|
+
├── reference/ # Complete API references
|
|
194
|
+
│ ├── cli.md # CLI command reference
|
|
195
|
+
│ ├── ruby-dsl.md # Ruby DSL API reference
|
|
196
|
+
│ └── yaml.md # YAML configuration reference
|
|
197
|
+
│
|
|
198
|
+
└── CHANGELOG.swarm_sdk.md # SwarmSDK version history
|
|
199
|
+
CHANGELOG.swarm_cli.md # SwarmCLI version history
|
|
200
|
+
CHANGELOG.swarm_memory.md # SwarmMemory version history ⭐ NEW
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 🎓 Learning Paths
|
|
206
|
+
|
|
207
|
+
### Path 1: Beginner → Intermediate
|
|
208
|
+
1. [Getting Started with SwarmSDK](guides/getting-started.md) - Core concepts and first swarm
|
|
209
|
+
2. [Getting Started with SwarmCLI](guides/quick-start-cli.md) - Command-line usage
|
|
210
|
+
3. [Complete Tutorial Parts 1-3](guides/complete-tutorial.md) - Fundamentals, tools, delegation
|
|
211
|
+
|
|
212
|
+
### Path 2: Intermediate → Advanced
|
|
213
|
+
1. [Complete Tutorial Parts 4-6](guides/complete-tutorial.md) - Hooks, workflows, advanced config
|
|
214
|
+
2. [Rails Integration](guides/rails-integration.md) - Production integration patterns
|
|
215
|
+
3. [Complete Tutorial Parts 7-8](guides/complete-tutorial.md) - Production features and best practices
|
|
216
|
+
|
|
217
|
+
### Path 3: Reference & API
|
|
218
|
+
1. [Ruby DSL Reference](reference/ruby-dsl.md) - Complete programmatic API
|
|
219
|
+
2. [YAML Reference](reference/yaml.md) - Complete configuration format
|
|
220
|
+
3. [CLI Reference](reference/cli.md) - All command-line options
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 💡 Key Concepts
|
|
225
|
+
|
|
226
|
+
### SwarmSDK
|
|
227
|
+
A Ruby framework for orchestrating multiple AI agents that work together as a team. Each agent has:
|
|
228
|
+
- **Role**: Specialized expertise (backend developer, code reviewer, etc.)
|
|
229
|
+
- **Tools**: Capabilities (Read files, Write files, Run bash commands, etc.)
|
|
230
|
+
- **Delegation**: Ability to delegate subtasks to other agents
|
|
231
|
+
- **Hooks**: Custom logic that runs at key points in execution
|
|
232
|
+
|
|
233
|
+
### SwarmCLI
|
|
234
|
+
A command-line interface for running SwarmSDK swarms with two modes:
|
|
235
|
+
- **Interactive (REPL)**: Conversational interface for exploration and iteration
|
|
236
|
+
- **Non-Interactive**: One-shot execution perfect for automation and scripting
|
|
237
|
+
|
|
238
|
+
### Configuration Formats
|
|
239
|
+
- **YAML**: Declarative, easy to read, great for shell-based hooks
|
|
240
|
+
- **Ruby DSL**: Programmatic, dynamic, full Ruby power, IDE support
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## 🔍 Search by Topic
|
|
245
|
+
|
|
246
|
+
| Topic | Guide | Reference |
|
|
247
|
+
|-------|-------|-----------|
|
|
248
|
+
| **Installation** | [SDK Guide](guides/getting-started.md#installation) | - |
|
|
249
|
+
| **First Swarm** | [SDK Guide](guides/getting-started.md#your-first-swarm) | - |
|
|
250
|
+
| **CLI Commands** | [CLI Guide](guides/quick-start-cli.md#commands-overview) | [CLI Ref](reference/cli.md) |
|
|
251
|
+
| **REPL Mode** | [CLI Guide](guides/quick-start-cli.md#interactive-mode-repl) | [CLI Ref](reference/cli.md#interactive-mode) |
|
|
252
|
+
| **Tools** | [Tutorial Part 2](guides/complete-tutorial.md#part-2-tools-and-permissions) | [YAML Ref](reference/yaml.md#tools) |
|
|
253
|
+
| **Permissions** | [Tutorial Part 2](guides/complete-tutorial.md#permissions-system) | [YAML Ref](reference/yaml.md#permissions-configuration) |
|
|
254
|
+
| **Delegation** | [Tutorial Part 3](guides/complete-tutorial.md#part-3-agent-collaboration) | [Ruby DSL Ref](reference/ruby-dsl.md#delegates_to) |
|
|
255
|
+
| **Hooks** | [Tutorial Part 4](guides/complete-tutorial.md#part-4-hooks-system) | [YAML Ref](reference/yaml.md#hooks-configuration) |
|
|
256
|
+
| **Workflows** | [Tutorial Part 5](guides/complete-tutorial.md#part-5-node-workflows) | [Ruby DSL Ref](reference/ruby-dsl.md#node-builder-dsl) |
|
|
257
|
+
| **MCP Servers** | [Tutorial Part 6](guides/complete-tutorial.md#mcp-server-integration) | [YAML Ref](reference/yaml.md#mcp_servers) |
|
|
258
|
+
| **Rails** | [Rails Guide](guides/rails-integration.md) | - |
|
|
259
|
+
| **Testing** | [Tutorial Part 8](guides/complete-tutorial.md#testing-strategies) | - |
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## 📝 Documentation Standards
|
|
264
|
+
|
|
265
|
+
All documentation in this directory follows these principles:
|
|
266
|
+
|
|
267
|
+
✅ **100% Accurate** - All information verified against source code
|
|
268
|
+
✅ **Comprehensive** - Every feature documented
|
|
269
|
+
✅ **Progressive** - Simple → Intermediate → Advanced
|
|
270
|
+
✅ **Practical** - Real-world examples throughout
|
|
271
|
+
✅ **Both Formats** - YAML and Ruby DSL for everything
|
|
272
|
+
✅ **User-Focused** - Written for developers using SwarmSDK, not implementers
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## 🤝 Contributing
|
|
277
|
+
|
|
278
|
+
Found an issue or want to improve the documentation?
|
|
279
|
+
|
|
280
|
+
1. Check existing documentation is accurate and up-to-date
|
|
281
|
+
2. Follow the established structure and style
|
|
282
|
+
3. Include both YAML and Ruby DSL examples where applicable
|
|
283
|
+
4. Test all code examples before submitting
|
|
284
|
+
5. Keep explanations clear and concise
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## 📄 Version History
|
|
289
|
+
|
|
290
|
+
### v2.0 (January 2025)
|
|
291
|
+
- Complete documentation rewrite
|
|
292
|
+
- Consolidated from 261 files to 7 focused documents
|
|
293
|
+
- 100% feature coverage
|
|
294
|
+
- Added Rails integration guide
|
|
295
|
+
- Added comprehensive tutorial
|
|
296
|
+
- Complete CLI, Ruby DSL, and YAML references
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## 📚 Additional Resources
|
|
301
|
+
|
|
302
|
+
- **GitHub Repository**: [parruda/claude-swarm](https://github.com/parruda/claude-swarm)
|
|
303
|
+
- **RubyGems**: [swarm_sdk](https://rubygems.org/gems/swarm_sdk) | [swarm_cli](https://rubygems.org/gems/swarm_cli) | [swarm_memory](https://rubygems.org/gems/swarm_memory)
|
|
304
|
+
- **Issues & Support**: [GitHub Issues](https://github.com/parruda/claude-swarm/issues)
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
**Ready to get started?** → [Getting Started with SwarmSDK](guides/getting-started.md) or [Getting Started with SwarmCLI](guides/quick-start-cli.md)
|