aia 2.0.0.0.pre.beta2 → 2.0.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 (225) hide show
  1. checksums.yaml +4 -4
  2. data/.version +1 -1
  3. data/CHANGELOG.md +146 -228
  4. data/README.md +41 -18
  5. data/bin/aia +8 -3
  6. data/lib/aia/aia_completion.bash +2 -3
  7. data/lib/aia/aia_completion.fish +6 -5
  8. data/lib/aia/aia_completion.zsh +2 -3
  9. data/lib/aia/chat_loop.rb +16 -14
  10. data/lib/aia/config/cli_parser.rb +123 -91
  11. data/lib/aia/config/defaults.yml +12 -39
  12. data/lib/aia/config/mcp_parser.rb +30 -36
  13. data/lib/aia/config/model_spec.rb +8 -14
  14. data/lib/aia/config/validator.rb +102 -103
  15. data/lib/aia/config/value_caster.rb +76 -0
  16. data/lib/aia/config.rb +70 -53
  17. data/lib/aia/crew.rb +29 -19
  18. data/lib/aia/debate_handler.rb +27 -10
  19. data/lib/aia/directives/configuration_directives.rb +55 -14
  20. data/lib/aia/directives/context_directives.rb +24 -12
  21. data/lib/aia/directives/execution_directives.rb +18 -23
  22. data/lib/aia/directives/model_directives.rb +41 -104
  23. data/lib/aia/directives/utility_directives.rb +16 -17
  24. data/lib/aia/directives/web_and_file_directives.rb +21 -14
  25. data/lib/aia/fact_asserter.rb +3 -3
  26. data/lib/aia/history_transfer.rb +64 -24
  27. data/lib/aia/logger.rb +10 -45
  28. data/lib/aia/mcp_config_normalizer.rb +27 -14
  29. data/lib/aia/mcp_connection_manager.rb +181 -184
  30. data/lib/aia/mcp_discovery.rb +43 -15
  31. data/lib/aia/mcp_grouper.rb +2 -1
  32. data/lib/aia/mcp_server_config.rb +20 -2
  33. data/lib/aia/mcp_utility.rb +24 -19
  34. data/lib/aia/mention_router.rb +15 -2
  35. data/lib/aia/modality_query.rb +36 -0
  36. data/lib/aia/model_alias_registry.rb +11 -11
  37. data/lib/aia/model_registry.rb +75 -0
  38. data/lib/aia/network_builder.rb +8 -7
  39. data/lib/aia/patches/ruby_llm_streaming_error.rb +21 -4
  40. data/lib/aia/patches/ruby_llm_tool_param_compat.rb +18 -0
  41. data/lib/aia/pipeline_orchestrator.rb +71 -38
  42. data/lib/aia/prompt_decomposer.rb +1 -1
  43. data/lib/aia/prompt_handler.rb +56 -29
  44. data/lib/aia/provider_registry.rb +105 -0
  45. data/lib/aia/robot_builder.rb +1 -1
  46. data/lib/aia/robot_factory.rb +67 -63
  47. data/lib/aia/robot_sync.rb +79 -0
  48. data/lib/aia/role_catalog.rb +89 -0
  49. data/lib/aia/session.rb +25 -11
  50. data/lib/aia/skill_utils.rb +60 -19
  51. data/lib/aia/spawn_handler.rb +16 -4
  52. data/lib/aia/spawn_spec_parser.rb +6 -7
  53. data/lib/aia/special_mode_handler.rb +28 -25
  54. data/lib/aia/speech.rb +70 -34
  55. data/lib/aia/startup_coordinator.rb +17 -92
  56. data/lib/aia/streaming_runner.rb +10 -2
  57. data/lib/aia/system_prompt_assembler.rb +12 -11
  58. data/lib/aia/task_board.rb +60 -0
  59. data/lib/aia/tool_approver.rb +205 -0
  60. data/lib/aia/tool_filter.rb +1 -10
  61. data/lib/aia/tool_filter_strategy.rb +12 -1
  62. data/lib/aia/tool_introspection.rb +9 -1
  63. data/lib/aia/tool_loader.rb +67 -33
  64. data/lib/aia/tool_utility.rb +6 -5
  65. data/lib/aia/tools/delegate_to_foreman_tool.rb +6 -4
  66. data/lib/aia/tools/recruit_robot_tool.rb +12 -12
  67. data/lib/aia/tools/reskill_robot_tool.rb +7 -7
  68. data/lib/aia/tools/task_board_tool.rb +16 -16
  69. data/lib/aia/trakflow_bridge.rb +14 -8
  70. data/lib/aia/turn_state.rb +31 -8
  71. data/lib/aia/ui_presenter.rb +16 -0
  72. data/lib/aia/utility.rb +6 -24
  73. data/lib/aia/variable_input_collector.rb +0 -3
  74. data/lib/aia/verification_network.rb +9 -10
  75. data/lib/aia.rb +33 -8
  76. metadata +19 -160
  77. data/.better-commits.json +0 -150
  78. data/.config/tocer/configuration.yml +0 -6
  79. data/.envrc +0 -19
  80. data/.loki +0 -11
  81. data/.reek.yml +0 -160
  82. data/.rubocop.yml +0 -116
  83. data/.rubocop_strict.yml +0 -15
  84. data/COMMITS.md +0 -196
  85. data/IMPLEMENTATION_PLAN.md +0 -506
  86. data/Rakefile +0 -47
  87. data/_typos.toml +0 -10
  88. data/aia.gemspec +0 -92
  89. data/architecture_review.md +0 -314
  90. data/config/aia.yml +0 -13
  91. data/docs/AGENTS.md +0 -40
  92. data/docs/advanced-prompting.md +0 -814
  93. data/docs/assets/images/aia.png +0 -0
  94. data/docs/cli-reference.md +0 -1241
  95. data/docs/configuration.md +0 -747
  96. data/docs/contributing.md +0 -386
  97. data/docs/directives-reference.md +0 -1145
  98. data/docs/examples/index.md +0 -277
  99. data/docs/examples/mcp/index.md +0 -475
  100. data/docs/examples/prompts/analysis/index.md +0 -78
  101. data/docs/examples/prompts/automation/index.md +0 -109
  102. data/docs/examples/prompts/development/index.md +0 -125
  103. data/docs/examples/prompts/index.md +0 -333
  104. data/docs/examples/prompts/learning/index.md +0 -127
  105. data/docs/examples/prompts/writing/index.md +0 -62
  106. data/docs/examples/tools/index.md +0 -282
  107. data/docs/faq.md +0 -578
  108. data/docs/guides/available-models.md +0 -366
  109. data/docs/guides/basic-usage.md +0 -478
  110. data/docs/guides/chat.md +0 -680
  111. data/docs/guides/crew.md +0 -239
  112. data/docs/guides/executable-prompts.md +0 -331
  113. data/docs/guides/first-prompt.md +0 -454
  114. data/docs/guides/getting-started.md +0 -455
  115. data/docs/guides/image-generation.md +0 -507
  116. data/docs/guides/index.md +0 -48
  117. data/docs/guides/local-models.md +0 -306
  118. data/docs/guides/migrate-prompts.md +0 -335
  119. data/docs/guides/models.md +0 -1017
  120. data/docs/guides/shared-tools.md +0 -254
  121. data/docs/guides/tools.md +0 -831
  122. data/docs/index.md +0 -259
  123. data/docs/installation.md +0 -274
  124. data/docs/mcp-integration.md +0 -603
  125. data/docs/prompt_management.md +0 -665
  126. data/docs/security.md +0 -674
  127. data/docs/special_projects_guide.md +0 -386
  128. data/docs/tools-and-mcp-examples.md +0 -1211
  129. data/docs/workflows-and-pipelines.md +0 -636
  130. data/examples/.gitignore +0 -2
  131. data/examples/00_setup_aia.sh +0 -111
  132. data/examples/01_basic_usage.sh +0 -23
  133. data/examples/02_frontmatter.sh +0 -33
  134. data/examples/03_shell_integration.sh +0 -55
  135. data/examples/04_erb_templating.sh +0 -56
  136. data/examples/05_shell_then_erb.sh +0 -38
  137. data/examples/06_prompt_chaining.sh +0 -59
  138. data/examples/07_pipeline.sh +0 -46
  139. data/examples/08_context_files.sh +0 -43
  140. data/examples/09_roles.sh +0 -67
  141. data/examples/10_stdin_piping.sh +0 -49
  142. data/examples/11_multi_model.sh +0 -65
  143. data/examples/12_token_usage.sh +0 -52
  144. data/examples/13_cost_tracking.sh +0 -68
  145. data/examples/14_output_file.sh +0 -91
  146. data/examples/15_parameters.sh +0 -68
  147. data/examples/16_directives.sh +0 -113
  148. data/examples/17_require_and_conditionals.sh +0 -68
  149. data/examples/18_tools.sh +0 -61
  150. data/examples/19_local_tools.sh +0 -34
  151. data/examples/20_mcp_servers.sh +0 -102
  152. data/examples/21_executable_prompts.sh +0 -78
  153. data/examples/22_chat_mode.sh +0 -217
  154. data/examples/23_verify.sh +0 -139
  155. data/examples/24_decompose.sh +0 -139
  156. data/examples/25_spawn.sh +0 -139
  157. data/examples/26_debate.sh +0 -97
  158. data/examples/27_mention_routing.sh +0 -157
  159. data/examples/28_model_switching.sh +0 -106
  160. data/examples/29_agent_harness.sh +0 -177
  161. data/examples/README.md +0 -321
  162. data/examples/advanced_multi_robot_capabilities_without_examples.md +0 -106
  163. data/examples/aia_config.yml +0 -22
  164. data/examples/aia_config_orchestrator.yml +0 -45
  165. data/examples/aia_config_with_mcp.yml +0 -21
  166. data/examples/common.sh +0 -39
  167. data/examples/context/project_goals.md +0 -6
  168. data/examples/context/tech_stack.md +0 -7
  169. data/examples/directives/timestamp_directive.rb +0 -22
  170. data/examples/mcp/filesystem.json +0 -9
  171. data/examples/prompts_dir/analyze.md +0 -2
  172. data/examples/prompts_dir/brainstorm.md +0 -2
  173. data/examples/prompts_dir/conditional.md +0 -17
  174. data/examples/prompts_dir/creative.md +0 -4
  175. data/examples/prompts_dir/erbinfo.md +0 -5
  176. data/examples/prompts_dir/erbinfo_raw.md +0 -8
  177. data/examples/prompts_dir/evaluate.md +0 -2
  178. data/examples/prompts_dir/explain_joke.md +0 -1
  179. data/examples/prompts_dir/explain_recursion.md +0 -1
  180. data/examples/prompts_dir/fun_fact +0 -3
  181. data/examples/prompts_dir/greeting.md +0 -8
  182. data/examples/prompts_dir/greeting_required.md +0 -7
  183. data/examples/prompts_dir/hello.md +0 -1
  184. data/examples/prompts_dir/includes/ruby_facts.md +0 -4
  185. data/examples/prompts_dir/limerick.md +0 -1
  186. data/examples/prompts_dir/list_with_mcp.md +0 -3
  187. data/examples/prompts_dir/pick_best.md +0 -2
  188. data/examples/prompts_dir/project_summary +0 -12
  189. data/examples/prompts_dir/quiz_with_include.md +0 -6
  190. data/examples/prompts_dir/require_demo.md +0 -5
  191. data/examples/prompts_dir/roles/formal.md +0 -3
  192. data/examples/prompts_dir/roles/orchestrator.md +0 -21
  193. data/examples/prompts_dir/roles/pirate.md +0 -3
  194. data/examples/prompts_dir/shell_then_erb.md +0 -6
  195. data/examples/prompts_dir/sort_compare.md +0 -2
  196. data/examples/prompts_dir/summarize_context.md +0 -2
  197. data/examples/prompts_dir/sysinfo.md +0 -5
  198. data/examples/prompts_dir/sysinfo_raw.md +0 -8
  199. data/examples/prompts_dir/tagline.md +0 -1
  200. data/examples/prompts_dir/tell_joke.md +0 -1
  201. data/examples/prompts_dir/tell_joke_with_next.md +0 -4
  202. data/examples/prompts_dir/use_local_tool.md +0 -8
  203. data/examples/prompts_dir/use_tools.md +0 -8
  204. data/examples/prompts_dir/weather.md +0 -2
  205. data/examples/prompts_dir/whats_new.md +0 -2
  206. data/examples/prompts_dir/with_timestamp.md +0 -5
  207. data/examples/requirements/sinatra_taskflow_app.md +0 -139
  208. data/examples/rules/01_classify_ruby.rb +0 -16
  209. data/examples/rules/02_prefer_claude_for_code.rb +0 -19
  210. data/examples/rules/03_gate_prompt_length.rb +0 -19
  211. data/examples/rules/04_tool_selection.rb +0 -41
  212. data/examples/rules/README.md +0 -30
  213. data/examples/run_all.sh +0 -294
  214. data/examples/tools/word_count_tool.rb +0 -30
  215. data/lib/AGENTS.md +0 -57
  216. data/lib/aia/model_switch_handler.rb +0 -100
  217. data/mcp_servers/README.md +0 -110
  218. data/mcp_servers/apple-mcp.json +0 -8
  219. data/mcp_servers/filesystem.json +0 -9
  220. data/mcp_servers/mcp_server_chart.json +0 -11
  221. data/mcp_servers/playwright_one.json +0 -8
  222. data/mcp_servers/playwright_server_definition.json +0 -9
  223. data/mcp_servers/playwright_two.json +0 -8
  224. data/mcp_servers/tavily_mcp_server.json +0 -8
  225. data/mkdocs.yml +0 -169
@@ -1,475 +0,0 @@
1
- # MCP Examples
2
-
3
- Collection of Model Context Protocol (MCP) client examples and configurations for extending AIA with external services.
4
-
5
- ## Available MCP Clients
6
-
7
- ### GitHub Integration
8
- - **github_analyzer.py** - Comprehensive GitHub repository analysis
9
- - **github_issue_manager.js** - Issue tracking and management
10
- - **github_pr_analyzer.py** - Pull request analysis and review
11
- - **github_metrics.rb** - Repository metrics and statistics
12
-
13
- ### File System Access
14
- - **filesystem_analyzer.py** - Safe file system analysis
15
- - **directory_scanner.js** - Directory structure analysis
16
- - **file_watcher.py** - File change monitoring
17
- - **backup_manager.go** - File backup and versioning
18
-
19
- ### Database Integration
20
- - **postgres_analyzer.py** - PostgreSQL database analysis
21
- - **mysql_connector.js** - MySQL database operations
22
- - **sqlite_manager.py** - SQLite database management
23
- - **schema_validator.rb** - Database schema validation
24
-
25
- ### API Integration
26
- - **rest_client.py** - RESTful API client and testing
27
- - **graphql_client.js** - GraphQL query and analysis
28
- - **webhook_server.py** - Webhook handling and processing
29
- - **api_monitor.go** - API performance monitoring
30
-
31
- ### Development Tools
32
- - **docker_manager.py** - Docker container management
33
- - **kubernetes_analyzer.js** - Kubernetes cluster analysis
34
- - **ci_cd_monitor.py** - CI/CD pipeline monitoring
35
- - **log_aggregator.rb** - Distributed log collection
36
-
37
- ## MCP Client Structure
38
-
39
- MCP clients follow the Model Context Protocol specification:
40
-
41
- ### Python MCP Server
42
- ```python
43
- from mcp.server import Server
44
- from mcp.types import Resource, Tool, TextContent
45
- import asyncio
46
-
47
- server = Server("client-name", "1.0.0")
48
-
49
- @server.list_tools()
50
- async def list_tools():
51
- return [
52
- Tool(
53
- name="tool_name",
54
- description="Tool description",
55
- inputSchema={
56
- "type": "object",
57
- "properties": {
58
- "param": {"type": "string"}
59
- },
60
- "required": ["param"]
61
- }
62
- )
63
- ]
64
-
65
- @server.call_tool()
66
- async def call_tool(name: str, arguments: dict):
67
- if name == "tool_name":
68
- result = process_request(arguments["param"])
69
- return TextContent(type="text", text=result)
70
-
71
- if __name__ == "__main__":
72
- asyncio.run(server.run())
73
- ```
74
-
75
- ### Node.js MCP Server
76
- ```javascript
77
- const { Server } = require('@anthropic-ai/mcp-sdk/server');
78
-
79
- const server = new Server('client-name', '1.0.0');
80
-
81
- server.setRequestHandler('tools/list', async () => {
82
- return {
83
- tools: [{
84
- name: 'tool_name',
85
- description: 'Tool description',
86
- inputSchema: {
87
- type: 'object',
88
- properties: {
89
- param: { type: 'string' }
90
- },
91
- required: ['param']
92
- }
93
- }]
94
- };
95
- });
96
-
97
- server.setRequestHandler('tools/call', async (request) => {
98
- const { name, arguments: args } = request.params;
99
-
100
- if (name === 'tool_name') {
101
- const result = processRequest(args.param);
102
- return { content: [{ type: 'text', text: result }] };
103
- }
104
- });
105
-
106
- server.connect();
107
- ```
108
-
109
- ## Configuration Examples
110
-
111
- ### Basic MCP Configuration
112
- ```yaml
113
- # ~/.config/aia/aia.yml
114
- mcp_servers:
115
- - name: github
116
- command: python
117
- args:
118
- - github_analyzer.py
119
- env:
120
- GITHUB_TOKEN: "${GITHUB_TOKEN}"
121
-
122
- - name: filesystem
123
- command: node
124
- args:
125
- - filesystem_analyzer.js
126
- - /allowed/path
127
-
128
- - name: database
129
- command: python
130
- args:
131
- - postgres_analyzer.py
132
- env:
133
- DATABASE_URL: "${DATABASE_URL}"
134
- ```
135
-
136
- ### MCP Configuration with Timeouts
137
- ```yaml
138
- # ~/.config/aia/aia.yml
139
- mcp_servers:
140
- - name: github
141
- command: python
142
- args:
143
- - mcp_clients/github_analyzer.py
144
- env:
145
- GITHUB_TOKEN: "${GITHUB_TOKEN}"
146
- LOG_LEVEL: "INFO"
147
- timeout: 30000
148
-
149
- - name: filesystem
150
- command: node
151
- args:
152
- - mcp_clients/filesystem_analyzer.js
153
- - /home/user/projects
154
- - /tmp/workspace
155
-
156
- - name: database
157
- command: python
158
- args:
159
- - mcp_clients/postgres_analyzer.py
160
- env:
161
- DATABASE_URL: "${READ_ONLY_DB_URL}"
162
- timeout: 10000
163
- ```
164
-
165
- ## Usage Examples
166
-
167
- ### GitHub Repository Analysis
168
- ```bash
169
- # Configure GitHub MCP client
170
- export GITHUB_TOKEN="your_github_token"
171
-
172
- # Use in AIA prompt
173
- aia --mcp github repo_analysis --owner microsoft --repo vscode
174
- ```
175
-
176
- ```markdown
177
- # github_analysis.md
178
- # Requires MCP server "github" configured in ~/.config/aia/aia.yml
179
-
180
- # GitHub Repository Analysis
181
-
182
- Repository: <%= owner %>/<%= repo %>
183
-
184
- Analyze the repository and provide:
185
- 1. Repository health and activity metrics
186
- 2. Code quality and organization assessment
187
- 3. Issue and PR management effectiveness
188
- 4. Contributor activity and patterns
189
- 5. Security and maintenance status
190
-
191
- Generate comprehensive analysis with recommendations.
192
- ```
193
-
194
- ### Database Schema Analysis
195
- ```bash
196
- # Configure database MCP client
197
- export DATABASE_URL="postgresql://user:pass@localhost/db"
198
-
199
- # Use in AIA prompt
200
- aia --mcp database schema_analysis --schema public
201
- ```
202
-
203
- ```markdown
204
- # database_analysis.md
205
- # Requires MCP server "database" configured in ~/.config/aia/aia.yml
206
-
207
- # Database Schema Analysis
208
-
209
- Schema: <%= schema %>
210
-
211
- Perform comprehensive database analysis:
212
- 1. Table structure and relationships
213
- 2. Index optimization opportunities
214
- 3. Data quality assessment
215
- 4. Performance bottlenecks
216
- 5. Security considerations
217
-
218
- Provide actionable optimization recommendations.
219
- ```
220
-
221
- ### Multi-Client Integration
222
- ```markdown
223
- # comprehensive_project_audit.md
224
- # Requires MCP servers: github, filesystem, database
225
- # Run with: aia --mcp-use github,filesystem,database comprehensive_project_audit
226
-
227
- # Comprehensive Project Audit
228
-
229
- Project: <%= project_name %>
230
-
231
- ## Phase 1: Repository Analysis (GitHub MCP)
232
- - Repository health and activity
233
- - Code review processes
234
- - Issue management effectiveness
235
- - Release and deployment practices
236
-
237
- ## Phase 2: File System Analysis (Filesystem MCP)
238
- - Project structure and organization
239
- - Configuration management
240
- - Documentation completeness
241
- - Security file analysis
242
-
243
- ## Phase 3: Database Analysis (Database MCP)
244
- - Schema design and integrity
245
- - Performance optimization
246
- - Data quality assessment
247
- - Security configuration
248
-
249
- ## Integration Analysis
250
- Cross-analyze findings from all systems to identify:
251
- - Consistency across different layers
252
- - Integration gaps and opportunities
253
- - Security vulnerabilities
254
- - Performance optimization priorities
255
-
256
- Generate unified recommendations with implementation priority.
257
- ```
258
-
259
- ## Security Considerations
260
-
261
- ### MCP Security Best Practices
262
-
263
- Control MCP server access using CLI flags:
264
-
265
- ```bash
266
- # Allow only specific MCP servers
267
- aia --mcp-use github,filesystem --chat
268
-
269
- # Skip specific MCP servers
270
- aia --mcp-skip database --chat
271
-
272
- # Disable all MCP servers
273
- aia --no-mcp --chat
274
- ```
275
-
276
- Limit what each MCP server can access through its configuration:
277
-
278
- ```yaml
279
- # ~/.config/aia/aia.yml
280
- mcp_servers:
281
- - name: filesystem
282
- command: mcp-server-filesystem
283
- args:
284
- - /home/user/projects # Restrict to safe directories
285
- - /tmp/aia-workspace
286
-
287
- - name: database
288
- command: database-mcp-server
289
- env:
290
- DATABASE_URL: "${READ_ONLY_DB_URL}" # Use read-only credentials
291
- timeout: 10000
292
- ```
293
-
294
- ### Access Control
295
- ```python
296
- # MCP client with access control
297
- class SecureGitHubAnalyzer:
298
- def __init__(self, allowed_operations=None):
299
- self.allowed_operations = allowed_operations or ['read', 'list']
300
-
301
- async def analyze_repository(self, owner, repo):
302
- if 'read' not in self.allowed_operations:
303
- raise PermissionError("Read access not allowed")
304
-
305
- # Safe repository analysis
306
- return await self._safe_analyze(owner, repo)
307
-
308
- async def _safe_analyze(self, owner, repo):
309
- # Implementation with safety checks
310
- pass
311
- ```
312
-
313
- ## Performance Optimization
314
-
315
- ### Caching Strategies
316
- ```python
317
- # MCP client with caching
318
- import asyncio
319
- from datetime import datetime, timedelta
320
- import json
321
-
322
- class CachedMCPClient:
323
- def __init__(self):
324
- self.cache = {}
325
- self.cache_ttl = timedelta(hours=1)
326
-
327
- async def cached_request(self, cache_key, request_func, *args):
328
- now = datetime.now()
329
-
330
- if cache_key in self.cache:
331
- cached_result, timestamp = self.cache[cache_key]
332
- if now - timestamp < self.cache_ttl:
333
- return cached_result
334
-
335
- # Fetch new data
336
- result = await request_func(*args)
337
- self.cache[cache_key] = (result, now)
338
- return result
339
- ```
340
-
341
- ### Connection Pooling
342
- ```javascript
343
- // Node.js MCP client with connection pooling
344
- const { Pool } = require('pg');
345
-
346
- class DatabaseMCPClient {
347
- constructor() {
348
- this.pool = new Pool({
349
- max: 10,
350
- idleTimeoutMillis: 30000,
351
- connectionTimeoutMillis: 2000,
352
- });
353
- }
354
-
355
- async query(sql, params) {
356
- const client = await this.pool.connect();
357
- try {
358
- const result = await client.query(sql, params);
359
- return result;
360
- } finally {
361
- client.release();
362
- }
363
- }
364
- }
365
- ```
366
-
367
- ## Troubleshooting
368
-
369
- ### Common MCP Issues
370
-
371
- #### Connection Failures
372
- ```bash
373
- # Debug MCP client connections
374
- aia --debug --mcp github test_connection
375
-
376
- # Check client process status
377
- ps aux | grep mcp
378
-
379
- # Test client directly
380
- python github_analyzer.py --test
381
- ```
382
-
383
- #### Protocol Errors
384
-
385
- Enable detailed MCP logging via the logger configuration:
386
-
387
- ```yaml
388
- # ~/.config/aia/aia.yml
389
- logger:
390
- mcp:
391
- file: /tmp/aia-mcp.log
392
- level: debug
393
- flush: true
394
- ```
395
-
396
- Or via CLI:
397
- ```bash
398
- aia --debug my_prompt # Sets all loggers to debug level
399
- ```
400
-
401
- #### Performance Issues
402
- ```python
403
- # MCP performance monitoring
404
- import time
405
- import logging
406
-
407
- class PerformanceMCP:
408
- def __init__(self):
409
- self.logger = logging.getLogger('mcp_performance')
410
-
411
- async def timed_operation(self, operation_name, func, *args):
412
- start_time = time.time()
413
- try:
414
- result = await func(*args)
415
- duration = time.time() - start_time
416
- self.logger.info(f"{operation_name}: {duration:.2f}s")
417
- return result
418
- except Exception as e:
419
- duration = time.time() - start_time
420
- self.logger.error(f"{operation_name} failed after {duration:.2f}s: {e}")
421
- raise
422
- ```
423
-
424
- ## Development Guidelines
425
-
426
- ### MCP Client Development
427
- 1. **Follow Protocol** - Implement MCP specification correctly
428
- 2. **Error Handling** - Comprehensive error handling and reporting
429
- 3. **Security First** - Validate inputs and limit access
430
- 4. **Performance** - Optimize for concurrent requests
431
- 5. **Testing** - Include unit and integration tests
432
-
433
- ### Example Test Suite
434
- ```python
435
- # test_github_mcp.py
436
- import pytest
437
- import asyncio
438
- from unittest.mock import patch
439
- from github_analyzer import GitHubAnalyzer
440
-
441
- @pytest.fixture
442
- def analyzer():
443
- return GitHubAnalyzer()
444
-
445
- @pytest.mark.asyncio
446
- async def test_repository_analysis(analyzer):
447
- with patch('aiohttp.ClientSession.get') as mock_get:
448
- mock_get.return_value.__aenter__.return_value.json.return_value = {
449
- 'name': 'test-repo',
450
- 'stargazers_count': 100
451
- }
452
-
453
- result = await analyzer.analyze_repository('owner', 'repo')
454
- assert result['repository']['name'] == 'test-repo'
455
- assert result['repository']['stars'] == 100
456
-
457
- @pytest.mark.asyncio
458
- async def test_error_handling(analyzer):
459
- with patch('aiohttp.ClientSession.get') as mock_get:
460
- mock_get.side_effect = Exception("Network error")
461
-
462
- with pytest.raises(Exception):
463
- await analyzer.analyze_repository('owner', 'repo')
464
- ```
465
-
466
- ## Related Documentation
467
-
468
- - [MCP Integration Guide](../../mcp-integration.md) - Detailed MCP integration
469
- - [Tools Examples](../tools/index.md) - Alternative Ruby tools approach
470
- - [Advanced Prompting](../../advanced-prompting.md) - Complex MCP usage patterns
471
- - [Configuration](../../configuration.md) - MCP configuration options
472
-
473
- ---
474
-
475
- MCP clients provide powerful integration capabilities for AIA. Start with simple read-only clients and gradually build more sophisticated integrations as your needs grow!
@@ -1,78 +0,0 @@
1
- # Analysis Prompts
2
-
3
- Collection of prompts for data analysis, research, and analytical tasks.
4
-
5
- ## Available Prompts
6
-
7
- ### Data Analysis
8
- - **data_analysis.md** - Comprehensive data analysis
9
- - **statistical_analysis.md** - Statistical analysis and insights
10
- - **trend_analysis.md** - Trend identification and analysis
11
- - **correlation_analysis.md** - Correlation and relationship analysis
12
-
13
- ### Research
14
- - **research_summary.md** - Research synthesis and summarization
15
- - **literature_review.md** - Academic literature review
16
- - **competitive_analysis.md** - Competitive landscape analysis
17
- - **market_research.md** - Market analysis and insights
18
-
19
- ### Business Analysis
20
- - **business_analysis.md** - Business process analysis
21
- - **performance_analysis.md** - Performance metrics analysis
22
- - **risk_assessment.md** - Risk analysis and mitigation
23
- - **opportunity_analysis.md** - Opportunity identification
24
-
25
- ### Financial Analysis
26
- - **financial_analysis.md** - Financial data analysis
27
- - **budget_analysis.md** - Budget review and analysis
28
- - **roi_analysis.md** - Return on investment analysis
29
- - **cost_benefit.md** - Cost-benefit analysis
30
-
31
- ### Report Generation
32
- - **executive_summary.md** - Executive summary creation
33
- - **detailed_report.md** - Comprehensive report generation
34
- - **dashboard_insights.md** - Dashboard and metrics interpretation
35
- - **recommendations.md** - Actionable recommendations generation
36
-
37
- ## Usage Examples
38
-
39
- ```bash
40
- # Analyze a dataset
41
- aia data_analysis dataset.csv --focus "sales trends"
42
-
43
- # Generate research summary
44
- aia research_summary research_papers/ --topic "AI trends"
45
-
46
- # Create executive summary
47
- aia executive_summary quarterly_data.xlsx --audience "executives"
48
- ```
49
-
50
- ## Analysis Workflows
51
-
52
- ### Data Pipeline
53
- 1. **data_preprocessing.md** - Clean and prepare data
54
- 2. **exploratory_analysis.md** - Initial data exploration
55
- 3. **detailed_analysis.md** - Deep dive analysis
56
- 4. **insight_generation.md** - Extract actionable insights
57
- 5. **report_creation.md** - Generate final report
58
-
59
- ### Research Workflow
60
- 1. **source_collection.md** - Gather research sources
61
- 2. **content_analysis.md** - Analyze source content
62
- 3. **synthesis.md** - Synthesize findings
63
- 4. **gap_analysis.md** - Identify research gaps
64
- 5. **conclusion.md** - Draw conclusions
65
-
66
- ## Customization Parameters
67
-
68
- - **Focus Area** - Specific aspect to analyze
69
- - **Depth Level** - Surface or deep analysis
70
- - **Audience** - Target audience for results
71
- - **Format** - Output format (charts, tables, narrative)
72
- - **Timeframe** - Analysis time period
73
-
74
- ## Related
75
-
76
- - [Development Prompts](../development/index.md) - Code analysis
77
- - [Automation Prompts](../automation/index.md) - Process analysis
78
- - [Tools Examples](../../tools/index.md) - Analysis tools
@@ -1,109 +0,0 @@
1
- # Automation Prompts
2
-
3
- Collection of prompts for system administration, process automation, and workflow management.
4
-
5
- ## Available Prompts
6
-
7
- ### System Administration
8
- - **system_health.md** - System health monitoring and analysis
9
- - **log_analysis.md** - Log file analysis and insights
10
- - **performance_monitoring.md** - System performance analysis
11
- - **security_audit.md** - Security assessment and audit
12
-
13
- ### Deployment and DevOps
14
- - **deployment_checklist.md** - Deployment readiness assessment
15
- - **ci_cd_analysis.md** - CI/CD pipeline analysis
16
- - **infrastructure_review.md** - Infrastructure assessment
17
- - **rollback_procedures.md** - Rollback planning and procedures
18
-
19
- ### Process Automation
20
- - **workflow_optimization.md** - Process optimization suggestions
21
- - **task_automation.md** - Task automation recommendations
22
- - **monitoring_setup.md** - Monitoring and alerting setup
23
- - **maintenance_scheduler.md** - Maintenance task scheduling
24
-
25
- ### Configuration Management
26
- - **config_validation.md** - Configuration file validation
27
- - **environment_sync.md** - Environment synchronization
28
- - **dependency_check.md** - Dependency analysis and management
29
- - **version_management.md** - Version control and management
30
-
31
- ### Incident Response
32
- - **incident_analysis.md** - Incident investigation and analysis
33
- - **root_cause_analysis.md** - Root cause identification
34
- - **recovery_procedures.md** - Recovery planning and execution
35
- - **post_mortem.md** - Post-incident analysis and learning
36
-
37
- ## Usage Examples
38
-
39
- ```bash
40
- # Analyze system health
41
- aia system_health --logs /var/log/ --timeframe "24h"
42
-
43
- # Validate deployment readiness
44
- aia deployment_checklist --environment production --service api
45
-
46
- # Perform security audit
47
- aia security_audit --scope "web_application" --depth comprehensive
48
- ```
49
-
50
- ## Automation Workflows
51
-
52
- ### Deployment Pipeline
53
- 1. **pre_deployment.md** - Pre-deployment checks
54
- 2. **deployment_execution.md** - Deployment process
55
- 3. **post_deployment.md** - Post-deployment validation
56
- 4. **rollback_if_needed.md** - Conditional rollback
57
- 5. **deployment_report.md** - Deployment summary
58
-
59
- ### Monitoring Setup
60
- 1. **baseline_establishment.md** - Establish performance baselines
61
- 2. **alert_configuration.md** - Configure monitoring alerts
62
- 3. **dashboard_creation.md** - Create monitoring dashboards
63
- 4. **escalation_procedures.md** - Define escalation paths
64
- 5. **monitoring_validation.md** - Validate monitoring effectiveness
65
-
66
- ### Incident Response
67
- 1. **incident_detection.md** - Initial incident assessment
68
- 2. **impact_analysis.md** - Assess incident impact
69
- 3. **mitigation_actions.md** - Define mitigation steps
70
- 4. **communication_plan.md** - Stakeholder communication
71
- 5. **resolution_verification.md** - Verify resolution
72
-
73
- ## Integration Points
74
-
75
- ### Shell Integration
76
- ```markdown
77
- /shell systemctl status nginx
78
- /shell df -h
79
- /shell top -b -n 1 | head -20
80
- ```
81
-
82
- ### Tool Integration
83
- ```bash
84
- # Use with system monitoring tools
85
- aia --tools system_monitor.rb system_health
86
-
87
- # Combine with log analysis tools
88
- aia --tools log_analyzer.rb incident_analysis /var/log/app.log
89
- ```
90
-
91
- ### MCP Integration
92
- ```bash
93
- # Run with MCP servers for filesystem access
94
- aia --mcp-use filesystem my_prompt
95
- ```
96
-
97
- ## Customization Parameters
98
-
99
- - **Environment** - target environment (dev, staging, prod)
100
- - **Service** - specific service or application
101
- - **Timeframe** - analysis time window
102
- - **Depth** - analysis depth level
103
- - **Scope** - analysis scope and boundaries
104
-
105
- ## Related
106
-
107
- - [Development Prompts](../development/index.md) - Development automation
108
- - [Analysis Prompts](../analysis/index.md) - System analysis
109
- - [MCP Examples](../../mcp/index.md) - External system integration