claude-on-rails 0.1.3 ā 0.2.0
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/.rubocop.yml +63 -0
- data/CHANGELOG.md +44 -0
- data/CLAUDE.md +59 -0
- data/Gemfile +6 -3
- data/Gemfile.lock +314 -0
- data/README.md +54 -5
- data/Rakefile +15 -5
- data/SETUP.md +132 -0
- data/lib/claude-on-rails.rb +4 -0
- data/lib/claude_on_rails/configuration.rb +8 -6
- data/lib/claude_on_rails/mcp_installer.rb +78 -0
- data/lib/claude_on_rails/mcp_support.rb +80 -0
- data/lib/claude_on_rails/project_analyzer.rb +53 -65
- data/lib/claude_on_rails/railtie.rb +12 -0
- data/lib/claude_on_rails/swarm_builder.rb +80 -88
- data/lib/claude_on_rails/version.rb +4 -2
- data/lib/claude_on_rails.rb +15 -12
- data/lib/generators/claude_on_rails/swarm/swarm_generator.rb +113 -53
- data/lib/generators/claude_on_rails/swarm/templates/CLAUDE.md.erb +2 -100
- data/lib/generators/claude_on_rails/swarm/templates/claude_on_rails_context.md +32 -0
- data/lib/generators/claude_on_rails/swarm/templates/prompts/api.md +22 -22
- data/lib/generators/claude_on_rails/swarm/templates/prompts/architect.md +14 -0
- data/lib/generators/claude_on_rails/swarm/templates/prompts/controllers.md +18 -2
- data/lib/generators/claude_on_rails/swarm/templates/prompts/models.md +15 -0
- data/lib/generators/claude_on_rails/swarm/templates/swarm.yml.erb +9 -0
- data/lib/tasks/claude_on_rails.rake +35 -0
- metadata +24 -109
- data/claude-on-rails.gemspec +0 -45
@@ -1,192 +1,184 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ClaudeOnRails
|
2
4
|
class SwarmBuilder
|
3
5
|
attr_reader :project_analysis
|
4
|
-
|
6
|
+
|
5
7
|
def initialize(project_analysis)
|
6
8
|
@project_analysis = project_analysis
|
7
9
|
end
|
8
|
-
|
10
|
+
|
9
11
|
def build
|
10
12
|
{
|
11
13
|
version: 1,
|
12
14
|
swarm: {
|
13
|
-
name:
|
14
|
-
main:
|
15
|
+
name: 'Rails Development Team',
|
16
|
+
main: 'architect',
|
15
17
|
instances: build_instances
|
16
18
|
}
|
17
19
|
}
|
18
20
|
end
|
19
|
-
|
21
|
+
|
20
22
|
private
|
21
|
-
|
23
|
+
|
22
24
|
def build_instances
|
23
25
|
instances = {}
|
24
|
-
|
26
|
+
|
25
27
|
# Always include architect
|
26
28
|
instances[:architect] = build_architect
|
27
|
-
|
29
|
+
|
28
30
|
# Core agents
|
29
31
|
instances[:models] = build_models_agent
|
30
32
|
instances[:controllers] = build_controllers_agent
|
31
|
-
|
33
|
+
|
32
34
|
# Conditional agents
|
33
|
-
unless project_analysis[:api_only]
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
if project_analysis[:
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
if project_analysis[:has_graphql]
|
42
|
-
instances[:graphql] = build_graphql_agent
|
43
|
-
end
|
44
|
-
|
45
|
-
if project_analysis[:has_turbo] && !project_analysis[:api_only]
|
46
|
-
instances[:stimulus] = build_stimulus_agent
|
47
|
-
end
|
48
|
-
|
35
|
+
instances[:views] = build_views_agent unless project_analysis[:api_only]
|
36
|
+
|
37
|
+
instances[:api] = build_api_agent if project_analysis[:api_only]
|
38
|
+
|
39
|
+
instances[:graphql] = build_graphql_agent if project_analysis[:has_graphql]
|
40
|
+
|
41
|
+
instances[:stimulus] = build_stimulus_agent if project_analysis[:has_turbo] && !project_analysis[:api_only]
|
42
|
+
|
49
43
|
# Supporting agents
|
50
44
|
instances[:services] = build_services_agent
|
51
45
|
instances[:jobs] = build_jobs_agent
|
52
|
-
|
53
|
-
if project_analysis[:test_framework]
|
54
|
-
|
55
|
-
end
|
56
|
-
|
46
|
+
|
47
|
+
instances[:tests] = build_tests_agent if project_analysis[:test_framework]
|
48
|
+
|
57
49
|
instances[:devops] = build_devops_agent
|
58
|
-
|
50
|
+
|
59
51
|
instances
|
60
52
|
end
|
61
|
-
|
53
|
+
|
62
54
|
def build_architect
|
63
|
-
connections = [
|
64
|
-
connections <<
|
65
|
-
connections <<
|
66
|
-
connections <<
|
67
|
-
connections <<
|
68
|
-
connections <<
|
69
|
-
connections <<
|
70
|
-
connections <<
|
71
|
-
|
55
|
+
connections = %w[models controllers]
|
56
|
+
connections << 'views' unless project_analysis[:api_only]
|
57
|
+
connections << 'api' if project_analysis[:api_only]
|
58
|
+
connections << 'graphql' if project_analysis[:has_graphql]
|
59
|
+
connections << 'services'
|
60
|
+
connections << 'jobs'
|
61
|
+
connections << 'tests' if project_analysis[:test_framework]
|
62
|
+
connections << 'devops'
|
63
|
+
|
72
64
|
{
|
73
65
|
description: "Rails architect coordinating #{project_analysis[:api_only] ? 'API' : 'full-stack'} development",
|
74
|
-
directory:
|
66
|
+
directory: '.',
|
75
67
|
model: ClaudeOnRails.configuration.default_model,
|
76
68
|
connections: connections,
|
77
|
-
prompt_file:
|
69
|
+
prompt_file: '.claude-on-rails/prompts/architect.md',
|
78
70
|
vibe: ClaudeOnRails.configuration.vibe_mode
|
79
71
|
}
|
80
72
|
end
|
81
|
-
|
73
|
+
|
82
74
|
def build_models_agent
|
83
75
|
{
|
84
|
-
description:
|
85
|
-
directory:
|
76
|
+
description: 'ActiveRecord models, migrations, and database optimization specialist',
|
77
|
+
directory: './app/models',
|
86
78
|
model: ClaudeOnRails.configuration.default_model,
|
87
79
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
88
|
-
prompt_file:
|
80
|
+
prompt_file: '.claude-on-rails/prompts/models.md'
|
89
81
|
}
|
90
82
|
end
|
91
|
-
|
83
|
+
|
92
84
|
def build_controllers_agent
|
93
|
-
connections = [
|
94
|
-
connections <<
|
95
|
-
|
85
|
+
connections = ['services']
|
86
|
+
connections << 'api' if project_analysis[:api_only]
|
87
|
+
|
96
88
|
{
|
97
|
-
description:
|
98
|
-
directory:
|
89
|
+
description: 'Rails controllers, routing, and request handling specialist',
|
90
|
+
directory: './app/controllers',
|
99
91
|
model: ClaudeOnRails.configuration.default_model,
|
100
92
|
connections: connections.empty? ? nil : connections,
|
101
93
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
102
|
-
prompt_file:
|
94
|
+
prompt_file: '.claude-on-rails/prompts/controllers.md'
|
103
95
|
}.compact
|
104
96
|
end
|
105
|
-
|
97
|
+
|
106
98
|
def build_views_agent
|
107
99
|
connections = []
|
108
|
-
connections <<
|
109
|
-
|
100
|
+
connections << 'stimulus' if project_analysis[:has_turbo]
|
101
|
+
|
110
102
|
{
|
111
|
-
description:
|
112
|
-
directory:
|
103
|
+
description: 'Rails views, layouts, partials, and asset pipeline specialist',
|
104
|
+
directory: './app/views',
|
113
105
|
model: ClaudeOnRails.configuration.default_model,
|
114
106
|
connections: connections.empty? ? nil : connections,
|
115
107
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
116
|
-
prompt_file:
|
108
|
+
prompt_file: '.claude-on-rails/prompts/views.md'
|
117
109
|
}.compact
|
118
110
|
end
|
119
|
-
|
111
|
+
|
120
112
|
def build_api_agent
|
121
113
|
{
|
122
|
-
description:
|
123
|
-
directory:
|
114
|
+
description: 'RESTful API design, serialization, and versioning specialist',
|
115
|
+
directory: './app/controllers/api',
|
124
116
|
model: ClaudeOnRails.configuration.default_model,
|
125
117
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
126
|
-
prompt_file:
|
118
|
+
prompt_file: '.claude-on-rails/prompts/api.md'
|
127
119
|
}
|
128
120
|
end
|
129
|
-
|
121
|
+
|
130
122
|
def build_graphql_agent
|
131
123
|
{
|
132
|
-
description:
|
133
|
-
directory:
|
124
|
+
description: 'GraphQL schema, resolvers, and mutations specialist',
|
125
|
+
directory: './app/graphql',
|
134
126
|
model: ClaudeOnRails.configuration.default_model,
|
135
127
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
136
|
-
prompt_file:
|
128
|
+
prompt_file: '.claude-on-rails/prompts/graphql.md'
|
137
129
|
}
|
138
130
|
end
|
139
|
-
|
131
|
+
|
140
132
|
def build_stimulus_agent
|
141
133
|
{
|
142
|
-
description:
|
143
|
-
directory:
|
134
|
+
description: 'Stimulus.js controllers and Turbo integration specialist',
|
135
|
+
directory: './app/javascript',
|
144
136
|
model: ClaudeOnRails.configuration.default_model,
|
145
137
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
146
|
-
prompt_file:
|
138
|
+
prompt_file: '.claude-on-rails/prompts/stimulus.md'
|
147
139
|
}
|
148
140
|
end
|
149
|
-
|
141
|
+
|
150
142
|
def build_services_agent
|
151
143
|
{
|
152
|
-
description:
|
153
|
-
directory:
|
144
|
+
description: 'Service objects, business logic, and design patterns specialist',
|
145
|
+
directory: './app/services',
|
154
146
|
model: ClaudeOnRails.configuration.default_model,
|
155
147
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
156
|
-
prompt_file:
|
148
|
+
prompt_file: '.claude-on-rails/prompts/services.md'
|
157
149
|
}
|
158
150
|
end
|
159
|
-
|
151
|
+
|
160
152
|
def build_jobs_agent
|
161
153
|
{
|
162
|
-
description:
|
163
|
-
directory:
|
154
|
+
description: 'Background jobs, ActiveJob, and async processing specialist',
|
155
|
+
directory: './app/jobs',
|
164
156
|
model: ClaudeOnRails.configuration.default_model,
|
165
157
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
166
|
-
prompt_file:
|
158
|
+
prompt_file: '.claude-on-rails/prompts/jobs.md'
|
167
159
|
}
|
168
160
|
end
|
169
|
-
|
161
|
+
|
170
162
|
def build_tests_agent
|
171
163
|
test_dir = project_analysis[:test_framework] == 'RSpec' ? './spec' : './test'
|
172
|
-
|
164
|
+
|
173
165
|
{
|
174
166
|
description: "#{project_analysis[:test_framework]} testing, factories, and test coverage specialist",
|
175
167
|
directory: test_dir,
|
176
168
|
model: ClaudeOnRails.configuration.default_model,
|
177
169
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
178
|
-
prompt_file:
|
170
|
+
prompt_file: '.claude-on-rails/prompts/tests.md'
|
179
171
|
}
|
180
172
|
end
|
181
|
-
|
173
|
+
|
182
174
|
def build_devops_agent
|
183
175
|
{
|
184
|
-
description:
|
185
|
-
directory:
|
176
|
+
description: 'Deployment, Docker, CI/CD, and production configuration specialist',
|
177
|
+
directory: './config',
|
186
178
|
model: ClaudeOnRails.configuration.default_model,
|
187
179
|
allowed_tools: %w[Read Edit Write Bash Grep Glob LS],
|
188
|
-
prompt_file:
|
180
|
+
prompt_file: '.claude-on-rails/prompts/devops.md'
|
189
181
|
}
|
190
182
|
end
|
191
183
|
end
|
192
|
-
end
|
184
|
+
end
|
data/lib/claude_on_rails.rb
CHANGED
@@ -1,29 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
4
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'claude_on_rails/version'
|
4
|
+
require 'claude_on_rails/configuration'
|
5
|
+
require 'claude_on_rails/project_analyzer'
|
6
|
+
require 'claude_on_rails/swarm_builder'
|
7
|
+
require 'claude_on_rails/mcp_support'
|
8
|
+
|
9
|
+
# Load railtie if Rails is defined
|
10
|
+
require 'claude_on_rails/railtie' if defined?(Rails::Railtie)
|
5
11
|
|
6
12
|
module ClaudeOnRails
|
7
13
|
class Error < StandardError; end
|
8
|
-
|
14
|
+
|
9
15
|
class << self
|
10
|
-
attr_accessor :configuration
|
11
|
-
|
12
16
|
def configure
|
13
|
-
self.configuration ||= Configuration.new
|
14
17
|
yield(configuration) if block_given?
|
15
18
|
end
|
16
|
-
|
19
|
+
|
17
20
|
def configuration
|
18
21
|
@configuration ||= Configuration.new
|
19
22
|
end
|
20
|
-
|
23
|
+
|
21
24
|
def analyze_project(root_path = Rails.root)
|
22
25
|
ProjectAnalyzer.new(root_path).analyze
|
23
26
|
end
|
24
|
-
|
27
|
+
|
25
28
|
def build_swarm(project_analysis)
|
26
29
|
SwarmBuilder.new(project_analysis).build
|
27
30
|
end
|
28
31
|
end
|
29
|
-
end
|
32
|
+
end
|
@@ -1,104 +1,164 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails/generators/base'
|
4
|
+
require 'claude_on_rails'
|
3
5
|
|
4
6
|
module ClaudeOnRails
|
5
7
|
module Generators
|
6
8
|
class SwarmGenerator < Rails::Generators::Base
|
7
|
-
source_root File.expand_path(
|
8
|
-
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
10
|
+
|
9
11
|
class_option :api_only, type: :boolean, default: false,
|
10
|
-
|
11
|
-
|
12
|
+
desc: 'Generate swarm for API-only Rails application'
|
13
|
+
|
12
14
|
class_option :skip_tests, type: :boolean, default: false,
|
13
|
-
|
14
|
-
|
15
|
+
desc: 'Skip test agent in swarm configuration'
|
16
|
+
|
15
17
|
class_option :graphql, type: :boolean, default: false,
|
16
|
-
|
17
|
-
|
18
|
+
desc: 'Include GraphQL specialist agent'
|
19
|
+
|
18
20
|
class_option :turbo, type: :boolean, default: true,
|
19
|
-
|
20
|
-
|
21
|
+
desc: 'Include Turbo/Stimulus specialist agents'
|
22
|
+
|
23
|
+
class_option :mcp_server, type: :boolean, default: true,
|
24
|
+
desc: 'Include Rails MCP Server for enhanced documentation access'
|
25
|
+
|
21
26
|
def analyze_project
|
22
|
-
say
|
27
|
+
say 'Analyzing Rails project structure...', :green
|
23
28
|
@project_analysis = ClaudeOnRails.analyze_project(Rails.root)
|
24
|
-
|
29
|
+
|
25
30
|
# Auto-detect features
|
26
31
|
@api_only = options[:api_only] || @project_analysis[:api_only]
|
27
32
|
@has_graphql = options[:graphql] || @project_analysis[:has_graphql]
|
28
33
|
@has_turbo = options[:turbo] && !@api_only
|
29
34
|
@skip_tests = options[:skip_tests]
|
30
35
|
@test_framework = @project_analysis[:test_framework]
|
31
|
-
|
36
|
+
|
37
|
+
# Check for Rails MCP Server
|
38
|
+
@include_mcp_server = options[:mcp_server] && ClaudeOnRails::MCPSupport.available?
|
39
|
+
|
32
40
|
say "Project type: #{@api_only ? 'API-only' : 'Full-stack Rails'}", :cyan
|
33
41
|
say "Test framework: #{@test_framework}", :cyan if @test_framework
|
34
42
|
say "GraphQL detected: #{@has_graphql ? 'Yes' : 'No'}", :cyan
|
35
|
-
|
43
|
+
say "Rails MCP Server: #{@include_mcp_server ? 'Available' : 'Not available'}", :cyan
|
44
|
+
|
45
|
+
# Offer MCP setup if enabled but not available
|
46
|
+
offer_mcp_setup if options[:mcp_server] && !@include_mcp_server
|
47
|
+
|
36
48
|
# Show which agents will be created
|
37
49
|
say "\nAgents to be created:", :yellow
|
38
50
|
agents.each do |agent|
|
39
51
|
say " - #{agent}", :cyan
|
40
52
|
end
|
41
53
|
end
|
42
|
-
|
54
|
+
|
43
55
|
def create_swarm_config
|
44
|
-
say
|
45
|
-
template
|
56
|
+
say 'Generating swarm configuration...', :green
|
57
|
+
template 'swarm.yml.erb', 'claude-swarm.yml'
|
46
58
|
end
|
47
|
-
|
59
|
+
|
48
60
|
def create_claude_md
|
49
|
-
|
50
|
-
template
|
61
|
+
# Always create the ClaudeOnRails context file
|
62
|
+
template 'claude_on_rails_context.md', '.claude-on-rails/context.md'
|
63
|
+
|
64
|
+
if File.exist?('CLAUDE.md')
|
65
|
+
say 'CLAUDE.md already exists - adding ClaudeOnRails file reference...', :yellow
|
66
|
+
|
67
|
+
existing_content = File.read('CLAUDE.md')
|
68
|
+
|
69
|
+
# Check if file reference already exists
|
70
|
+
if existing_content.include?('.claude-on-rails/context.md')
|
71
|
+
say 'ā CLAUDE.md already references ClaudeOnRails context', :green
|
72
|
+
else
|
73
|
+
file_reference = "\n/file:.claude-on-rails/context.md\n"
|
74
|
+
append_to_file 'CLAUDE.md', file_reference
|
75
|
+
say 'ā Added ClaudeOnRails context reference to existing CLAUDE.md', :green
|
76
|
+
end
|
77
|
+
else
|
78
|
+
say 'Creating CLAUDE.md configuration...', :green
|
79
|
+
template 'CLAUDE.md.erb', 'CLAUDE.md'
|
80
|
+
end
|
51
81
|
end
|
52
|
-
|
82
|
+
|
53
83
|
def create_agent_prompts
|
54
|
-
say
|
55
|
-
directory
|
84
|
+
say 'Setting up agent-specific prompts...', :green
|
85
|
+
directory 'prompts', '.claude-on-rails/prompts'
|
56
86
|
end
|
57
|
-
|
87
|
+
|
58
88
|
def update_gitignore
|
59
|
-
say
|
60
|
-
|
89
|
+
say 'Updating .gitignore...', :green
|
90
|
+
gitignore_path = Rails.root.join('.gitignore')
|
91
|
+
|
92
|
+
# Create .gitignore if it doesn't exist
|
93
|
+
create_file '.gitignore', '' unless File.exist?(gitignore_path)
|
94
|
+
|
95
|
+
append_to_file '.gitignore', "\n# ClaudeOnRails\n.claude-on-rails/sessions/\n.claude-swarm/\nclaude-swarm.log\n"
|
61
96
|
end
|
62
|
-
|
97
|
+
|
63
98
|
def display_next_steps
|
64
99
|
say "\nā
ClaudeOnRails swarm configuration created!", :green
|
65
100
|
say "\nNext steps:", :yellow
|
66
|
-
|
67
|
-
|
68
|
-
|
101
|
+
|
102
|
+
# Remove this section since we now handle it interactively in analyze_project
|
103
|
+
|
104
|
+
say '1. Review and customize claude-swarm.yml for your project'
|
105
|
+
say '2. Start your Rails development swarm:'
|
106
|
+
say ' claude-swarm', :cyan
|
69
107
|
say "\nOnce the swarm is running, just describe what you want to build:"
|
70
108
|
say ' > Add user authentication with social login', :cyan
|
71
109
|
say "\nThe swarm will automatically coordinate the implementation across all layers!"
|
72
110
|
end
|
73
|
-
|
111
|
+
|
74
112
|
private
|
75
|
-
|
113
|
+
|
76
114
|
def agents
|
77
115
|
@agents ||= build_agent_list
|
78
116
|
end
|
79
|
-
|
117
|
+
|
80
118
|
def build_agent_list
|
81
|
-
list = [
|
82
|
-
list <<
|
83
|
-
list <<
|
84
|
-
list <<
|
85
|
-
list <<
|
86
|
-
list <<
|
87
|
-
list <<
|
88
|
-
list <<
|
89
|
-
list <<
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
119
|
+
list = ['architect']
|
120
|
+
list << 'models' if File.directory?(Rails.root.join('app/models'))
|
121
|
+
list << 'controllers' if File.directory?(Rails.root.join('app/controllers'))
|
122
|
+
list << 'views' if !@api_only && File.directory?(Rails.root.join('app/views'))
|
123
|
+
list << 'api' if @api_only && File.directory?(Rails.root.join('app/controllers/api'))
|
124
|
+
list << 'graphql' if @has_graphql && File.directory?(Rails.root.join('app/graphql'))
|
125
|
+
list << 'stimulus' if @has_turbo && File.directory?(Rails.root.join('app/javascript'))
|
126
|
+
list << 'services' if File.directory?(Rails.root.join('app/services'))
|
127
|
+
list << 'jobs' if File.directory?(Rails.root.join('app/jobs'))
|
128
|
+
|
129
|
+
unless @skip_tests
|
130
|
+
case @test_framework
|
131
|
+
when 'RSpec'
|
132
|
+
list << 'tests' if File.directory?(Rails.root.join('spec'))
|
133
|
+
when 'Minitest'
|
134
|
+
list << 'tests' if File.directory?(Rails.root.join('test'))
|
96
135
|
end
|
97
136
|
end
|
98
|
-
|
99
|
-
list <<
|
137
|
+
|
138
|
+
list << 'devops' if File.directory?(Rails.root.join('config'))
|
100
139
|
list
|
101
140
|
end
|
141
|
+
|
142
|
+
def offer_mcp_setup
|
143
|
+
say "\nšÆ Rails MCP Server Enhancement Available!", :yellow
|
144
|
+
say "Rails MCP Server provides your AI agents with real-time Rails documentation.", :cyan
|
145
|
+
|
146
|
+
if yes?("Would you like to set it up now? (Y/n)", :green)
|
147
|
+
say "\nStarting Rails MCP Server setup...", :green
|
148
|
+
system('bundle exec rake claude_on_rails:setup_mcp')
|
149
|
+
|
150
|
+
# Re-check availability after setup
|
151
|
+
@include_mcp_server = ClaudeOnRails::MCPSupport.available?
|
152
|
+
|
153
|
+
if @include_mcp_server
|
154
|
+
say "\nā Rails MCP Server is now available!", :green
|
155
|
+
else
|
156
|
+
say "\nSetup was not completed. Continuing without MCP Server.", :yellow
|
157
|
+
end
|
158
|
+
else
|
159
|
+
say "\nYou can set it up later with: bundle exec rake claude_on_rails:setup_mcp", :cyan
|
160
|
+
end
|
161
|
+
end
|
102
162
|
end
|
103
163
|
end
|
104
|
-
end
|
164
|
+
end
|
@@ -1,101 +1,3 @@
|
|
1
|
-
|
1
|
+
## ClaudeOnRails Configuration
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
## Project Overview
|
6
|
-
|
7
|
-
- **Application**: <%= Rails.application.class.module_parent_name %>
|
8
|
-
- **Rails Version**: <%= Rails.version %>
|
9
|
-
- **Ruby Version**: <%= RUBY_VERSION %>
|
10
|
-
- **Type**: <%= @api_only ? 'API-only' : 'Full-stack Rails application' %>
|
11
|
-
- **Test Framework**: <%= @test_framework || 'Not detected' %>
|
12
|
-
<% if @has_graphql -%>
|
13
|
-
- **GraphQL**: Enabled
|
14
|
-
<% end -%>
|
15
|
-
|
16
|
-
## How to Use
|
17
|
-
|
18
|
-
Simply describe what you want to build or fix, and the swarm will automatically coordinate the implementation:
|
19
|
-
|
20
|
-
```bash
|
21
|
-
# Start the swarm
|
22
|
-
claude-swarm orchestrate
|
23
|
-
|
24
|
-
# Then just describe your task
|
25
|
-
claude "Add user authentication with email confirmation"
|
26
|
-
claude "Optimize the dashboard queries that are running slowly"
|
27
|
-
claude "Create an API endpoint for mobile app integration"
|
28
|
-
```
|
29
|
-
|
30
|
-
## Swarm Architecture
|
31
|
-
|
32
|
-
The following specialized agents work together to implement your requests:
|
33
|
-
|
34
|
-
- **Architect**: Coordinates all development and makes high-level decisions
|
35
|
-
- **Models**: Handles ActiveRecord models, migrations, and database design
|
36
|
-
- **Controllers**: Manages request handling, routing, and controller logic
|
37
|
-
<% unless @api_only -%>
|
38
|
-
- **Views**: Creates and maintains views, layouts, and partials
|
39
|
-
<% end -%>
|
40
|
-
<% if @api_only -%>
|
41
|
-
- **API**: Designs RESTful endpoints and handles serialization
|
42
|
-
<% end -%>
|
43
|
-
<% if @has_graphql -%>
|
44
|
-
- **GraphQL**: Manages GraphQL schemas, types, and resolvers
|
45
|
-
<% end -%>
|
46
|
-
<% if @has_turbo -%>
|
47
|
-
- **Stimulus**: Implements interactive features with Stimulus controllers
|
48
|
-
<% end -%>
|
49
|
-
- **Services**: Extracts business logic into service objects
|
50
|
-
- **Jobs**: Handles background processing and async tasks
|
51
|
-
<% unless @skip_tests -%>
|
52
|
-
- **Tests**: Ensures comprehensive test coverage with <%= @test_framework %>
|
53
|
-
<% end -%>
|
54
|
-
- **DevOps**: Manages deployment and production configurations
|
55
|
-
|
56
|
-
## Project Conventions
|
57
|
-
|
58
|
-
### Code Style
|
59
|
-
- Follow Rails conventions and best practices
|
60
|
-
- Use RuboCop for Ruby style enforcement
|
61
|
-
- Prefer clarity over cleverness
|
62
|
-
- Write self-documenting code
|
63
|
-
|
64
|
-
### Testing
|
65
|
-
<% if @test_framework == 'RSpec' -%>
|
66
|
-
- RSpec for all tests
|
67
|
-
- Factory Bot for test data
|
68
|
-
- Request specs for API endpoints
|
69
|
-
- System specs for user interactions
|
70
|
-
<% else -%>
|
71
|
-
- Minitest for all tests
|
72
|
-
- Fixtures or factories for test data
|
73
|
-
- Integration tests for user flows
|
74
|
-
- Unit tests for models and services
|
75
|
-
<% end -%>
|
76
|
-
|
77
|
-
### Git Workflow
|
78
|
-
- Feature branches for new work
|
79
|
-
- Descriptive commit messages
|
80
|
-
- PR reviews before merging
|
81
|
-
- Keep main branch deployable
|
82
|
-
|
83
|
-
## Custom Patterns
|
84
|
-
|
85
|
-
Add your project-specific patterns and conventions here:
|
86
|
-
|
87
|
-
```yaml
|
88
|
-
# Example: Custom service object pattern
|
89
|
-
Services:
|
90
|
-
Pattern: Command pattern with Result objects
|
91
|
-
Location: app/services/
|
92
|
-
Naming: VerbNoun (e.g., CreateOrder, SendEmail)
|
93
|
-
Testing: Unit tests with mocked dependencies
|
94
|
-
```
|
95
|
-
|
96
|
-
## Notes
|
97
|
-
|
98
|
-
- This configuration was generated by ClaudeOnRails
|
99
|
-
- Customize agent prompts in `.claude-on-rails/prompts/`
|
100
|
-
- Update this file with project-specific conventions
|
101
|
-
- The swarm learns from your codebase patterns
|
3
|
+
You are working on <%= Rails.application.class.module_parent_name %>, a <%= @api_only ? 'Rails API' : 'Rails' %> application. Review the ClaudeOnRails context file at @.claude-on-rails/context.md
|