enhance_swarm 2.1.0 β†’ 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 96486b70ea6b91dd85a7428f69a134473251a9da3631524231ff6dc666703b01
4
- data.tar.gz: 0ab0529529648d4ce97874cd98abaf39e30494793eb5f32e66bf5292d7add096
3
+ metadata.gz: 7b8c5522c0ed58c3863fddfd4e6f11d0d091440ae2de4b863bfae7e7bece5b6b
4
+ data.tar.gz: 286889e00e4f50c6100d5012f1320bb06ce6270c6b6b9dbcce2cd26846c1a16c
5
5
  SHA512:
6
- metadata.gz: 8c3aa14e5be811b9cabeac1444a80845b226a109e39fee236bc00bfc03a9f94d0190e8ff3b7bc1dd27ac6ee6af0629e50128262292b7322313cf8322bb807834
7
- data.tar.gz: e929cbad2a991ff4bd879456bef4785012763301fbe37c6f333388deea820e300ff6e5cc573bebc2193223c320e4523d7af242bf041a40b16e18789fd22541ca
6
+ metadata.gz: 9ed4192cb031f30d8baa2fcd9762ef161e463c23d01b44f14a6c2663dcac11896001a23fc8fb523fd75caf38e63c4d1555523c782c38ae7bc334d82e20ebb93d
7
+ data.tar.gz: 97aeaaf8afcd9396f6441ae82666759aaa25c545eb693371731a3d991372a25d1c9e84065143aad3a45155d0a58519f830dbfafa9dd6b518d517e045cb23bf27
data/CHANGELOG.md CHANGED
@@ -5,6 +5,24 @@ All notable changes to EnhanceSwarm will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.1.1] - 2025-06-30
9
+
10
+ ### πŸ”§ Critical Bug Fixes
11
+
12
+ #### πŸ’₯ Production Issues Resolved
13
+ - **βœ… CRITICAL: Fixed Detached Mode Logging** - Absolute paths prevent log files from disappearing in background processes
14
+ - **βœ… CRITICAL: Fixed Bullet Train Super Scaffolding** - Non-interactive printf commands prevent NoMethodError on interactive prompts
15
+ - **βœ… Enhanced Non-Interactive Templates** - Comprehensive printf templates for common BT scaffolding patterns
16
+ - **βœ… Improved Status Reporting** - Better orchestration monitoring and error handling
17
+
18
+ #### πŸ› οΈ Technical Improvements
19
+ - **Detached Mode:** Fixed absolute path resolution for `.enhance_swarm/logs/` directory
20
+ - **BT Scaffolding:** Added `printf "y\\n[slug]\\n[icon]\\n"` templates for common Super Scaffolding patterns
21
+ - **Error Handling:** Enhanced subprocess error capture and reporting
22
+ - **Status Monitoring:** Reliable status file writing with working directory context
23
+
24
+ This patch release ensures production orchestration reliability with proper logging and Bullet Train scaffolding compliance.
25
+
8
26
  ## [2.1.0] - 2025-06-30
9
27
 
10
28
  ### πŸ”₯ Critical Orchestration Fixes & Production Enhancements
@@ -0,0 +1,117 @@
1
+ # πŸš€ Production Installation & Test Guide - v2.1.0
2
+
3
+ ## βœ… Quick Test with Published Gem
4
+
5
+ ### 1. Install Latest Version
6
+ ```bash
7
+ # Install the latest version with all critical fixes
8
+ gem install enhance_swarm
9
+
10
+ # Verify version 2.1.0+
11
+ enhance-swarm --version
12
+ ```
13
+
14
+ ### 2. Create Test Project
15
+ ```bash
16
+ # Create fresh Rails app
17
+ rails new enhance_test_production && cd enhance_test_production
18
+
19
+ # Initialize git (required)
20
+ git init && git add -A && git commit -m "Initial Rails app"
21
+ ```
22
+
23
+ ### 3. Run Production Test
24
+ ```bash
25
+ # Test detached orchestration (recommended)
26
+ enhance-swarm orchestrate "Create a Contact management system with name, email, phone, company fields and full CRUD operations" --detached
27
+
28
+ # Monitor progress
29
+ enhance-swarm status
30
+
31
+ # Watch logs
32
+ tail -f .enhance_swarm/logs/orchestration.log
33
+ ```
34
+
35
+ ### 4. Verify Results (2-3 minutes)
36
+ ```bash
37
+ # Check completion
38
+ cat .enhance_swarm/logs/orchestration_status.txt
39
+ # Should show: COMPLETED
40
+
41
+ # Verify files created
42
+ find . -name "*contact*" -type f | head -10
43
+
44
+ # Check git commit
45
+ git log --oneline -5 | grep "EnhanceSwarm"
46
+ ```
47
+
48
+ ## πŸš… Bullet Train Test
49
+
50
+ ### 1. Setup Bullet Train Project
51
+ ```bash
52
+ # Clone Bullet Train starter
53
+ git clone https://github.com/bullet-train-co/bullet_train.git bt_production_test
54
+ cd bt_production_test
55
+
56
+ # Setup (follow BT docs)
57
+ bundle install && yarn install
58
+ rails db:create db:migrate db:seed
59
+ git add -A && git commit -m "Initial BT setup"
60
+ ```
61
+
62
+ ### 2. Test with Bullet Train Conventions
63
+ ```bash
64
+ # Run orchestration with BT-specific task
65
+ enhance-swarm orchestrate "Create a Project management system using Bullet Train Super Scaffolding with title, description, status, due_date fields" --detached
66
+
67
+ # Monitor until completion
68
+ enhance-swarm status && tail -f .enhance_swarm/logs/orchestration.log
69
+ ```
70
+
71
+ ### 3. Verify Bullet Train Results
72
+ ```bash
73
+ # Should create files with:
74
+ # βœ… Proper BT includes (include Projects::Base)
75
+ # βœ… Magic comments (πŸš… add associations above)
76
+ # βœ… Tailwind CSS styling (NOT Bootstrap)
77
+ # βœ… Team-scoped architecture
78
+ # βœ… Super Scaffolding patterns
79
+
80
+ grep -r "include.*Base" app/models/
81
+ grep -r "πŸš…" app/models/
82
+ grep -r "bg-white\|text-gray" app/views/
83
+ ```
84
+
85
+ ## 🎯 Expected Results
86
+
87
+ ### βœ… Success Indicators
88
+ - **Status**: `COMPLETED` in 2-3 minutes
89
+ - **Files**: 10-15 files created including models, controllers, views, migrations
90
+ - **Quality**: Professional validations, responsive UI, comprehensive tests
91
+ - **Git**: Automatic commit with descriptive message
92
+ - **Styling**: Tailwind CSS for BT, Bootstrap/Tailwind for Rails
93
+
94
+ ### ⚠️ Troubleshooting
95
+ ```bash
96
+ # If orchestration hangs
97
+ enhance-swarm status
98
+
99
+ # Check for errors
100
+ cat .enhance_swarm/logs/orchestration.log | grep ERROR
101
+
102
+ # Verify Claude CLI
103
+ claude --version
104
+ ```
105
+
106
+ ---
107
+
108
+ ## πŸ“‹ What's New in v2.1.0
109
+
110
+ βœ… **Detached Mode**: Non-blocking orchestration with `--detached`
111
+ βœ… **Status Monitoring**: Real-time progress with `enhance-swarm status`
112
+ βœ… **Worktree Merging**: Agents properly merge changes to main project
113
+ βœ… **Tailwind Default**: Bullet Train projects use Tailwind CSS automatically
114
+ βœ… **Enhanced Prompting**: Mandatory Super Scaffolding for BT projects
115
+ βœ… **Timeout Controls**: 120-second timeouts with proper error handling
116
+
117
+ **πŸš€ Ready for production with `gem install enhance_swarm`!**
data/README.md CHANGED
@@ -18,6 +18,7 @@ EnhanceSwarm transforms Claude into a sophisticated development team that works
18
18
  ### Installation
19
19
  ```bash
20
20
  gem install enhance_swarm
21
+ # Version 2.1.0+ required for critical fixes and detached mode
21
22
  ```
22
23
 
23
24
  ### Initialize in Your Project
@@ -350,15 +350,28 @@ module EnhanceSwarm
350
350
  ```
351
351
 
352
352
  **🚨 MANDATORY EXECUTION SEQUENCE - NO EXCEPTIONS:**
353
- 1. FIRST: bundle exec rails generate super_scaffold Contact Team name:text_field email:email_field phone:phone_field company:text_field
353
+ 1. FIRST: Use Super Scaffolding with non-interactive mode:
354
+ ```bash
355
+ # For Contact model:
356
+ printf "y\\ncontacts\\nti-address-book\\n" | bundle exec rails generate super_scaffold Contact Team name:text_field email:email_field phone:phone_field company:text_field
357
+
358
+ # For Project model:
359
+ printf "y\\nprojects\\nti-view-grid\\n" | bundle exec rails generate super_scaffold Project Team title:text_field description:trix_editor status:buttons due_date:date_field
360
+
361
+ # Template for any model:
362
+ printf "y\\n[plural_slug]\\n[icon_name]\\n" | bundle exec rails generate super_scaffold [ModelName] Team [field:type ...]
363
+ ```
364
+ - Auto-answers: navbar=yes, slug=[plural_slug], icon=[icon_name]
365
+ - Common icons: ti-address-book, ti-view-grid, ti-users, ti-folder, ti-calendar
354
366
  2. THEN: bundle exec rails db:migrate
355
367
  3. THEN: bundle exec rails test (to verify everything works)
356
- 4. ONLY IF NEEDED: bin/resolve Contacts::Base --eject --open (for customization)
368
+ 4. ONLY IF NEEDED: bin/resolve Projects::Base --eject --open (for customization)
357
369
  5. Configure config/models/roles.yml with proper permissions
358
370
 
359
371
  **🚨 CRITICAL: You MUST actually run these commands using the Bash tool - not just describe them!**
360
372
  **🚨 DO NOT create manual Rails models/controllers - ONLY use Super Scaffolding!**
361
373
  **🚨 NEVER skip step 1 - Super Scaffolding is MANDATORY for Bullet Train projects!**
374
+ **🚨 ALWAYS use printf with proper answers for interactive prompts!**
362
375
 
363
376
  **API Routes (add to config/routes/api/v1.rb):**
364
377
  ```ruby
@@ -652,30 +652,31 @@ module EnhanceSwarm
652
652
  require '#{File.expand_path('../../enhance_swarm', __FILE__)}'
653
653
 
654
654
  task_desc = ENV['ENHANCE_SWARM_TASK']
655
+ working_dir = '#{Dir.pwd}'
655
656
 
656
657
  begin
657
- Dir.chdir('#{Dir.pwd}')
658
+ Dir.chdir(working_dir)
658
659
 
659
- File.write('.enhance_swarm/logs/orchestration_status.txt', 'RUNNING')
660
- File.write('.enhance_swarm/logs/orchestration.log',
661
- "\#{Time.now}: Coordinator starting\\n", mode: 'a')
660
+ File.write("\#{working_dir}/.enhance_swarm/logs/orchestration_status.txt", 'RUNNING')
661
+ File.write("\#{working_dir}/.enhance_swarm/logs/orchestration.log",
662
+ "\#{Time.now}: Coordinator starting in \#{working_dir}\\n", mode: 'a')
662
663
 
663
664
  coordinator = EnhanceSwarm::TaskCoordinator.new
664
665
  coordinator.coordinate_task(task_desc)
665
666
 
666
- File.write('.enhance_swarm/logs/orchestration_status.txt', 'COMPLETED')
667
- File.write('.enhance_swarm/logs/orchestration.log',
667
+ File.write("\#{working_dir}/.enhance_swarm/logs/orchestration_status.txt", 'COMPLETED')
668
+ File.write("\#{working_dir}/.enhance_swarm/logs/orchestration.log",
668
669
  "\#{Time.now}: Orchestration completed successfully\\n", mode: 'a')
669
670
 
670
671
  rescue => e
671
- File.write('.enhance_swarm/logs/orchestration_status.txt', "FAILED: \#{e.message}")
672
- File.write('.enhance_swarm/logs/orchestration.log',
672
+ File.write("\#{working_dir}/.enhance_swarm/logs/orchestration_status.txt", "FAILED: \#{e.message}")
673
+ File.write("\#{working_dir}/.enhance_swarm/logs/orchestration.log",
673
674
  "\#{Time.now}: ERROR: \#{e.message}\\n\#{e.backtrace.first(3).join('\\n')}\\n", mode: 'a')
674
675
  end
675
676
  RUBY
676
677
  chdir: Dir.pwd,
677
- out: '.enhance_swarm/logs/orchestration.log',
678
- err: '.enhance_swarm/logs/orchestration.log'
678
+ out: File.join(Dir.pwd, '.enhance_swarm/logs/orchestration.log'),
679
+ err: File.join(Dir.pwd, '.enhance_swarm/logs/orchestration.log')
679
680
  )
680
681
 
681
682
  # Store PID and detach
@@ -20,19 +20,37 @@ module EnhanceSwarm
20
20
  end
21
21
 
22
22
  def coordinate_task(description)
23
- Logger.info("🎯 Starting intelligent task coordination: #{description}")
23
+ Logger.info("🎯 ENHANCE SWARM TASK COORDINATOR ACTIVATED")
24
+ Logger.info("πŸ“‹ Master Task: #{description}")
25
+ Logger.info("πŸ” Beginning intelligent task analysis and decomposition...")
24
26
 
25
27
  # 1. Analyze project context
28
+ Logger.info("πŸ”¬ PHASE 1: Project Context Analysis")
26
29
  @project_analyzer.analyze
27
30
  project_context = @project_analyzer.generate_smart_defaults
28
31
 
32
+ project_type = project_context[:project_type] || 'Generic'
33
+ tech_stack = project_context[:technology_stack]&.join(', ') || 'Unknown'
34
+ Logger.info(" πŸ“Š Detected: #{project_type} project using #{tech_stack}")
35
+
29
36
  # 2. Break down task into specialized subtasks
37
+ Logger.info("🧩 PHASE 2: Intelligent Task Decomposition")
30
38
  subtasks = decompose_task(description, project_context)
39
+ Logger.info(" ⚑ Decomposed into #{subtasks.length} specialized agent tasks")
40
+ subtasks.each_with_index do |task, i|
41
+ Logger.info(" #{i+1}. #{task[:role].upcase}: #{task[:description]}")
42
+ end
31
43
 
32
44
  # 3. Create dependency-aware execution plan
45
+ Logger.info("πŸ—ΊοΈ PHASE 3: Dependency-Aware Execution Planning")
33
46
  execution_plan = create_execution_plan(subtasks)
47
+ phases = execution_plan[:phases].length
48
+ total_agents = execution_plan[:phases].sum { |p| p[:tasks].length }
49
+ Logger.info(" 🎯 Generated #{phases}-phase execution plan with #{total_agents} coordinated agents")
34
50
 
35
51
  # 4. Execute plan with coordination
52
+ Logger.info("πŸš€ PHASE 4: Multi-Agent Orchestration Launch")
53
+ Logger.info("═" * 60)
36
54
  execute_coordinated_plan(execution_plan)
37
55
  end
38
56
 
@@ -538,71 +556,134 @@ module EnhanceSwarm
538
556
  end
539
557
 
540
558
  def execute_coordinated_plan(plan)
541
- Logger.info("πŸš€ Executing coordinated plan with #{plan[:phases].length} phases")
559
+ Logger.info("🎯 MULTI-AGENT ORCHESTRATION STARTING")
560
+ Logger.info("πŸ“‹ Execution Plan: #{plan[:phases].length} phases with #{plan[:phases].sum { |p| p[:tasks].length }} specialized agents")
561
+
562
+ # Show complete coordination plan
563
+ plan[:phases].each_with_index do |phase, i|
564
+ agent_roles = phase[:tasks].map { |t| "#{t[:role].upcase}" }.join(", ")
565
+ Logger.info(" Phase #{i + 1}: [#{agent_roles}] - #{phase[:description]}")
566
+ end
567
+ Logger.info("πŸ€– Agent specializations defined, beginning coordinated execution...")
568
+ Logger.info("")
542
569
 
543
570
  plan[:phases].each_with_index do |phase, index|
544
- Logger.info("πŸ“ Phase #{index + 1}: #{phase[:description]}")
571
+ Logger.info("πŸš€ PHASE #{index + 1} ACTIVATION: #{phase[:description]}")
572
+ agent_count = phase[:tasks].length
573
+ agent_list = phase[:tasks].map { |t| "#{t[:role].upcase} Agent" }.join(", ")
574
+ Logger.info("πŸ‘₯ Deploying #{agent_count} specialized agents: #{agent_list}")
575
+
576
+ # Show dependencies for this phase
577
+ if index > 0
578
+ Logger.info("πŸ”— Dependencies: Awaiting completion of Phase #{index} handoffs")
579
+ end
545
580
 
546
581
  # Execute all tasks in this phase (they can run in parallel)
547
582
  phase_results = execute_phase(phase[:tasks])
548
583
 
549
584
  # Validate phase completion before proceeding
550
585
  if phase_results.all? { |result| result[:success] }
551
- Logger.info("βœ… Phase #{index + 1} completed successfully")
586
+ Logger.info("βœ… PHASE #{index + 1} COMPLETE: All agents completed successfully")
587
+
588
+ # Show what each agent accomplished
589
+ phase_results.each do |result|
590
+ Logger.info(" πŸ“‹ #{result[:role].upcase} Agent: #{result[:summary] || 'Task completed'}")
591
+ end
552
592
 
553
593
  # CRITICAL: Merge all agent worktree changes back to main project
594
+ Logger.info("πŸ”„ COORDINATION: Merging agent changes to main project...")
554
595
  merge_agent_changes_to_main(phase_results)
596
+ Logger.info("βœ… HANDOFF: Phase #{index + 1} work integrated, ready for next phase")
555
597
  else
556
- Logger.error("❌ Phase #{index + 1} had failures, stopping execution")
598
+ Logger.error("❌ PHASE #{index + 1} FAILED: Agent coordination breakdown")
599
+ failed_agents = phase_results.select { |r| !r[:success] }.map { |r| r[:role].upcase }
600
+ Logger.error(" 🚨 Failed agents: #{failed_agents.join(', ')}")
557
601
  break
558
602
  end
559
603
 
560
604
  # Brief pause between phases for coordination
561
- sleep(2) if index < plan[:phases].length - 1
605
+ if index < plan[:phases].length - 1
606
+ Logger.info("⏸️ COORDINATION PAUSE: Preparing next phase handoff...")
607
+ sleep(2)
608
+ Logger.info("")
609
+ end
562
610
  end
563
611
 
564
612
  # Final cleanup and commit of merged changes
613
+ Logger.info("🎯 ORCHESTRATION FINALIZATION: Integrating all agent work...")
565
614
  finalize_orchestration_results
615
+ Logger.info("πŸ† MULTI-AGENT ORCHESTRATION COMPLETE: Full team coordination successful!")
566
616
  end
567
617
 
568
618
  def execute_phase(tasks)
569
619
  results = []
570
620
  threads = []
571
621
 
572
- Logger.info("πŸš€ Starting parallel execution of #{tasks.length} tasks")
622
+ Logger.info("⚑ PARALLEL AGENT DEPLOYMENT: Activating #{tasks.length} specialized agents")
623
+
624
+ # Show agent deployment plan
625
+ tasks.each_with_index do |task, i|
626
+ dependencies = task[:dependencies]&.empty? ? "None" : task[:dependencies].join(", ")
627
+ Logger.info(" πŸ€– #{task[:role].upcase} Agent ##{i+1}: #{task[:description]}")
628
+ Logger.info(" πŸ“‹ Dependencies: #{dependencies}")
629
+ end
630
+ Logger.info("πŸš€ Beginning parallel agent execution...")
573
631
 
574
632
  # Execute tasks in parallel threads
575
- tasks.each do |task|
633
+ tasks.each_with_index do |task, index|
576
634
  thread = Thread.new do
577
635
  Thread.current[:task_id] = task[:id]
578
636
  Thread.current[:role] = task[:role]
579
637
 
580
638
  begin
639
+ Logger.info("🟒 AGENT ACTIVATION: #{task[:role].upcase} Agent starting work...")
640
+ Logger.info(" πŸ“Œ Task: #{task[:description]}")
641
+
581
642
  enhanced_prompt = build_enhanced_task_prompt(task)
582
643
 
583
644
  # Try agent spawning first
645
+ Logger.info(" πŸ”§ Spawning specialized #{task[:role]} agent in isolated worktree...")
646
+ start_time = Time.now
647
+
584
648
  result = @agent_spawner.spawn_agent(
585
649
  role: task[:role],
586
650
  task: enhanced_prompt,
587
651
  worktree: true
588
652
  )
589
653
 
654
+ execution_time = (Time.now - start_time).round(1)
655
+
590
656
  if result
591
657
  @agent_assignments[task[:id]] = result
592
- Logger.info("βœ… Spawned #{task[:role]} agent for task: #{task[:id]}")
593
- { task_id: task[:id], success: true, agent_info: result }
658
+ Logger.info("βœ… AGENT SUCCESS: #{task[:role].upcase} Agent completed in #{execution_time}s")
659
+ Logger.info(" πŸ“Š Work completed in isolated environment, ready for integration")
660
+ {
661
+ task_id: task[:id],
662
+ role: task[:role],
663
+ success: true,
664
+ agent_info: result,
665
+ execution_time: execution_time,
666
+ summary: "Specialized #{task[:role]} work completed successfully"
667
+ }
594
668
  else
595
669
  # Fallback to direct execution
596
- Logger.warn("⚠️ Agent spawn failed for #{task[:role]}, executing directly")
670
+ Logger.warn("⚠️ AGENT FALLBACK: #{task[:role]} agent spawn failed, using control agent")
597
671
  direct_result = execute_task_directly(task)
598
672
 
599
673
  if direct_result
600
- Logger.info("βœ… Control agent completed task directly: #{task[:id]}")
674
+ Logger.info("βœ… CONTROL AGENT: Completed #{task[:role]} task directly in #{execution_time}s")
601
675
  else
602
- Logger.error("❌ Control agent failed to execute task: #{task[:id]}")
676
+ Logger.error("❌ AGENT FAILURE: Control agent could not complete #{task[:role]} task")
603
677
  end
604
678
 
605
- { task_id: task[:id], success: direct_result, executed_directly: true }
679
+ {
680
+ task_id: task[:id],
681
+ role: task[:role],
682
+ success: direct_result,
683
+ executed_directly: true,
684
+ execution_time: execution_time,
685
+ summary: direct_result ? "Control agent handled task" : "Task failed"
686
+ }
606
687
  end
607
688
  rescue StandardError => e
608
689
  Logger.error("πŸ’₯ Task #{task[:id]} failed: #{e.message}")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnhanceSwarm
4
- VERSION = '2.1.0'
4
+ VERSION = '2.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enhance_swarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Dickerson
@@ -231,6 +231,7 @@ files:
231
231
  - CHANGELOG.md
232
232
  - DEPLOYMENT.md
233
233
  - LICENSE
234
+ - PRODUCTION_INSTALL_TEST.md
234
235
  - README.md
235
236
  - Rakefile
236
237
  - USAGE_EXAMPLES.md