aidp 0.9.6 → 0.11.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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +194 -25
  3. data/lib/aidp/analyze/error_handler.rb +4 -2
  4. data/lib/aidp/{analysis → analyze}/kb_inspector.rb +93 -89
  5. data/lib/aidp/analyze/prioritizer.rb +3 -2
  6. data/lib/aidp/analyze/progress.rb +2 -1
  7. data/lib/aidp/analyze/ruby_maat_integration.rb +7 -3
  8. data/lib/aidp/analyze/runner.rb +73 -11
  9. data/lib/aidp/{analysis → analyze}/seams.rb +1 -1
  10. data/lib/aidp/analyze/steps.rb +10 -8
  11. data/lib/aidp/{analysis → analyze}/tree_sitter_grammar_loader.rb +11 -5
  12. data/lib/aidp/{analysis → analyze}/tree_sitter_scan.rb +21 -15
  13. data/lib/aidp/cli/checkpoint_command.rb +98 -0
  14. data/lib/aidp/cli/first_run_wizard.rb +83 -103
  15. data/lib/aidp/cli/jobs_command.rb +270 -36
  16. data/lib/aidp/cli/terminal_io.rb +3 -3
  17. data/lib/aidp/cli.rb +411 -69
  18. data/lib/aidp/config.rb +5 -8
  19. data/lib/aidp/debug_logger.rb +4 -4
  20. data/lib/aidp/debug_mixin.rb +11 -4
  21. data/lib/aidp/execute/checkpoint.rb +282 -0
  22. data/lib/aidp/execute/checkpoint_display.rb +221 -0
  23. data/lib/aidp/execute/progress.rb +2 -1
  24. data/lib/aidp/execute/prompt_manager.rb +62 -0
  25. data/lib/aidp/execute/runner.rb +67 -20
  26. data/lib/aidp/execute/steps.rb +36 -27
  27. data/lib/aidp/execute/work_loop_runner.rb +308 -0
  28. data/lib/aidp/execute/workflow_selector.rb +50 -26
  29. data/lib/aidp/harness/condition_detector.rb +4 -4
  30. data/lib/aidp/harness/config_schema.rb +40 -0
  31. data/lib/aidp/harness/config_validator.rb +3 -6
  32. data/lib/aidp/harness/configuration.rb +35 -1
  33. data/lib/aidp/harness/enhanced_runner.rb +25 -4
  34. data/lib/aidp/harness/error_handler.rb +103 -28
  35. data/lib/aidp/harness/provider_factory.rb +6 -1
  36. data/lib/aidp/harness/provider_manager.rb +273 -19
  37. data/lib/aidp/harness/runner.rb +14 -6
  38. data/lib/aidp/harness/simple_user_interface.rb +6 -4
  39. data/lib/aidp/harness/status_display.rb +118 -106
  40. data/lib/aidp/harness/test_runner.rb +83 -0
  41. data/lib/aidp/harness/ui/enhanced_tui.rb +7 -5
  42. data/lib/aidp/harness/ui/enhanced_workflow_selector.rb +22 -4
  43. data/lib/aidp/harness/ui/error_handler.rb +7 -2
  44. data/lib/aidp/harness/ui/frame_manager.rb +61 -39
  45. data/lib/aidp/harness/ui/job_monitor.rb +2 -0
  46. data/lib/aidp/harness/ui/navigation/main_menu.rb +27 -16
  47. data/lib/aidp/harness/ui/navigation/menu_item.rb +1 -0
  48. data/lib/aidp/harness/ui/navigation/menu_state.rb +1 -0
  49. data/lib/aidp/harness/ui/navigation/submenu.rb +1 -0
  50. data/lib/aidp/harness/ui/navigation/workflow_selector.rb +2 -0
  51. data/lib/aidp/harness/ui/progress_display.rb +26 -7
  52. data/lib/aidp/harness/ui/question_collector.rb +2 -0
  53. data/lib/aidp/harness/ui/spinner_group.rb +2 -0
  54. data/lib/aidp/harness/ui/spinner_helper.rb +1 -1
  55. data/lib/aidp/harness/ui/status_manager.rb +4 -2
  56. data/lib/aidp/harness/ui/status_widget.rb +20 -9
  57. data/lib/aidp/harness/ui/workflow_controller.rb +27 -9
  58. data/lib/aidp/harness/user_interface.rb +338 -330
  59. data/lib/aidp/jobs/background_runner.rb +278 -0
  60. data/lib/aidp/message_display.rb +48 -0
  61. data/lib/aidp/provider_manager.rb +13 -7
  62. data/lib/aidp/providers/anthropic.rb +101 -18
  63. data/lib/aidp/providers/base.rb +51 -1
  64. data/lib/aidp/providers/codex.rb +248 -0
  65. data/lib/aidp/providers/cursor.rb +39 -48
  66. data/lib/aidp/providers/gemini.rb +26 -16
  67. data/lib/aidp/providers/github_copilot.rb +263 -0
  68. data/lib/aidp/providers/opencode.rb +38 -47
  69. data/lib/aidp/version.rb +1 -1
  70. data/lib/aidp/workflows/definitions.rb +357 -0
  71. data/lib/aidp/workflows/selector.rb +171 -0
  72. data/lib/aidp.rb +16 -4
  73. data/templates/planning/generate_llm_style_guide.md +119 -0
  74. metadata +43 -31
  75. data/lib/aidp/analyze/progress_visualizer.rb +0 -314
  76. /data/templates/{ANALYZE/02_ARCHITECTURE_ANALYSIS.md → analysis/analyze_architecture.md} +0 -0
  77. /data/templates/{ANALYZE/05_DOCUMENTATION_ANALYSIS.md → analysis/analyze_documentation.md} +0 -0
  78. /data/templates/{ANALYZE/04_FUNCTIONALITY_ANALYSIS.md → analysis/analyze_functionality.md} +0 -0
  79. /data/templates/{ANALYZE/01_REPOSITORY_ANALYSIS.md → analysis/analyze_repository.md} +0 -0
  80. /data/templates/{ANALYZE/06_STATIC_ANALYSIS.md → analysis/analyze_static_code.md} +0 -0
  81. /data/templates/{ANALYZE/03_TEST_ANALYSIS.md → analysis/analyze_tests.md} +0 -0
  82. /data/templates/{ANALYZE/07_REFACTORING_RECOMMENDATIONS.md → analysis/recommend_refactoring.md} +0 -0
  83. /data/templates/{ANALYZE/06a_tree_sitter_scan.md → analysis/scan_with_tree_sitter.md} +0 -0
  84. /data/templates/{EXECUTE/11_STATIC_ANALYSIS.md → implementation/configure_static_analysis.md} +0 -0
  85. /data/templates/{EXECUTE/14_DOCS_PORTAL.md → implementation/create_documentation_portal.md} +0 -0
  86. /data/templates/{EXECUTE/10_IMPLEMENTATION_AGENT.md → implementation/implement_features.md} +0 -0
  87. /data/templates/{EXECUTE/13_DELIVERY_ROLLOUT.md → implementation/plan_delivery.md} +0 -0
  88. /data/templates/{EXECUTE/15_POST_RELEASE.md → implementation/review_post_release.md} +0 -0
  89. /data/templates/{EXECUTE/09_SCAFFOLDING_DEVEX.md → implementation/setup_scaffolding.md} +0 -0
  90. /data/templates/{EXECUTE/02A_ARCH_GATE_QUESTIONS.md → planning/ask_architecture_questions.md} +0 -0
  91. /data/templates/{EXECUTE/00_PRD.md → planning/create_prd.md} +0 -0
  92. /data/templates/{EXECUTE/08_TASKS.md → planning/create_tasks.md} +0 -0
  93. /data/templates/{EXECUTE/04_DOMAIN_DECOMPOSITION.md → planning/decompose_domain.md} +0 -0
  94. /data/templates/{EXECUTE/01_NFRS.md → planning/define_nfrs.md} +0 -0
  95. /data/templates/{EXECUTE/05_CONTRACTS.md → planning/design_apis.md} +0 -0
  96. /data/templates/{EXECUTE/02_ARCHITECTURE.md → planning/design_architecture.md} +0 -0
  97. /data/templates/{EXECUTE/06_THREAT_MODEL.md → planning/design_data_model.md} +0 -0
  98. /data/templates/{EXECUTE/03_ADR_FACTORY.md → planning/generate_adrs.md} +0 -0
  99. /data/templates/{EXECUTE/12_OBSERVABILITY_SLOS.md → planning/plan_observability.md} +0 -0
  100. /data/templates/{EXECUTE/07_TEST_PLAN.md → planning/plan_testing.md} +0 -0
@@ -0,0 +1,357 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Aidp
4
+ module Workflows
5
+ # Centralized workflow definitions for both Analyze and Execute modes
6
+ # Provides pre-configured workflows at various levels of depth/complexity
7
+ module Definitions
8
+ # Analyze mode workflows - from surface-level to deep analysis
9
+ ANALYZE_WORKFLOWS = {
10
+ quick_overview: {
11
+ name: "Quick Overview",
12
+ description: "Surface-level understanding - What does this project do?",
13
+ icon: "🔍",
14
+ details: [
15
+ "Repository structure scan",
16
+ "High-level functionality mapping",
17
+ "Quick documentation review"
18
+ ],
19
+ steps: [
20
+ "01_REPOSITORY_ANALYSIS",
21
+ "04_FUNCTIONALITY_ANALYSIS",
22
+ "05_DOCUMENTATION_ANALYSIS"
23
+ ]
24
+ },
25
+
26
+ style_guide: {
27
+ name: "Style & Patterns",
28
+ description: "Identify coding patterns and create style guide",
29
+ icon: "📐",
30
+ details: [
31
+ "Code pattern analysis",
32
+ "Style consistency review",
33
+ "Generate project style guide"
34
+ ],
35
+ steps: [
36
+ "01_REPOSITORY_ANALYSIS",
37
+ "06_STATIC_ANALYSIS",
38
+ "06A_TREE_SITTER_SCAN"
39
+ ]
40
+ },
41
+
42
+ architecture_review: {
43
+ name: "Architecture Review",
44
+ description: "Understand system architecture and dependencies",
45
+ icon: "🏗️",
46
+ details: [
47
+ "Architecture pattern analysis",
48
+ "Dependency mapping",
49
+ "Component relationships",
50
+ "Design principles review"
51
+ ],
52
+ steps: [
53
+ "01_REPOSITORY_ANALYSIS",
54
+ "02_ARCHITECTURE_ANALYSIS",
55
+ "06A_TREE_SITTER_SCAN"
56
+ ]
57
+ },
58
+
59
+ quality_assessment: {
60
+ name: "Quality Assessment",
61
+ description: "Comprehensive code quality and test coverage analysis",
62
+ icon: "✅",
63
+ details: [
64
+ "Test coverage analysis",
65
+ "Code quality metrics",
66
+ "Static analysis review",
67
+ "Refactoring opportunities"
68
+ ],
69
+ steps: [
70
+ "03_TEST_ANALYSIS",
71
+ "06_STATIC_ANALYSIS",
72
+ "06A_TREE_SITTER_SCAN",
73
+ "07_REFACTORING_RECOMMENDATIONS"
74
+ ]
75
+ },
76
+
77
+ deep_analysis: {
78
+ name: "Deep Analysis",
79
+ description: "Complete analysis for extension/refactoring",
80
+ icon: "🔬",
81
+ details: [
82
+ "Full repository analysis",
83
+ "Architecture deep dive",
84
+ "Complete test coverage analysis",
85
+ "Functionality mapping",
86
+ "Documentation review",
87
+ "Static analysis",
88
+ "Tree-sitter knowledge base",
89
+ "Refactoring recommendations"
90
+ ],
91
+ steps: [
92
+ "01_REPOSITORY_ANALYSIS",
93
+ "02_ARCHITECTURE_ANALYSIS",
94
+ "03_TEST_ANALYSIS",
95
+ "04_FUNCTIONALITY_ANALYSIS",
96
+ "05_DOCUMENTATION_ANALYSIS",
97
+ "06_STATIC_ANALYSIS",
98
+ "06A_TREE_SITTER_SCAN",
99
+ "07_REFACTORING_RECOMMENDATIONS"
100
+ ]
101
+ },
102
+
103
+ custom: {
104
+ name: "Custom Analysis",
105
+ description: "Choose specific analysis steps",
106
+ icon: "⚙️",
107
+ details: ["Select exactly which analysis steps you need"],
108
+ steps: :custom # Will be populated by user selection
109
+ }
110
+ }.freeze
111
+
112
+ # Execute mode workflows - from quick prototype to enterprise-grade
113
+ EXECUTE_WORKFLOWS = {
114
+ quick_prototype: {
115
+ name: "Quick Prototype",
116
+ description: "Rapid prototype - minimal planning, fast iteration",
117
+ icon: "⚡",
118
+ details: [
119
+ "Minimal PRD",
120
+ "Basic testing strategy",
121
+ "Direct to implementation"
122
+ ],
123
+ steps: [
124
+ "00_PRD",
125
+ "10_TESTING_STRATEGY",
126
+ "16_IMPLEMENTATION"
127
+ ]
128
+ },
129
+
130
+ exploration: {
131
+ name: "Exploration/Experiment",
132
+ description: "Proof of concept with basic quality checks",
133
+ icon: "🔬",
134
+ details: [
135
+ "Quick PRD generation",
136
+ "Testing strategy",
137
+ "Static analysis setup",
138
+ "Implementation with work loops"
139
+ ],
140
+ steps: [
141
+ "00_PRD",
142
+ "10_TESTING_STRATEGY",
143
+ "11_STATIC_ANALYSIS",
144
+ "16_IMPLEMENTATION"
145
+ ]
146
+ },
147
+
148
+ feature_development: {
149
+ name: "Feature Development",
150
+ description: "Standard feature with architecture and testing",
151
+ icon: "🚀",
152
+ details: [
153
+ "Product requirements",
154
+ "Architecture design",
155
+ "Testing strategy",
156
+ "Static analysis",
157
+ "Implementation"
158
+ ],
159
+ steps: [
160
+ "00_PRD",
161
+ "02_ARCHITECTURE",
162
+ "10_TESTING_STRATEGY",
163
+ "11_STATIC_ANALYSIS",
164
+ "16_IMPLEMENTATION"
165
+ ]
166
+ },
167
+
168
+ production_ready: {
169
+ name: "Production-Ready",
170
+ description: "Enterprise-grade with NFRs and compliance",
171
+ icon: "🏗️",
172
+ details: [
173
+ "Comprehensive PRD",
174
+ "Non-functional requirements",
175
+ "System architecture",
176
+ "Security review",
177
+ "Performance planning",
178
+ "Testing strategy",
179
+ "Observability & SLOs",
180
+ "Delivery planning",
181
+ "Implementation"
182
+ ],
183
+ steps: [
184
+ "00_PRD",
185
+ "01_NFRS",
186
+ "02_ARCHITECTURE",
187
+ "07_SECURITY_REVIEW",
188
+ "08_PERFORMANCE_REVIEW",
189
+ "10_TESTING_STRATEGY",
190
+ "11_STATIC_ANALYSIS",
191
+ "12_OBSERVABILITY_SLOS",
192
+ "13_DELIVERY_ROLLOUT",
193
+ "16_IMPLEMENTATION"
194
+ ]
195
+ },
196
+
197
+ full_enterprise: {
198
+ name: "Full Enterprise",
199
+ description: "Complete enterprise workflow with all governance",
200
+ icon: "🏢",
201
+ details: [
202
+ "All planning documents",
203
+ "Architecture decision records",
204
+ "Domain decomposition",
205
+ "API design",
206
+ "Security & performance reviews",
207
+ "Reliability planning",
208
+ "Complete observability",
209
+ "Documentation portal"
210
+ ],
211
+ steps: [
212
+ "00_PRD",
213
+ "01_NFRS",
214
+ "02_ARCHITECTURE",
215
+ "03_ADR_FACTORY",
216
+ "04_DOMAIN_DECOMPOSITION",
217
+ "05_API_DESIGN",
218
+ "07_SECURITY_REVIEW",
219
+ "08_PERFORMANCE_REVIEW",
220
+ "09_RELIABILITY_REVIEW",
221
+ "10_TESTING_STRATEGY",
222
+ "11_STATIC_ANALYSIS",
223
+ "12_OBSERVABILITY_SLOS",
224
+ "13_DELIVERY_ROLLOUT",
225
+ "14_DOCS_PORTAL",
226
+ "16_IMPLEMENTATION"
227
+ ]
228
+ },
229
+
230
+ custom: {
231
+ name: "Custom Workflow",
232
+ description: "Choose specific planning and implementation steps",
233
+ icon: "⚙️",
234
+ details: ["Select exactly which steps you need"],
235
+ steps: :custom # Will be populated by user selection
236
+ }
237
+ }.freeze
238
+
239
+ # Hybrid workflows - mix of analyze and execute steps
240
+ HYBRID_WORKFLOWS = {
241
+ legacy_modernization: {
242
+ name: "Legacy Modernization",
243
+ description: "Analyze existing code then plan modernization",
244
+ icon: "♻️",
245
+ details: [
246
+ "Deep code analysis",
247
+ "Refactoring recommendations",
248
+ "Architecture design for new system",
249
+ "Migration planning",
250
+ "Implementation"
251
+ ],
252
+ steps: [
253
+ "01_REPOSITORY_ANALYSIS",
254
+ "02_ARCHITECTURE_ANALYSIS",
255
+ "06A_TREE_SITTER_SCAN",
256
+ "07_REFACTORING_RECOMMENDATIONS",
257
+ "00_PRD",
258
+ "02_ARCHITECTURE",
259
+ "16_IMPLEMENTATION"
260
+ ]
261
+ },
262
+
263
+ style_guide_enforcement: {
264
+ name: "Style Guide Enforcement",
265
+ description: "Extract patterns then enforce them",
266
+ icon: "📏",
267
+ details: [
268
+ "Analyze existing patterns",
269
+ "Generate LLM style guide",
270
+ "Configure static analysis",
271
+ "Implement enforcement"
272
+ ],
273
+ steps: [
274
+ "01_REPOSITORY_ANALYSIS",
275
+ "06_STATIC_ANALYSIS",
276
+ "06A_TREE_SITTER_SCAN",
277
+ "00_LLM_STYLE_GUIDE",
278
+ "11_STATIC_ANALYSIS",
279
+ "16_IMPLEMENTATION"
280
+ ]
281
+ },
282
+
283
+ test_coverage_improvement: {
284
+ name: "Test Coverage Improvement",
285
+ description: "Analyze gaps then implement comprehensive tests",
286
+ icon: "🧪",
287
+ details: [
288
+ "Test coverage analysis",
289
+ "Functionality mapping",
290
+ "Testing strategy design",
291
+ "Test implementation"
292
+ ],
293
+ steps: [
294
+ "03_TEST_ANALYSIS",
295
+ "04_FUNCTIONALITY_ANALYSIS",
296
+ "06A_TREE_SITTER_SCAN",
297
+ "10_TESTING_STRATEGY",
298
+ "16_IMPLEMENTATION"
299
+ ]
300
+ },
301
+
302
+ custom_hybrid: {
303
+ name: "Custom Hybrid",
304
+ description: "Mix analyze and execute steps",
305
+ icon: "🔀",
306
+ details: ["Choose from both analyze and execute steps"],
307
+ steps: :custom # Will be populated by user selection
308
+ }
309
+ }.freeze
310
+
311
+ # Get all available steps for custom selection
312
+ def self.all_available_steps
313
+ analyze_steps = Aidp::Analyze::Steps::SPEC.keys.map do |step|
314
+ {
315
+ step: step,
316
+ mode: :analyze,
317
+ description: Aidp::Analyze::Steps::SPEC[step]["description"]
318
+ }
319
+ end
320
+
321
+ execute_steps = Aidp::Execute::Steps::SPEC.keys.map do |step|
322
+ {
323
+ step: step,
324
+ mode: :execute,
325
+ description: Aidp::Execute::Steps::SPEC[step]["description"]
326
+ }
327
+ end
328
+
329
+ (analyze_steps + execute_steps).sort_by { |s| s[:step] }
330
+ end
331
+
332
+ # Get workflow definition by key
333
+ def self.get_workflow(mode, workflow_key)
334
+ case mode
335
+ when :analyze
336
+ ANALYZE_WORKFLOWS[workflow_key]
337
+ when :execute
338
+ EXECUTE_WORKFLOWS[workflow_key]
339
+ when :hybrid
340
+ HYBRID_WORKFLOWS[workflow_key]
341
+ end
342
+ end
343
+
344
+ # Get all workflows for a mode
345
+ def self.workflows_for_mode(mode)
346
+ case mode
347
+ when :analyze
348
+ ANALYZE_WORKFLOWS
349
+ when :execute
350
+ EXECUTE_WORKFLOWS
351
+ when :hybrid
352
+ HYBRID_WORKFLOWS
353
+ end
354
+ end
355
+ end
356
+ end
357
+ end
@@ -0,0 +1,171 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "tty-prompt"
4
+ require_relative "definitions"
5
+ require_relative "../message_display"
6
+
7
+ module Aidp
8
+ module Workflows
9
+ # Enhanced workflow selector with support for custom workflows
10
+ # Handles selection for analyze, execute, and hybrid modes
11
+ class Selector
12
+ include Aidp::MessageDisplay
13
+
14
+ def initialize(prompt: TTY::Prompt.new)
15
+ @prompt = prompt
16
+ end
17
+
18
+ # Select mode (analyze, execute, or hybrid)
19
+ def select_mode
20
+ display_message("\n🚀 Welcome to AI Dev Pipeline!", type: :highlight)
21
+ display_message("Choose your mode:\n", type: :highlight)
22
+
23
+ choices = {
24
+ "🔬 Analyze Mode" => :analyze,
25
+ "🏗️ Execute Mode" => :execute,
26
+ "🔀 Hybrid Mode" => :hybrid
27
+ }
28
+
29
+ @prompt.select("What would you like to do?", choices, per_page: 10)
30
+ end
31
+
32
+ # Select workflow for the given mode
33
+ def select_workflow(mode)
34
+ workflows = Definitions.workflows_for_mode(mode)
35
+
36
+ display_message("\n#{mode_header(mode)}", type: :highlight)
37
+ display_message("Choose a workflow:\n")
38
+
39
+ # Build choices with icons and descriptions
40
+ choices = workflows.map do |key, workflow|
41
+ {
42
+ name: "#{workflow[:icon]} #{workflow[:name]} - #{workflow[:description]}",
43
+ value: key
44
+ }
45
+ end
46
+
47
+ selected = @prompt.select(
48
+ "Select workflow:",
49
+ choices,
50
+ per_page: 15,
51
+ help: "(↑/↓ to navigate, Enter to select)"
52
+ )
53
+
54
+ workflow = workflows[selected]
55
+
56
+ # Show workflow details
57
+ display_workflow_details(workflow)
58
+
59
+ # Handle custom workflows
60
+ if workflow[:steps] == :custom
61
+ steps = select_custom_steps(mode)
62
+ {workflow_key: selected, steps: steps, workflow: workflow}
63
+ else
64
+ {workflow_key: selected, steps: workflow[:steps], workflow: workflow}
65
+ end
66
+ end
67
+
68
+ # Select custom steps for hybrid or custom workflows
69
+ def select_custom_steps(mode)
70
+ display_message("\n⚙️ Custom Step Selection", type: :highlight)
71
+ display_message("")
72
+
73
+ if mode == :hybrid
74
+ select_hybrid_steps
75
+ elsif mode == :analyze
76
+ select_steps_from_mode(:analyze)
77
+ elsif mode == :execute
78
+ select_steps_from_mode(:execute)
79
+ end
80
+ end
81
+
82
+ private
83
+
84
+ def mode_header(mode)
85
+ case mode
86
+ when :analyze
87
+ "🔬 Analyze Mode - Understand Your Codebase"
88
+ when :execute
89
+ "🏗️ Execute Mode - Build New Features"
90
+ when :hybrid
91
+ "🔀 Hybrid Mode - Analyze Then Execute"
92
+ end
93
+ end
94
+
95
+ def display_workflow_details(workflow)
96
+ display_message("\n#{workflow[:icon]} #{workflow[:name]}", type: :highlight)
97
+ display_message("─" * 60, type: :muted)
98
+ display_message("")
99
+ display_message("Description: #{workflow[:description]}")
100
+ display_message("")
101
+ display_message("Includes:", type: :highlight)
102
+ workflow[:details].each do |detail|
103
+ display_message(" • #{detail}", type: :info)
104
+ end
105
+ display_message("")
106
+ end
107
+
108
+ def select_steps_from_mode(mode)
109
+ spec = (mode == :analyze) ? Aidp::Analyze::Steps::SPEC : Aidp::Execute::Steps::SPEC
110
+
111
+ display_message("Available #{mode} steps:")
112
+ display_message("")
113
+
114
+ # Build step choices
115
+ step_choices = spec.map do |step_key, step_spec|
116
+ {
117
+ name: "#{step_key} - #{step_spec["description"]}",
118
+ value: step_key,
119
+ disabled: step_spec["gate"] ? "(requires manual review)" : false
120
+ }
121
+ end
122
+
123
+ selected_steps = @prompt.multi_select(
124
+ "Select steps (Space to select, Enter when done):",
125
+ step_choices,
126
+ per_page: 20,
127
+ help: "Select one or more steps"
128
+ )
129
+
130
+ if selected_steps.empty?
131
+ display_message("⚠️ No steps selected, using default workflow", type: :warning)
132
+ # Return a sensible default
133
+ (mode == :analyze) ? ["01_REPOSITORY_ANALYSIS"] : ["00_PRD", "16_IMPLEMENTATION"]
134
+ else
135
+ selected_steps.sort
136
+ end
137
+ end
138
+
139
+ def select_hybrid_steps
140
+ display_message("You can mix analyze and execute steps for a custom hybrid workflow.")
141
+ display_message("")
142
+
143
+ all_steps = Definitions.all_available_steps
144
+
145
+ # Group steps by mode for display
146
+ step_choices = all_steps.map do |step_info|
147
+ mode_tag = (step_info[:mode] == :analyze) ? "[ANALYZE]" : "[EXECUTE]"
148
+ {
149
+ name: "#{mode_tag} #{step_info[:step]} - #{step_info[:description]}",
150
+ value: step_info[:step]
151
+ }
152
+ end
153
+
154
+ selected_steps = @prompt.multi_select(
155
+ "Select steps (Space to select, Enter when done):",
156
+ step_choices,
157
+ per_page: 25,
158
+ help: "Mix analyze and execute steps as needed"
159
+ )
160
+
161
+ if selected_steps.empty?
162
+ display_message("⚠️ No steps selected, using default hybrid workflow", type: :warning)
163
+ # Return a sensible default hybrid
164
+ ["01_REPOSITORY_ANALYSIS", "00_PRD", "16_IMPLEMENTATION"]
165
+ else
166
+ selected_steps.sort
167
+ end
168
+ end
169
+ end
170
+ end
171
+ end
data/lib/aidp.rb CHANGED
@@ -7,7 +7,13 @@ require_relative "aidp/core_ext/class_attribute"
7
7
  require_relative "aidp/version"
8
8
  require_relative "aidp/config"
9
9
  require_relative "aidp/util"
10
+ require_relative "aidp/message_display"
10
11
  require_relative "aidp/cli"
12
+
13
+ # Jobs and background execution
14
+ require_relative "aidp/jobs/background_runner"
15
+
16
+ # CLI commands
11
17
  require_relative "aidp/cli/jobs_command"
12
18
 
13
19
  # Providers
@@ -33,15 +39,21 @@ require_relative "aidp/analyze/steps"
33
39
  require_relative "aidp/analyze/progress"
34
40
 
35
41
  # Tree-sitter analysis
36
- require_relative "aidp/analysis/tree_sitter_grammar_loader"
37
- require_relative "aidp/analysis/seams"
38
- require_relative "aidp/analysis/tree_sitter_scan"
39
- require_relative "aidp/analysis/kb_inspector"
42
+ require_relative "aidp/analyze/tree_sitter_grammar_loader"
43
+ require_relative "aidp/analyze/seams"
44
+ require_relative "aidp/analyze/tree_sitter_scan"
45
+ require_relative "aidp/analyze/kb_inspector"
46
+
47
+ # Workflows
48
+ require_relative "aidp/workflows/definitions"
49
+ require_relative "aidp/workflows/selector"
40
50
 
41
51
  # Execute mode
42
52
  require_relative "aidp/execute/steps"
43
53
  require_relative "aidp/execute/runner"
44
54
  require_relative "aidp/execute/progress"
55
+ require_relative "aidp/execute/checkpoint"
56
+ require_relative "aidp/execute/checkpoint_display"
45
57
 
46
58
  # Harness mode
47
59
  require_relative "aidp/harness/configuration"
@@ -0,0 +1,119 @@
1
+ # Generate LLM Style Guide
2
+
3
+ Your task is to create a project-specific **LLM_STYLE_GUIDE.md** that will be used by AI agents working on this project. This guide should be concise, actionable, and tailored to this specific codebase.
4
+
5
+ ## Context
6
+
7
+ You have access to the project directory. Examine the codebase to understand:
8
+
9
+ - Programming language(s) used
10
+ - Existing code style and patterns
11
+ - Testing framework and patterns
12
+ - Build tools and configuration
13
+ - Project structure
14
+ - Dependencies and frameworks
15
+
16
+ ## Requirements
17
+
18
+ Create a file at `docs/LLM_STYLE_GUIDE.md` with the following sections:
19
+
20
+ ### 1. Core Engineering Rules
21
+
22
+ - Single Responsibility Principle applications
23
+ - Code organization patterns specific to this project
24
+ - When to extract methods/classes/modules
25
+ - Dead code and TODO policies
26
+
27
+ ### 2. Naming & Structure
28
+
29
+ - Language-specific naming conventions (if not standard)
30
+ - File organization patterns
31
+ - Module/package structure guidelines
32
+ - Public API design principles
33
+
34
+ ### 3. Parameters & Data
35
+
36
+ - Parameter passing conventions
37
+ - Data structure preferences
38
+ - Configuration management patterns
39
+
40
+ ### 4. Error Handling
41
+
42
+ - Error handling strategy for this project
43
+ - Logging patterns
44
+ - Exception types and when to use them
45
+ - Recovery strategies
46
+
47
+ ### 5. Testing Contracts
48
+
49
+ - Testing philosophy for this project
50
+ - What to test vs what not to test
51
+ - Mocking/stubbing guidelines
52
+ - Test organization and naming
53
+ - Code coverage expectations
54
+
55
+ ### 6. Framework-Specific Guidelines
56
+
57
+ - Key patterns from the frameworks used
58
+ - Anti-patterns to avoid
59
+ - Performance considerations
60
+ - Security guidelines
61
+
62
+ ### 7. Dependencies & External Services
63
+
64
+ - Dependency injection patterns
65
+ - External service interaction patterns
66
+ - API client patterns
67
+ - Database interaction patterns (if applicable)
68
+
69
+ ### 8. Build & Development
70
+
71
+ - Build commands and what they do
72
+ - Linting and formatting tools
73
+ - Pre-commit hooks (if any)
74
+ - Development workflow
75
+
76
+ ### 9. Performance
77
+
78
+ - Performance considerations for this codebase
79
+ - Optimization strategies
80
+ - Caching patterns
81
+ - Resource management
82
+
83
+ ### 10. Project-Specific Anti-Patterns
84
+
85
+ - Known anti-patterns in this codebase to avoid
86
+ - Previous mistakes to learn from
87
+ - Deprecated patterns to avoid
88
+
89
+ ## Output Format
90
+
91
+ The LLM_STYLE_GUIDE.md should be:
92
+
93
+ - **Concise**: Use bullet points and tables where possible
94
+ - **Specific**: Reference actual code patterns from this project
95
+ - **Actionable**: Provide clear do's and don'ts
96
+ - **Scannable**: Use headers, lists, and formatting for easy reference
97
+
98
+ ## Example Structure
99
+
100
+ ```markdown
101
+ # Project LLM Style Guide
102
+
103
+ > Concise rules for AI agents working on [Project Name]. Based on [Language/Framework].
104
+
105
+ ## 1. Core Engineering Rules
106
+ - [Specific rule based on this project]
107
+ - [Another specific rule]
108
+
109
+ ## 2. Naming & Structure
110
+ - Classes: [convention]
111
+ - Files: [convention]
112
+ - [etc.]
113
+
114
+ [Continue with all sections...]
115
+ ```
116
+
117
+ ## Deliverable
118
+
119
+ Create `docs/LLM_STYLE_GUIDE.md` with all the sections above, tailored specifically to this project's codebase, languages, and frameworks.