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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f524705593a3496a0959020afc83df09af23091ac3fe057e1e63e995598cd3ca
4
- data.tar.gz: cf5e3b842c2a0e2976b1e5d49698ec1394d588122c8e20fabcc6225c069231bc
3
+ metadata.gz: ffba477d4ca2e297b4fe81d7ecb32ccf37d161df6bcd2dceaa91e94ccbc8ea8f
4
+ data.tar.gz: 851fdc47c7a12bd8f6f8304badf60ffdb6855787d0982645d80a309d9caee40b
5
5
  SHA512:
6
- metadata.gz: 656cbf7e645cf77062014d1c83b62555e57cdd9e4c7752ceb93d8b79baad1e2e91038a7d810735aff49ae097e5c22e06a6897c9fc58de7fba8e98fddc9706e98
7
- data.tar.gz: 47a07ad75ce545dba7ba73746f8444f30e4a8c0da1cee1e92d6d3b7a020c8e30010dfb266a84f0cf0f5d4aad6f8c7085283cbd7b6bff9f1c641d205270d1d4f1
6
+ metadata.gz: ef68650e5a8c55d8b219a00a42ba7fbff2c87bdd5cacf5f450c8bf406c481d6d1e4c00cd7edabbf41b07928bb28c2b5246c54392e67f52ee8381bac1668d9463
7
+ data.tar.gz: d2ae0a1bc041b0f8c0cdf1ccb3c328fc7bb1c4ba3cbb0599c983f4937056a8ad1f47e0bcb475a96dd8d4d936cfc6d7452a0333121ed36e29a14708b8e4bd15ec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AI Dev Pipeline (aidp) - Ruby Gem
2
2
 
3
- A portable CLI that automates a complete AI development workflow from idea to implementation using your existing IDE assistants. Now with **Enhanced TUI** - a rich terminal interface that runs complete workflows with intelligent provider management and error recovery.
3
+ A portable CLI that automates AI development workflows from idea to implementation using your existing IDE assistants. Features autonomous work loops, background execution, and comprehensive progress tracking.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -11,13 +11,16 @@ gem install aidp
11
11
  # Navigate to your project
12
12
  cd /your/project
13
13
 
14
- # Start the interactive TUI (default)
15
- aidp
14
+ # Start an interactive workflow
15
+ aidp execute
16
+
17
+ # Or run in background
18
+ aidp execute --background
16
19
  ```
17
20
 
18
21
  ### First-Time Setup
19
22
 
20
- On the first run in a project without an `aidp.yml`, AIDP now launches a **First-Time Setup Wizard** instead of failing with a configuration error. You'll be prompted to choose one of:
23
+ On the first run in a project without an `aidp.yml`, AIDP launches a **First-Time Setup Wizard**. You'll be prompted to choose one of:
21
24
 
22
25
  1. Minimal (single provider: cursor)
23
26
  2. Development template (multiple providers, safe defaults)
@@ -27,43 +30,156 @@ On the first run in a project without an `aidp.yml`, AIDP now launches a **First
27
30
 
28
31
  Non-interactive environments (CI, scripts, pipes) automatically receive a minimal `aidp.yml` so workflows can proceed without manual intervention.
29
32
 
30
- You can re-run the wizard manually by removing `aidp.yml` and starting `aidp` again.
33
+ You can re-run the wizard manually:
34
+
35
+ ```bash
36
+ aidp --setup-config
37
+ ```
38
+
39
+ ## Core Features
40
+
41
+ ### Work Loops
42
+
43
+ AIDP implements **work loops** - an iterative execution pattern where AI agents autonomously work on tasks until completion, with automatic testing and linting feedback.
44
+
45
+ - **Iterative refinement**: Agent works in loops until task is 100% complete
46
+ - **Self-management**: Agent edits PROMPT.md to track its own progress
47
+ - **Automatic validation**: Tests and linters run after each iteration
48
+ - **Self-correction**: Only failures are fed back for the next iteration
49
+
50
+ See [Work Loops Guide](docs/WORK_LOOPS_GUIDE.md) for details.
51
+
52
+ ### Background Execution
53
+
54
+ Run workflows in the background while monitoring progress from separate terminals:
55
+
56
+ ```bash
57
+ # Start in background
58
+ aidp execute --background
59
+ ✓ Started background job: 20251005_235912_a1b2c3d4
60
+
61
+ # Monitor progress
62
+ aidp jobs list # List all jobs
63
+ aidp jobs status <job_id> # Show job status
64
+ aidp jobs logs <job_id> --tail # View recent logs
65
+ aidp checkpoint summary --watch # Watch metrics in real-time
66
+
67
+ # Control jobs
68
+ aidp jobs stop <job_id> # Stop a running job
69
+ ```
70
+
71
+ ### Progress Checkpoints
31
72
 
32
- ## Enhanced TUI
73
+ Track code quality metrics and task progress throughout execution:
33
74
 
34
- AIDP features a rich terminal interface that transforms it from a step-by-step tool into an intelligent development assistant. The enhanced TUI provides beautiful, interactive terminal components while running complete workflows automatically.
75
+ ```bash
76
+ # View current progress
77
+ aidp checkpoint summary
78
+
79
+ # Watch with auto-refresh
80
+ aidp checkpoint summary --watch
81
+
82
+ # View historical data
83
+ aidp checkpoint history 20
84
+ ```
35
85
 
36
- ### Features
86
+ **Tracked Metrics:**
37
87
 
38
- - **🎨 Rich Terminal Interface**: Beautiful CLI UI components with progress bars, spinners, and frames
39
- - **📋 Interactive Navigation**: Hierarchical menu system with breadcrumb navigation
40
- - **⌨️ Keyboard Shortcuts**: Full keyboard navigation and control
41
- - **📊 Real-time Progress**: Live monitoring of progress and system status
42
- - **🔄 Workflow Control**: Pause, resume, cancel, and stop workflows with visual feedback
43
- - **💬 Smart Question Collection**: Interactive prompts with validation and error handling
88
+ - Lines of code
89
+ - Test coverage
90
+ - Code quality scores
91
+ - PRD task completion percentage
92
+ - File count and growth trends
44
93
 
45
- ### Usage
94
+ ## Command Reference
95
+
96
+ ### Execution Modes
46
97
 
47
98
  ```bash
48
- # Start the interactive TUI (default)
49
- aidp
99
+ # Execute mode - Build new features
100
+ aidp execute # Interactive workflow selection
101
+ aidp execute --background # Run in background
102
+ aidp execute --background --follow # Start and follow logs
103
+
104
+ # Analyze mode - Analyze codebase
105
+ aidp analyze # Interactive analysis
106
+ aidp analyze --background # Background analysis
107
+ ```
50
108
 
51
- # Show version information
52
- aidp --version
109
+ ### Job Management
110
+
111
+ ```bash
112
+ # List all background jobs
113
+ aidp jobs list
53
114
 
54
- # Show help information
55
- aidp --help
115
+ # Show job status
116
+ aidp jobs status <job_id>
117
+ aidp jobs status <job_id> --follow # Follow with auto-refresh
118
+
119
+ # View job logs
120
+ aidp jobs logs <job_id>
121
+ aidp jobs logs <job_id> --tail # Last 50 lines
122
+ aidp jobs logs <job_id> --follow # Stream in real-time
123
+
124
+ # Stop a running job
125
+ aidp jobs stop <job_id>
126
+ ```
127
+
128
+ ### Checkpoint Monitoring
129
+
130
+ ```bash
131
+ # View latest checkpoint
132
+ aidp checkpoint show
133
+
134
+ # Progress summary with trends
135
+ aidp checkpoint summary
136
+ aidp checkpoint summary --watch # Auto-refresh every 5s
137
+ aidp checkpoint summary --watch --interval 10 # Custom interval
138
+
139
+ # View checkpoint history
140
+ aidp checkpoint history # Last 10 checkpoints
141
+ aidp checkpoint history 50 # Last 50 checkpoints
142
+
143
+ # Detailed metrics
144
+ aidp checkpoint metrics
145
+
146
+ # Clear checkpoint data
147
+ aidp checkpoint clear
148
+ aidp checkpoint clear --force # Skip confirmation
149
+ ```
150
+
151
+ ### System Commands
152
+
153
+ ```bash
154
+ # Show system status
155
+ aidp status
156
+
157
+ # Provider health dashboard
158
+ aidp providers
159
+
160
+ # Harness state management
161
+ aidp harness status
162
+ aidp harness reset
163
+
164
+ # Configuration
165
+ aidp --setup-config # Re-run setup wizard
166
+ aidp --help # Show all commands
167
+ aidp --version # Show version
56
168
  ```
57
169
 
58
170
  ## AI Providers
59
171
 
60
172
  AIDP intelligently manages multiple providers with automatic switching:
61
173
 
62
- - **Claude API** - Primary provider for complex analysis and code generation
63
- - **Gemini API** - Cost-effective fallback for general tasks
174
+ - **Anthropic Claude CLI** - Primary provider for complex analysis and code generation
175
+ - **Codex CLI** - OpenAI's Codex command-line interface for code generation
64
176
  - **Cursor CLI** - IDE-integrated provider for code-specific tasks
177
+ - **Gemini CLI** - Google's Gemini command-line interface for general tasks
178
+ - **GitHub Copilot CLI** - GitHub's AI pair programmer command-line interface
179
+ - **macOS UI** - macOS-specific UI automation provider
180
+ - **OpenCode** - Alternative open-source code generation provider
65
181
 
66
- The TUI automatically switches providers when:
182
+ The system automatically switches providers when:
67
183
 
68
184
  - Rate limits are hit
69
185
  - Providers fail or timeout
@@ -74,6 +190,15 @@ The TUI automatically switches providers when:
74
190
 
75
191
  ```yaml
76
192
  # aidp.yml
193
+ harness:
194
+ work_loop:
195
+ enabled: true
196
+ max_iterations: 50
197
+ test_commands:
198
+ - "bundle exec rspec"
199
+ lint_commands:
200
+ - "bundle exec standardrb"
201
+
77
202
  providers:
78
203
  claude:
79
204
  type: "usage_based"
@@ -190,6 +315,49 @@ When the AI creates a questions file, follow these steps:
190
315
 
191
316
  The questions file is only created when the AI needs additional information beyond what it can infer from your project structure and existing files. Your answers are preserved for future reference.
192
317
 
318
+ ## Workflow Examples
319
+
320
+ ### Standard Interactive Workflow
321
+
322
+ ```bash
323
+ # Start execute mode
324
+ aidp execute
325
+
326
+ # Select workflow type (e.g., "Full PRD to Implementation")
327
+ # Answer any questions interactively
328
+ # Review generated files (PRD, architecture, etc.)
329
+ # Workflow runs automatically with harness managing retries
330
+ ```
331
+
332
+ ### Background Workflow with Monitoring
333
+
334
+ ```bash
335
+ # Terminal 1: Start background execution
336
+ aidp execute --background
337
+ ✓ Started background job: 20251005_235912_a1b2c3d4
338
+
339
+ # Terminal 2: Watch progress in real-time
340
+ aidp checkpoint summary --watch
341
+
342
+ # Terminal 3: Monitor job status
343
+ aidp jobs status 20251005_235912_a1b2c3d4 --follow
344
+
345
+ # Later: Check final results
346
+ aidp checkpoint summary
347
+ aidp jobs logs 20251005_235912_a1b2c3d4 --tail
348
+ ```
349
+
350
+ ### Quick Analysis
351
+
352
+ ```bash
353
+ # Run analysis in background
354
+ aidp analyze --background
355
+
356
+ # Check progress
357
+ aidp jobs list
358
+ aidp checkpoint summary
359
+ ```
360
+
193
361
  ## Debug and Logging
194
362
 
195
363
  ```bash
@@ -247,7 +415,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and conventional co
247
415
 
248
416
  For detailed information:
249
417
 
250
- - **[TUI User Guide](docs/TUI_USER_GUIDE.md)** - Complete guide to using the enhanced TUI
418
+ - **[CLI User Guide](docs/CLI_USER_GUIDE.md)** - Complete guide to using AIDP commands
419
+ - **[Work Loops Guide](docs/WORK_LOOPS_GUIDE.md)** - Iterative workflows with automatic validation
251
420
  - **[Configuration Guide](docs/harness-configuration.md)** - Detailed configuration options and examples
252
421
  - **[Troubleshooting Guide](docs/harness-troubleshooting.md)** - Common issues and solutions
253
422
 
@@ -8,7 +8,8 @@ module Aidp
8
8
  class ErrorHandler
9
9
  attr_reader :logger, :error_counts, :recovery_strategies
10
10
 
11
- def initialize(log_file: nil, verbose: false)
11
+ def initialize(log_file: nil, verbose: false, output: nil)
12
+ @output = output
12
13
  @logger = setup_logger(log_file, verbose)
13
14
  @error_counts = Hash.new(0)
14
15
  @recovery_strategies = setup_recovery_strategies
@@ -87,7 +88,8 @@ module Aidp
87
88
  private
88
89
 
89
90
  def setup_logger(log_file, verbose)
90
- logger = Logger.new(log_file || $stdout)
91
+ output_stream = log_file || @output || $stdout
92
+ logger = Logger.new(output_stream)
91
93
  logger.level = verbose ? Logger::DEBUG : Logger::INFO
92
94
  logger.formatter = proc do |severity, datetime, progname, msg|
93
95
  "#{datetime.strftime("%Y-%m-%d %H:%M:%S")} [#{severity}] #{msg}\n"