aia 0.9.11 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/CHANGELOG.md +66 -2
- data/README.md +133 -4
- data/docs/advanced-prompting.md +721 -0
- data/docs/cli-reference.md +582 -0
- data/docs/configuration.md +347 -0
- data/docs/contributing.md +332 -0
- data/docs/directives-reference.md +490 -0
- data/docs/examples/index.md +277 -0
- data/docs/examples/mcp/index.md +479 -0
- data/docs/examples/prompts/analysis/index.md +78 -0
- data/docs/examples/prompts/automation/index.md +108 -0
- data/docs/examples/prompts/development/index.md +125 -0
- data/docs/examples/prompts/index.md +333 -0
- data/docs/examples/prompts/learning/index.md +127 -0
- data/docs/examples/prompts/writing/index.md +62 -0
- data/docs/examples/tools/index.md +292 -0
- data/docs/faq.md +414 -0
- data/docs/guides/available-models.md +366 -0
- data/docs/guides/basic-usage.md +477 -0
- data/docs/guides/chat.md +474 -0
- data/docs/guides/executable-prompts.md +417 -0
- data/docs/guides/first-prompt.md +454 -0
- data/docs/guides/getting-started.md +455 -0
- data/docs/guides/image-generation.md +507 -0
- data/docs/guides/index.md +46 -0
- data/docs/guides/models.md +507 -0
- data/docs/guides/tools.md +856 -0
- data/docs/index.md +173 -0
- data/docs/installation.md +238 -0
- data/docs/mcp-integration.md +612 -0
- data/docs/prompt_management.md +579 -0
- data/docs/security.md +629 -0
- data/docs/tools-and-mcp-examples.md +1186 -0
- data/docs/workflows-and-pipelines.md +563 -0
- data/examples/tools/mcp/github_mcp_server.json +11 -0
- data/examples/tools/mcp/imcp.json +7 -0
- data/lib/aia/chat_processor_service.rb +19 -3
- data/lib/aia/config/base.rb +224 -0
- data/lib/aia/config/cli_parser.rb +409 -0
- data/lib/aia/config/defaults.rb +88 -0
- data/lib/aia/config/file_loader.rb +131 -0
- data/lib/aia/config/validator.rb +184 -0
- data/lib/aia/config.rb +10 -860
- data/lib/aia/directive_processor.rb +27 -372
- data/lib/aia/directives/configuration.rb +114 -0
- data/lib/aia/directives/execution.rb +37 -0
- data/lib/aia/directives/models.rb +178 -0
- data/lib/aia/directives/registry.rb +120 -0
- data/lib/aia/directives/utility.rb +70 -0
- data/lib/aia/directives/web_and_file.rb +71 -0
- data/lib/aia/prompt_handler.rb +23 -3
- data/lib/aia/ruby_llm_adapter.rb +307 -128
- data/lib/aia/session.rb +27 -14
- data/lib/aia/utility.rb +12 -8
- data/lib/aia.rb +11 -2
- data/lib/extensions/ruby_llm/.irbrc +56 -0
- data/mkdocs.yml +165 -0
- metadata +77 -20
- /data/{images → docs/assets/images}/aia.png +0 -0
@@ -0,0 +1,277 @@
|
|
1
|
+
# Examples
|
2
|
+
|
3
|
+
This section contains comprehensive examples demonstrating AIA's capabilities across different use cases and domains.
|
4
|
+
|
5
|
+
## Example Categories
|
6
|
+
|
7
|
+
### [Prompts](prompts/index.md)
|
8
|
+
Real-world prompt examples covering:
|
9
|
+
- **Development**: Code review, documentation, debugging
|
10
|
+
- **Writing**: Blog posts, technical documentation, creative writing
|
11
|
+
- **Analysis**: Data analysis, report generation, research
|
12
|
+
- **Automation**: System administration, workflow automation
|
13
|
+
- **Learning**: Educational prompts, concept explanations
|
14
|
+
|
15
|
+
### [Tools](tools/index.md)
|
16
|
+
Custom Ruby tools that extend AIA's functionality:
|
17
|
+
- **File Processing**: Advanced file operations and analysis
|
18
|
+
- **Web Integration**: HTTP clients, API interactions, web scraping
|
19
|
+
- **Data Analysis**: Statistical analysis, data transformation
|
20
|
+
- **Development Tools**: Code analysis, testing utilities
|
21
|
+
- **System Integration**: OS interaction, external service integration
|
22
|
+
|
23
|
+
### [MCP Clients](mcp/index.md)
|
24
|
+
Model Context Protocol client examples:
|
25
|
+
- **GitHub Integration**: Repository management, issue tracking
|
26
|
+
- **File System Access**: Safe file operations with sandboxing
|
27
|
+
- **Database Connectivity**: SQL querying, data manipulation
|
28
|
+
- **API Integrations**: Third-party service connections
|
29
|
+
- **Development Environments**: IDE and editor integrations
|
30
|
+
|
31
|
+
## Getting Started with Examples
|
32
|
+
|
33
|
+
### 1. Browse by Use Case
|
34
|
+
|
35
|
+
Each example includes:
|
36
|
+
- **Purpose**: What the example demonstrates
|
37
|
+
- **Prerequisites**: Required setup or dependencies
|
38
|
+
- **Usage**: How to run the example
|
39
|
+
- **Customization**: How to adapt for your needs
|
40
|
+
- **Related Examples**: Similar or complementary examples
|
41
|
+
|
42
|
+
### 2. Copy and Modify
|
43
|
+
|
44
|
+
All examples are designed to be:
|
45
|
+
- **Copyable**: Ready to use with minimal setup
|
46
|
+
- **Modifiable**: Easy to customize for your specific needs
|
47
|
+
- **Educational**: Well-commented and explained
|
48
|
+
- **Production-Ready**: Following best practices
|
49
|
+
|
50
|
+
### 3. Combine Examples
|
51
|
+
|
52
|
+
Many examples can be combined:
|
53
|
+
- Use multiple prompts in a workflow
|
54
|
+
- Combine tools for complex operations
|
55
|
+
- Chain MCP clients for advanced integrations
|
56
|
+
|
57
|
+
## Quick Start Examples
|
58
|
+
|
59
|
+
### Simple Code Review
|
60
|
+
```bash
|
61
|
+
# Copy the code review prompt
|
62
|
+
cp docs/examples/prompts/development/code_review.txt ~/.prompts/
|
63
|
+
|
64
|
+
# Use it on your code
|
65
|
+
aia code_review src/main.rb
|
66
|
+
```
|
67
|
+
|
68
|
+
### Data Analysis Workflow
|
69
|
+
```bash
|
70
|
+
# Copy the analysis pipeline
|
71
|
+
cp docs/examples/prompts/analysis/data_pipeline.txt ~/.prompts/
|
72
|
+
|
73
|
+
# Run the complete workflow
|
74
|
+
aia --pipeline "extract_data,analyze_data,generate_report" dataset.csv
|
75
|
+
```
|
76
|
+
|
77
|
+
### Custom Tool Integration
|
78
|
+
```bash
|
79
|
+
# Copy a useful tool
|
80
|
+
cp docs/examples/tools/file_analyzer.rb ~/.aia/tools/
|
81
|
+
|
82
|
+
# Use it in a prompt
|
83
|
+
aia --tools ~/.aia/tools/file_analyzer.rb analyze_project
|
84
|
+
```
|
85
|
+
|
86
|
+
## Example Structure
|
87
|
+
|
88
|
+
Each example directory contains:
|
89
|
+
|
90
|
+
```
|
91
|
+
category/
|
92
|
+
├── README.md # Category overview and index
|
93
|
+
├── basic/ # Simple, beginner-friendly examples
|
94
|
+
├── intermediate/ # More complex examples
|
95
|
+
├── advanced/ # Expert-level examples
|
96
|
+
└── specialized/ # Domain-specific examples
|
97
|
+
```
|
98
|
+
|
99
|
+
Individual examples include:
|
100
|
+
- **Source file** (`.txt`, `.rb`, `.json`, etc.)
|
101
|
+
- **Documentation** (`README.md` or inline comments)
|
102
|
+
- **Usage examples** with sample inputs/outputs
|
103
|
+
- **Customization guide**
|
104
|
+
|
105
|
+
## Contributing Examples
|
106
|
+
|
107
|
+
We welcome example contributions! See our [contribution guidelines](../contributing.md) for:
|
108
|
+
- Example standards and format
|
109
|
+
- Documentation requirements
|
110
|
+
- Testing and validation
|
111
|
+
- Submission process
|
112
|
+
|
113
|
+
## Example Categories Overview
|
114
|
+
|
115
|
+
### [Prompts Examples](prompts/index.md)
|
116
|
+
|
117
|
+
#### Development
|
118
|
+
- Code review and optimization prompts
|
119
|
+
- Documentation generation
|
120
|
+
- Debugging assistance
|
121
|
+
- Architecture analysis
|
122
|
+
- Testing strategy prompts
|
123
|
+
|
124
|
+
#### Writing
|
125
|
+
- Technical documentation templates
|
126
|
+
- Blog post generation
|
127
|
+
- Creative writing prompts
|
128
|
+
- Content editing and improvement
|
129
|
+
- Style guide enforcement
|
130
|
+
|
131
|
+
#### Analysis
|
132
|
+
- Data analysis workflows
|
133
|
+
- Research methodology prompts
|
134
|
+
- Report generation templates
|
135
|
+
- Comparative analysis
|
136
|
+
- Trend identification
|
137
|
+
|
138
|
+
#### Automation
|
139
|
+
- System monitoring prompts
|
140
|
+
- Deployment workflows
|
141
|
+
- Log analysis automation
|
142
|
+
- Maintenance task prompts
|
143
|
+
- Alert and notification templates
|
144
|
+
|
145
|
+
### [Tools Examples](tools/index.md)
|
146
|
+
|
147
|
+
#### File Processing
|
148
|
+
- Log file analyzers
|
149
|
+
- Configuration file processors
|
150
|
+
- Code metrics calculators
|
151
|
+
- Document converters
|
152
|
+
- Archive handlers
|
153
|
+
|
154
|
+
#### Web Integration
|
155
|
+
- HTTP API clients
|
156
|
+
- Web scraping tools
|
157
|
+
- Content fetchers
|
158
|
+
- Social media integrations
|
159
|
+
- Webhook handlers
|
160
|
+
|
161
|
+
#### Data Analysis
|
162
|
+
- Statistical calculators
|
163
|
+
- Data visualizers
|
164
|
+
- CSV/JSON processors
|
165
|
+
- Database query tools
|
166
|
+
- Report generators
|
167
|
+
|
168
|
+
#### Development
|
169
|
+
- Code quality analyzers
|
170
|
+
- Dependency checkers
|
171
|
+
- Performance profilers
|
172
|
+
- Test runners
|
173
|
+
- Deployment tools
|
174
|
+
|
175
|
+
### [MCP Examples](mcp/index.md)
|
176
|
+
|
177
|
+
#### GitHub Integration
|
178
|
+
- Repository analysis
|
179
|
+
- Issue management
|
180
|
+
- Pull request automation
|
181
|
+
- Code review workflows
|
182
|
+
- Project tracking
|
183
|
+
|
184
|
+
#### File System
|
185
|
+
- Safe file operations
|
186
|
+
- Directory analysis
|
187
|
+
- Permission management
|
188
|
+
- Backup utilities
|
189
|
+
- Sync operations
|
190
|
+
|
191
|
+
#### Database
|
192
|
+
- Query builders
|
193
|
+
- Schema analysis
|
194
|
+
- Data migration tools
|
195
|
+
- Performance monitoring
|
196
|
+
- Backup and restore
|
197
|
+
|
198
|
+
#### API Integration
|
199
|
+
- REST client wrappers
|
200
|
+
- Authentication handlers
|
201
|
+
- Rate limiting tools
|
202
|
+
- Response processors
|
203
|
+
- Error handling
|
204
|
+
|
205
|
+
## Best Practices from Examples
|
206
|
+
|
207
|
+
### Prompt Design
|
208
|
+
1. **Clear Structure**: Use sections and headers
|
209
|
+
2. **Parameterization**: Make prompts reusable with variables
|
210
|
+
3. **Context Inclusion**: Provide relevant background information
|
211
|
+
4. **Output Formatting**: Specify desired response format
|
212
|
+
5. **Error Handling**: Account for edge cases
|
213
|
+
|
214
|
+
### Tool Development
|
215
|
+
1. **Single Responsibility**: Each tool should do one thing well
|
216
|
+
2. **Error Handling**: Robust error management and user feedback
|
217
|
+
3. **Documentation**: Clear usage instructions and examples
|
218
|
+
4. **Testing**: Include test cases and validation
|
219
|
+
5. **Configuration**: Support customization through parameters
|
220
|
+
|
221
|
+
### MCP Integration
|
222
|
+
1. **Security**: Follow security best practices
|
223
|
+
2. **Sandboxing**: Limit access to necessary resources only
|
224
|
+
3. **Performance**: Optimize for responsiveness
|
225
|
+
4. **Compatibility**: Ensure cross-platform operation
|
226
|
+
5. **Monitoring**: Include logging and metrics
|
227
|
+
|
228
|
+
## Advanced Usage Patterns
|
229
|
+
|
230
|
+
### Multi-Stage Workflows
|
231
|
+
Examples demonstrating complex multi-step processes:
|
232
|
+
- Data ingestion → processing → analysis → reporting
|
233
|
+
- Code development → testing → documentation → deployment
|
234
|
+
- Research → analysis → writing → review → publication
|
235
|
+
|
236
|
+
### Model Comparison
|
237
|
+
Examples showing how to:
|
238
|
+
- Compare outputs from different AI models
|
239
|
+
- Choose optimal models for specific tasks
|
240
|
+
- Implement fallback strategies
|
241
|
+
- Combine results from multiple models
|
242
|
+
|
243
|
+
### Dynamic Configuration
|
244
|
+
Examples of:
|
245
|
+
- Runtime configuration adjustment
|
246
|
+
- Environment-specific settings
|
247
|
+
- User preference adaptation
|
248
|
+
- Performance optimization
|
249
|
+
|
250
|
+
## Testing Examples
|
251
|
+
|
252
|
+
All examples include testing approaches:
|
253
|
+
- **Unit Tests**: For individual components
|
254
|
+
- **Integration Tests**: For complete workflows
|
255
|
+
- **Performance Tests**: For optimization validation
|
256
|
+
- **User Acceptance Tests**: For real-world scenarios
|
257
|
+
|
258
|
+
## Troubleshooting Guide
|
259
|
+
|
260
|
+
Common issues and solutions:
|
261
|
+
- **Permission Errors**: File access and execution permissions
|
262
|
+
- **Missing Dependencies**: Required gems, tools, or services
|
263
|
+
- **Configuration Issues**: API keys, paths, and settings
|
264
|
+
- **Performance Problems**: Memory, CPU, and network optimization
|
265
|
+
- **Compatibility Issues**: Version mismatches and platform differences
|
266
|
+
|
267
|
+
## Related Documentation
|
268
|
+
|
269
|
+
- [Getting Started](../guides/getting-started.md) - Basic AIA usage
|
270
|
+
- [CLI Reference](../cli-reference.md) - Command-line options
|
271
|
+
- [Directives Reference](../directives-reference.md) - Prompt directives
|
272
|
+
- [Configuration](../configuration.md) - Setup and configuration
|
273
|
+
- [Advanced Prompting](../advanced-prompting.md) - Expert techniques
|
274
|
+
|
275
|
+
---
|
276
|
+
|
277
|
+
Ready to explore? Start with the [Prompts Examples](prompts/index.md) to see AIA in action!
|