aidp 0.7.0 → 0.8.1

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 (119) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +60 -214
  3. data/bin/aidp +1 -1
  4. data/lib/aidp/analysis/kb_inspector.rb +38 -23
  5. data/lib/aidp/analysis/seams.rb +2 -31
  6. data/lib/aidp/analysis/tree_sitter_grammar_loader.rb +1 -13
  7. data/lib/aidp/analysis/tree_sitter_scan.rb +3 -20
  8. data/lib/aidp/analyze/error_handler.rb +2 -75
  9. data/lib/aidp/analyze/json_file_storage.rb +292 -0
  10. data/lib/aidp/analyze/progress.rb +12 -0
  11. data/lib/aidp/analyze/progress_visualizer.rb +12 -17
  12. data/lib/aidp/analyze/ruby_maat_integration.rb +13 -31
  13. data/lib/aidp/analyze/runner.rb +256 -87
  14. data/lib/aidp/cli/jobs_command.rb +100 -432
  15. data/lib/aidp/cli.rb +309 -239
  16. data/lib/aidp/config.rb +298 -10
  17. data/lib/aidp/debug_logger.rb +195 -0
  18. data/lib/aidp/debug_mixin.rb +187 -0
  19. data/lib/aidp/execute/progress.rb +9 -0
  20. data/lib/aidp/execute/runner.rb +221 -40
  21. data/lib/aidp/execute/steps.rb +17 -7
  22. data/lib/aidp/execute/workflow_selector.rb +211 -0
  23. data/lib/aidp/harness/completion_checker.rb +268 -0
  24. data/lib/aidp/harness/condition_detector.rb +1526 -0
  25. data/lib/aidp/harness/config_loader.rb +373 -0
  26. data/lib/aidp/harness/config_manager.rb +382 -0
  27. data/lib/aidp/harness/config_schema.rb +1006 -0
  28. data/lib/aidp/harness/config_validator.rb +355 -0
  29. data/lib/aidp/harness/configuration.rb +477 -0
  30. data/lib/aidp/harness/enhanced_runner.rb +494 -0
  31. data/lib/aidp/harness/error_handler.rb +616 -0
  32. data/lib/aidp/harness/provider_config.rb +423 -0
  33. data/lib/aidp/harness/provider_factory.rb +306 -0
  34. data/lib/aidp/harness/provider_manager.rb +1269 -0
  35. data/lib/aidp/harness/provider_type_checker.rb +88 -0
  36. data/lib/aidp/harness/runner.rb +411 -0
  37. data/lib/aidp/harness/state/errors.rb +28 -0
  38. data/lib/aidp/harness/state/metrics.rb +219 -0
  39. data/lib/aidp/harness/state/persistence.rb +128 -0
  40. data/lib/aidp/harness/state/provider_state.rb +132 -0
  41. data/lib/aidp/harness/state/ui_state.rb +68 -0
  42. data/lib/aidp/harness/state/workflow_state.rb +123 -0
  43. data/lib/aidp/harness/state_manager.rb +586 -0
  44. data/lib/aidp/harness/status_display.rb +888 -0
  45. data/lib/aidp/harness/ui/base.rb +16 -0
  46. data/lib/aidp/harness/ui/enhanced_tui.rb +545 -0
  47. data/lib/aidp/harness/ui/enhanced_workflow_selector.rb +252 -0
  48. data/lib/aidp/harness/ui/error_handler.rb +132 -0
  49. data/lib/aidp/harness/ui/frame_manager.rb +361 -0
  50. data/lib/aidp/harness/ui/job_monitor.rb +500 -0
  51. data/lib/aidp/harness/ui/navigation/main_menu.rb +311 -0
  52. data/lib/aidp/harness/ui/navigation/menu_formatter.rb +120 -0
  53. data/lib/aidp/harness/ui/navigation/menu_item.rb +142 -0
  54. data/lib/aidp/harness/ui/navigation/menu_state.rb +139 -0
  55. data/lib/aidp/harness/ui/navigation/submenu.rb +202 -0
  56. data/lib/aidp/harness/ui/navigation/workflow_selector.rb +176 -0
  57. data/lib/aidp/harness/ui/progress_display.rb +280 -0
  58. data/lib/aidp/harness/ui/question_collector.rb +141 -0
  59. data/lib/aidp/harness/ui/spinner_group.rb +184 -0
  60. data/lib/aidp/harness/ui/spinner_helper.rb +152 -0
  61. data/lib/aidp/harness/ui/status_manager.rb +312 -0
  62. data/lib/aidp/harness/ui/status_widget.rb +280 -0
  63. data/lib/aidp/harness/ui/workflow_controller.rb +312 -0
  64. data/lib/aidp/harness/user_interface.rb +2381 -0
  65. data/lib/aidp/provider_manager.rb +131 -7
  66. data/lib/aidp/providers/anthropic.rb +28 -103
  67. data/lib/aidp/providers/base.rb +170 -0
  68. data/lib/aidp/providers/cursor.rb +52 -181
  69. data/lib/aidp/providers/gemini.rb +24 -107
  70. data/lib/aidp/providers/macos_ui.rb +99 -5
  71. data/lib/aidp/providers/opencode.rb +194 -0
  72. data/lib/aidp/storage/csv_storage.rb +172 -0
  73. data/lib/aidp/storage/file_manager.rb +214 -0
  74. data/lib/aidp/storage/json_storage.rb +140 -0
  75. data/lib/aidp/version.rb +1 -1
  76. data/lib/aidp.rb +54 -39
  77. data/templates/COMMON/AGENT_BASE.md +11 -0
  78. data/templates/EXECUTE/00_PRD.md +4 -4
  79. data/templates/EXECUTE/02_ARCHITECTURE.md +5 -4
  80. data/templates/EXECUTE/07_TEST_PLAN.md +4 -1
  81. data/templates/EXECUTE/08_TASKS.md +4 -4
  82. data/templates/EXECUTE/10_IMPLEMENTATION_AGENT.md +4 -4
  83. data/templates/README.md +279 -0
  84. data/templates/aidp-development.yml.example +373 -0
  85. data/templates/aidp-minimal.yml.example +48 -0
  86. data/templates/aidp-production.yml.example +475 -0
  87. data/templates/aidp.yml.example +598 -0
  88. metadata +93 -69
  89. data/lib/aidp/analyze/agent_personas.rb +0 -71
  90. data/lib/aidp/analyze/agent_tool_executor.rb +0 -439
  91. data/lib/aidp/analyze/data_retention_manager.rb +0 -421
  92. data/lib/aidp/analyze/database.rb +0 -260
  93. data/lib/aidp/analyze/dependencies.rb +0 -335
  94. data/lib/aidp/analyze/export_manager.rb +0 -418
  95. data/lib/aidp/analyze/focus_guidance.rb +0 -517
  96. data/lib/aidp/analyze/incremental_analyzer.rb +0 -533
  97. data/lib/aidp/analyze/language_analysis_strategies.rb +0 -897
  98. data/lib/aidp/analyze/large_analysis_progress.rb +0 -499
  99. data/lib/aidp/analyze/memory_manager.rb +0 -339
  100. data/lib/aidp/analyze/metrics_storage.rb +0 -336
  101. data/lib/aidp/analyze/parallel_processor.rb +0 -454
  102. data/lib/aidp/analyze/performance_optimizer.rb +0 -691
  103. data/lib/aidp/analyze/repository_chunker.rb +0 -697
  104. data/lib/aidp/analyze/static_analysis_detector.rb +0 -577
  105. data/lib/aidp/analyze/storage.rb +0 -655
  106. data/lib/aidp/analyze/tool_configuration.rb +0 -441
  107. data/lib/aidp/analyze/tool_modernization.rb +0 -750
  108. data/lib/aidp/database/pg_adapter.rb +0 -148
  109. data/lib/aidp/database_config.rb +0 -69
  110. data/lib/aidp/database_connection.rb +0 -72
  111. data/lib/aidp/job_manager.rb +0 -41
  112. data/lib/aidp/jobs/base_job.rb +0 -45
  113. data/lib/aidp/jobs/provider_execution_job.rb +0 -83
  114. data/lib/aidp/project_detector.rb +0 -117
  115. data/lib/aidp/providers/agent_supervisor.rb +0 -348
  116. data/lib/aidp/providers/supervised_base.rb +0 -317
  117. data/lib/aidp/providers/supervised_cursor.rb +0 -22
  118. data/lib/aidp/sync.rb +0 -13
  119. data/lib/aidp/workspace.rb +0 -19
data/lib/aidp/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aidp
4
- VERSION = "0.7.0"
4
+ VERSION = "0.8.1"
5
5
  end
data/lib/aidp.rb CHANGED
@@ -1,50 +1,65 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Core extensions
4
- require "aidp/core_ext/class_attribute"
4
+ require_relative "aidp/core_ext/class_attribute"
5
5
 
6
6
  # Shared modules
7
- require "aidp/version"
8
- require "aidp/config"
9
- require "aidp/workspace"
10
- require "aidp/util"
11
- require "aidp/cli"
12
- require "aidp/cli/jobs_command"
13
- require "aidp/project_detector"
14
- require "aidp/sync"
15
-
16
- # Database
17
- require "aidp/database_connection"
18
-
19
- # Job infrastructure
20
- require "aidp/job_manager"
21
- require "aidp/jobs/base_job"
22
- require "aidp/jobs/provider_execution_job"
7
+ require_relative "aidp/version"
8
+ require_relative "aidp/config"
9
+ require_relative "aidp/util"
10
+ require_relative "aidp/cli"
11
+ require_relative "aidp/cli/jobs_command"
23
12
 
24
13
  # Providers
25
- require "aidp/providers/base"
26
- require "aidp/providers/cursor"
27
- require "aidp/providers/anthropic"
28
- require "aidp/providers/gemini"
29
- require "aidp/providers/macos_ui"
30
- require "aidp/provider_manager"
31
-
32
- # Analyze mode
33
- require "aidp/analyze/error_handler"
34
- require "aidp/analyze/parallel_processor"
35
- require "aidp/analyze/repository_chunker"
36
- require "aidp/analyze/ruby_maat_integration"
37
- require "aidp/analyze/runner"
38
- require "aidp/analyze/steps"
39
- require "aidp/analyze/progress"
14
+ require_relative "aidp/providers/base"
15
+ require_relative "aidp/providers/cursor"
16
+ require_relative "aidp/providers/anthropic"
17
+ require_relative "aidp/providers/gemini"
18
+ require_relative "aidp/providers/macos_ui"
19
+ # Supervised providers removed - using direct execution model
20
+ require_relative "aidp/provider_manager"
21
+
22
+ # Simple file-based storage
23
+ require_relative "aidp/storage/json_storage"
24
+ require_relative "aidp/storage/csv_storage"
25
+ require_relative "aidp/storage/file_manager"
26
+
27
+ # Analyze mode (simplified - file-based storage only)
28
+ require_relative "aidp/analyze/json_file_storage"
29
+ require_relative "aidp/analyze/error_handler"
30
+ require_relative "aidp/analyze/ruby_maat_integration"
31
+ require_relative "aidp/analyze/runner"
32
+ require_relative "aidp/analyze/steps"
33
+ require_relative "aidp/analyze/progress"
40
34
 
41
35
  # Tree-sitter analysis
42
- require "aidp/analysis/tree_sitter_grammar_loader"
43
- require "aidp/analysis/seams"
44
- require "aidp/analysis/tree_sitter_scan"
45
- require "aidp/analysis/kb_inspector"
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"
46
40
 
47
41
  # Execute mode
48
- require "aidp/execute/steps"
49
- require "aidp/execute/runner"
50
- require "aidp/execute/progress"
42
+ require_relative "aidp/execute/steps"
43
+ require_relative "aidp/execute/runner"
44
+ require_relative "aidp/execute/progress"
45
+
46
+ # Harness mode
47
+ require_relative "aidp/harness/configuration"
48
+ require_relative "aidp/harness/config_schema"
49
+ require_relative "aidp/harness/config_validator"
50
+ require_relative "aidp/harness/config_loader"
51
+ require_relative "aidp/harness/config_manager"
52
+ require_relative "aidp/harness/condition_detector"
53
+ require_relative "aidp/harness/user_interface"
54
+ require_relative "aidp/harness/provider_manager"
55
+ require_relative "aidp/harness/provider_config"
56
+ require_relative "aidp/harness/provider_factory"
57
+ require_relative "aidp/harness/state_manager"
58
+ require_relative "aidp/harness/error_handler"
59
+ require_relative "aidp/harness/status_display"
60
+ require_relative "aidp/harness/runner"
61
+
62
+ # UI components
63
+ require_relative "aidp/harness/ui/spinner_helper"
64
+
65
+ # CLI commands
@@ -20,6 +20,17 @@ This template provides common capabilities and guidelines for AI agents in both
20
20
  - **Contextual Relevance**: Ensure recommendations are relevant to the project
21
21
  - **Professional Tone**: Maintain a helpful, professional demeanor
22
22
 
23
+ ### User Interaction Guidelines
24
+
25
+ #### TUI-Based Interaction
26
+
27
+ - **Interactive Questions**: Present questions through the harness TUI system for real-time user input
28
+ - **Validation**: Use built-in validation for user responses (required fields, format validation, etc.)
29
+ - **Error Handling**: Provide clear error messages and allow users to correct invalid input
30
+ - **Progress Feedback**: Show progress indicators and status updates during long operations
31
+ - **Rich Interface**: Utilize CLI UI components for beautiful, interactive terminal experience
32
+ - **STDOUT Integration**: Ensure all output flows through the harness system for proper display
33
+
23
34
  ### Quality Standards
24
35
 
25
36
  - **Accuracy**: Ensure information is correct and up-to-date
@@ -4,10 +4,10 @@ You are a product strategist. Produce a **concise, complete PRD**.
4
4
 
5
5
  ## Important Instructions
6
6
 
7
- - If you need additional information to create a complete PRD, create a file called `PRD_QUESTIONS.md` with specific questions for the user.
8
- - If `PRD_QUESTIONS.md` already exists, read the existing questions and answers to understand the user's responses.
9
- - Otherwise, proceed to create the complete PRD document.
10
- - Only ask for clarifications at this PRD step. For subsequent steps, proceed with available information.
7
+ - If you need additional information to create a complete PRD, present questions interactively through the harness TUI system
8
+ - Users will answer questions directly in the terminal with validation and error handling
9
+ - If you have sufficient information, proceed directly to create the complete PRD document
10
+ - Only ask for clarifications at this PRD step. For subsequent steps, proceed with available information
11
11
 
12
12
  ## Input
13
13
 
@@ -5,10 +5,11 @@ and **hexagonal structure**.
5
5
 
6
6
  ## Important Instructions
7
7
 
8
- - If you need additional information to create a complete architecture, create a file called `ARCH_QUESTIONS.md` with specific questions for the user (see `02A_ARCH_GATE_QUESTIONS.md` for suggested questions).
9
- - If `ARCH_QUESTIONS.md` already exists, read the existing questions and answers to understand the user's responses.
10
- - Otherwise, proceed to create the complete architecture document.
11
- - Only ask for clarifications at this Architecture step. For subsequent steps, proceed with available information.
8
+ - If you need additional information to create a complete architecture, present questions interactively through the harness TUI system
9
+ - Users will answer questions directly in the terminal with validation and error handling
10
+ - See `02A_ARCH_GATE_QUESTIONS.md` for suggested questions to ask
11
+ - If you have sufficient information, proceed directly to create the complete architecture document
12
+ - Only ask for clarifications at this Architecture step. For subsequent steps, proceed with available information
12
13
 
13
14
  ## Inputs
14
15
 
@@ -9,15 +9,18 @@ You are a test strategist.
9
9
  ## Process
10
10
 
11
11
  - Derive acceptance tests from user stories.
12
+ - Give each test a clear and descriptive title, so that running tests in "documentation" format will create a clear specification of behavior.
12
13
  - Define the **test pyramid** (unit, contract, component, e2e) and
13
14
  **property-based** tests for core logic.
15
+ - Avoid mocking non-external dependencies unless necessary.
14
16
  - Establish coverage & mutation-testing thresholds.
15
17
  - Follow Sandi Metz's rules for unit testing.
18
+ - Tests should be written for maximum understandability, maintainability, and reviewability. Assume the reviewer is not familiar with the codebase.
16
19
 
17
20
  ## Output
18
21
 
19
22
  - `docs/TestPlan.md`
20
- - `golden/` fixtures directory plan
23
+ - `spec/fixtures/` fixtures directory plan
21
24
 
22
25
  ## Regeneration Policy
23
26
 
@@ -4,10 +4,10 @@ You are a planner.
4
4
 
5
5
  ## Important Instructions
6
6
 
7
- - If you need additional information to create a complete task plan, create a file called `TASKS_QUESTIONS.md` with specific questions for the user.
8
- - If `TASKS_QUESTIONS.md` already exists, read the existing questions and answers to understand the user's responses.
9
- - Otherwise, proceed to create the complete task plan.
10
- - Only ask for clarifications at this Tasks step. For subsequent steps, proceed with available information.
7
+ - If you need additional information to create a complete task plan, present questions interactively through the harness TUI system
8
+ - Users will answer questions directly in the terminal with validation and error handling
9
+ - If you have sufficient information, proceed directly to create the complete task plan
10
+ - Only ask for clarifications at this Tasks step. For subsequent steps, proceed with available information
11
11
 
12
12
  ## Inputs
13
13
 
@@ -4,10 +4,10 @@ You are a senior engineer writing **implementation guidance** for domain agents.
4
4
 
5
5
  ## Important Instructions
6
6
 
7
- - If you need additional information to create a complete implementation guide, create a file called `IMPL_QUESTIONS.md` with specific questions for the user.
8
- - If `IMPL_QUESTIONS.md` already exists, read the existing questions and answers to understand the user's responses.
9
- - Otherwise, proceed to create the complete implementation guide.
10
- - Only ask for clarifications at this Implementation step. For subsequent steps, proceed with available information.
7
+ - If you need additional information to create a complete implementation guide, present questions interactively through the harness TUI system
8
+ - Users will answer questions directly in the terminal with validation and error handling
9
+ - If you have sufficient information, proceed directly to create the complete implementation guide
10
+ - Only ask for clarifications at this Implementation step. For subsequent steps, proceed with available information
11
11
 
12
12
  ## Inputs
13
13
 
@@ -0,0 +1,279 @@
1
+ # AIDP Configuration Examples
2
+
3
+ This directory contains example configuration files for the AIDP (AI Dev Pipeline) harness system. Choose the configuration that best fits your needs and copy it to your project root as `aidp.yml`.
4
+
5
+ ## Available Configuration Files
6
+
7
+ ### 1. `aidp.yml.example` - Complete Configuration
8
+
9
+ **Best for**: Production use, comprehensive setups, advanced users
10
+
11
+ This is the most comprehensive configuration file that demonstrates all available harness features including:
12
+
13
+ - Complete harness configuration with all options
14
+ - Multiple provider configurations (Cursor, Claude, Gemini)
15
+ - Advanced features like circuit breakers, load balancing, health checks
16
+ - Environment-specific configurations
17
+ - Mode-specific configurations (analyze vs execute)
18
+ - Feature flags
19
+ - Time-based configurations
20
+ - Step-specific configurations
21
+ - User-specific configurations
22
+ - Comprehensive monitoring and logging
23
+ - Security configurations
24
+
25
+ ### 2. `aidp-minimal.yml.example` - Minimal Configuration
26
+
27
+ **Best for**: Getting started, simple setups, basic usage
28
+
29
+ This is a minimal configuration file that includes only the essential settings:
30
+
31
+ - Basic harness configuration
32
+ - Two providers (Cursor and Claude)
33
+ - Essential features only
34
+ - Simple retry and fallback configuration
35
+
36
+ ### 3. `aidp-production.yml.example` - Production Configuration
37
+
38
+ **Best for**: Production deployments, enterprise use, high availability
39
+
40
+ This configuration is optimized for production use with:
41
+
42
+ - Comprehensive monitoring and alerting
43
+ - Robust error handling and retry logic
44
+ - Circuit breaker patterns for fault tolerance
45
+ - Load balancing and health checks
46
+ - Security configurations
47
+ - Cost tracking and budgeting
48
+ - Audit logging
49
+ - Performance optimizations
50
+
51
+ ### 4. `aidp-development.yml.example` - Development Configuration
52
+
53
+ **Best for**: Development, testing, debugging
54
+
55
+ This configuration is optimized for development with:
56
+
57
+ - Relaxed timeouts and retry settings
58
+ - Enhanced logging and debugging
59
+ - Disabled rate limiting for testing
60
+ - Fast feedback loops
61
+ - Detailed error reporting
62
+ - Request/response logging
63
+
64
+ ## Quick Start
65
+
66
+ 1. **Choose a configuration file** based on your needs
67
+ 2. **Copy it to your project root** as `aidp.yml`:
68
+
69
+ ```bash
70
+ cp templates/aidp-minimal.yml.example aidp.yml
71
+ ```
72
+
73
+ 3. **Set up your API keys** in environment variables:
74
+
75
+ ```bash
76
+ export ANTHROPIC_API_KEY="your_api_key_here"
77
+ export GEMINI_API_KEY="your_api_key_here"
78
+ ```
79
+
80
+ 4. **Customize the configuration** for your specific needs
81
+ 5. **Run AIDP** with the harness:
82
+
83
+ ```bash
84
+ aidp analyze
85
+ aidp execute
86
+ ```
87
+
88
+ ## Configuration Sections
89
+
90
+ ### Harness Configuration
91
+
92
+ The `harness` section controls the overall behavior of the harness system:
93
+
94
+ - `default_provider`: Primary provider to use
95
+ - `fallback_providers`: Backup providers in order of preference
96
+ - `max_retries`: Number of retry attempts
97
+ - `request_timeout`: Global request timeout
98
+ - `auto_switch_on_error`: Automatically switch providers on errors
99
+ - `auto_switch_on_rate_limit`: Automatically switch providers on rate limits
100
+
101
+ ### Provider Configuration
102
+
103
+ The `providers` section defines individual provider settings:
104
+
105
+ - `type`: Provider type (package, api, byok)
106
+ - `priority`: Provider priority (higher = more preferred)
107
+ - `models`: Available models for the provider
108
+ - `features`: Provider capabilities
109
+ - `auth`: Authentication configuration
110
+ - `endpoints`: API endpoints
111
+ - `monitoring`: Monitoring and metrics
112
+ - `rate_limit`: Rate limiting settings
113
+ - `retry`: Retry configuration
114
+ - `circuit_breaker`: Circuit breaker settings
115
+ - `cost`: Cost tracking
116
+ - `health_check`: Health check configuration
117
+ - `log`: Logging configuration
118
+ - `cache`: Caching configuration
119
+ - `security`: Security settings
120
+
121
+ ### Advanced Features
122
+
123
+ #### Environment-Specific Configuration
124
+
125
+ Use the `environments` section to have different settings for different environments:
126
+
127
+ ```yaml
128
+ environments:
129
+ development:
130
+ harness:
131
+ max_retries: 1
132
+ production:
133
+ harness:
134
+ max_retries: 3
135
+ ```
136
+
137
+ #### Mode-Specific Configuration
138
+
139
+ Use the `analyze_mode` and `execute_mode` sections for different execution modes:
140
+
141
+ ```yaml
142
+ analyze_mode:
143
+ harness:
144
+ request_timeout: 600
145
+ execute_mode:
146
+ harness:
147
+ request_timeout: 300
148
+ ```
149
+
150
+ #### Feature Flags
151
+
152
+ Use the `features` section to enable/disable functionality:
153
+
154
+ ```yaml
155
+ features:
156
+ debugging:
157
+ harness:
158
+ log_errors: true
159
+ ```
160
+
161
+ #### Time-Based Configuration
162
+
163
+ Use the `time_based` section for different settings based on time:
164
+
165
+ ```yaml
166
+ time_based:
167
+ hours:
168
+ 9..17: # Business hours
169
+ harness:
170
+ max_retries: 2
171
+ ```
172
+
173
+ ## Provider Types
174
+
175
+ ### Package Providers
176
+
177
+ - **Type**: `package`
178
+ - **Pricing**: Fixed monthly/yearly subscription
179
+ - **Examples**: Cursor Pro
180
+ - **Configuration**: No API keys needed
181
+
182
+ ### API Providers
183
+
184
+ - **Type**: `api`
185
+ - **Pricing**: Pay-per-use based on tokens
186
+ - **Examples**: Claude, Gemini
187
+ - **Configuration**: Requires API keys
188
+
189
+ ### BYOK Providers
190
+
191
+ - **Type**: `byok`
192
+ - **Pricing**: User provides their own API key
193
+ - **Examples**: OpenAI, custom APIs
194
+ - **Configuration**: User manages API keys
195
+
196
+ ## Best Practices
197
+
198
+ ### Security
199
+
200
+ - Store API keys in environment variables, not in the config file
201
+ - Use `restrict_to_non_byok: true` to avoid BYOK providers
202
+ - Enable SSL verification in production
203
+ - Configure allowed/blocked hosts appropriately
204
+
205
+ ### Performance
206
+
207
+ - Enable caching for frequently used responses
208
+ - Use appropriate timeouts for different models
209
+ - Configure rate limits based on your API plans
210
+ - Enable parallel processing for better throughput
211
+
212
+ ### Reliability
213
+
214
+ - Configure fallback providers for automatic failover
215
+ - Enable circuit breakers for fault tolerance
216
+ - Set up health checks for all providers
217
+ - Configure appropriate retry strategies
218
+
219
+ ### Monitoring
220
+
221
+ - Enable metrics collection in production
222
+ - Set up log rotation and retention
223
+ - Configure monitoring intervals appropriately
224
+ - Enable audit logging for compliance
225
+
226
+ ### Cost Management
227
+
228
+ - Configure cost tracking for API providers
229
+ - Set appropriate token limits
230
+ - Monitor usage and costs regularly
231
+ - Use cost-effective models when possible
232
+
233
+ ## Troubleshooting
234
+
235
+ ### Common Issues
236
+
237
+ 1. **Provider not working**: Check API keys and endpoints
238
+ 2. **Rate limiting**: Adjust rate limit settings or use fallback providers
239
+ 3. **Timeout errors**: Increase timeout values
240
+ 4. **Configuration errors**: Validate your YAML syntax
241
+ 5. **Permission errors**: Check file permissions for log files
242
+
243
+ ### Validation
244
+
245
+ Use the AIDP configuration validator to check your configuration:
246
+
247
+ ```bash
248
+ aidp config validate
249
+ ```
250
+
251
+ ### Debugging
252
+
253
+ Enable debug logging to troubleshoot issues:
254
+
255
+ ```yaml
256
+ providers:
257
+ your_provider:
258
+ log:
259
+ level: "debug"
260
+ log_requests: true
261
+ log_responses: true
262
+ ```
263
+
264
+ ## Support
265
+
266
+ For more information about AIDP configuration, see:
267
+
268
+ - [AIDP Documentation](https://github.com/your-org/aidp/docs)
269
+ - [Configuration Schema](https://github.com/your-org/aidp/docs/configuration-schema.md)
270
+ - [Provider Guide](https://github.com/your-org/aidp/docs/providers.md)
271
+
272
+ ## Contributing
273
+
274
+ To contribute new configuration examples or improve existing ones:
275
+
276
+ 1. Fork the repository
277
+ 2. Create a new configuration file or modify an existing one
278
+ 3. Test your configuration thoroughly
279
+ 4. Submit a pull request with your changes